"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from datetime import datetime
from kombo.types import BaseModel, Nullable, UNSET_SENTINEL
from kombo.utils import validate_const
import pydantic
from pydantic import model_serializer
from pydantic.functional_validators import AfterValidator
from typing import List, Literal
from typing_extensions import Annotated, TypedDict


GetAssessmentPackagesPositiveResponseType = Literal[
    "BEHAVIORAL",
    "VIDEO_INTERVIEW",
    "SKILLS_TEST",
    "BACKGROUND_CHECK",
    "REFERENCE_CHECK",
]


class GetAssessmentPackagesPositiveResponsePackageTypedDict(TypedDict):
    id: str
    name: str
    description: str
    updated_at: Nullable[datetime]
    r"""YYYY-MM-DDTHH:mm:ss.sssZ
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
    """
    type: Nullable[GetAssessmentPackagesPositiveResponseType]


class GetAssessmentPackagesPositiveResponsePackage(BaseModel):
    id: str

    name: str

    description: str

    updated_at: Nullable[datetime]
    r"""YYYY-MM-DDTHH:mm:ss.sssZ
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
    """

    type: Nullable[GetAssessmentPackagesPositiveResponseType]

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


class GetAssessmentPackagesPositiveResponseDataTypedDict(TypedDict):
    packages: List[GetAssessmentPackagesPositiveResponsePackageTypedDict]


class GetAssessmentPackagesPositiveResponseData(BaseModel):
    packages: List[GetAssessmentPackagesPositiveResponsePackage]


class GetAssessmentPackagesPositiveResponseTypedDict(TypedDict):
    data: GetAssessmentPackagesPositiveResponseDataTypedDict
    status: Literal["success"]


class GetAssessmentPackagesPositiveResponse(BaseModel):
    data: GetAssessmentPackagesPositiveResponseData

    STATUS: Annotated[
        Annotated[Literal["success"], AfterValidator(validate_const("success"))],
        pydantic.Field(alias="status"),
    ] = "success"


try:
    GetAssessmentPackagesPositiveResponse.model_rebuild()
except NameError:
    pass
