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

import datetime as dt
import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .forms_polymorphic_user_object_response_body import FormsPolymorphicUserObjectResponseBody
from .qualification_field_input_object_response_body import QualificationFieldInputObjectResponseBody
from .qualification_owner_object_response_body import QualificationOwnerObjectResponseBody
from .qualification_record_response_object_response_body_record_status import (
    QualificationRecordResponseObjectResponseBodyRecordStatus,
)
from .qualification_type_reference_object_response_body import QualificationTypeReferenceObjectResponseBody


class QualificationRecordResponseObjectResponseBody(UniversalBaseModel):
    """
    Qualification Record response object.
    """

    created_at_time: typing_extensions.Annotated[
        dt.datetime,
        FieldMetadata(alias="createdAtTime"),
        pydantic.Field(alias="createdAtTime", description="Creation time. UTC timestamp in RFC 3339 format."),
    ]
    created_by: typing_extensions.Annotated[
        FormsPolymorphicUserObjectResponseBody, FieldMetadata(alias="createdBy"), pydantic.Field(alias="createdBy")
    ]
    expiration_date: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="expirationDate"),
        pydantic.Field(alias="expirationDate", description="Expiration date. UTC timestamp in RFC 3339 format."),
    ] = None
    external_ids: typing_extensions.Annotated[
        typing.Optional[typing.Dict[str, str]],
        FieldMetadata(alias="externalIds"),
        pydantic.Field(alias="externalIds", description="A map of external ids"),
    ] = None
    fields: typing.List[QualificationFieldInputObjectResponseBody] = pydantic.Field()
    """
    List of field inputs in a qualification record.
    """

    id: str = pydantic.Field()
    """
    ID of the qualification record.
    """

    issue_date: typing_extensions.Annotated[
        dt.datetime,
        FieldMetadata(alias="issueDate"),
        pydantic.Field(alias="issueDate", description="Issue/effective date. UTC timestamp in RFC 3339 format."),
    ]
    owner: QualificationOwnerObjectResponseBody
    qualification_type: typing_extensions.Annotated[
        QualificationTypeReferenceObjectResponseBody,
        FieldMetadata(alias="qualificationType"),
        pydantic.Field(alias="qualificationType"),
    ]
    record_status: typing_extensions.Annotated[
        QualificationRecordResponseObjectResponseBodyRecordStatus,
        FieldMetadata(alias="recordStatus"),
        pydantic.Field(
            alias="recordStatus",
            description="Status of the qualification record.  Valid values: `active`, `archived`, `deleted`",
        ),
    ]
    updated_at_time: typing_extensions.Annotated[
        dt.datetime,
        FieldMetadata(alias="updatedAtTime"),
        pydantic.Field(alias="updatedAtTime", description="Last updated time. UTC timestamp in RFC 3339 format."),
    ]
    updated_by: typing_extensions.Annotated[
        FormsPolymorphicUserObjectResponseBody, FieldMetadata(alias="updatedBy"), pydantic.Field(alias="updatedBy")
    ]

    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
