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

from __future__ import annotations
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


class PrehireTypedDict(TypedDict):
    r"""An object containing the temporary pre-hire information from the remote system. This ID may change or become invalid when the pre-hire becomes a full employee. Only populated when `id` is null."""

    remote_id: Nullable[str]
    r"""The temporary ID returned by the remote system when creating a pre-hire."""


class Prehire(BaseModel):
    r"""An object containing the temporary pre-hire information from the remote system. This ID may change or become invalid when the pre-hire becomes a full employee. Only populated when `id` is null."""

    remote_id: Nullable[str]
    r"""The temporary ID returned by the remote system when creating a pre-hire."""

    @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 PostHrisEmployeesFormPositiveResponseDataTypedDict(TypedDict):
    id: Nullable[str]
    r"""The Kombo id of the created employee. If null, we only created a pre-hire which shows up in the next sync after a successful onboarding."""
    remote_id: Nullable[str]
    r"""The raw ID of the created employee in the remote system. This is only populated when `id` is set (i.e., when a full employee was created). For pre-hires, use the `prehire` object instead."""
    prehire: PrehireTypedDict
    r"""An object containing the temporary pre-hire information from the remote system. This ID may change or become invalid when the pre-hire becomes a full employee. Only populated when `id` is null."""


class PostHrisEmployeesFormPositiveResponseData(BaseModel):
    id: Nullable[str]
    r"""The Kombo id of the created employee. If null, we only created a pre-hire which shows up in the next sync after a successful onboarding."""

    remote_id: Nullable[str]
    r"""The raw ID of the created employee in the remote system. This is only populated when `id` is set (i.e., when a full employee was created). For pre-hires, use the `prehire` object instead."""

    prehire: Prehire
    r"""An object containing the temporary pre-hire information from the remote system. This ID may change or become invalid when the pre-hire becomes a full employee. Only populated when `id` is null."""

    @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 PostHrisEmployeesFormPositiveResponseWarningTypedDict(TypedDict):
    message: str


class PostHrisEmployeesFormPositiveResponseWarning(BaseModel):
    message: str


class PostHrisEmployeesFormPositiveResponseTypedDict(TypedDict):
    data: PostHrisEmployeesFormPositiveResponseDataTypedDict
    warnings: List[PostHrisEmployeesFormPositiveResponseWarningTypedDict]
    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 PostHrisEmployeesFormPositiveResponse(BaseModel):
    data: PostHrisEmployeesFormPositiveResponseData

    warnings: List[PostHrisEmployeesFormPositiveResponseWarning]
    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:
    PostHrisEmployeesFormPositiveResponse.model_rebuild()
except NameError:
    pass
