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

from __future__ import annotations
from ...core.unchecked_base_model import UncheckedBaseModel
import typing
from ...organization_base.types.environment import Environment
from ...account_base.types.account_id import AccountId
from ...core.pydantic_utilities import IS_PYDANTIC_V2
import pydantic
from ...operation_id_generated.types.operation_id import OperationId
import typing_extensions
from ...core.unchecked_base_model import UnionMetadata


class McpTokenScope_Management(UncheckedBaseModel):
    type: typing.Literal["management"] = "management"
    environment: typing.Optional[Environment] = None
    account_id: typing.Optional[AccountId] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
            extra="allow"
        )  # type: ignore # Pydantic v2
    else:

        class Config:
            smart_union = True
            extra = pydantic.Extra.allow


class McpTokenScope_IntegrationUsage(UncheckedBaseModel):
    type: typing.Literal["integration-usage"] = "integration-usage"
    account_id: AccountId
    restrict_to_connector_operations: typing.Optional[typing.List[OperationId]] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
            extra="allow"
        )  # type: ignore # Pydantic v2
    else:

        class Config:
            smart_union = True
            extra = pydantic.Extra.allow


class McpTokenScope_Developer(UncheckedBaseModel):
    type: typing.Literal["developer"] = "developer"
    account_id: AccountId

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(
            extra="allow"
        )  # type: ignore # Pydantic v2
    else:

        class Config:
            smart_union = True
            extra = pydantic.Extra.allow


McpTokenScope = typing_extensions.Annotated[
    typing.Union[
        McpTokenScope_Management,
        McpTokenScope_IntegrationUsage,
        McpTokenScope_Developer,
    ],
    UnionMetadata(discriminant="type"),
]
