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

from ..core.pydantic_utilities import UniversalBaseModel
import pydantic
import typing
from .api_role import ApiRole
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CreateClientCredentialsRequest(UniversalBaseModel):
    """
    Create an App Client which allows you to call Vectara APIs using OAuth 2.0 client credentials.
    """

    name: str = pydantic.Field()
    """
    Name of the client credentials.
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    Description of the client credentials.
    """

    type: typing.Literal["client_credentials"] = "client_credentials"
    api_roles: typing.Optional[typing.List[ApiRole]] = pydantic.Field(default=None)
    """
    API roles that the client credentials will have.
    """

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

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