# 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.dynamic_variable_assignment import DynamicVariableAssignment
from ....types.mcp_server_response_model import McpServerResponseModel
from ....types.mcp_tool_config_override import McpToolConfigOverride
from ....types.tool_call_sound_behavior import ToolCallSoundBehavior
from ....types.tool_call_sound_type import ToolCallSoundType
from ....types.tool_execution_mode import ToolExecutionMode
from .raw_client import AsyncRawToolConfigsClient, RawToolConfigsClient

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


class ToolConfigsClient:
    def __init__(self, *, client_wrapper: SyncClientWrapper):
        self._raw_client = RawToolConfigsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        RawToolConfigsClient
        """
        return self._raw_client

    def create(
        self,
        mcp_server_id: str,
        *,
        tool_name: str,
        force_pre_tool_speech: typing.Optional[bool] = OMIT,
        disable_interruptions: typing.Optional[bool] = OMIT,
        tool_call_sound: typing.Optional[ToolCallSoundType] = OMIT,
        tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT,
        execution_mode: typing.Optional[ToolExecutionMode] = OMIT,
        assignments: typing.Optional[typing.Sequence[DynamicVariableAssignment]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> McpServerResponseModel:
        """
        Create configuration overrides for a specific MCP tool.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        tool_name : str
            The name of the MCP tool

        force_pre_tool_speech : typing.Optional[bool]
            If set, overrides the server's force_pre_tool_speech setting for this tool

        disable_interruptions : typing.Optional[bool]
            If set, overrides the server's disable_interruptions setting for this tool

        tool_call_sound : typing.Optional[ToolCallSoundType]
            If set, overrides the server's tool_call_sound setting for this tool

        tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior]
            If set, overrides the server's tool_call_sound_behavior setting for this tool

        execution_mode : typing.Optional[ToolExecutionMode]
            If set, overrides the server's execution_mode setting for this tool

        assignments : typing.Optional[typing.Sequence[DynamicVariableAssignment]]
            Dynamic variable assignments for this MCP tool

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

        Returns
        -------
        McpServerResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.mcp_servers.tool_configs.create(
            mcp_server_id="mcp_server_id",
            tool_name="tool_name",
        )
        """
        _response = self._raw_client.create(
            mcp_server_id,
            tool_name=tool_name,
            force_pre_tool_speech=force_pre_tool_speech,
            disable_interruptions=disable_interruptions,
            tool_call_sound=tool_call_sound,
            tool_call_sound_behavior=tool_call_sound_behavior,
            execution_mode=execution_mode,
            assignments=assignments,
            request_options=request_options,
        )
        return _response.data

    def get(
        self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> McpToolConfigOverride:
        """
        Retrieve configuration overrides for a specific MCP tool.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        tool_name : str
            Name of the MCP tool to retrieve config overrides for.

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

        Returns
        -------
        McpToolConfigOverride
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.mcp_servers.tool_configs.get(
            mcp_server_id="mcp_server_id",
            tool_name="tool_name",
        )
        """
        _response = self._raw_client.get(mcp_server_id, tool_name, request_options=request_options)
        return _response.data

    def delete(
        self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> McpServerResponseModel:
        """
        Remove configuration overrides for a specific MCP tool.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        tool_name : str
            Name of the MCP tool to remove config overrides for.

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

        Returns
        -------
        McpServerResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.mcp_servers.tool_configs.delete(
            mcp_server_id="mcp_server_id",
            tool_name="tool_name",
        )
        """
        _response = self._raw_client.delete(mcp_server_id, tool_name, request_options=request_options)
        return _response.data

    def update(
        self,
        mcp_server_id: str,
        tool_name: str,
        *,
        force_pre_tool_speech: typing.Optional[bool] = OMIT,
        disable_interruptions: typing.Optional[bool] = OMIT,
        tool_call_sound: typing.Optional[ToolCallSoundType] = OMIT,
        tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT,
        execution_mode: typing.Optional[ToolExecutionMode] = OMIT,
        assignments: typing.Optional[typing.Sequence[DynamicVariableAssignment]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> McpServerResponseModel:
        """
        Update configuration overrides for a specific MCP tool.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        tool_name : str
            Name of the MCP tool to update config overrides for.

        force_pre_tool_speech : typing.Optional[bool]
            If set, overrides the server's force_pre_tool_speech setting for this tool

        disable_interruptions : typing.Optional[bool]
            If set, overrides the server's disable_interruptions setting for this tool

        tool_call_sound : typing.Optional[ToolCallSoundType]
            If set, overrides the server's tool_call_sound setting for this tool

        tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior]
            If set, overrides the server's tool_call_sound_behavior setting for this tool

        execution_mode : typing.Optional[ToolExecutionMode]
            If set, overrides the server's execution_mode setting for this tool

        assignments : typing.Optional[typing.Sequence[DynamicVariableAssignment]]
            Dynamic variable assignments for this MCP tool

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

        Returns
        -------
        McpServerResponseModel
            Successful Response

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

        client = ElevenLabs(
            api_key="YOUR_API_KEY",
        )
        client.conversational_ai.mcp_servers.tool_configs.update(
            mcp_server_id="mcp_server_id",
            tool_name="tool_name",
        )
        """
        _response = self._raw_client.update(
            mcp_server_id,
            tool_name,
            force_pre_tool_speech=force_pre_tool_speech,
            disable_interruptions=disable_interruptions,
            tool_call_sound=tool_call_sound,
            tool_call_sound_behavior=tool_call_sound_behavior,
            execution_mode=execution_mode,
            assignments=assignments,
            request_options=request_options,
        )
        return _response.data


class AsyncToolConfigsClient:
    def __init__(self, *, client_wrapper: AsyncClientWrapper):
        self._raw_client = AsyncRawToolConfigsClient(client_wrapper=client_wrapper)

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

        Returns
        -------
        AsyncRawToolConfigsClient
        """
        return self._raw_client

    async def create(
        self,
        mcp_server_id: str,
        *,
        tool_name: str,
        force_pre_tool_speech: typing.Optional[bool] = OMIT,
        disable_interruptions: typing.Optional[bool] = OMIT,
        tool_call_sound: typing.Optional[ToolCallSoundType] = OMIT,
        tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT,
        execution_mode: typing.Optional[ToolExecutionMode] = OMIT,
        assignments: typing.Optional[typing.Sequence[DynamicVariableAssignment]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> McpServerResponseModel:
        """
        Create configuration overrides for a specific MCP tool.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        tool_name : str
            The name of the MCP tool

        force_pre_tool_speech : typing.Optional[bool]
            If set, overrides the server's force_pre_tool_speech setting for this tool

        disable_interruptions : typing.Optional[bool]
            If set, overrides the server's disable_interruptions setting for this tool

        tool_call_sound : typing.Optional[ToolCallSoundType]
            If set, overrides the server's tool_call_sound setting for this tool

        tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior]
            If set, overrides the server's tool_call_sound_behavior setting for this tool

        execution_mode : typing.Optional[ToolExecutionMode]
            If set, overrides the server's execution_mode setting for this tool

        assignments : typing.Optional[typing.Sequence[DynamicVariableAssignment]]
            Dynamic variable assignments for this MCP tool

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

        Returns
        -------
        McpServerResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.mcp_servers.tool_configs.create(
                mcp_server_id="mcp_server_id",
                tool_name="tool_name",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.create(
            mcp_server_id,
            tool_name=tool_name,
            force_pre_tool_speech=force_pre_tool_speech,
            disable_interruptions=disable_interruptions,
            tool_call_sound=tool_call_sound,
            tool_call_sound_behavior=tool_call_sound_behavior,
            execution_mode=execution_mode,
            assignments=assignments,
            request_options=request_options,
        )
        return _response.data

    async def get(
        self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> McpToolConfigOverride:
        """
        Retrieve configuration overrides for a specific MCP tool.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        tool_name : str
            Name of the MCP tool to retrieve config overrides for.

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

        Returns
        -------
        McpToolConfigOverride
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.mcp_servers.tool_configs.get(
                mcp_server_id="mcp_server_id",
                tool_name="tool_name",
            )


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

    async def delete(
        self, mcp_server_id: str, tool_name: str, *, request_options: typing.Optional[RequestOptions] = None
    ) -> McpServerResponseModel:
        """
        Remove configuration overrides for a specific MCP tool.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        tool_name : str
            Name of the MCP tool to remove config overrides for.

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

        Returns
        -------
        McpServerResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.mcp_servers.tool_configs.delete(
                mcp_server_id="mcp_server_id",
                tool_name="tool_name",
            )


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

    async def update(
        self,
        mcp_server_id: str,
        tool_name: str,
        *,
        force_pre_tool_speech: typing.Optional[bool] = OMIT,
        disable_interruptions: typing.Optional[bool] = OMIT,
        tool_call_sound: typing.Optional[ToolCallSoundType] = OMIT,
        tool_call_sound_behavior: typing.Optional[ToolCallSoundBehavior] = OMIT,
        execution_mode: typing.Optional[ToolExecutionMode] = OMIT,
        assignments: typing.Optional[typing.Sequence[DynamicVariableAssignment]] = OMIT,
        request_options: typing.Optional[RequestOptions] = None,
    ) -> McpServerResponseModel:
        """
        Update configuration overrides for a specific MCP tool.

        Parameters
        ----------
        mcp_server_id : str
            ID of the MCP Server.

        tool_name : str
            Name of the MCP tool to update config overrides for.

        force_pre_tool_speech : typing.Optional[bool]
            If set, overrides the server's force_pre_tool_speech setting for this tool

        disable_interruptions : typing.Optional[bool]
            If set, overrides the server's disable_interruptions setting for this tool

        tool_call_sound : typing.Optional[ToolCallSoundType]
            If set, overrides the server's tool_call_sound setting for this tool

        tool_call_sound_behavior : typing.Optional[ToolCallSoundBehavior]
            If set, overrides the server's tool_call_sound_behavior setting for this tool

        execution_mode : typing.Optional[ToolExecutionMode]
            If set, overrides the server's execution_mode setting for this tool

        assignments : typing.Optional[typing.Sequence[DynamicVariableAssignment]]
            Dynamic variable assignments for this MCP tool

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

        Returns
        -------
        McpServerResponseModel
            Successful Response

        Examples
        --------
        import asyncio

        from elevenlabs import AsyncElevenLabs

        client = AsyncElevenLabs(
            api_key="YOUR_API_KEY",
        )


        async def main() -> None:
            await client.conversational_ai.mcp_servers.tool_configs.update(
                mcp_server_id="mcp_server_id",
                tool_name="tool_name",
            )


        asyncio.run(main())
        """
        _response = await self._raw_client.update(
            mcp_server_id,
            tool_name,
            force_pre_tool_speech=force_pre_tool_speech,
            disable_interruptions=disable_interruptions,
            tool_call_sound=tool_call_sound,
            tool_call_sound_behavior=tool_call_sound_behavior,
            execution_mode=execution_mode,
            assignments=assignments,
            request_options=request_options,
        )
        return _response.data
