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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .client_grant_default_for_enum import ClientGrantDefaultForEnum
from .client_grant_organization_usage_enum import ClientGrantOrganizationUsageEnum
from .client_grant_subject_type_enum import ClientGrantSubjectTypeEnum


class CreateClientGrantResponseContent(UniversalBaseModel):
    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of the client grant.
    """

    client_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of the client.
    """

    audience: typing.Optional[str] = pydantic.Field(default=None)
    """
    The audience (API identifier) of this client grant.
    """

    scope: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Scopes allowed for this client grant.
    """

    organization_usage: typing.Optional[ClientGrantOrganizationUsageEnum] = None
    allow_any_organization: typing.Optional[bool] = pydantic.Field(default=None)
    """
    If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations.
    """

    default_for: typing.Optional[ClientGrantDefaultForEnum] = None
    is_system: typing.Optional[bool] = pydantic.Field(default=None)
    """
    If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly.
    """

    subject_type: typing.Optional[ClientGrantSubjectTypeEnum] = None
    authorization_details_types: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Types of authorization_details allowed for this client grant.
    """

    allow_all_scopes: typing.Optional[bool] = pydantic.Field(default=None)
    """
    If enabled, all scopes configured on the resource server are allowed for this grant.
    """

    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
