# 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.app_variant_response import AppVariantResponse
from ..types.app_variant_revision import AppVariantRevision
from ..types.config_dto import ConfigDto
from ..types.config_response_model import ConfigResponseModel
from ..types.reference_dto import ReferenceDto
from ..types.reference_request_model import ReferenceRequestModel
from .raw_client import AsyncRawVariantsClient, RawVariantsClient
from .types.add_variant_from_base_and_config_response import (
    AddVariantFromBaseAndConfigResponse,
)

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)


class VariantsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawVariantsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawVariantsClient
        """
        return self._raw_client

    def add_variant_from_base_and_config(
        self,
        *,
        base_id: str,
        new_variant_name: str,
        new_config_name: str,
        parameters: typing.Dict[str, typing.Optional[typing.Any]],
        commit_message: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AddVariantFromBaseAndConfigResponse:
        """
        Add a new variant based on an existing one.
        Same as POST /config

        Args:
            payload (AddVariantFromBasePayload): Payload containing base variant ID, new variant name, and parameters.

        Raises:
            HTTPException: Raised if the variant could not be added or accessed.

        Returns:
            Union[AppVariantResponse, Any]: New variant details or exception.

        Parameters
        ----------
        base_id : str

        new_variant_name : str

        new_config_name : str

        parameters : typing.Dict[str, typing.Optional[typing.Any]]

        commit_message : typing.Optional[str]

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

        Returns
        -------
        AddVariantFromBaseAndConfigResponse
            Successful Response

        Examples
        --------
        from agenta import AgentaApi

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.add_variant_from_base_and_config(
            base_id="base_id",
            new_variant_name="new_variant_name",
            new_config_name="new_config_name",
            parameters={"key": "value"},
        )
        """
        _response = self._raw_client.add_variant_from_base_and_config(
            base_id=base_id,
            new_variant_name=new_variant_name,
            new_config_name=new_config_name,
            parameters=parameters,
            commit_message=commit_message,
            request_options=request_options,
        )
        return _response.data

    def get_variant(
        self,
        variant_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AppVariantResponse:
        """
        Parameters
        ----------
        variant_id : str

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

        Returns
        -------
        AppVariantResponse
            Successful Response

        Examples
        --------
        from agenta import AgentaApi

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.get_variant(
            variant_id="variant_id",
        )
        """
        _response = self._raw_client.get_variant(
            variant_id, request_options=request_options
        )
        return _response.data

    def mark_variant_as_hidden(
        self,
        variant_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Mark a variant as hidden from the UI.

        Arguments:
            app_variant -- AppVariant to remove

        Raises:
            HTTPException: If there is a problem removing the app variant

        Parameters
        ----------
        variant_id : str

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        from agenta import AgentaApi

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.mark_variant_as_hidden(
            variant_id="variant_id",
        )
        """
        _response = self._raw_client.mark_variant_as_hidden(
            variant_id, request_options=request_options
        )
        return _response.data

    def update_variant_parameters(
        self,
        variant_id: str,
        *,
        parameters: typing.Dict[str, typing.Optional[typing.Any]],
        commit_message: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Updates the parameters for an app variant.

        Args:
            variant_id (str): The ID of the app variant to update.
            payload (UpdateVariantParameterPayload): The payload containing the updated parameters.

        Raises:
            HTTPException: If there is an error while trying to update the app variant.

        Returns:
            JSONResponse: A JSON response containing the updated app variant parameters.

        Parameters
        ----------
        variant_id : str

        parameters : typing.Dict[str, typing.Optional[typing.Any]]

        commit_message : typing.Optional[str]

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        from agenta import AgentaApi

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.update_variant_parameters(
            variant_id="variant_id",
            parameters={"key": "value"},
        )
        """
        _response = self._raw_client.update_variant_parameters(
            variant_id,
            parameters=parameters,
            commit_message=commit_message,
            request_options=request_options,
        )
        return _response.data

    def update_variant_url(
        self,
        variant_id: str,
        *,
        url: str,
        update_variant_url_payload_variant_id: str,
        commit_message: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Updates the URL used in an app variant.

        Args:
            variant_id (str): The ID of the app variant to update.
            url (str): The URL to update.

        Raises:
            HTTPException: If an error occurs while trying to update the app variant.

        Returns:
            JSONResponse: A JSON response indicating whether the update was successful or not.

        Parameters
        ----------
        variant_id : str

        url : str

        update_variant_url_payload_variant_id : str

        commit_message : typing.Optional[str]

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        from agenta import AgentaApi

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.update_variant_url(
            variant_id="variant_id",
            url="url",
            update_variant_url_payload_variant_id="variant_id",
        )
        """
        _response = self._raw_client.update_variant_url(
            variant_id,
            url=url,
            update_variant_url_payload_variant_id=update_variant_url_payload_variant_id,
            commit_message=commit_message,
            request_options=request_options,
        )
        return _response.data

    def get_variant_revisions(
        self,
        variant_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[AppVariantRevision]:
        """
        Parameters
        ----------
        variant_id : str

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

        Returns
        -------
        typing.List[AppVariantRevision]
            Successful Response

        Examples
        --------
        from agenta import AgentaApi

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.get_variant_revisions(
            variant_id="variant_id",
        )
        """
        _response = self._raw_client.get_variant_revisions(
            variant_id, request_options=request_options
        )
        return _response.data

    def get_variant_revision(
        self,
        variant_id: str,
        revision_number: int,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AppVariantRevision:
        """
        Parameters
        ----------
        variant_id : str

        revision_number : int

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

        Returns
        -------
        AppVariantRevision
            Successful Response

        Examples
        --------
        from agenta import AgentaApi

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.get_variant_revision(
            variant_id="variant_id",
            revision_number=1,
        )
        """
        _response = self._raw_client.get_variant_revision(
            variant_id, revision_number, request_options=request_options
        )
        return _response.data

    def mark_variant_revision_as_hidden(
        self,
        variant_id: str,
        revision_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Mark a variant revision as hidden from the UI.

        Arguments:
            app_variant -- AppVariant to remove
            revision_id -- Revision ID to remove

        Raises:
            HTTPException: If there is a problem removing the app variant

        Parameters
        ----------
        variant_id : str

        revision_id : str

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        from agenta import AgentaApi

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.mark_variant_revision_as_hidden(
            variant_id="variant_id",
            revision_id="revision_id",
        )
        """
        _response = self._raw_client.mark_variant_revision_as_hidden(
            variant_id, revision_id, request_options=request_options
        )
        return _response.data

    def configs_add(
        self,
        *,
        variant_ref: ReferenceRequestModel,
        application_ref: ReferenceRequestModel,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ConfigResponseModel:
        """
        Parameters
        ----------
        variant_ref : ReferenceRequestModel

        application_ref : ReferenceRequestModel

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

        Returns
        -------
        ConfigResponseModel
            Successful Response

        Examples
        --------
        from agenta import AgentaApi, ReferenceRequestModel

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.configs_add(
            variant_ref=ReferenceRequestModel(),
            application_ref=ReferenceRequestModel(),
        )
        """
        _response = self._raw_client.configs_add(
            variant_ref=variant_ref,
            application_ref=application_ref,
            request_options=request_options,
        )
        return _response.data

    def configs_fetch(
        self,
        *,
        variant_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        environment_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ConfigResponseModel:
        """
        Fetch configuration for a variant or environment.

        Either variant_ref OR environment_ref must be provided (if neither is provided,
        a default environment_ref with slug="production" will be used).

        For each reference object (variant_ref, environment_ref, application_ref):
        - Provide either 'slug' or 'id' field
        - 'version' is optional and can be set to null
        - If 'id' is provided, it will be used directly to fetch the resource
        - Otherwise, 'slug' will be used along with application_ref

        Returns:
            ConfigResponseModel: The configuration for the requested variant or environment.

        Raises:
            HTTPException: If the configuration is not found.

        Parameters
        ----------
        variant_ref : typing.Optional[ReferenceRequestModel]

        environment_ref : typing.Optional[ReferenceRequestModel]

        application_ref : typing.Optional[ReferenceRequestModel]

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

        Returns
        -------
        ConfigResponseModel
            Successful Response

        Examples
        --------
        from agenta import AgentaApi

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.configs_fetch()
        """
        _response = self._raw_client.configs_fetch(
            variant_ref=variant_ref,
            environment_ref=environment_ref,
            application_ref=application_ref,
            request_options=request_options,
        )
        return _response.data

    def configs_fork(
        self,
        *,
        variant_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        environment_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ConfigResponseModel:
        """
        Parameters
        ----------
        variant_ref : typing.Optional[ReferenceRequestModel]

        environment_ref : typing.Optional[ReferenceRequestModel]

        application_ref : typing.Optional[ReferenceRequestModel]

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

        Returns
        -------
        ConfigResponseModel
            Successful Response

        Examples
        --------
        from agenta import AgentaApi

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.configs_fork()
        """
        _response = self._raw_client.configs_fork(
            variant_ref=variant_ref,
            environment_ref=environment_ref,
            application_ref=application_ref,
            request_options=request_options,
        )
        return _response.data

    def configs_commit(
        self,
        *,
        config: ConfigDto,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ConfigResponseModel:
        """
        Parameters
        ----------
        config : ConfigDto

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

        Returns
        -------
        ConfigResponseModel
            Successful Response

        Examples
        --------
        from agenta import AgentaApi, ConfigDto

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.configs_commit(
            config=ConfigDto(
                params={"key": "value"},
            ),
        )
        """
        _response = self._raw_client.configs_commit(
            config=config, request_options=request_options
        )
        return _response.data

    def configs_deploy(
        self,
        *,
        variant_ref: ReferenceRequestModel,
        environment_ref: ReferenceRequestModel,
        application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ConfigResponseModel:
        """
        Parameters
        ----------
        variant_ref : ReferenceRequestModel

        environment_ref : ReferenceRequestModel

        application_ref : typing.Optional[ReferenceRequestModel]

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

        Returns
        -------
        ConfigResponseModel
            Successful Response

        Examples
        --------
        from agenta import AgentaApi, ReferenceRequestModel

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.configs_deploy(
            variant_ref=ReferenceRequestModel(),
            environment_ref=ReferenceRequestModel(),
        )
        """
        _response = self._raw_client.configs_deploy(
            variant_ref=variant_ref,
            environment_ref=environment_ref,
            application_ref=application_ref,
            request_options=request_options,
        )
        return _response.data

    def configs_delete(
        self,
        *,
        variant_ref: ReferenceRequestModel,
        application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> int:
        """
        Parameters
        ----------
        variant_ref : ReferenceRequestModel

        application_ref : typing.Optional[ReferenceRequestModel]

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

        Returns
        -------
        int
            Successful Response

        Examples
        --------
        from agenta import AgentaApi, ReferenceRequestModel

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.configs_delete(
            variant_ref=ReferenceRequestModel(),
        )
        """
        _response = self._raw_client.configs_delete(
            variant_ref=variant_ref,
            application_ref=application_ref,
            request_options=request_options,
        )
        return _response.data

    def configs_list(
        self,
        *,
        application_ref: ReferenceDto,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[ConfigResponseModel]:
        """
        Parameters
        ----------
        application_ref : ReferenceDto

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

        Returns
        -------
        typing.List[ConfigResponseModel]
            Successful Response

        Examples
        --------
        from agenta import AgentaApi, ReferenceDto

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.configs_list(
            application_ref=ReferenceDto(),
        )
        """
        _response = self._raw_client.configs_list(
            application_ref=application_ref, request_options=request_options
        )
        return _response.data

    def configs_history(
        self,
        *,
        variant_ref: ReferenceRequestModel,
        application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[ConfigResponseModel]:
        """
        Parameters
        ----------
        variant_ref : ReferenceRequestModel

        application_ref : typing.Optional[ReferenceRequestModel]

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

        Returns
        -------
        typing.List[ConfigResponseModel]
            Successful Response

        Examples
        --------
        from agenta import AgentaApi, ReferenceRequestModel

        client = AgentaApi(
            api_key="YOUR_API_KEY",
        )
        client.variants.configs_history(
            variant_ref=ReferenceRequestModel(),
        )
        """
        _response = self._raw_client.configs_history(
            variant_ref=variant_ref,
            application_ref=application_ref,
            request_options=request_options,
        )
        return _response.data


class AsyncVariantsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawVariantsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawVariantsClient
        """
        return self._raw_client

    async def add_variant_from_base_and_config(
        self,
        *,
        base_id: str,
        new_variant_name: str,
        new_config_name: str,
        parameters: typing.Dict[str, typing.Optional[typing.Any]],
        commit_message: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AddVariantFromBaseAndConfigResponse:
        """
        Add a new variant based on an existing one.
        Same as POST /config

        Args:
            payload (AddVariantFromBasePayload): Payload containing base variant ID, new variant name, and parameters.

        Raises:
            HTTPException: Raised if the variant could not be added or accessed.

        Returns:
            Union[AppVariantResponse, Any]: New variant details or exception.

        Parameters
        ----------
        base_id : str

        new_variant_name : str

        new_config_name : str

        parameters : typing.Dict[str, typing.Optional[typing.Any]]

        commit_message : typing.Optional[str]

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

        Returns
        -------
        AddVariantFromBaseAndConfigResponse
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.add_variant_from_base_and_config(
                base_id="base_id",
                new_variant_name="new_variant_name",
                new_config_name="new_config_name",
                parameters={"key": "value"},
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.add_variant_from_base_and_config(
            base_id=base_id,
            new_variant_name=new_variant_name,
            new_config_name=new_config_name,
            parameters=parameters,
            commit_message=commit_message,
            request_options=request_options,
        )
        return _response.data

    async def get_variant(
        self,
        variant_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AppVariantResponse:
        """
        Parameters
        ----------
        variant_id : str

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

        Returns
        -------
        AppVariantResponse
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.get_variant(
                variant_id="variant_id",
            )


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

    async def mark_variant_as_hidden(
        self,
        variant_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Mark a variant as hidden from the UI.

        Arguments:
            app_variant -- AppVariant to remove

        Raises:
            HTTPException: If there is a problem removing the app variant

        Parameters
        ----------
        variant_id : str

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.mark_variant_as_hidden(
                variant_id="variant_id",
            )


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

    async def update_variant_parameters(
        self,
        variant_id: str,
        *,
        parameters: typing.Dict[str, typing.Optional[typing.Any]],
        commit_message: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Updates the parameters for an app variant.

        Args:
            variant_id (str): The ID of the app variant to update.
            payload (UpdateVariantParameterPayload): The payload containing the updated parameters.

        Raises:
            HTTPException: If there is an error while trying to update the app variant.

        Returns:
            JSONResponse: A JSON response containing the updated app variant parameters.

        Parameters
        ----------
        variant_id : str

        parameters : typing.Dict[str, typing.Optional[typing.Any]]

        commit_message : typing.Optional[str]

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.update_variant_parameters(
                variant_id="variant_id",
                parameters={"key": "value"},
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_variant_parameters(
            variant_id,
            parameters=parameters,
            commit_message=commit_message,
            request_options=request_options,
        )
        return _response.data

    async def update_variant_url(
        self,
        variant_id: str,
        *,
        url: str,
        update_variant_url_payload_variant_id: str,
        commit_message: typing.Optional[str] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Updates the URL used in an app variant.

        Args:
            variant_id (str): The ID of the app variant to update.
            url (str): The URL to update.

        Raises:
            HTTPException: If an error occurs while trying to update the app variant.

        Returns:
            JSONResponse: A JSON response indicating whether the update was successful or not.

        Parameters
        ----------
        variant_id : str

        url : str

        update_variant_url_payload_variant_id : str

        commit_message : typing.Optional[str]

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.update_variant_url(
                variant_id="variant_id",
                url="url",
                update_variant_url_payload_variant_id="variant_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update_variant_url(
            variant_id,
            url=url,
            update_variant_url_payload_variant_id=update_variant_url_payload_variant_id,
            commit_message=commit_message,
            request_options=request_options,
        )
        return _response.data

    async def get_variant_revisions(
        self,
        variant_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[AppVariantRevision]:
        """
        Parameters
        ----------
        variant_id : str

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

        Returns
        -------
        typing.List[AppVariantRevision]
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.get_variant_revisions(
                variant_id="variant_id",
            )


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

    async def get_variant_revision(
        self,
        variant_id: str,
        revision_number: int,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> AppVariantRevision:
        """
        Parameters
        ----------
        variant_id : str

        revision_number : int

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

        Returns
        -------
        AppVariantRevision
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.get_variant_revision(
                variant_id="variant_id",
                revision_number=1,
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.get_variant_revision(
            variant_id, revision_number, request_options=request_options
        )
        return _response.data

    async def mark_variant_revision_as_hidden(
        self,
        variant_id: str,
        revision_id: str,
        *,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.Optional[typing.Any]:
        """
        Mark a variant revision as hidden from the UI.

        Arguments:
            app_variant -- AppVariant to remove
            revision_id -- Revision ID to remove

        Raises:
            HTTPException: If there is a problem removing the app variant

        Parameters
        ----------
        variant_id : str

        revision_id : str

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

        Returns
        -------
        typing.Optional[typing.Any]
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.mark_variant_revision_as_hidden(
                variant_id="variant_id",
                revision_id="revision_id",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.mark_variant_revision_as_hidden(
            variant_id, revision_id, request_options=request_options
        )
        return _response.data

    async def configs_add(
        self,
        *,
        variant_ref: ReferenceRequestModel,
        application_ref: ReferenceRequestModel,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ConfigResponseModel:
        """
        Parameters
        ----------
        variant_ref : ReferenceRequestModel

        application_ref : ReferenceRequestModel

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

        Returns
        -------
        ConfigResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi, ReferenceRequestModel

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.configs_add(
                variant_ref=ReferenceRequestModel(),
                application_ref=ReferenceRequestModel(),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.configs_add(
            variant_ref=variant_ref,
            application_ref=application_ref,
            request_options=request_options,
        )
        return _response.data

    async def configs_fetch(
        self,
        *,
        variant_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        environment_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ConfigResponseModel:
        """
        Fetch configuration for a variant or environment.

        Either variant_ref OR environment_ref must be provided (if neither is provided,
        a default environment_ref with slug="production" will be used).

        For each reference object (variant_ref, environment_ref, application_ref):
        - Provide either 'slug' or 'id' field
        - 'version' is optional and can be set to null
        - If 'id' is provided, it will be used directly to fetch the resource
        - Otherwise, 'slug' will be used along with application_ref

        Returns:
            ConfigResponseModel: The configuration for the requested variant or environment.

        Raises:
            HTTPException: If the configuration is not found.

        Parameters
        ----------
        variant_ref : typing.Optional[ReferenceRequestModel]

        environment_ref : typing.Optional[ReferenceRequestModel]

        application_ref : typing.Optional[ReferenceRequestModel]

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

        Returns
        -------
        ConfigResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.configs_fetch()


        asyncio.run(main())
        """
        _response = await self._raw_client.configs_fetch(
            variant_ref=variant_ref,
            environment_ref=environment_ref,
            application_ref=application_ref,
            request_options=request_options,
        )
        return _response.data

    async def configs_fork(
        self,
        *,
        variant_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        environment_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ConfigResponseModel:
        """
        Parameters
        ----------
        variant_ref : typing.Optional[ReferenceRequestModel]

        environment_ref : typing.Optional[ReferenceRequestModel]

        application_ref : typing.Optional[ReferenceRequestModel]

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

        Returns
        -------
        ConfigResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.configs_fork()


        asyncio.run(main())
        """
        _response = await self._raw_client.configs_fork(
            variant_ref=variant_ref,
            environment_ref=environment_ref,
            application_ref=application_ref,
            request_options=request_options,
        )
        return _response.data

    async def configs_commit(
        self,
        *,
        config: ConfigDto,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ConfigResponseModel:
        """
        Parameters
        ----------
        config : ConfigDto

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

        Returns
        -------
        ConfigResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi, ConfigDto

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.configs_commit(
                config=ConfigDto(
                    params={"key": "value"},
                ),
            )


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

    async def configs_deploy(
        self,
        *,
        variant_ref: ReferenceRequestModel,
        environment_ref: ReferenceRequestModel,
        application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> ConfigResponseModel:
        """
        Parameters
        ----------
        variant_ref : ReferenceRequestModel

        environment_ref : ReferenceRequestModel

        application_ref : typing.Optional[ReferenceRequestModel]

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

        Returns
        -------
        ConfigResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi, ReferenceRequestModel

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.configs_deploy(
                variant_ref=ReferenceRequestModel(),
                environment_ref=ReferenceRequestModel(),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.configs_deploy(
            variant_ref=variant_ref,
            environment_ref=environment_ref,
            application_ref=application_ref,
            request_options=request_options,
        )
        return _response.data

    async def configs_delete(
        self,
        *,
        variant_ref: ReferenceRequestModel,
        application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> int:
        """
        Parameters
        ----------
        variant_ref : ReferenceRequestModel

        application_ref : typing.Optional[ReferenceRequestModel]

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

        Returns
        -------
        int
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi, ReferenceRequestModel

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.configs_delete(
                variant_ref=ReferenceRequestModel(),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.configs_delete(
            variant_ref=variant_ref,
            application_ref=application_ref,
            request_options=request_options,
        )
        return _response.data

    async def configs_list(
        self,
        *,
        application_ref: ReferenceDto,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[ConfigResponseModel]:
        """
        Parameters
        ----------
        application_ref : ReferenceDto

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

        Returns
        -------
        typing.List[ConfigResponseModel]
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi, ReferenceDto

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.configs_list(
                application_ref=ReferenceDto(),
            )


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

    async def configs_history(
        self,
        *,
        variant_ref: ReferenceRequestModel,
        application_ref: typing.Optional[ReferenceRequestModel] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> typing.List[ConfigResponseModel]:
        """
        Parameters
        ----------
        variant_ref : ReferenceRequestModel

        application_ref : typing.Optional[ReferenceRequestModel]

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

        Returns
        -------
        typing.List[ConfigResponseModel]
            Successful Response

        Examples
        --------
        import asyncio

        from agenta import AsyncAgentaApi, ReferenceRequestModel

        client = AsyncAgentaApi(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.variants.configs_history(
                variant_ref=ReferenceRequestModel(),
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.configs_history(
            variant_ref=variant_ref,
            application_ref=application_ref,
            request_options=request_options,
        )
        return _response.data
