"""Auto-generated by adk-fluent generator. Manual edits will be overwritten."""

from __future__ import annotations

import ssl
from collections import defaultdict
from collections.abc import Callable
from typing import TYPE_CHECKING, Any, Self

from google.adk.agents.active_streaming_tool import ActiveStreamingTool as _ADK_ActiveStreamingTool
from google.adk.tools.agent_tool import AgentTool as _ADK_AgentTool
from google.adk.tools.apihub_tool.apihub_toolset import APIHubToolset as _ADK_APIHubToolset
from google.adk.tools.application_integration_tool.application_integration_toolset import (
    ApplicationIntegrationToolset as _ADK_ApplicationIntegrationToolset,
)
from google.adk.tools.application_integration_tool.integration_connector_tool import (
    IntegrationConnectorTool as _ADK_IntegrationConnectorTool,
)
from google.adk.tools.base_authenticated_tool import BaseAuthenticatedTool as _ADK_BaseAuthenticatedTool
from google.adk.tools.base_tool import BaseTool as _ADK_BaseTool
from google.adk.tools.base_toolset import BaseToolset as _ADK_BaseToolset
from google.adk.tools.bigquery.bigquery_toolset import BigQueryToolset as _ADK_BigQueryToolset
from google.adk.tools.bigtable.bigtable_toolset import BigtableToolset as _ADK_BigtableToolset
from google.adk.tools.computer_use.computer_use_tool import ComputerUseTool as _ADK_ComputerUseTool
from google.adk.tools.computer_use.computer_use_toolset import ComputerUseToolset as _ADK_ComputerUseToolset
from google.adk.tools.data_agent.data_agent_toolset import DataAgentToolset as _ADK_DataAgentToolset
from google.adk.tools.discovery_engine_search_tool import DiscoveryEngineSearchTool as _ADK_DiscoveryEngineSearchTool
from google.adk.tools.enterprise_search_tool import EnterpriseWebSearchTool as _ADK_EnterpriseWebSearchTool
from google.adk.tools.example_tool import ExampleTool as _ADK_ExampleTool
from google.adk.tools.function_tool import FunctionTool as _ADK_FunctionTool
from google.adk.tools.google_api_tool.google_api_tool import GoogleApiTool as _ADK_GoogleApiTool
from google.adk.tools.google_api_tool.google_api_toolset import GoogleApiToolset as _ADK_GoogleApiToolset
from google.adk.tools.google_api_tool.google_api_toolsets import CalendarToolset as _ADK_CalendarToolset
from google.adk.tools.google_api_tool.google_api_toolsets import DocsToolset as _ADK_DocsToolset
from google.adk.tools.google_api_tool.google_api_toolsets import GmailToolset as _ADK_GmailToolset
from google.adk.tools.google_api_tool.google_api_toolsets import SheetsToolset as _ADK_SheetsToolset
from google.adk.tools.google_api_tool.google_api_toolsets import SlidesToolset as _ADK_SlidesToolset
from google.adk.tools.google_api_tool.google_api_toolsets import YoutubeToolset as _ADK_YoutubeToolset
from google.adk.tools.google_maps_grounding_tool import GoogleMapsGroundingTool as _ADK_GoogleMapsGroundingTool
from google.adk.tools.google_search_agent_tool import GoogleSearchAgentTool as _ADK_GoogleSearchAgentTool
from google.adk.tools.google_search_tool import GoogleSearchTool as _ADK_GoogleSearchTool
from google.adk.tools.google_tool import GoogleTool as _ADK_GoogleTool
from google.adk.tools.load_artifacts_tool import LoadArtifactsTool as _ADK_LoadArtifactsTool
from google.adk.tools.load_mcp_resource_tool import LoadMcpResourceTool as _ADK_LoadMcpResourceTool
from google.adk.tools.load_memory_tool import LoadMemoryTool as _ADK_LoadMemoryTool
from google.adk.tools.long_running_tool import LongRunningFunctionTool as _ADK_LongRunningFunctionTool
from google.adk.tools.mcp_tool.mcp_tool import MCPTool as _ADK_MCPTool
from google.adk.tools.mcp_tool.mcp_tool import McpTool as _ADK_McpTool
from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset as _ADK_MCPToolset
from google.adk.tools.mcp_tool.mcp_toolset import McpToolset as _ADK_McpToolset
from google.adk.tools.openapi_tool.openapi_spec_parser.openapi_toolset import OpenAPIToolset as _ADK_OpenAPIToolset
from google.adk.tools.openapi_tool.openapi_spec_parser.rest_api_tool import RestApiTool as _ADK_RestApiTool
from google.adk.tools.preload_memory_tool import PreloadMemoryTool as _ADK_PreloadMemoryTool
from google.adk.tools.pubsub.pubsub_toolset import PubSubToolset as _ADK_PubSubToolset
from google.adk.tools.retrieval.base_retrieval_tool import BaseRetrievalTool as _ADK_BaseRetrievalTool
from google.adk.tools.set_model_response_tool import SetModelResponseTool as _ADK_SetModelResponseTool
from google.adk.tools.skill_toolset import LoadSkillResourceTool as _ADK_LoadSkillResourceTool
from google.adk.tools.skill_toolset import LoadSkillTool as _ADK_LoadSkillTool
from google.adk.tools.skill_toolset import SkillToolset as _ADK_SkillToolset
from google.adk.tools.spanner.spanner_toolset import SpannerToolset as _ADK_SpannerToolset
from google.adk.tools.toolbox_toolset import ToolboxToolset as _ADK_ToolboxToolset
from google.adk.tools.transfer_to_agent_tool import TransferToAgentTool as _ADK_TransferToAgentTool
from google.adk.tools.url_context_tool import UrlContextTool as _ADK_UrlContextTool
from google.adk.tools.vertex_ai_search_tool import VertexAiSearchTool as _ADK_VertexAiSearchTool

from adk_fluent._base import BuilderBase

if TYPE_CHECKING:
    from collections.abc import Mapping
    from typing import Literal, TextIO

    from fastapi.openapi.models import Operation
    from google.adk.agents.live_request_queue import LiveRequestQueue
    from google.adk.agents.readonly_context import ReadonlyContext
    from google.adk.auth.auth_credential import AuthCredential, ServiceAccount
    from google.adk.auth.auth_schemes import AuthScheme
    from google.adk.auth.auth_tool import AuthConfig
    from google.adk.tools._google_credentials import BaseGoogleCredentialsConfig
    from google.adk.tools.apihub_tool.clients.apihub_client import APIHubClient
    from google.adk.tools.base_toolset import ToolPredicate
    from google.adk.tools.bigquery.bigquery_credentials import BigQueryCredentialsConfig
    from google.adk.tools.bigquery.config import BigQueryToolConfig
    from google.adk.tools.bigtable.bigtable_credentials import BigtableCredentialsConfig
    from google.adk.tools.bigtable.settings import BigtableToolSettings
    from google.adk.tools.data_agent.config import DataAgentToolConfig
    from google.adk.tools.data_agent.credentials import DataAgentCredentialsConfig
    from google.adk.tools.mcp_tool.mcp_tool import ProgressCallbackFactory
    from google.adk.tools.pubsub.config import PubSubToolConfig
    from google.adk.tools.pubsub.pubsub_credentials import PubSubCredentialsConfig
    from google.adk.tools.spanner.settings import SpannerToolSettings
    from google.adk.tools.spanner.spanner_credentials import SpannerCredentialsConfig
    from google.genai.types import VertexAISearchDataStoreSpec
    from mcp.shared.session import ProgressFnT
    from pydantic import BaseModel


class ActiveStreamingTool(BuilderBase):
    """Manages streaming tool related resources during invocation."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _ADK_TARGET_CLASS = _ADK_ActiveStreamingTool

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def task(self, value: Any | None) -> Self:
        """Set the ``task`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["task"] = value
        return self

    def stream(self, value: LiveRequestQueue | None) -> Self:
        """Set the ``stream`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["stream"] = value
        return self

    def build(self) -> _ADK_ActiveStreamingTool:
        """Manages streaming tool related resources during invocation. Resolve into a native ADK _ADK_ActiveStreamingTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_ActiveStreamingTool, config)
        return self._apply_native_hooks(result)


class AgentTool(BuilderBase):
    """A tool that wraps an agent."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"agent", "include_plugins", "skip_summarization"}

    def __init__(self, agent: str) -> None:
        self._config: dict[str, Any] = {"agent": agent}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def skip_summarization(self, value: bool) -> Self:
        """Set the ``skip_summarization`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["skip_summarization"] = value
        return self

    def include_plugins(self, value: bool) -> Self:
        """Set the ``include_plugins`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["include_plugins"] = value
        return self

    def build(self) -> _ADK_AgentTool:
        """A tool that wraps an agent. Resolve into a native ADK _ADK_AgentTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_AgentTool, config)
        return self._apply_native_hooks(result)


class APIHubToolset(BuilderBase):
    """APIHubTool generates tools from a given API Hub resource."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "access_token",
        "apihub_client",
        "apihub_resource_name",
        "auth_credential",
        "auth_scheme",
        "description",
        "lazy_load_spec",
        "name",
        "service_account_json",
        "tool_filter",
    }

    def __init__(self, apihub_resource_name: str) -> None:
        self._config: dict[str, Any] = {"apihub_resource_name": apihub_resource_name}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def access_token(self, value: str | None) -> Self:
        """Set the ``access_token`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["access_token"] = value
        return self

    def service_account_json(self, value: str | None) -> Self:
        """Set the ``service_account_json`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["service_account_json"] = value
        return self

    def name(self, value: str) -> Self:
        """Set the ``name`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["name"] = value
        return self

    def description(self, value: str) -> Self:
        """Set the ``description`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["description"] = value
        return self

    def lazy_load_spec(self, value: Any) -> Self:
        """Set the ``lazy_load_spec`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["lazy_load_spec"] = value
        return self

    def auth_scheme(self, value: AuthScheme | None) -> Self:
        """Set the ``auth_scheme`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_scheme"] = value
        return self

    def auth_credential(self, value: AuthCredential | None) -> Self:
        """Set the ``auth_credential`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_credential"] = value
        return self

    def apihub_client(self, value: APIHubClient | None) -> Self:
        """Set the ``apihub_client`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["apihub_client"] = value
        return self

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def build(self) -> _ADK_APIHubToolset:
        """APIHubTool generates tools from a given API Hub resource. Resolve into a native ADK _ADK_APIHubToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_APIHubToolset, config)
        return self._apply_native_hooks(result)


class ApplicationIntegrationToolset(BuilderBase):
    """ApplicationIntegrationToolset generates tools from a given Application."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "actions",
        "auth_credential",
        "auth_scheme",
        "connection",
        "connection_template_override",
        "entity_operations",
        "integration",
        "location",
        "project",
        "service_account_json",
        "tool_filter",
        "tool_instructions",
        "tool_name_prefix",
        "triggers",
    }

    def __init__(self, project: str, location: str) -> None:
        self._config: dict[str, Any] = {"project": project, "location": location}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def connection_template_override(self, value: str | None) -> Self:
        """Set the ``connection_template_override`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["connection_template_override"] = value
        return self

    def integration(self, value: str | None) -> Self:
        """Set the ``integration`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["integration"] = value
        return self

    def triggers(self, value: list[str] | None) -> Self:
        """Set the ``triggers`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["triggers"] = value
        return self

    def connection(self, value: str | None) -> Self:
        """Set the ``connection`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["connection"] = value
        return self

    def entity_operations(self, value: str | None) -> Self:
        """Set the ``entity_operations`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["entity_operations"] = value
        return self

    def actions(self, value: list[str] | None) -> Self:
        """Set the ``actions`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["actions"] = value
        return self

    def tool_name_prefix(self, value: str | None) -> Self:
        """Set the ``tool_name_prefix`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_name_prefix"] = value
        return self

    def tool_instructions(self, value: str | None) -> Self:
        """Set the ``tool_instructions`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_instructions"] = value
        return self

    def service_account_json(self, value: str | None) -> Self:
        """Set the ``service_account_json`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["service_account_json"] = value
        return self

    def auth_scheme(self, value: AuthScheme | None) -> Self:
        """Set the ``auth_scheme`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_scheme"] = value
        return self

    def auth_credential(self, value: AuthCredential | None) -> Self:
        """Set the ``auth_credential`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_credential"] = value
        return self

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def build(self) -> _ADK_ApplicationIntegrationToolset:
        """ApplicationIntegrationToolset generates tools from a given Application. Resolve into a native ADK _ADK_ApplicationIntegrationToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_ApplicationIntegrationToolset, config)
        return self._apply_native_hooks(result)


class IntegrationConnectorTool(BuilderBase):
    """A tool that wraps a RestApiTool to interact with a specific Application Integration endpoint."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "action",
        "auth_credential",
        "auth_scheme",
        "connection_host",
        "connection_name",
        "connection_service_name",
        "description",
        "entity",
        "name",
        "operation",
        "rest_api_tool",
    }

    def __init__(self, name: str, description: str, connection_name: str) -> None:
        self._config: dict[str, Any] = {"name": name, "description": description, "connection_name": connection_name}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def connection_host(self, value: str) -> Self:
        """Set the ``connection_host`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["connection_host"] = value
        return self

    def connection_service_name(self, value: str) -> Self:
        """Set the ``connection_service_name`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["connection_service_name"] = value
        return self

    def entity(self, value: str) -> Self:
        """Set the ``entity`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["entity"] = value
        return self

    def operation(self, value: str) -> Self:
        """Set the ``operation`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["operation"] = value
        return self

    def action(self, value: str) -> Self:
        """Set the ``action`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["action"] = value
        return self

    def rest_api_tool(self, value: RestApiTool) -> Self:
        """Set the ``rest_api_tool`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["rest_api_tool"] = value
        return self

    def auth_scheme(self, value: AuthScheme | str | None) -> Self:
        """Set the ``auth_scheme`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_scheme"] = value
        return self

    def auth_credential(self, value: AuthCredential | str | None) -> Self:
        """Set the ``auth_credential`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_credential"] = value
        return self

    def build(self) -> _ADK_IntegrationConnectorTool:
        """A tool that wraps a RestApiTool to interact with a specific Application Integration endpoint. Resolve into a native ADK _ADK_IntegrationConnectorTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_IntegrationConnectorTool, config)
        return self._apply_native_hooks(result)


class BaseAuthenticatedTool(BuilderBase):
    """A base tool class that handles authentication before the actual tool logic."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"auth_config", "description", "name", "response_for_auth_required"}

    def __init__(self, name: str, description: str) -> None:
        self._config: dict[str, Any] = {"name": name, "description": description}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def auth_config(self, value: AuthConfig) -> Self:
        """Set the ``auth_config`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_config"] = value
        return self

    def response_for_auth_required(self, value: dict[str, Any] | str | None) -> Self:
        """Set the ``response_for_auth_required`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["response_for_auth_required"] = value
        return self

    def build(self) -> _ADK_BaseAuthenticatedTool:
        """A base tool class that handles authentication before the actual tool logic. Resolve into a native ADK _ADK_BaseAuthenticatedTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_BaseAuthenticatedTool, config)
        return self._apply_native_hooks(result)


class BaseTool(BuilderBase):
    """The base class for all tools."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"custom_metadata", "description", "is_long_running", "name"}

    def __init__(self, name: str, description: str) -> None:
        self._config: dict[str, Any] = {"name": name, "description": description}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def is_long_running(self, value: bool) -> Self:
        """Set the ``is_long_running`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["is_long_running"] = value
        return self

    def custom_metadata(self, value: dict[str, Any] | None) -> Self:
        """Set the ``custom_metadata`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["custom_metadata"] = value
        return self

    def build(self) -> _ADK_BaseTool:
        """The base class for all tools. Resolve into a native ADK _ADK_BaseTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_BaseTool, config)
        return self._apply_native_hooks(result)


class BaseToolset(BuilderBase):
    """Base class for toolset."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"tool_filter", "tool_name_prefix"}

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def tool_name_prefix(self, value: str | None) -> Self:
        """Set the ``tool_name_prefix`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_name_prefix"] = value
        return self

    def build(self) -> _ADK_BaseToolset:
        """Base class for toolset. Resolve into a native ADK _ADK_BaseToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_BaseToolset, config)
        return self._apply_native_hooks(result)


class BigQueryToolset(BuilderBase):
    """BigQuery Toolset contains tools for interacting with BigQuery data and metadata."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"bigquery_tool_config", "credentials_config", "tool_filter"}

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def credentials_config(self, value: BigQueryCredentialsConfig | None) -> Self:
        """Set the ``credentials_config`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["credentials_config"] = value
        return self

    def bigquery_tool_config(self, value: BigQueryToolConfig | None) -> Self:
        """Set the ``bigquery_tool_config`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["bigquery_tool_config"] = value
        return self

    def build(self) -> _ADK_BigQueryToolset:
        """BigQuery Toolset contains tools for interacting with BigQuery data and metadata. Resolve into a native ADK _ADK_BigQueryToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_BigQueryToolset, config)
        return self._apply_native_hooks(result)


class BigtableToolset(BuilderBase):
    """Bigtable Toolset contains tools for interacting with Bigtable data and metadata."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"bigtable_tool_settings", "credentials_config", "tool_filter"}

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def credentials_config(self, value: BigtableCredentialsConfig | None) -> Self:
        """Set the ``credentials_config`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["credentials_config"] = value
        return self

    def bigtable_tool_settings(self, value: BigtableToolSettings | None) -> Self:
        """Set the ``bigtable_tool_settings`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["bigtable_tool_settings"] = value
        return self

    def build(self) -> _ADK_BigtableToolset:
        """Bigtable Toolset contains tools for interacting with Bigtable data and metadata. Resolve into a native ADK _ADK_BigtableToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_BigtableToolset, config)
        return self._apply_native_hooks(result)


class ComputerUseTool(BuilderBase):
    """A tool that wraps computer control functions for use with LLMs."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"func", "screen_size", "virtual_screen_size"}

    def __init__(self, func: str, screen_size: str) -> None:
        self._config: dict[str, Any] = {"func": func, "screen_size": screen_size}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def virtual_screen_size(self, value: tuple[int, int]) -> Self:
        """Set the ``virtual_screen_size`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["virtual_screen_size"] = value
        return self

    def build(self) -> _ADK_ComputerUseTool:
        """A tool that wraps computer control functions for use with LLMs. Resolve into a native ADK _ADK_ComputerUseTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_ComputerUseTool, config)
        return self._apply_native_hooks(result)


class ComputerUseToolset(BuilderBase):
    """Fluent builder for ComputerUseToolset."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"computer"}

    def __init__(self, computer: str) -> None:
        self._config: dict[str, Any] = {"computer": computer}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_ComputerUseToolset:
        """Fluent builder for ComputerUseToolset. Resolve into a native ADK _ADK_ComputerUseToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_ComputerUseToolset, config)
        return self._apply_native_hooks(result)


class DataAgentToolset(BuilderBase):
    """Data Agent Toolset contains tools for interacting with data agents."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"credentials_config", "data_agent_tool_config", "tool_filter"}

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def credentials_config(self, value: DataAgentCredentialsConfig | None) -> Self:
        """Set the ``credentials_config`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["credentials_config"] = value
        return self

    def data_agent_tool_config(self, value: DataAgentToolConfig | None) -> Self:
        """Set the ``data_agent_tool_config`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["data_agent_tool_config"] = value
        return self

    def build(self) -> _ADK_DataAgentToolset:
        """Data Agent Toolset contains tools for interacting with data agents. Resolve into a native ADK _ADK_DataAgentToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_DataAgentToolset, config)
        return self._apply_native_hooks(result)


class DiscoveryEngineSearchTool(BuilderBase):
    """Tool for searching the discovery engine."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"data_store_id", "data_store_specs", "filter", "max_results", "search_engine_id"}

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def data_store_id(self, value: str | None) -> Self:
        """Set the ``data_store_id`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["data_store_id"] = value
        return self

    def data_store_specs(self, value: list[VertexAISearchDataStoreSpec] | None) -> Self:
        """Set the ``data_store_specs`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["data_store_specs"] = value
        return self

    def search_engine_id(self, value: str | None) -> Self:
        """Set the ``search_engine_id`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["search_engine_id"] = value
        return self

    def filter(self, value: str | None) -> Self:
        """Set the ``filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["filter"] = value
        return self

    def max_results(self, value: int | None) -> Self:
        """Set the ``max_results`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["max_results"] = value
        return self

    def build(self) -> _ADK_DiscoveryEngineSearchTool:
        """Tool for searching the discovery engine. Resolve into a native ADK _ADK_DiscoveryEngineSearchTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_DiscoveryEngineSearchTool, config)
        return self._apply_native_hooks(result)


class EnterpriseWebSearchTool(BuilderBase):
    """A Gemini 2+ built-in tool using web grounding for Enterprise compliance."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = set()

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_EnterpriseWebSearchTool:
        """A Gemini 2+ built-in tool using web grounding for Enterprise compliance. Resolve into a native ADK _ADK_EnterpriseWebSearchTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_EnterpriseWebSearchTool, config)
        return self._apply_native_hooks(result)


class ExampleTool(BuilderBase):
    """A tool that adds (few-shot) examples to the LLM request."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"examples"}

    def __init__(self, examples: str) -> None:
        self._config: dict[str, Any] = {"examples": examples}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_ExampleTool:
        """A tool that adds (few-shot) examples to the LLM request. Resolve into a native ADK _ADK_ExampleTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_ExampleTool, config)
        return self._apply_native_hooks(result)


class FunctionTool(BuilderBase):
    """A tool that wraps a user-defined Python function."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"func", "require_confirmation"}

    def __init__(self, func: str) -> None:
        self._config: dict[str, Any] = {"func": func}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def require_confirmation(self, value: bool | Callable[..., bool]) -> Self:
        """Set the ``require_confirmation`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["require_confirmation"] = value
        return self

    def build(self) -> _ADK_FunctionTool:
        """A tool that wraps a user-defined Python function. Resolve into a native ADK _ADK_FunctionTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_FunctionTool, config)
        return self._apply_native_hooks(result)


class GoogleApiTool(BuilderBase):
    """Fluent builder for GoogleApiTool."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "additional_headers",
        "client_id",
        "client_secret",
        "rest_api_tool",
        "service_account",
    }

    def __init__(self, rest_api_tool: str) -> None:
        self._config: dict[str, Any] = {"rest_api_tool": rest_api_tool}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def client_id(self, value: str | None) -> Self:
        """Set the ``client_id`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_id"] = value
        return self

    def client_secret(self, value: str | None) -> Self:
        """Set the ``client_secret`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_secret"] = value
        return self

    def service_account(self, value: ServiceAccount | None) -> Self:
        """Set the ``service_account`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["service_account"] = value
        return self

    def additional_headers(self, value: dict[str, str] | None) -> Self:
        """Set the ``additional_headers`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["additional_headers"] = value
        return self

    def build(self) -> _ADK_GoogleApiTool:
        """Fluent builder for GoogleApiTool. Resolve into a native ADK _ADK_GoogleApiTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_GoogleApiTool, config)
        return self._apply_native_hooks(result)


class GoogleApiToolset(BuilderBase):
    """Google API Toolset contains tools for interacting with Google APIs."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "additional_headers",
        "api_name",
        "api_version",
        "client_id",
        "client_secret",
        "service_account",
        "tool_filter",
        "tool_name_prefix",
    }

    def __init__(self, api_name: str, api_version: str) -> None:
        self._config: dict[str, Any] = {"api_name": api_name, "api_version": api_version}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def client_id(self, value: str | None) -> Self:
        """Set the ``client_id`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_id"] = value
        return self

    def client_secret(self, value: str | None) -> Self:
        """Set the ``client_secret`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_secret"] = value
        return self

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def service_account(self, value: ServiceAccount | None) -> Self:
        """Set the ``service_account`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["service_account"] = value
        return self

    def tool_name_prefix(self, value: str | None) -> Self:
        """Set the ``tool_name_prefix`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_name_prefix"] = value
        return self

    def additional_headers(self, value: dict[str, str] | None) -> Self:
        """Set the ``additional_headers`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["additional_headers"] = value
        return self

    def build(self) -> _ADK_GoogleApiToolset:
        """Google API Toolset contains tools for interacting with Google APIs. Resolve into a native ADK _ADK_GoogleApiToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_GoogleApiToolset, config)
        return self._apply_native_hooks(result)


class CalendarToolset(BuilderBase):
    """Auto-generated Calendar toolset based on Google Calendar API v3 spec exposed by Google API discovery API."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "client_id",
        "client_secret",
        "service_account",
        "tool_filter",
        "tool_name_prefix",
    }

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def client_id(self, value: str | None) -> Self:
        """Set the ``client_id`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_id"] = value
        return self

    def client_secret(self, value: str | None) -> Self:
        """Set the ``client_secret`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_secret"] = value
        return self

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def service_account(self, value: ServiceAccount | None) -> Self:
        """Set the ``service_account`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["service_account"] = value
        return self

    def tool_name_prefix(self, value: str | None) -> Self:
        """Set the ``tool_name_prefix`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_name_prefix"] = value
        return self

    def build(self) -> _ADK_CalendarToolset:
        """Auto-generated Calendar toolset based on Google Calendar API v3 spec exposed by Google API discovery API. Resolve into a native ADK _ADK_CalendarToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_CalendarToolset, config)
        return self._apply_native_hooks(result)


class DocsToolset(BuilderBase):
    """Auto-generated Docs toolset based on Google Docs API v1 spec exposed by Google API discovery API."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "client_id",
        "client_secret",
        "service_account",
        "tool_filter",
        "tool_name_prefix",
    }

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def client_id(self, value: str | None) -> Self:
        """Set the ``client_id`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_id"] = value
        return self

    def client_secret(self, value: str | None) -> Self:
        """Set the ``client_secret`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_secret"] = value
        return self

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def service_account(self, value: ServiceAccount | None) -> Self:
        """Set the ``service_account`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["service_account"] = value
        return self

    def tool_name_prefix(self, value: str | None) -> Self:
        """Set the ``tool_name_prefix`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_name_prefix"] = value
        return self

    def build(self) -> _ADK_DocsToolset:
        """Auto-generated Docs toolset based on Google Docs API v1 spec exposed by Google API discovery API. Resolve into a native ADK _ADK_DocsToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_DocsToolset, config)
        return self._apply_native_hooks(result)


class GmailToolset(BuilderBase):
    """Auto-generated Gmail toolset based on Google Gmail API v1 spec exposed by Google API discovery API."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "client_id",
        "client_secret",
        "service_account",
        "tool_filter",
        "tool_name_prefix",
    }

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def client_id(self, value: str | None) -> Self:
        """Set the ``client_id`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_id"] = value
        return self

    def client_secret(self, value: str | None) -> Self:
        """Set the ``client_secret`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_secret"] = value
        return self

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def service_account(self, value: ServiceAccount | None) -> Self:
        """Set the ``service_account`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["service_account"] = value
        return self

    def tool_name_prefix(self, value: str | None) -> Self:
        """Set the ``tool_name_prefix`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_name_prefix"] = value
        return self

    def build(self) -> _ADK_GmailToolset:
        """Auto-generated Gmail toolset based on Google Gmail API v1 spec exposed by Google API discovery API. Resolve into a native ADK _ADK_GmailToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_GmailToolset, config)
        return self._apply_native_hooks(result)


class SheetsToolset(BuilderBase):
    """Auto-generated Sheets toolset based on Google Sheets API v4 spec exposed by Google API discovery API."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "client_id",
        "client_secret",
        "service_account",
        "tool_filter",
        "tool_name_prefix",
    }

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def client_id(self, value: str | None) -> Self:
        """Set the ``client_id`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_id"] = value
        return self

    def client_secret(self, value: str | None) -> Self:
        """Set the ``client_secret`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_secret"] = value
        return self

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def service_account(self, value: ServiceAccount | None) -> Self:
        """Set the ``service_account`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["service_account"] = value
        return self

    def tool_name_prefix(self, value: str | None) -> Self:
        """Set the ``tool_name_prefix`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_name_prefix"] = value
        return self

    def build(self) -> _ADK_SheetsToolset:
        """Auto-generated Sheets toolset based on Google Sheets API v4 spec exposed by Google API discovery API. Resolve into a native ADK _ADK_SheetsToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_SheetsToolset, config)
        return self._apply_native_hooks(result)


class SlidesToolset(BuilderBase):
    """Auto-generated Slides toolset based on Google Slides API v1 spec exposed by Google API discovery API."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "client_id",
        "client_secret",
        "service_account",
        "tool_filter",
        "tool_name_prefix",
    }

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def client_id(self, value: str | None) -> Self:
        """Set the ``client_id`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_id"] = value
        return self

    def client_secret(self, value: str | None) -> Self:
        """Set the ``client_secret`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_secret"] = value
        return self

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def service_account(self, value: ServiceAccount | None) -> Self:
        """Set the ``service_account`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["service_account"] = value
        return self

    def tool_name_prefix(self, value: str | None) -> Self:
        """Set the ``tool_name_prefix`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_name_prefix"] = value
        return self

    def build(self) -> _ADK_SlidesToolset:
        """Auto-generated Slides toolset based on Google Slides API v1 spec exposed by Google API discovery API. Resolve into a native ADK _ADK_SlidesToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_SlidesToolset, config)
        return self._apply_native_hooks(result)


class YoutubeToolset(BuilderBase):
    """Auto-generated YouTube toolset based on YouTube API v3 spec exposed by Google API discovery API."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "client_id",
        "client_secret",
        "service_account",
        "tool_filter",
        "tool_name_prefix",
    }

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def client_id(self, value: str | None) -> Self:
        """Set the ``client_id`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_id"] = value
        return self

    def client_secret(self, value: str | None) -> Self:
        """Set the ``client_secret`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["client_secret"] = value
        return self

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def service_account(self, value: ServiceAccount | None) -> Self:
        """Set the ``service_account`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["service_account"] = value
        return self

    def tool_name_prefix(self, value: str | None) -> Self:
        """Set the ``tool_name_prefix`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_name_prefix"] = value
        return self

    def build(self) -> _ADK_YoutubeToolset:
        """Auto-generated YouTube toolset based on YouTube API v3 spec exposed by Google API discovery API. Resolve into a native ADK _ADK_YoutubeToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_YoutubeToolset, config)
        return self._apply_native_hooks(result)


class GoogleMapsGroundingTool(BuilderBase):
    """A built-in tool that is automatically invoked by Gemini 2 models to ground query results with Google Maps."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = set()

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_GoogleMapsGroundingTool:
        """A built-in tool that is automatically invoked by Gemini 2 models to ground query results with Google Maps. Resolve into a native ADK _ADK_GoogleMapsGroundingTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_GoogleMapsGroundingTool, config)
        return self._apply_native_hooks(result)


class GoogleSearchAgentTool(BuilderBase):
    """A tool that wraps a sub-agent that only uses google_search tool."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"agent"}

    def __init__(self, agent: str) -> None:
        self._config: dict[str, Any] = {"agent": agent}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_GoogleSearchAgentTool:
        """A tool that wraps a sub-agent that only uses google_search tool. Resolve into a native ADK _ADK_GoogleSearchAgentTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_GoogleSearchAgentTool, config)
        return self._apply_native_hooks(result)


class GoogleSearchTool(BuilderBase):
    """A built-in tool that is automatically invoked by Gemini 2 models to retrieve search results from Google Search."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"bypass_multi_tools_limit", "model"}

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def bypass_multi_tools_limit(self, value: bool) -> Self:
        """Set the ``bypass_multi_tools_limit`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["bypass_multi_tools_limit"] = value
        return self

    def model(self, value: str | None) -> Self:
        """Set the ``model`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["model"] = value
        return self

    def build(self) -> _ADK_GoogleSearchTool:
        """A built-in tool that is automatically invoked by Gemini 2 models to retrieve search results from Google Search. Resolve into a native ADK _ADK_GoogleSearchTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_GoogleSearchTool, config)
        return self._apply_native_hooks(result)


class GoogleTool(BuilderBase):
    """GoogleTool class for tools that call Google APIs."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"credentials_config", "func", "tool_settings"}

    def __init__(self, func: str) -> None:
        self._config: dict[str, Any] = {"func": func}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def credentials_config(self, value: BaseGoogleCredentialsConfig | None) -> Self:
        """Set the ``credentials_config`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["credentials_config"] = value
        return self

    def tool_settings(self, value: BaseModel | None) -> Self:
        """Set the ``tool_settings`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_settings"] = value
        return self

    def build(self) -> _ADK_GoogleTool:
        """GoogleTool class for tools that call Google APIs. Resolve into a native ADK _ADK_GoogleTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_GoogleTool, config)
        return self._apply_native_hooks(result)


class LoadArtifactsTool(BuilderBase):
    """A tool that loads the artifacts and adds them to the session."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = set()

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_LoadArtifactsTool:
        """A tool that loads the artifacts and adds them to the session. Resolve into a native ADK _ADK_LoadArtifactsTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_LoadArtifactsTool, config)
        return self._apply_native_hooks(result)


class LoadMcpResourceTool(BuilderBase):
    """A tool that loads the MCP resources and adds them to the session."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"mcp_toolset"}

    def __init__(self, mcp_toolset: str) -> None:
        self._config: dict[str, Any] = {"mcp_toolset": mcp_toolset}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_LoadMcpResourceTool:
        """A tool that loads the MCP resources and adds them to the session. Resolve into a native ADK _ADK_LoadMcpResourceTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_LoadMcpResourceTool, config)
        return self._apply_native_hooks(result)


class LoadMemoryTool(BuilderBase):
    """A tool that loads the memory for the current user."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = set()

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_LoadMemoryTool:
        """A tool that loads the memory for the current user. Resolve into a native ADK _ADK_LoadMemoryTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_LoadMemoryTool, config)
        return self._apply_native_hooks(result)


class LongRunningFunctionTool(BuilderBase):
    """A function tool that returns the result asynchronously."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"func"}

    def __init__(self, func: str) -> None:
        self._config: dict[str, Any] = {"func": func}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_LongRunningFunctionTool:
        """A function tool that returns the result asynchronously. Resolve into a native ADK _ADK_LongRunningFunctionTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_LongRunningFunctionTool, config)
        return self._apply_native_hooks(result)


class MCPTool(BuilderBase):
    """Deprecated name, use `McpTool` instead."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = set()

    def __init__(self, args: str, kwargs: str) -> None:
        self._config: dict[str, Any] = {"args": args, "kwargs": kwargs}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_MCPTool:
        """Deprecated name, use `McpTool` instead. Resolve into a native ADK _ADK_MCPTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_MCPTool, config)
        return self._apply_native_hooks(result)


class McpTool(BuilderBase):
    """Turns an MCP Tool into an ADK Tool."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "auth_credential",
        "auth_scheme",
        "header_provider",
        "mcp_session_manager",
        "mcp_tool",
        "progress_callback",
        "require_confirmation",
    }

    def __init__(self, mcp_tool: str, mcp_session_manager: str) -> None:
        self._config: dict[str, Any] = {"mcp_tool": mcp_tool, "mcp_session_manager": mcp_session_manager}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def auth_scheme(self, value: AuthScheme | None) -> Self:
        """Set the ``auth_scheme`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_scheme"] = value
        return self

    def auth_credential(self, value: AuthCredential | None) -> Self:
        """Set the ``auth_credential`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_credential"] = value
        return self

    def require_confirmation(self, value: bool | Callable[..., bool]) -> Self:
        """Set the ``require_confirmation`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["require_confirmation"] = value
        return self

    def header_provider(self, value: Callable[[ReadonlyContext], dict[str, str]] | None) -> Self:
        """Set the ``header_provider`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["header_provider"] = value
        return self

    def progress_callback(self, value: ProgressFnT | ProgressCallbackFactory | None) -> Self:
        """Set the ``progress_callback`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["progress_callback"] = value
        return self

    def build(self) -> _ADK_McpTool:
        """Turns an MCP Tool into an ADK Tool. Resolve into a native ADK _ADK_McpTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_McpTool, config)
        return self._apply_native_hooks(result)


class MCPToolset(BuilderBase):
    """Deprecated name, use `McpToolset` instead."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = set()

    def __init__(self, args: str, kwargs: str) -> None:
        self._config: dict[str, Any] = {"args": args, "kwargs": kwargs}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_MCPToolset:
        """Deprecated name, use `McpToolset` instead. Resolve into a native ADK _ADK_MCPToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_MCPToolset, config)
        return self._apply_native_hooks(result)


class McpToolset(BuilderBase):
    """Connects to a MCP Server, and retrieves MCP Tools into ADK Tools."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "auth_credential",
        "auth_scheme",
        "connection_params",
        "errlog",
        "header_provider",
        "progress_callback",
        "require_confirmation",
        "tool_filter",
        "tool_name_prefix",
        "use_mcp_resources",
    }

    def __init__(self, connection_params: str) -> None:
        self._config: dict[str, Any] = {"connection_params": connection_params}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def tool_name_prefix(self, value: str | None) -> Self:
        """Set the ``tool_name_prefix`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_name_prefix"] = value
        return self

    def errlog(self, value: TextIO) -> Self:
        """Set the ``errlog`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["errlog"] = value
        return self

    def auth_scheme(self, value: AuthScheme | None) -> Self:
        """Set the ``auth_scheme`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_scheme"] = value
        return self

    def auth_credential(self, value: AuthCredential | None) -> Self:
        """Set the ``auth_credential`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_credential"] = value
        return self

    def require_confirmation(self, value: bool | Callable[..., bool]) -> Self:
        """Set the ``require_confirmation`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["require_confirmation"] = value
        return self

    def header_provider(self, value: Callable[[ReadonlyContext], dict[str, str]] | None) -> Self:
        """Set the ``header_provider`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["header_provider"] = value
        return self

    def progress_callback(self, value: ProgressFnT | ProgressCallbackFactory | None) -> Self:
        """Set the ``progress_callback`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["progress_callback"] = value
        return self

    def use_mcp_resources(self, value: bool | None) -> Self:
        """Set the ``use_mcp_resources`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["use_mcp_resources"] = value
        return self

    def build(self) -> _ADK_McpToolset:
        """Connects to a MCP Server, and retrieves MCP Tools into ADK Tools. Resolve into a native ADK _ADK_McpToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_McpToolset, config)
        return self._apply_native_hooks(result)


class OpenAPIToolset(BuilderBase):
    """Class for parsing OpenAPI spec into a list of RestApiTool."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "auth_credential",
        "auth_scheme",
        "credential_key",
        "header_provider",
        "spec_dict",
        "spec_str",
        "spec_str_type",
        "ssl_verify",
        "tool_filter",
        "tool_name_prefix",
    }

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def spec_dict(self, value: dict[str, Any] | None) -> Self:
        """Set the ``spec_dict`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["spec_dict"] = value
        return self

    def spec_str(self, value: str | None) -> Self:
        """Set the ``spec_str`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["spec_str"] = value
        return self

    def spec_str_type(self, value: Literal["json", "yaml"]) -> Self:
        """Set the ``spec_str_type`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["spec_str_type"] = value
        return self

    def auth_scheme(self, value: AuthScheme | None) -> Self:
        """Set the ``auth_scheme`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_scheme"] = value
        return self

    def auth_credential(self, value: AuthCredential | None) -> Self:
        """Set the ``auth_credential`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_credential"] = value
        return self

    def credential_key(self, value: str | None) -> Self:
        """Set the ``credential_key`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["credential_key"] = value
        return self

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def tool_name_prefix(self, value: str | None) -> Self:
        """Set the ``tool_name_prefix`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_name_prefix"] = value
        return self

    def ssl_verify(self, value: bool | str | ssl.SSLContext | None) -> Self:
        """Set the ``ssl_verify`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["ssl_verify"] = value
        return self

    def header_provider(self, value: Callable[[ReadonlyContext], dict[str, str]] | None) -> Self:
        """Set the ``header_provider`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["header_provider"] = value
        return self

    def build(self) -> _ADK_OpenAPIToolset:
        """Class for parsing OpenAPI spec into a list of RestApiTool. Resolve into a native ADK _ADK_OpenAPIToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_OpenAPIToolset, config)
        return self._apply_native_hooks(result)


class RestApiTool(BuilderBase):
    """A generic tool that interacts with a REST API."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "auth_credential",
        "auth_scheme",
        "credential_key",
        "description",
        "endpoint",
        "header_provider",
        "name",
        "operation",
        "should_parse_operation",
        "ssl_verify",
    }

    def __init__(self, name: str, description: str, endpoint: str) -> None:
        self._config: dict[str, Any] = {"name": name, "description": description, "endpoint": endpoint}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def operation(self, value: Operation | str) -> Self:
        """Set the ``operation`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["operation"] = value
        return self

    def auth_scheme(self, value: AuthScheme | str | None) -> Self:
        """Set the ``auth_scheme`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_scheme"] = value
        return self

    def auth_credential(self, value: AuthCredential | str | None) -> Self:
        """Set the ``auth_credential`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_credential"] = value
        return self

    def should_parse_operation(self, value: Any) -> Self:
        """Set the ``should_parse_operation`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["should_parse_operation"] = value
        return self

    def ssl_verify(self, value: bool | str | ssl.SSLContext | None) -> Self:
        """Set the ``ssl_verify`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["ssl_verify"] = value
        return self

    def header_provider(self, value: Callable[[ReadonlyContext], dict[str, str]] | None) -> Self:
        """Set the ``header_provider`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["header_provider"] = value
        return self

    def credential_key(self, value: str | None) -> Self:
        """Set the ``credential_key`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["credential_key"] = value
        return self

    def build(self) -> _ADK_RestApiTool:
        """A generic tool that interacts with a REST API. Resolve into a native ADK _ADK_RestApiTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_RestApiTool, config)
        return self._apply_native_hooks(result)


class PreloadMemoryTool(BuilderBase):
    """A tool that preloads the memory for the current user."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = set()

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_PreloadMemoryTool:
        """A tool that preloads the memory for the current user. Resolve into a native ADK _ADK_PreloadMemoryTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_PreloadMemoryTool, config)
        return self._apply_native_hooks(result)


class PubSubToolset(BuilderBase):
    """Pub/Sub Toolset contains tools for interacting with Pub/Sub topics and subscriptions."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"credentials_config", "pubsub_tool_config", "tool_filter"}

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def credentials_config(self, value: PubSubCredentialsConfig | None) -> Self:
        """Set the ``credentials_config`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["credentials_config"] = value
        return self

    def pubsub_tool_config(self, value: PubSubToolConfig | None) -> Self:
        """Set the ``pubsub_tool_config`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["pubsub_tool_config"] = value
        return self

    def build(self) -> _ADK_PubSubToolset:
        """Pub/Sub Toolset contains tools for interacting with Pub/Sub topics and subscriptions. Resolve into a native ADK _ADK_PubSubToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_PubSubToolset, config)
        return self._apply_native_hooks(result)


class BaseRetrievalTool(BuilderBase):
    """Fluent builder for BaseRetrievalTool."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"custom_metadata", "description", "is_long_running", "name"}

    def __init__(self, name: str, description: str) -> None:
        self._config: dict[str, Any] = {"name": name, "description": description}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def is_long_running(self, value: bool) -> Self:
        """Set the ``is_long_running`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["is_long_running"] = value
        return self

    def custom_metadata(self, value: dict[str, Any] | None) -> Self:
        """Set the ``custom_metadata`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["custom_metadata"] = value
        return self

    def build(self) -> _ADK_BaseRetrievalTool:
        """Fluent builder for BaseRetrievalTool. Resolve into a native ADK _ADK_BaseRetrievalTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_BaseRetrievalTool, config)
        return self._apply_native_hooks(result)


class SetModelResponseTool(BuilderBase):
    """Internal tool used for output schema workaround."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"output_schema"}

    def __init__(self, output_schema: str) -> None:
        self._config: dict[str, Any] = {"output_schema": output_schema}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_SetModelResponseTool:
        """Internal tool used for output schema workaround. Resolve into a native ADK _ADK_SetModelResponseTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_SetModelResponseTool, config)
        return self._apply_native_hooks(result)


class LoadSkillResourceTool(BuilderBase):
    """Tool to load resources (references or assets) from a skill."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"toolset"}

    def __init__(self, toolset: str) -> None:
        self._config: dict[str, Any] = {"toolset": toolset}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_LoadSkillResourceTool:
        """Tool to load resources (references or assets) from a skill. Resolve into a native ADK _ADK_LoadSkillResourceTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_LoadSkillResourceTool, config)
        return self._apply_native_hooks(result)


class LoadSkillTool(BuilderBase):
    """Tool to load a skill's instructions."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"toolset"}

    def __init__(self, toolset: str) -> None:
        self._config: dict[str, Any] = {"toolset": toolset}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_LoadSkillTool:
        """Tool to load a skill's instructions. Resolve into a native ADK _ADK_LoadSkillTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_LoadSkillTool, config)
        return self._apply_native_hooks(result)


class SkillToolset(BuilderBase):
    """A toolset for managing and interacting with agent skills."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"skills"}

    def __init__(self, skills: str) -> None:
        self._config: dict[str, Any] = {"skills": skills}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_SkillToolset:
        """A toolset for managing and interacting with agent skills. Resolve into a native ADK _ADK_SkillToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_SkillToolset, config)
        return self._apply_native_hooks(result)


class SpannerToolset(BuilderBase):
    """Spanner Toolset contains tools for interacting with Spanner data, database and table information."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"credentials_config", "spanner_tool_settings", "tool_filter"}

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def tool_filter(self, value: ToolPredicate | list[str] | None) -> Self:
        """Set the ``tool_filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_filter"] = value
        return self

    def credentials_config(self, value: SpannerCredentialsConfig | None) -> Self:
        """Set the ``credentials_config`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["credentials_config"] = value
        return self

    def spanner_tool_settings(self, value: SpannerToolSettings | None) -> Self:
        """Set the ``spanner_tool_settings`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["spanner_tool_settings"] = value
        return self

    def build(self) -> _ADK_SpannerToolset:
        """Spanner Toolset contains tools for interacting with Spanner data, database and table information. Resolve into a native ADK _ADK_SpannerToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_SpannerToolset, config)
        return self._apply_native_hooks(result)


class ToolboxToolset(BuilderBase):
    """A class that provides access to toolbox toolsets."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "additional_headers",
        "auth_token_getters",
        "bound_params",
        "credentials",
        "server_url",
        "tool_names",
        "toolset_name",
    }

    def __init__(self, server_url: str, kwargs: str) -> None:
        self._config: dict[str, Any] = {"server_url": server_url, "kwargs": kwargs}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def toolset_name(self, value: str | None) -> Self:
        """Set the ``toolset_name`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["toolset_name"] = value
        return self

    def tool_names(self, value: list[str] | None) -> Self:
        """Set the ``tool_names`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["tool_names"] = value
        return self

    def auth_token_getters(self, value: Mapping[str, Callable[[], str]] | None) -> Self:
        """Set the ``auth_token_getters`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["auth_token_getters"] = value
        return self

    def bound_params(self, value: Mapping[str, Callable[[], Any] | Any] | None) -> Self:
        """Set the ``bound_params`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["bound_params"] = value
        return self

    def credentials(self, value: Any | None) -> Self:
        """Set the ``credentials`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["credentials"] = value
        return self

    def additional_headers(self, value: Mapping[str, str] | None) -> Self:
        """Set the ``additional_headers`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["additional_headers"] = value
        return self

    def build(self) -> _ADK_ToolboxToolset:
        """A class that provides access to toolbox toolsets. Resolve into a native ADK _ADK_ToolboxToolset."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_ToolboxToolset, config)
        return self._apply_native_hooks(result)


class TransferToAgentTool(BuilderBase):
    """A specialized FunctionTool for agent transfer with enum constraints."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {"agent_names"}

    def __init__(self, agent_names: str) -> None:
        self._config: dict[str, Any] = {"agent_names": agent_names}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_TransferToAgentTool:
        """A specialized FunctionTool for agent transfer with enum constraints. Resolve into a native ADK _ADK_TransferToAgentTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_TransferToAgentTool, config)
        return self._apply_native_hooks(result)


class UrlContextTool(BuilderBase):
    """A built-in tool that is automatically invoked by Gemini 2 models to retrieve content from the URLs and use that content to inform and shape its response."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = set()

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def build(self) -> _ADK_UrlContextTool:
        """A built-in tool that is automatically invoked by Gemini 2 models to retrieve content from the URLs and use that content to inform and shape its response. Resolve into a native ADK _ADK_UrlContextTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_UrlContextTool, config)
        return self._apply_native_hooks(result)


class VertexAiSearchTool(BuilderBase):
    """A built-in tool using Vertex AI Search."""

    _ALIASES: dict[str, str] = {}
    _CALLBACK_ALIASES: dict[str, str] = {}
    _ADDITIVE_FIELDS: set[str] = set()
    _KNOWN_PARAMS: set[str] | None = {
        "bypass_multi_tools_limit",
        "data_store_id",
        "data_store_specs",
        "filter",
        "max_results",
        "search_engine_id",
    }

    def __init__(self) -> None:
        self._config: dict[str, Any] = {}
        self._callbacks: dict[str, list[Callable]] = defaultdict(list)
        self._lists: dict[str, list] = defaultdict(list)
        self._frozen = False

    def data_store_id(self, value: str | None) -> Self:
        """Set the ``data_store_id`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["data_store_id"] = value
        return self

    def data_store_specs(self, value: list[VertexAISearchDataStoreSpec] | None) -> Self:
        """Set the ``data_store_specs`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["data_store_specs"] = value
        return self

    def search_engine_id(self, value: str | None) -> Self:
        """Set the ``search_engine_id`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["search_engine_id"] = value
        return self

    def filter(self, value: str | None) -> Self:
        """Set the ``filter`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["filter"] = value
        return self

    def max_results(self, value: int | None) -> Self:
        """Set the ``max_results`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["max_results"] = value
        return self

    def bypass_multi_tools_limit(self, value: bool) -> Self:
        """Set the ``bypass_multi_tools_limit`` field."""
        self = self._maybe_fork_for_mutation()
        self._config["bypass_multi_tools_limit"] = value
        return self

    def build(self) -> _ADK_VertexAiSearchTool:
        """A built-in tool using Vertex AI Search. Resolve into a native ADK _ADK_VertexAiSearchTool."""
        config = self._prepare_build_config()
        result = self._safe_build(_ADK_VertexAiSearchTool, config)
        return self._apply_native_hooks(result)
