# This file was auto-generated by Fern from our API Definition.

from __future__ import annotations

import typing

from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from .raw_client import AsyncRawExpressionMeasurementClient, RawExpressionMeasurementClient

if typing.TYPE_CHECKING:
    from .batch.client_with_utils import AsyncBatchClientWithUtils, BatchClientWithUtils
    from .stream.stream.client import StreamClient, AsyncStreamClient


class ExpressionMeasurementClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawExpressionMeasurementClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._batch: typing.Optional[BatchClientWithUtils] = None
        self._stream: typing.Optional[StreamClient] = None

    @property
    def with_raw_response(self) -> RawExpressionMeasurementClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        RawExpressionMeasurementClient
        """
        return self._raw_client

    @property
    def batch(self):
        if self._batch is None:
            from .batch.client_with_utils import BatchClientWithUtils  # noqa: E402

            self._batch = BatchClientWithUtils(client_wrapper=self._client_wrapper)
        return self._batch

    @property
    def stream(self):
        if self._stream is None:
            from .stream.stream.client import StreamClient  # noqa: E402
            self._stream = StreamClient(client_wrapper=self._client_wrapper)
        return self._stream


class AsyncExpressionMeasurementClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawExpressionMeasurementClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._batch: typing.Optional[AsyncBatchClientWithUtils] = None
        self._stream: typing.Optional[AsyncStreamClient] = None

    @property
    def with_raw_response(self) -> AsyncRawExpressionMeasurementClient:
        """
        Retrieves a raw implementation of this client that returns raw responses.

        Returns
        -------
        AsyncRawExpressionMeasurementClient
        """
        return self._raw_client

    @property
    def batch(self):
        if self._batch is None:
            from .batch.client_with_utils import AsyncBatchClientWithUtils  # noqa: E402

            self._batch = AsyncBatchClientWithUtils(client_wrapper=self._client_wrapper)
        return self._batch

    @property
    def stream(self):
        if self._stream is None:
            from .stream.stream.client import AsyncStreamClient  # noqa: E402

            self._stream = AsyncStreamClient(client_wrapper=self._client_wrapper)
        return self._stream
