# 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_field_definition_object_response_body import FormsFieldDefinitionObjectResponseBody
from .forms_polymorphic_user_object_response_body import FormsPolymorphicUserObjectResponseBody
from .qualification_type_response_object_response_body_entity_type import (
    QualificationTypeResponseObjectResponseBodyEntityType,
)


class QualificationTypeResponseObjectResponseBody(UniversalBaseModel):
    """
    Qualification type response object.
    """

    created_at_time: typing_extensions.Annotated[
        dt.datetime,
        FieldMetadata(alias="createdAtTime"),
        pydantic.Field(
            alias="createdAtTime",
            description="Creation time of the qualification type. UTC timestamp in RFC 3339 format.",
        ),
    ]
    created_by: typing_extensions.Annotated[
        FormsPolymorphicUserObjectResponseBody, FieldMetadata(alias="createdBy"), pydantic.Field(alias="createdBy")
    ]
    entity_type: typing_extensions.Annotated[
        QualificationTypeResponseObjectResponseBodyEntityType,
        FieldMetadata(alias="entityType"),
        pydantic.Field(alias="entityType", description="Owner entity type  Valid values: `worker`, `asset`"),
    ]
    fields: typing.List[FormsFieldDefinitionObjectResponseBody] = pydantic.Field()
    """
    List of fields in the qualification type.
    """

    id: str = pydantic.Field()
    """
    Unique identifier of the qualification type.
    """

    name: str = pydantic.Field()
    """
    Name of the qualification type.
    """

    revision_id: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="revisionId"),
        pydantic.Field(alias="revisionId", description="Unique identifier of the qualification type revision."),
    ]
    updated_at_time: typing_extensions.Annotated[
        dt.datetime,
        FieldMetadata(alias="updatedAtTime"),
        pydantic.Field(
            alias="updatedAtTime",
            description="Update time of the qualification type. 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
