"""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 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 SubmissionBlockersTypedDict(TypedDict):
    blocker_type: NotRequired[str]
    r"""The type of submission_blocker that is blocking the payment."""
    selected_option: NotRequired[str]
    r"""The selected option to unblock the payment's submission_blocker."""


class SubmissionBlockers(BaseModel):
    blocker_type: Optional[str] = None
    r"""The type of submission_blocker that is blocking the payment."""

    selected_option: Optional[str] = None
    r"""The selected option to unblock the payment's submission_blocker."""


class PutV1CompaniesCompanyIDPayrollsPayrollIDSubmitRequestBodyTypedDict(TypedDict):
    submission_blockers: NotRequired[List[SubmissionBlockersTypedDict]]
    r"""An array of submission_blockers, each with a selected unblock option."""


class PutV1CompaniesCompanyIDPayrollsPayrollIDSubmitRequestBody(BaseModel):
    submission_blockers: Optional[List[SubmissionBlockers]] = None
    r"""An array of submission_blockers, each with a selected unblock option."""


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

    payroll_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The UUID of the payroll"""

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


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


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

    data: PutV1CompaniesCompanyIDPayrollsPayrollIDSubmitResponseBodyUnion

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

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