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

from __future__ import annotations
from .versionheader import VersionHeader
from datetime import date
from enum import Enum
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 PostV1CompaniesCompanyIDContractorPaymentGroupsPaymentMethod(str, Enum):
    DIRECT_DEPOSIT = "Direct Deposit"
    CHECK = "Check"
    HISTORICAL_PAYMENT = "Historical Payment"


class PostV1CompaniesCompanyIDContractorPaymentGroupsContractorPaymentsTypedDict(
    TypedDict
):
    contractor_uuid: NotRequired[str]
    r"""The contractor receiving the payment"""
    payment_method: NotRequired[
        PostV1CompaniesCompanyIDContractorPaymentGroupsPaymentMethod
    ]
    wage: NotRequired[float]
    r"""If the contractor is on a fixed wage, this is the fixed wage payment for the contractor, regardless of hours worked"""
    hours: NotRequired[float]
    r"""If the contractor is on an hourly wage, this is the number of hours that the contractor worked for the payment"""
    bonus: NotRequired[float]
    r"""If the contractor is on an hourly wage, this is the bonus the contractor earned"""
    reimbursement: NotRequired[float]
    r"""Reimbursed wages for the contractor"""


class PostV1CompaniesCompanyIDContractorPaymentGroupsContractorPayments(BaseModel):
    contractor_uuid: Optional[str] = None
    r"""The contractor receiving the payment"""

    payment_method: Optional[
        PostV1CompaniesCompanyIDContractorPaymentGroupsPaymentMethod
    ] = PostV1CompaniesCompanyIDContractorPaymentGroupsPaymentMethod.DIRECT_DEPOSIT

    wage: Optional[float] = None
    r"""If the contractor is on a fixed wage, this is the fixed wage payment for the contractor, regardless of hours worked"""

    hours: Optional[float] = None
    r"""If the contractor is on an hourly wage, this is the number of hours that the contractor worked for the payment"""

    bonus: Optional[float] = None
    r"""If the contractor is on an hourly wage, this is the bonus the contractor earned"""

    reimbursement: Optional[float] = None
    r"""Reimbursed wages for the contractor"""


class PostV1CompaniesCompanyIDContractorPaymentGroupsRequestBodyTypedDict(TypedDict):
    check_date: date
    r"""The payment check date"""
    contractor_payments: List[
        PostV1CompaniesCompanyIDContractorPaymentGroupsContractorPaymentsTypedDict
    ]
    creation_token: NotRequired[str]
    r"""Optional token used to make contractor payment group creation idempotent.  If provided, string must be unique for each group you intend to create."""


class PostV1CompaniesCompanyIDContractorPaymentGroupsRequestBody(BaseModel):
    check_date: date
    r"""The payment check date"""

    contractor_payments: List[
        PostV1CompaniesCompanyIDContractorPaymentGroupsContractorPayments
    ]

    creation_token: Optional[str] = None
    r"""Optional token used to make contractor payment group creation idempotent.  If provided, string must be unique for each group you intend to create."""


class PostV1CompaniesCompanyIDContractorPaymentGroupsRequestTypedDict(TypedDict):
    company_id: str
    r"""The UUID of the company"""
    request_body: PostV1CompaniesCompanyIDContractorPaymentGroupsRequestBodyTypedDict
    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 PostV1CompaniesCompanyIDContractorPaymentGroupsRequest(BaseModel):
    company_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The UUID of the company"""

    request_body: Annotated[
        PostV1CompaniesCompanyIDContractorPaymentGroupsRequestBody,
        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."""
