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

from __future__ import annotations
from .datecreate import DateCreate, DateCreateTypedDict
from ascend_sdk import utils
from ascend_sdk.types import BaseModel
from ascend_sdk.utils import validate_open_enum
from enum import Enum
from pydantic.functional_validators import PlainValidator
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class Type(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""Identification type"""

    IDENTIFICATION_TYPE_UNSPECIFIED = "IDENTIFICATION_TYPE_UNSPECIFIED"
    PASSPORT = "PASSPORT"
    NATIONAL_ID = "NATIONAL_ID"
    DRIVERS_LICENSE = "DRIVERS_LICENSE"


class ForeignIdentificationCreateTypedDict(TypedDict):
    r"""Foreign identification"""

    ftin: bool
    r"""Denotes if the identification is a tax id or other"""
    identification_number: str
    r"""Identification number"""
    issuing_region_code: str
    r"""Region of issuance must be provided as a two-character CLDR country code"""
    expiration_date: NotRequired[DateCreateTypedDict]
    r"""Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following:

    * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date

    Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`.
    """
    issue_date: NotRequired[DateCreateTypedDict]
    r"""Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following:

    * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date

    Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`.
    """
    type: NotRequired[Type]
    r"""Identification type"""


class ForeignIdentificationCreate(BaseModel):
    r"""Foreign identification"""

    ftin: bool
    r"""Denotes if the identification is a tax id or other"""

    identification_number: str
    r"""Identification number"""

    issuing_region_code: str
    r"""Region of issuance must be provided as a two-character CLDR country code"""

    expiration_date: Optional[DateCreate] = None
    r"""Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following:

    * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date

    Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`.
    """

    issue_date: Optional[DateCreate] = None
    r"""Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following:

    * A full date, with non-zero year, month, and day values * A month and day value, with a zero year, such as an anniversary * A year on its own, with zero month and day values * A year and month value, with a zero day, such as a credit card expiration date

    Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and `google.protobuf.Timestamp`.
    """

    type: Annotated[Optional[Type], PlainValidator(validate_open_enum(False))] = None
    r"""Identification type"""
