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

from __future__ import annotations
from .versionheader import VersionHeader
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
from typing_extensions import Annotated, NotRequired, TypedDict


class GetCompaniesCompanyUUIDContractorPaymentsPreviewContractorPaymentsTypedDict(
    TypedDict
):
    bonus: NotRequired[int]
    contractor_uuid: NotRequired[str]
    date_: NotRequired[str]
    hourly_rate: NotRequired[int]
    hours: NotRequired[int]
    payment_method: NotRequired[str]
    reimbursement: NotRequired[int]
    wage: NotRequired[int]


class GetCompaniesCompanyUUIDContractorPaymentsPreviewContractorPayments(BaseModel):
    bonus: Optional[int] = None

    contractor_uuid: Optional[str] = None

    date_: Annotated[Optional[str], pydantic.Field(alias="date")] = None

    hourly_rate: Optional[int] = None

    hours: Optional[int] = None

    payment_method: Optional[str] = None

    reimbursement: Optional[int] = None

    wage: Optional[int] = None


class GetCompaniesCompanyUUIDContractorPaymentsPreviewRequestBodyTypedDict(TypedDict):
    r"""a list of contractor payments."""

    contractor_payments: List[
        GetCompaniesCompanyUUIDContractorPaymentsPreviewContractorPaymentsTypedDict
    ]


class GetCompaniesCompanyUUIDContractorPaymentsPreviewRequestBody(BaseModel):
    r"""a list of contractor payments."""

    contractor_payments: List[
        GetCompaniesCompanyUUIDContractorPaymentsPreviewContractorPayments
    ]


class GetCompaniesCompanyUUIDContractorPaymentsPreviewRequestTypedDict(TypedDict):
    company_uuid: str
    r"""The UUID of the company"""
    request_body: GetCompaniesCompanyUUIDContractorPaymentsPreviewRequestBodyTypedDict
    r"""a list of contractor payments."""
    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 GetCompaniesCompanyUUIDContractorPaymentsPreviewRequest(BaseModel):
    company_uuid: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The UUID of the company"""

    request_body: Annotated[
        GetCompaniesCompanyUUIDContractorPaymentsPreviewRequestBody,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]
    r"""a list of contractor payments."""

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


class GetCompaniesCompanyUUIDContractorPaymentsPreviewBaseTypedDict(TypedDict):
    type: NotRequired[str]
    message: NotRequired[str]
    full_message: NotRequired[str]


class GetCompaniesCompanyUUIDContractorPaymentsPreviewBase(BaseModel):
    type: Optional[str] = None

    message: Optional[str] = None

    full_message: Optional[str] = None


class CheckDateTypedDict(TypedDict):
    type: NotRequired[str]
    message: NotRequired[str]
    full_message: NotRequired[str]


class CheckDate(BaseModel):
    type: Optional[str] = None

    message: Optional[str] = None

    full_message: Optional[str] = None


class GetCompaniesCompanyUUIDContractorPaymentsPreviewErrorsTypedDict(TypedDict):
    base: NotRequired[
        List[GetCompaniesCompanyUUIDContractorPaymentsPreviewBaseTypedDict]
    ]
    check_date: NotRequired[List[CheckDateTypedDict]]


class GetCompaniesCompanyUUIDContractorPaymentsPreviewErrors(BaseModel):
    base: Optional[List[GetCompaniesCompanyUUIDContractorPaymentsPreviewBase]] = None

    check_date: Optional[List[CheckDate]] = None


class GetCompaniesCompanyUUIDContractorPaymentsPreviewContractorPaymentsResponseBodyData(
    BaseModel
):
    errors: Optional[GetCompaniesCompanyUUIDContractorPaymentsPreviewErrors] = None


class GetCompaniesCompanyUUIDContractorPaymentsPreviewContractorPaymentsResponseBody(
    Exception
):
    r"""Unprocessable Entity (WebDAV)"""

    data: GetCompaniesCompanyUUIDContractorPaymentsPreviewContractorPaymentsResponseBodyData

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

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


class GetCompaniesCompanyUUIDContractorPaymentsPreviewResponseBodyTypedDict(TypedDict):
    r"""OK"""

    expected_debit_date: NotRequired[str]
    r"""The calculated debit date. If the payment method is Direct Deposit, the debit date will account for the company's ACH speed. If the payment method is Check, the debit date will be the same as the check date."""


class GetCompaniesCompanyUUIDContractorPaymentsPreviewResponseBody(BaseModel):
    r"""OK"""

    expected_debit_date: Optional[str] = None
    r"""The calculated debit date. If the payment method is Direct Deposit, the debit date will account for the company's ACH speed. If the payment method is Check, the debit date will be the same as the check date."""
