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

from ...core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .mcp_token_scope import McpTokenScope
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class CreateMcpTokenRequest(UncheckedBaseModel):
    token_ttl: typing.Optional[str] = pydantic.Field(default=None)
    """
    Token time-to-live. If not provided, defaults to 1 hour. May be set to a maximum of 24 hours. Use the format "1h", "1m", "1s" for hours, minutes, and seconds respectively, e.g., "2h" for 2 hours.
    """

    scope: McpTokenScope = pydantic.Field()
    """
    Controls the tools that are available to the MCP server,
    and the APIs that can be accessed by the MCP server.
    """

    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
