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

from ..core.pydantic_utilities import UniversalBaseModel
from .consent_type import ConsentType
import pydantic
import typing
import datetime as dt
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class Consent(UniversalBaseModel):
    consent_type: ConsentType = pydantic.Field(alias="consentType")
    version: typing.Optional[str] = None
    time_of_consent: typing.Optional[dt.datetime] = pydantic.Field(alias="timeOfConsent", default=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
