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

import typing

import pydantic
import typing_extensions
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ..core.serialization import FieldMetadata
from .training_assignment_near_due_date_trigger_assignment_group_object_response_body import (
    TrainingAssignmentNearDueDateTriggerAssignmentGroupObjectResponseBody,
)
from .training_assignment_near_due_date_trigger_details_object_response_body_condition_units import (
    TrainingAssignmentNearDueDateTriggerDetailsObjectResponseBodyConditionUnits,
)


class TrainingAssignmentNearDueDateTriggerDetailsObjectResponseBody(UniversalBaseModel):
    """
    Details specific to Training Assignment Near Due Date
    """

    assignment_groups: typing_extensions.Annotated[
        typing.Optional[typing.List[TrainingAssignmentNearDueDateTriggerAssignmentGroupObjectResponseBody]],
        FieldMetadata(alias="assignmentGroups"),
        pydantic.Field(alias="assignmentGroups", description="The assignment groups the trigger is configured for."),
    ] = None
    condition_units: typing_extensions.Annotated[
        TrainingAssignmentNearDueDateTriggerDetailsObjectResponseBodyConditionUnits,
        FieldMetadata(alias="conditionUnits"),
        pydantic.Field(
            alias="conditionUnits",
            description="Whether the trigger is configured in days or weeks.  Valid values: `DAYS`, `WEEKS`",
        ),
    ]
    condition_value: typing_extensions.Annotated[
        int,
        FieldMetadata(alias="conditionValue"),
        pydantic.Field(
            alias="conditionValue", description="The number of days or weeks near the due date to trigger on."
        ),
    ]
    timezone: str = pydantic.Field()
    """
    The timezone that the alert will be set up in.
    """

    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
