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

import typing

from ....core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ....core.request_options import RequestOptions
from ....types.agent_version_metadata import AgentVersionMetadata
from .raw_client import AsyncRawVersionsClient, RawVersionsClient


class VersionsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawVersionsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawVersionsClient
        """
        return self._raw_client

    def get(
        self, agent_id: str, version_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> AgentVersionMetadata:
        """
        Get metadata for a specific agent version

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        version_id : str
            Unique identifier for the version.

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

        Returns
        -------
        AgentVersionMetadata
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.agents.versions.get(
            agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
            version_id="agtvrsn_0901k4aafjxxfxt93gd841r7tv5t",
        )
        """
        _response = self._raw_client.get(agent_id, version_id, request_options=request_options)
        return _response.data


class AsyncVersionsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawVersionsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawVersionsClient
        """
        return self._raw_client

    async def get(
        self, agent_id: str, version_id: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> AgentVersionMetadata:
        """
        Get metadata for a specific agent version

        Parameters
        ----------
        agent_id : str
            The id of an agent. This is returned on agent creation.

        version_id : str
            Unique identifier for the version.

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

        Returns
        -------
        AgentVersionMetadata
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.agents.versions.get(
                agent_id="agent_3701k3ttaq12ewp8b7qv5rfyszkz",
                version_id="agtvrsn_0901k4aafjxxfxt93gd841r7tv5t",
            )


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