# 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 .resource_server_proof_of_possession_mechanism_enum import ResourceServerProofOfPossessionMechanismEnum
from .resource_server_proof_of_possession_required_for_enum import ResourceServerProofOfPossessionRequiredForEnum


class ResourceServerProofOfPossession(UniversalBaseModel):
    """
    Proof-of-Possession configuration for access tokens
    """

    mechanism: ResourceServerProofOfPossessionMechanismEnum
    required: bool = pydantic.Field()
    """
    Whether the use of Proof-of-Possession is required for the resource server
    """

    required_for: typing.Optional[ResourceServerProofOfPossessionRequiredForEnum] = None

    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
