# 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 AsyncRawAudioClient, RawAudioClient

if typing.TYPE_CHECKING:
    from .transcriptions.client import AsyncTranscriptionsClient, TranscriptionsClient


class AudioClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawAudioClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._transcriptions: typing.Optional[TranscriptionsClient] = None

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

        Returns
        -------
        RawAudioClient
        """
        return self._raw_client

    @property
    def transcriptions(self):
        if self._transcriptions is None:
            from .transcriptions.client import TranscriptionsClient  # noqa: E402

            self._transcriptions = TranscriptionsClient(client_wrapper=self._client_wrapper)
        return self._transcriptions


class AsyncAudioClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawAudioClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._transcriptions: typing.Optional[AsyncTranscriptionsClient] = None

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

        Returns
        -------
        AsyncRawAudioClient
        """
        return self._raw_client

    @property
    def transcriptions(self):
        if self._transcriptions is None:
            from .transcriptions.client import AsyncTranscriptionsClient  # noqa: E402

            self._transcriptions = AsyncTranscriptionsClient(client_wrapper=self._client_wrapper)
        return self._transcriptions
