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

from __future__ import annotations

import typing

from .. import core
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ..core.request_options import RequestOptions
from ..types.delete_dubbing_response_model import DeleteDubbingResponseModel
from ..types.do_dubbing_response import DoDubbingResponse
from ..types.dubbing_metadata_page_response_model import DubbingMetadataPageResponseModel
from ..types.dubbing_metadata_response import DubbingMetadataResponse
from .raw_client import AsyncRawDubbingClient, RawDubbingClient
from .types.dub_request_mode import DubRequestMode
from .types.dubbing_list_request_creation_sources_item import DubbingListRequestCreationSourcesItem
from .types.dubbing_list_request_dubbing_models_item import DubbingListRequestDubbingModelsItem
from .types.dubbing_list_request_dubbing_status import DubbingListRequestDubbingStatus
from .types.dubbing_list_request_dubbing_statuses_item import DubbingListRequestDubbingStatusesItem
from .types.dubbing_list_request_filter_by_creator import DubbingListRequestFilterByCreator
from .types.dubbing_list_request_order_by import DubbingListRequestOrderBy
from .types.dubbing_list_request_order_direction import DubbingListRequestOrderDirection

if typing.TYPE_CHECKING:
    from .audio.client import AsyncAudioClient, AudioClient
    from .project.client import AsyncProjectClient, ProjectClient
    from .resource.client import AsyncResourceClient, ResourceClient
    from .transcript.client import AsyncTranscriptClient, TranscriptClient
    from .transcripts.client import AsyncTranscriptsClient, TranscriptsClient
# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class DubbingClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawDubbingClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._project: typing.Optional[ProjectClient] = None
        self._resource: typing.Optional[ResourceClient] = None
        self._audio: typing.Optional[AudioClient] = None
        self._transcript: typing.Optional[TranscriptClient] = None
        self._transcripts: typing.Optional[TranscriptsClient] = None

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

        Returns
        -------
        RawDubbingClient
        """
        return self._raw_client

    def list(
        self,
        *,
        cursor: typing.Optional[str] = None,
        page_size: typing.Optional[int] = None,
        dubbing_status: typing.Optional[DubbingListRequestDubbingStatus] = None,
        dubbing_statuses: typing.Optional[
            typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]]
        ] = None,
        dubbing_models: typing.Optional[
            typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]]
        ] = None,
        target_language_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        creation_sources: typing.Optional[
            typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]]
        ] = None,
        filter_by_creator: typing.Optional[DubbingListRequestFilterByCreator] = None,
        order_by: typing.Optional[DubbingListRequestOrderBy] = None,
        order_direction: typing.Optional[DubbingListRequestOrderDirection] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> DubbingMetadataPageResponseModel:
        """
        List the dubs you have access to.

        Parameters
        ----------
        cursor : typing.Optional[str]
            Used for fetching next page. Cursor is returned in the response.

        page_size : typing.Optional[int]
            How many dubs to return at maximum. Can not exceed 200, defaults to 100.

        dubbing_status : typing.Optional[DubbingListRequestDubbingStatus]
            What state the dub is currently in.

        dubbing_statuses : typing.Optional[typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]]]
            Filter by dubbing status.

        dubbing_models : typing.Optional[typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]]]
            Filter by dubbing model generation.

        target_language_codes : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter by target language code.

        creation_sources : typing.Optional[typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]]]
            Filter by dubbing creation source.

        filter_by_creator : typing.Optional[DubbingListRequestFilterByCreator]
            Filters who created the resources being listed, whether it was the user running the request or someone else that shared the resource with them.

        order_by : typing.Optional[DubbingListRequestOrderBy]
            The field to use for ordering results from this query.

        order_direction : typing.Optional[DubbingListRequestOrderDirection]
            The order direction to use for results from this query.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DubbingMetadataPageResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.dubbing.list(
            cursor="cursor",
            page_size=1,
            dubbing_status="dubbing",
            dubbing_statuses=["queued"],
            dubbing_models=["dubbing_v1"],
            target_language_codes=["target_language_codes"],
            creation_sources=["flow_node"],
            filter_by_creator="personal",
            order_by="created_at",
            order_direction="DESCENDING",
        )
        """
        _response = self._raw_client.list(
            cursor=cursor,
            page_size=page_size,
            dubbing_status=dubbing_status,
            dubbing_statuses=dubbing_statuses,
            dubbing_models=dubbing_models,
            target_language_codes=target_language_codes,
            creation_sources=creation_sources,
            filter_by_creator=filter_by_creator,
            order_by=order_by,
            order_direction=order_direction,
            request_options=request_options,
        )
        return _response.data

    def create(
        self,
        *,
        file: typing.Optional[core.File] = OMIT,
        csv_file: typing.Optional[core.File] = OMIT,
        foreground_audio_file: typing.Optional[core.File] = OMIT,
        background_audio_file: typing.Optional[core.File] = OMIT,
        name: typing.Optional[str] = OMIT,
        source_url: typing.Optional[str] = OMIT,
        source_lang: typing.Optional[str] = OMIT,
        target_lang: typing.Optional[str] = OMIT,
        target_accent: typing.Optional[str] = OMIT,
        num_speakers: typing.Optional[int] = OMIT,
        watermark: typing.Optional[bool] = OMIT,
        start_time: typing.Optional[int] = OMIT,
        end_time: typing.Optional[int] = OMIT,
        highest_resolution: typing.Optional[bool] = OMIT,
        drop_background_audio: typing.Optional[bool] = OMIT,
        use_profanity_filter: typing.Optional[bool] = OMIT,
        dubbing_studio: typing.Optional[bool] = OMIT,
        disable_voice_cloning: typing.Optional[bool] = OMIT,
        mode: typing.Optional[DubRequestMode] = OMIT,
        csv_fps: typing.Optional[float] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> DoDubbingResponse:
        """
        Dubs a provided audio or video file into given language.

        Parameters
        ----------
        file : typing.Optional[core.File]
            See core.File for more documentation

        csv_file : typing.Optional[core.File]
            See core.File for more documentation

        foreground_audio_file : typing.Optional[core.File]
            See core.File for more documentation

        background_audio_file : typing.Optional[core.File]
            See core.File for more documentation

        name : typing.Optional[str]
            Name of the dubbing project.

        source_url : typing.Optional[str]
            URL of the source video/audio file.

        source_lang : typing.Optional[str]
            Source language. Expects a valid iso639-1 or iso639-3 language code.

        target_lang : typing.Optional[str]
            The Target language to dub the content into. Expects a valid iso639-1 or iso639-3 language code.

        target_accent : typing.Optional[str]
            [Experimental] An accent to apply when selecting voices from the library and to use to inform translation of the dialect to prefer.

        num_speakers : typing.Optional[int]
            Number of speakers to use for the dubbing. Set to 0 to automatically detect the number of speakers

        watermark : typing.Optional[bool]
            Whether to apply watermark to the output video.

        start_time : typing.Optional[int]
            Start time of the source video/audio file.

        end_time : typing.Optional[int]
            End time of the source video/audio file.

        highest_resolution : typing.Optional[bool]
            Whether to use the highest resolution available.

        drop_background_audio : typing.Optional[bool]
            An advanced setting. Whether to drop background audio from the final dub. This can improve dub quality where it's known that audio shouldn't have a background track such as for speeches or monologues.

        use_profanity_filter : typing.Optional[bool]
            [BETA] Whether transcripts should have profanities censored with the words '[censored]'

        dubbing_studio : typing.Optional[bool]
            Whether to prepare dub for edits in dubbing studio or edits as a dubbing resource.

        disable_voice_cloning : typing.Optional[bool]
            Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. Voices used from the library will contribute towards a workspace's custom voices limit, and if there aren't enough available slots the dub will fail. Using this feature requires the caller to have the 'add_voice_from_voice_library' permission on their workspace to access new voices.

        mode : typing.Optional[DubRequestMode]
            The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. Note that manual mode is experimental and production use is strongly discouraged.

        csv_fps : typing.Optional[float]
            Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DoDubbingResponse
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.dubbing.create()
        """
        _response = self._raw_client.create(
            file=file,
            csv_file=csv_file,
            foreground_audio_file=foreground_audio_file,
            background_audio_file=background_audio_file,
            name=name,
            source_url=source_url,
            source_lang=source_lang,
            target_lang=target_lang,
            target_accent=target_accent,
            num_speakers=num_speakers,
            watermark=watermark,
            start_time=start_time,
            end_time=end_time,
            highest_resolution=highest_resolution,
            drop_background_audio=drop_background_audio,
            use_profanity_filter=use_profanity_filter,
            dubbing_studio=dubbing_studio,
            disable_voice_cloning=disable_voice_cloning,
            mode=mode,
            csv_fps=csv_fps,
            request_options=request_options,
        )
        return _response.data

    def get(
        self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DubbingMetadataResponse:
        """
        Returns metadata about a dubbing project, including whether it's still in progress or not

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DubbingMetadataResponse
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.dubbing.get(
            dubbing_id="dubbing_id",
        )
        """
        _response = self._raw_client.get(dubbing_id, request_options=request_options)
        return _response.data

    def delete(
        self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteDubbingResponseModel:
        """
        Deletes a dubbing project.

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DeleteDubbingResponseModel
            Successful Response

        Examples
        --------
        from elevenlabs import ElevenLabs

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.dubbing.delete(
            dubbing_id="dubbing_id",
        )
        """
        _response = self._raw_client.delete(dubbing_id, request_options=request_options)
        return _response.data

    @property
    def project(self):
        if self._project is None:
            from .project.client import ProjectClient  # noqa: E402

            self._project = ProjectClient(client_wrapper=self._client_wrapper)
        return self._project

    @property
    def resource(self):
        if self._resource is None:
            from .resource.client import ResourceClient  # noqa: E402

            self._resource = ResourceClient(client_wrapper=self._client_wrapper)
        return self._resource

    @property
    def audio(self):
        if self._audio is None:
            from .audio.client import AudioClient  # noqa: E402

            self._audio = AudioClient(client_wrapper=self._client_wrapper)
        return self._audio

    @property
    def transcript(self):
        if self._transcript is None:
            from .transcript.client import TranscriptClient  # noqa: E402

            self._transcript = TranscriptClient(client_wrapper=self._client_wrapper)
        return self._transcript

    @property
    def transcripts(self):
        if self._transcripts is None:
            from .transcripts.client import TranscriptsClient  # noqa: E402

            self._transcripts = TranscriptsClient(client_wrapper=self._client_wrapper)
        return self._transcripts


class AsyncDubbingClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawDubbingClient(client_wrapper=client_wrapper)
        self._client_wrapper = client_wrapper
        self._project: typing.Optional[AsyncProjectClient] = None
        self._resource: typing.Optional[AsyncResourceClient] = None
        self._audio: typing.Optional[AsyncAudioClient] = None
        self._transcript: typing.Optional[AsyncTranscriptClient] = None
        self._transcripts: typing.Optional[AsyncTranscriptsClient] = None

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

        Returns
        -------
        AsyncRawDubbingClient
        """
        return self._raw_client

    async def list(
        self,
        *,
        cursor: typing.Optional[str] = None,
        page_size: typing.Optional[int] = None,
        dubbing_status: typing.Optional[DubbingListRequestDubbingStatus] = None,
        dubbing_statuses: typing.Optional[
            typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]]
        ] = None,
        dubbing_models: typing.Optional[
            typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]]
        ] = None,
        target_language_codes: typing.Optional[typing.Union[str, typing.Sequence[str]]] = None,
        creation_sources: typing.Optional[
            typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]]
        ] = None,
        filter_by_creator: typing.Optional[DubbingListRequestFilterByCreator] = None,
        order_by: typing.Optional[DubbingListRequestOrderBy] = None,
        order_direction: typing.Optional[DubbingListRequestOrderDirection] = None,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> DubbingMetadataPageResponseModel:
        """
        List the dubs you have access to.

        Parameters
        ----------
        cursor : typing.Optional[str]
            Used for fetching next page. Cursor is returned in the response.

        page_size : typing.Optional[int]
            How many dubs to return at maximum. Can not exceed 200, defaults to 100.

        dubbing_status : typing.Optional[DubbingListRequestDubbingStatus]
            What state the dub is currently in.

        dubbing_statuses : typing.Optional[typing.Union[DubbingListRequestDubbingStatusesItem, typing.Sequence[DubbingListRequestDubbingStatusesItem]]]
            Filter by dubbing status.

        dubbing_models : typing.Optional[typing.Union[DubbingListRequestDubbingModelsItem, typing.Sequence[DubbingListRequestDubbingModelsItem]]]
            Filter by dubbing model generation.

        target_language_codes : typing.Optional[typing.Union[str, typing.Sequence[str]]]
            Filter by target language code.

        creation_sources : typing.Optional[typing.Union[DubbingListRequestCreationSourcesItem, typing.Sequence[DubbingListRequestCreationSourcesItem]]]
            Filter by dubbing creation source.

        filter_by_creator : typing.Optional[DubbingListRequestFilterByCreator]
            Filters who created the resources being listed, whether it was the user running the request or someone else that shared the resource with them.

        order_by : typing.Optional[DubbingListRequestOrderBy]
            The field to use for ordering results from this query.

        order_direction : typing.Optional[DubbingListRequestOrderDirection]
            The order direction to use for results from this query.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DubbingMetadataPageResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.dubbing.list(
                cursor="cursor",
                page_size=1,
                dubbing_status="dubbing",
                dubbing_statuses=["queued"],
                dubbing_models=["dubbing_v1"],
                target_language_codes=["target_language_codes"],
                creation_sources=["flow_node"],
                filter_by_creator="personal",
                order_by="created_at",
                order_direction="DESCENDING",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.list(
            cursor=cursor,
            page_size=page_size,
            dubbing_status=dubbing_status,
            dubbing_statuses=dubbing_statuses,
            dubbing_models=dubbing_models,
            target_language_codes=target_language_codes,
            creation_sources=creation_sources,
            filter_by_creator=filter_by_creator,
            order_by=order_by,
            order_direction=order_direction,
            request_options=request_options,
        )
        return _response.data

    async def create(
        self,
        *,
        file: typing.Optional[core.File] = OMIT,
        csv_file: typing.Optional[core.File] = OMIT,
        foreground_audio_file: typing.Optional[core.File] = OMIT,
        background_audio_file: typing.Optional[core.File] = OMIT,
        name: typing.Optional[str] = OMIT,
        source_url: typing.Optional[str] = OMIT,
        source_lang: typing.Optional[str] = OMIT,
        target_lang: typing.Optional[str] = OMIT,
        target_accent: typing.Optional[str] = OMIT,
        num_speakers: typing.Optional[int] = OMIT,
        watermark: typing.Optional[bool] = OMIT,
        start_time: typing.Optional[int] = OMIT,
        end_time: typing.Optional[int] = OMIT,
        highest_resolution: typing.Optional[bool] = OMIT,
        drop_background_audio: typing.Optional[bool] = OMIT,
        use_profanity_filter: typing.Optional[bool] = OMIT,
        dubbing_studio: typing.Optional[bool] = OMIT,
        disable_voice_cloning: typing.Optional[bool] = OMIT,
        mode: typing.Optional[DubRequestMode] = OMIT,
        csv_fps: typing.Optional[float] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> DoDubbingResponse:
        """
        Dubs a provided audio or video file into given language.

        Parameters
        ----------
        file : typing.Optional[core.File]
            See core.File for more documentation

        csv_file : typing.Optional[core.File]
            See core.File for more documentation

        foreground_audio_file : typing.Optional[core.File]
            See core.File for more documentation

        background_audio_file : typing.Optional[core.File]
            See core.File for more documentation

        name : typing.Optional[str]
            Name of the dubbing project.

        source_url : typing.Optional[str]
            URL of the source video/audio file.

        source_lang : typing.Optional[str]
            Source language. Expects a valid iso639-1 or iso639-3 language code.

        target_lang : typing.Optional[str]
            The Target language to dub the content into. Expects a valid iso639-1 or iso639-3 language code.

        target_accent : typing.Optional[str]
            [Experimental] An accent to apply when selecting voices from the library and to use to inform translation of the dialect to prefer.

        num_speakers : typing.Optional[int]
            Number of speakers to use for the dubbing. Set to 0 to automatically detect the number of speakers

        watermark : typing.Optional[bool]
            Whether to apply watermark to the output video.

        start_time : typing.Optional[int]
            Start time of the source video/audio file.

        end_time : typing.Optional[int]
            End time of the source video/audio file.

        highest_resolution : typing.Optional[bool]
            Whether to use the highest resolution available.

        drop_background_audio : typing.Optional[bool]
            An advanced setting. Whether to drop background audio from the final dub. This can improve dub quality where it's known that audio shouldn't have a background track such as for speeches or monologues.

        use_profanity_filter : typing.Optional[bool]
            [BETA] Whether transcripts should have profanities censored with the words '[censored]'

        dubbing_studio : typing.Optional[bool]
            Whether to prepare dub for edits in dubbing studio or edits as a dubbing resource.

        disable_voice_cloning : typing.Optional[bool]
            Instead of using a voice clone in dubbing, use a similar voice from the ElevenLabs Voice Library. Voices used from the library will contribute towards a workspace's custom voices limit, and if there aren't enough available slots the dub will fail. Using this feature requires the caller to have the 'add_voice_from_voice_library' permission on their workspace to access new voices.

        mode : typing.Optional[DubRequestMode]
            The mode in which to run this Dubbing job. Defaults to automatic, use manual if specifically providing a CSV transcript to use. Note that manual mode is experimental and production use is strongly discouraged.

        csv_fps : typing.Optional[float]
            Frames per second to use when parsing a CSV file for dubbing. If not provided, FPS will be inferred from timecodes.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DoDubbingResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.dubbing.create()


        asyncio.run(main())
        """
        _response = await self._raw_client.create(
            file=file,
            csv_file=csv_file,
            foreground_audio_file=foreground_audio_file,
            background_audio_file=background_audio_file,
            name=name,
            source_url=source_url,
            source_lang=source_lang,
            target_lang=target_lang,
            target_accent=target_accent,
            num_speakers=num_speakers,
            watermark=watermark,
            start_time=start_time,
            end_time=end_time,
            highest_resolution=highest_resolution,
            drop_background_audio=drop_background_audio,
            use_profanity_filter=use_profanity_filter,
            dubbing_studio=dubbing_studio,
            disable_voice_cloning=disable_voice_cloning,
            mode=mode,
            csv_fps=csv_fps,
            request_options=request_options,
        )
        return _response.data

    async def get(
        self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DubbingMetadataResponse:
        """
        Returns metadata about a dubbing project, including whether it's still in progress or not

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DubbingMetadataResponse
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.dubbing.get(
                dubbing_id="dubbing_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get(dubbing_id, request_options=request_options)
        return _response.data

    async def delete(
        self, dubbing_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> DeleteDubbingResponseModel:
        """
        Deletes a dubbing project.

        Parameters
        ----------
        dubbing_id : str
            ID of the dubbing project.

        request_options : typing.Optional[RequestOptions]
            Request-specific configuration.

        Returns
        -------
        DeleteDubbingResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.dubbing.delete(
                dubbing_id="dubbing_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.delete(dubbing_id, request_options=request_options)
        return _response.data

    @property
    def project(self):
        if self._project is None:
            from .project.client import AsyncProjectClient  # noqa: E402

            self._project = AsyncProjectClient(client_wrapper=self._client_wrapper)
        return self._project

    @property
    def resource(self):
        if self._resource is None:
            from .resource.client import AsyncResourceClient  # noqa: E402

            self._resource = AsyncResourceClient(client_wrapper=self._client_wrapper)
        return self._resource

    @property
    def audio(self):
        if self._audio is None:
            from .audio.client import AsyncAudioClient  # noqa: E402

            self._audio = AsyncAudioClient(client_wrapper=self._client_wrapper)
        return self._audio

    @property
    def transcript(self):
        if self._transcript is None:
            from .transcript.client import AsyncTranscriptClient  # noqa: E402

            self._transcript = AsyncTranscriptClient(client_wrapper=self._client_wrapper)
        return self._transcript

    @property
    def transcripts(self):
        if self._transcripts is None:
            from .transcripts.client import AsyncTranscriptsClient  # noqa: E402

            self._transcripts = AsyncTranscriptsClient(client_wrapper=self._client_wrapper)
        return self._transcripts
