# coding: utf-8
# Copyright (c) 2016, 2026, Oracle and/or its affiliates.  All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.

# NOTE: This class is auto generated by OracleSDKGenerator. DO NOT EDIT. API Version: 20201005

from .update_database_tools_mcp_toolset_details import UpdateDatabaseToolsMcpToolsetDetails
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel  # noqa: F401
from oci.decorators import init_model_state_from_kwargs


@init_model_state_from_kwargs
class UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails(UpdateDatabaseToolsMcpToolsetDetails):
    """
    Database Tools MCP Toolset information to be updated for the CUSTOM_SQL_TOOL type.
    """

    #: A constant which can be used with the default_execution_type property of a UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
    #: This constant has a value of "SYNCHRONOUS"
    DEFAULT_EXECUTION_TYPE_SYNCHRONOUS = "SYNCHRONOUS"

    #: A constant which can be used with the default_execution_type property of a UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
    #: This constant has a value of "ASYNCHRONOUS"
    DEFAULT_EXECUTION_TYPE_ASYNCHRONOUS = "ASYNCHRONOUS"

    def __init__(self, **kwargs):
        """
        Initializes a new UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails object with values from keyword arguments. The default value of the :py:attr:`~oci.database_tools.models.UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.type` attribute
        of this class is ``CUSTOM_SQL_TOOL`` and it should not be changed.
        The following keyword arguments are supported (corresponding to the getters/setters of this class):

        :param version:
            The value to assign to the version property of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type version: int

        :param display_name:
            The value to assign to the display_name property of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type display_name: str

        :param description:
            The value to assign to the description property of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type description: str

        :param defined_tags:
            The value to assign to the defined_tags property of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type defined_tags: dict(str, dict(str, object))

        :param freeform_tags:
            The value to assign to the freeform_tags property of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type freeform_tags: dict(str, str)

        :param type:
            The value to assign to the type property of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
            Allowed values for this property are: "CUSTOM_SQL_TOOL", "BUILT_IN_SQL_TOOLS", "CUSTOMIZABLE_REPORTING_TOOLS", "GENAI_SQL_ASSISTANT"
        :type type: str

        :param tool_description:
            The value to assign to the tool_description property of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type tool_description: str

        :param tool_name:
            The value to assign to the tool_name property of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type tool_name: str

        :param source:
            The value to assign to the source property of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type source: oci.database_tools.models.DatabaseToolsCustomSqlToolToolsetSource

        :param variables:
            The value to assign to the variables property of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type variables: list[oci.database_tools.models.DatabaseToolsMcpToolsetCustomSqlToolVariable]

        :param allowed_roles:
            The value to assign to the allowed_roles property of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type allowed_roles: list[str]

        :param default_execution_type:
            The value to assign to the default_execution_type property of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
            Allowed values for this property are: "SYNCHRONOUS", "ASYNCHRONOUS"
        :type default_execution_type: str

        """
        self.swagger_types = {
            'version': 'int',
            'display_name': 'str',
            'description': 'str',
            'defined_tags': 'dict(str, dict(str, object))',
            'freeform_tags': 'dict(str, str)',
            'type': 'str',
            'tool_description': 'str',
            'tool_name': 'str',
            'source': 'DatabaseToolsCustomSqlToolToolsetSource',
            'variables': 'list[DatabaseToolsMcpToolsetCustomSqlToolVariable]',
            'allowed_roles': 'list[str]',
            'default_execution_type': 'str'
        }
        self.attribute_map = {
            'version': 'version',
            'display_name': 'displayName',
            'description': 'description',
            'defined_tags': 'definedTags',
            'freeform_tags': 'freeformTags',
            'type': 'type',
            'tool_description': 'toolDescription',
            'tool_name': 'toolName',
            'source': 'source',
            'variables': 'variables',
            'allowed_roles': 'allowedRoles',
            'default_execution_type': 'defaultExecutionType'
        }
        self._version = None
        self._display_name = None
        self._description = None
        self._defined_tags = None
        self._freeform_tags = None
        self._type = None
        self._tool_description = None
        self._tool_name = None
        self._source = None
        self._variables = None
        self._allowed_roles = None
        self._default_execution_type = None
        self._type = 'CUSTOM_SQL_TOOL'

    @property
    def tool_description(self):
        """
        Gets the tool_description of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        Instructions describing how to use the MCP toolset and its features. This can be used to improve the LLM's understanding of the tool.


        :return: The tool_description of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :rtype: str
        """
        return self._tool_description

    @tool_description.setter
    def tool_description(self, tool_description):
        """
        Sets the tool_description of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        Instructions describing how to use the MCP toolset and its features. This can be used to improve the LLM's understanding of the tool.


        :param tool_description: The tool_description of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type: str
        """
        self._tool_description = tool_description

    @property
    def tool_name(self):
        """
        Gets the tool_name of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        Name of the tool returned by the MCP Server


        :return: The tool_name of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :rtype: str
        """
        return self._tool_name

    @tool_name.setter
    def tool_name(self, tool_name):
        """
        Sets the tool_name of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        Name of the tool returned by the MCP Server


        :param tool_name: The tool_name of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type: str
        """
        self._tool_name = tool_name

    @property
    def source(self):
        """
        Gets the source of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.

        :return: The source of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :rtype: oci.database_tools.models.DatabaseToolsCustomSqlToolToolsetSource
        """
        return self._source

    @source.setter
    def source(self, source):
        """
        Sets the source of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.

        :param source: The source of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type: oci.database_tools.models.DatabaseToolsCustomSqlToolToolsetSource
        """
        self._source = source

    @property
    def variables(self):
        """
        Gets the variables of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        The variables to use with the query


        :return: The variables of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :rtype: list[oci.database_tools.models.DatabaseToolsMcpToolsetCustomSqlToolVariable]
        """
        return self._variables

    @variables.setter
    def variables(self, variables):
        """
        Sets the variables of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        The variables to use with the query


        :param variables: The variables of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type: list[oci.database_tools.models.DatabaseToolsMcpToolsetCustomSqlToolVariable]
        """
        self._variables = variables

    @property
    def allowed_roles(self):
        """
        Gets the allowed_roles of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        The roles granted access to the MCP tool generated by this toolset


        :return: The allowed_roles of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :rtype: list[str]
        """
        return self._allowed_roles

    @allowed_roles.setter
    def allowed_roles(self, allowed_roles):
        """
        Sets the allowed_roles of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        The roles granted access to the MCP tool generated by this toolset


        :param allowed_roles: The allowed_roles of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type: list[str]
        """
        self._allowed_roles = allowed_roles

    @property
    def default_execution_type(self):
        """
        Gets the default_execution_type of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        The default execution type for the toolset. The default value is SYNCHRONOUS.

        To use ASYNCHRONOUS execution, the MCP Server must have the storage property configured.

        Allowed values for this property are: "SYNCHRONOUS", "ASYNCHRONOUS"


        :return: The default_execution_type of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :rtype: str
        """
        return self._default_execution_type

    @default_execution_type.setter
    def default_execution_type(self, default_execution_type):
        """
        Sets the default_execution_type of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        The default execution type for the toolset. The default value is SYNCHRONOUS.

        To use ASYNCHRONOUS execution, the MCP Server must have the storage property configured.


        :param default_execution_type: The default_execution_type of this UpdateDatabaseToolsMcpToolsetCustomSqlToolDetails.
        :type: str
        """
        allowed_values = ["SYNCHRONOUS", "ASYNCHRONOUS"]
        if not value_allowed_none_or_none_sentinel(default_execution_type, allowed_values):
            raise ValueError(
                f"Invalid value for `default_execution_type`, must be None or one of {allowed_values}"
            )
        self._default_execution_type = default_execution_type

    def __repr__(self):
        return formatted_flat_dict(self)

    def __eq__(self, other):
        if other is None:
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        return not self == other
