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

from __future__ import annotations
from .versionheader import VersionHeader
from enum import Enum
from gusto_embedded.types import BaseModel
from gusto_embedded.utils import (
    FieldMetadata,
    HeaderMetadata,
    PathParamMetadata,
    QueryParamMetadata,
)
import pydantic
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class QueryParamFrequency(str, Enum):
    r"""The frequency that employees on this pay schedule are paid with Gusto."""

    EVERY_WEEK = "Every week"
    EVERY_OTHER_WEEK = "Every other week"
    TWICE_PER_MONTH = "Twice per month"
    MONTHLY = "Monthly"


class GetV1CompaniesCompanyIDPaySchedulesPreviewRequestTypedDict(TypedDict):
    company_id: str
    r"""The UUID of the company"""
    frequency: QueryParamFrequency
    r"""The frequency that employees on this pay schedule are paid with Gusto."""
    anchor_pay_date: str
    r"""The first date that employees on this pay schedule are paid with Gusto."""
    anchor_end_of_pay_period: str
    r"""The last date of the first pay period. This can be the same date as the anchor pay date."""
    day_1: NotRequired[int]
    r"""An integer between 1 and 31 indicating the first day of the month that employees are paid. This field is only relevant for pay schedules with the “Twice per month” and “Monthly” frequencies. It will be null for pay schedules with other frequencies."""
    day_2: NotRequired[int]
    r"""An integer between 1 and 31 indicating the second day of the month that employees are paid. This field is the second pay date for pay schedules with the \"Twice per month\" frequency. For semi-monthly pay schedules, set this field to 31. For months shorter than 31 days, we will set the second pay date to the last day of the month. It will be null for pay schedules with other frequencies."""
    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 GetV1CompaniesCompanyIDPaySchedulesPreviewRequest(BaseModel):
    company_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The UUID of the company"""

    frequency: Annotated[
        QueryParamFrequency,
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ]
    r"""The frequency that employees on this pay schedule are paid with Gusto."""

    anchor_pay_date: Annotated[
        str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
    ]
    r"""The first date that employees on this pay schedule are paid with Gusto."""

    anchor_end_of_pay_period: Annotated[
        str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
    ]
    r"""The last date of the first pay period. This can be the same date as the anchor pay date."""

    day_1: Annotated[
        Optional[int],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""An integer between 1 and 31 indicating the first day of the month that employees are paid. This field is only relevant for pay schedules with the “Twice per month” and “Monthly” frequencies. It will be null for pay schedules with other frequencies."""

    day_2: Annotated[
        Optional[int],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""An integer between 1 and 31 indicating the second day of the month that employees are paid. This field is the second pay date for pay schedules with the \"Twice per month\" frequency. For semi-monthly pay schedules, set this field to 31. For months shorter than 31 days, we will set the second pay date to the last day of the month. It will be null for pay schedules with other frequencies."""

    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 PayPeriodsTypedDict(TypedDict):
    check_date: NotRequired[str]
    r"""The payment date, \"Check date\", for the pay period"""
    run_payroll_by: NotRequired[str]
    r"""The deadline to run payroll for direct deposit on the check date"""
    start_date: NotRequired[str]
    r"""The first day of the pay period"""
    end_date: NotRequired[str]
    r"""The last day of the pay period."""


class PayPeriods(BaseModel):
    check_date: Optional[str] = None
    r"""The payment date, \"Check date\", for the pay period"""

    run_payroll_by: Optional[str] = None
    r"""The deadline to run payroll for direct deposit on the check date"""

    start_date: Optional[str] = None
    r"""The first day of the pay period"""

    end_date: Optional[str] = None
    r"""The last day of the pay period."""


class GetV1CompaniesCompanyIDPaySchedulesPreviewResponseBodyTypedDict(TypedDict):
    r"""Pay schedule preview"""

    pay_periods: NotRequired[List[PayPeriodsTypedDict]]
    r"""A list of pay periods for the previewed pay schedule"""
    holidays: NotRequired[List[str]]
    r"""A list of dates for bank closures"""


class GetV1CompaniesCompanyIDPaySchedulesPreviewResponseBody(BaseModel):
    r"""Pay schedule preview"""

    pay_periods: Optional[List[PayPeriods]] = None
    r"""A list of pay periods for the previewed pay schedule"""

    holidays: Optional[List[str]] = None
    r"""A list of dates for bank closures"""
