# 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 .training_course_object_response_body import TrainingCourseObjectResponseBody
from .training_learner_object_response_body import TrainingLearnerObjectResponseBody


class TrainingAssignmentPostResponseObjectResponseBody(UniversalBaseModel):
    """
    Training Assignment response object.
    """

    course: TrainingCourseObjectResponseBody
    created_at_time: typing_extensions.Annotated[
        dt.datetime,
        FieldMetadata(alias="createdAtTime"),
        pydantic.Field(
            alias="createdAtTime",
            description="Creation time of the training assignment. UTC timestamp in RFC 3339 format.",
        ),
    ]
    created_by_id: typing_extensions.Annotated[
        str,
        FieldMetadata(alias="createdById"),
        pydantic.Field(alias="createdById", description="ID of the user who created the training assignment."),
    ]
    due_at_time: typing_extensions.Annotated[
        typing.Optional[dt.datetime],
        FieldMetadata(alias="dueAtTime"),
        pydantic.Field(
            alias="dueAtTime",
            description="Time training assignment is due. UTC timestamp in RFC 3339 format. Returned when an assignment has a due date set by an admin.",
        ),
    ] = None
    id: str = pydantic.Field()
    """
    ID of the training assignment.
    """

    is_existing_assignment: typing_extensions.Annotated[
        bool,
        FieldMetadata(alias="isExistingAssignment"),
        pydantic.Field(
            alias="isExistingAssignment", description="Indicates whether the training assignment was already created."
        ),
    ]
    learner: TrainingLearnerObjectResponseBody

    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
