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

from __future__ import annotations
from .payroll_blockers_error import PayrollBlockersErrorData
from .unprocessable_entity_error_object import UnprocessableEntityErrorObjectData
from .versionheader import VersionHeader
from enum import Enum
from gusto_embedded import utils
from gusto_embedded.types import BaseModel
from gusto_embedded.utils import (
    FieldMetadata,
    HeaderMetadata,
    PathParamMetadata,
    RequestMetadata,
)
import pydantic
from typing import List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


class PostCompaniesPayrollSkipCompanyUUIDPayrollType(str, Enum):
    r"""Payroll type"""

    REGULAR = "Regular"
    HIRED_EMPLOYEE = "Hired employee"
    DISMISSED_EMPLOYEE = "Dismissed employee"
    TRANSITION_FROM_OLD_PAY_SCHEDULE = "Transition from old pay schedule"


class PostCompaniesPayrollSkipCompanyUUIDRequestBodyTypedDict(TypedDict):
    payroll_type: PostCompaniesPayrollSkipCompanyUUIDPayrollType
    r"""Payroll type"""
    start_date: NotRequired[str]
    r"""Pay period start date"""
    end_date: NotRequired[str]
    r"""Pay period end date. If left empty, defaults to today's date."""
    pay_schedule_uuid: NotRequired[str]
    r"""The UUID of the pay schedule"""
    employee_uuids: NotRequired[List[str]]
    r"""An array of employees. This field is only applicable to new hire payroll and termination payroll"""


class PostCompaniesPayrollSkipCompanyUUIDRequestBody(BaseModel):
    payroll_type: PostCompaniesPayrollSkipCompanyUUIDPayrollType
    r"""Payroll type"""

    start_date: Optional[str] = None
    r"""Pay period start date"""

    end_date: Optional[str] = None
    r"""Pay period end date. If left empty, defaults to today's date."""

    pay_schedule_uuid: Optional[str] = None
    r"""The UUID of the pay schedule"""

    employee_uuids: Optional[List[str]] = None
    r"""An array of employees. This field is only applicable to new hire payroll and termination payroll"""


class PostCompaniesPayrollSkipCompanyUUIDRequestTypedDict(TypedDict):
    company_uuid: str
    r"""The UUID of the company"""
    request_body: PostCompaniesPayrollSkipCompanyUUIDRequestBodyTypedDict
    x_gusto_api_version: NotRequired[VersionHeader]
    r"""Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used."""


class PostCompaniesPayrollSkipCompanyUUIDRequest(BaseModel):
    company_uuid: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The UUID of the company"""

    request_body: Annotated[
        PostCompaniesPayrollSkipCompanyUUIDRequestBody,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]

    x_gusto_api_version: Annotated[
        Optional[VersionHeader],
        pydantic.Field(alias="X-Gusto-API-Version"),
        FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
    ] = VersionHeader.TWO_THOUSAND_AND_TWENTY_FOUR_04_01
    r"""Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used."""


PostCompaniesPayrollSkipCompanyUUIDResponseBodyUnion = TypeAliasType(
    "PostCompaniesPayrollSkipCompanyUUIDResponseBodyUnion",
    Union[UnprocessableEntityErrorObjectData, PayrollBlockersErrorData],
)
r"""Unprocessable Entity"""


class PostCompaniesPayrollSkipCompanyUUIDResponseBody(Exception):
    r"""Unprocessable Entity"""

    data: PostCompaniesPayrollSkipCompanyUUIDResponseBodyUnion

    def __init__(self, data: PostCompaniesPayrollSkipCompanyUUIDResponseBodyUnion):
        self.data = data

    def __str__(self) -> str:
        return utils.marshal_json(
            self.data, PostCompaniesPayrollSkipCompanyUUIDResponseBodyUnion
        )
