"""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


GetAtsApplicationsApplicationIDAttachmentsPositiveResponseType = Literal[
    "CV",
    "COVER_LETTER",
    "OTHER",
]


class GetAtsApplicationsApplicationIDAttachmentsPositiveResponseResultTypedDict(
    TypedDict
):
    type: GetAtsApplicationsApplicationIDAttachmentsPositiveResponseType
    id: str
    remote_id: str
    data_url: str
    file_name: str
    content_type: str
    remote_created_at: Nullable[datetime]
    r"""The date when the attachment was created.
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
    """
    remote_updated_at: Nullable[datetime]
    r"""The date when the attachment was last updated.
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
    """


class GetAtsApplicationsApplicationIDAttachmentsPositiveResponseResult(BaseModel):
    type: GetAtsApplicationsApplicationIDAttachmentsPositiveResponseType

    id: str

    remote_id: str

    data_url: str

    file_name: str

    content_type: str

    remote_created_at: Nullable[datetime]
    r"""The date when the attachment was created.
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
    """

    remote_updated_at: Nullable[datetime]
    r"""The date when the attachment was last updated.
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString
    """

    @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 GetAtsApplicationsApplicationIDAttachmentsPositiveResponseDataTypedDict(
    TypedDict
):
    results: List[
        GetAtsApplicationsApplicationIDAttachmentsPositiveResponseResultTypedDict
    ]


class GetAtsApplicationsApplicationIDAttachmentsPositiveResponseData(BaseModel):
    results: List[GetAtsApplicationsApplicationIDAttachmentsPositiveResponseResult]


class GetAtsApplicationsApplicationIDAttachmentsPositiveResponseWarningTypedDict(
    TypedDict
):
    message: str


class GetAtsApplicationsApplicationIDAttachmentsPositiveResponseWarning(BaseModel):
    message: str


class GetAtsApplicationsApplicationIDAttachmentsPositiveResponseTypedDict(TypedDict):
    data: GetAtsApplicationsApplicationIDAttachmentsPositiveResponseDataTypedDict
    warnings: List[
        GetAtsApplicationsApplicationIDAttachmentsPositiveResponseWarningTypedDict
    ]
    r"""These are the interaction warnings that are shown in the dashboard. They are meant to provide debug information to you. We recommend logging them to the console."""
    status: Literal["success"]


class GetAtsApplicationsApplicationIDAttachmentsPositiveResponse(BaseModel):
    data: GetAtsApplicationsApplicationIDAttachmentsPositiveResponseData

    warnings: List[GetAtsApplicationsApplicationIDAttachmentsPositiveResponseWarning]
    r"""These are the interaction warnings that are shown in the dashboard. They are meant to provide debug information to you. We recommend logging them to the console."""

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


try:
    GetAtsApplicationsApplicationIDAttachmentsPositiveResponse.model_rebuild()
except NameError:
    pass
