"""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,
    RequestMetadata,
)
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class PutV1EmployeesEmployeeIDI9AuthorizationAuthorizationStatus(str, Enum):
    r"""The employee's authorization status

    * `citizen`: A citizen is someone who was born in the United States or is a naturalized citizen living in the United States.
    * `noncitizen`: A noncitizen national is someone born in American Samoa, certain former citizens of the former Trust Territory of the Pacific Islands, and certain children of noncitizen nationals born abroad.
    * `permanent_resident`: A lawful permanent resident is someone who is not a US citizen and who resides under legally recognized and lawfully recorded permanent residence as an immigrant.
    * `alien`: Also referred to as a \"noncitizen authorized to work\". This includes anyone who is authorized to work in the United States but is not a US citizen, US national or lawful permanent resident.

    """

    CITIZEN = "citizen"
    NONCITIZEN = "noncitizen"
    PERMANENT_RESIDENT = "permanent_resident"
    ALIEN = "alien"


class PutV1EmployeesEmployeeIDI9AuthorizationDocumentType(str, Enum):
    r"""The type of document an employee holds, based on their authorization status.

    * This is unused for authorization status `citizen` or `noncitizen`.
    * If the authorization status is `permanent_resident`, this must be `uscis_alien_registration_number`.
    * If the authorization status is `alien`, this is required and may be any of the valid values.

    """

    USCIS_ALIEN_REGISTRATION_NUMBER = "uscis_alien_registration_number"
    FORM_I94 = "form_i94"
    FOREIGN_PASSPORT = "foreign_passport"


class PutV1EmployeesEmployeeIDI9AuthorizationRequestBodyTypedDict(TypedDict):
    authorization_status: PutV1EmployeesEmployeeIDI9AuthorizationAuthorizationStatus
    r"""The employee's authorization status

    * `citizen`: A citizen is someone who was born in the United States or is a naturalized citizen living in the United States.
    * `noncitizen`: A noncitizen national is someone born in American Samoa, certain former citizens of the former Trust Territory of the Pacific Islands, and certain children of noncitizen nationals born abroad.
    * `permanent_resident`: A lawful permanent resident is someone who is not a US citizen and who resides under legally recognized and lawfully recorded permanent residence as an immigrant.
    * `alien`: Also referred to as a \"noncitizen authorized to work\". This includes anyone who is authorized to work in the United States but is not a US citizen, US national or lawful permanent resident.

    """
    document_type: NotRequired[PutV1EmployeesEmployeeIDI9AuthorizationDocumentType]
    r"""The type of document an employee holds, based on their authorization status.

    * This is unused for authorization status `citizen` or `noncitizen`.
    * If the authorization status is `permanent_resident`, this must be `uscis_alien_registration_number`.
    * If the authorization status is `alien`, this is required and may be any of the valid values.

    """
    document_number: NotRequired[str]
    r"""The document number. Formatting depends on the employee's document type.

    * For `document_type:'uscis_alien_registration_number'`, this must be a USCIS Number/A-Number, which is 7 to 9 digits.
    * For `document_type:'form_i94'`, this must be a Form I-94 Admission Number, which is 11 digits.
    * For `document_type:'foreign_passport'`, this must be the passport number.

    This is required when the document type is present.

    """
    country: NotRequired[str]
    r"""The document's country of issuance.

    This is required when the document type is `foreign_passport`.

    """
    expiration_date: NotRequired[str]
    r"""The document's expiration date.

    This may only be used when the authorization status is `alien`.

    """
    version: NotRequired[str]
    r"""The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/versioning#object-layer) for information on how to use this field. If supplied, this endpoint will update the existing I-9 authorization if it exists."""


class PutV1EmployeesEmployeeIDI9AuthorizationRequestBody(BaseModel):
    authorization_status: PutV1EmployeesEmployeeIDI9AuthorizationAuthorizationStatus
    r"""The employee's authorization status

    * `citizen`: A citizen is someone who was born in the United States or is a naturalized citizen living in the United States.
    * `noncitizen`: A noncitizen national is someone born in American Samoa, certain former citizens of the former Trust Territory of the Pacific Islands, and certain children of noncitizen nationals born abroad.
    * `permanent_resident`: A lawful permanent resident is someone who is not a US citizen and who resides under legally recognized and lawfully recorded permanent residence as an immigrant.
    * `alien`: Also referred to as a \"noncitizen authorized to work\". This includes anyone who is authorized to work in the United States but is not a US citizen, US national or lawful permanent resident.

    """

    document_type: Optional[PutV1EmployeesEmployeeIDI9AuthorizationDocumentType] = None
    r"""The type of document an employee holds, based on their authorization status.

    * This is unused for authorization status `citizen` or `noncitizen`.
    * If the authorization status is `permanent_resident`, this must be `uscis_alien_registration_number`.
    * If the authorization status is `alien`, this is required and may be any of the valid values.

    """

    document_number: Optional[str] = None
    r"""The document number. Formatting depends on the employee's document type.

    * For `document_type:'uscis_alien_registration_number'`, this must be a USCIS Number/A-Number, which is 7 to 9 digits.
    * For `document_type:'form_i94'`, this must be a Form I-94 Admission Number, which is 11 digits.
    * For `document_type:'foreign_passport'`, this must be the passport number.

    This is required when the document type is present.

    """

    country: Optional[str] = None
    r"""The document's country of issuance.

    This is required when the document type is `foreign_passport`.

    """

    expiration_date: Optional[str] = None
    r"""The document's expiration date.

    This may only be used when the authorization status is `alien`.

    """

    version: Optional[str] = None
    r"""The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/versioning#object-layer) for information on how to use this field. If supplied, this endpoint will update the existing I-9 authorization if it exists."""


class PutV1EmployeesEmployeeIDI9AuthorizationRequestTypedDict(TypedDict):
    employee_id: str
    r"""The UUID of the employee"""
    request_body: PutV1EmployeesEmployeeIDI9AuthorizationRequestBodyTypedDict
    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 PutV1EmployeesEmployeeIDI9AuthorizationRequest(BaseModel):
    employee_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The UUID of the employee"""

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