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

from __future__ import annotations
from .dateupdate import DateUpdate, DateUpdateTypedDict
from .personidentificationupdate import (
    PersonIdentificationUpdate,
    PersonIdentificationUpdateTypedDict,
)
from .postaladdressupdate import PostalAddressUpdate, PostalAddressUpdateTypedDict
from .providedidentityverificationupdate import (
    ProvidedIdentityVerificationUpdate,
    ProvidedIdentityVerificationUpdateTypedDict,
)
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 List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class PersonUpdateNameSuffix(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""Suffix of the person's name"""

    NAME_SUFFIX_UNSPECIFIED = "NAME_SUFFIX_UNSPECIFIED"
    SR = "SR"
    JR = "JR"
    III = "III"
    IV = "IV"
    V = "V"


class PersonUpdateTypedDict(TypedDict):
    r"""investigation details on a person"""

    birth_date: NotRequired[DateUpdateTypedDict]
    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`.
    """
    birth_region_code: NotRequired[str]
    r"""Two character region code, complies with https://cldr.unicode.org/index Example values: \"US\", \"CA\" """
    citizenship_region_codes: NotRequired[List[str]]
    r"""The countries where a natural person retains citizenship; This is used for tax (treaty) and country block list considerations Two character region code, complies with https://cldr.unicode.org/index Example values: \"US\", \"CA\" """
    document_ids: NotRequired[List[str]]
    r"""Conditional: document_ids must be provided by the correspondent if InvestigationRequestScope = PERFORMED_BY_APEX and citizenship_country is not USA"""
    email_addresses: NotRequired[List[str]]
    r"""Email addresses indicated for account communications"""
    family_name: NotRequired[str]
    r"""Family name of a natural person"""
    given_name: NotRequired[str]
    r"""The given name of a natural person; Conventionally known as 'first name' in most English-speaking countries"""
    identifications: NotRequired[List[PersonIdentificationUpdateTypedDict]]
    r"""Identification details including id value, and type (e.g. ssn)"""
    legal_address: NotRequired[PostalAddressUpdateTypedDict]
    r"""Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical locations (roads, towns, mountains).

    In typical usage an address would be created via user input or from importing existing data, depending on the type of process.

    Advice on address input / editing: - Use an i18n-ready address widget such as  https://github.com/google/libaddressinput) - Users should not be presented with UI elements for input or editing of  fields outside countries where that field is used.

    For more guidance on how to use this schema, please see: https://support.google.com/business/answer/6397478
    """
    mailing_addresses: NotRequired[List[PostalAddressUpdateTypedDict]]
    r"""mailing address"""
    middle_names: NotRequired[str]
    r"""Middle names"""
    name_suffix: NotRequired[PersonUpdateNameSuffix]
    r"""Suffix of the person's name"""
    phone_numbers: NotRequired[List[str]]
    r"""phone numbers related to this person"""
    provided_identity_verification: NotRequired[
        ProvidedIdentityVerificationUpdateTypedDict
    ]
    r"""Clients must supply data and confirmation attesting to identity verification."""


class PersonUpdate(BaseModel):
    r"""investigation details on a person"""

    birth_date: Optional[DateUpdate] = 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`.
    """

    birth_region_code: Optional[str] = None
    r"""Two character region code, complies with https://cldr.unicode.org/index Example values: \"US\", \"CA\" """

    citizenship_region_codes: Optional[List[str]] = None
    r"""The countries where a natural person retains citizenship; This is used for tax (treaty) and country block list considerations Two character region code, complies with https://cldr.unicode.org/index Example values: \"US\", \"CA\" """

    document_ids: Optional[List[str]] = None
    r"""Conditional: document_ids must be provided by the correspondent if InvestigationRequestScope = PERFORMED_BY_APEX and citizenship_country is not USA"""

    email_addresses: Optional[List[str]] = None
    r"""Email addresses indicated for account communications"""

    family_name: Optional[str] = None
    r"""Family name of a natural person"""

    given_name: Optional[str] = None
    r"""The given name of a natural person; Conventionally known as 'first name' in most English-speaking countries"""

    identifications: Optional[List[PersonIdentificationUpdate]] = None
    r"""Identification details including id value, and type (e.g. ssn)"""

    legal_address: Optional[PostalAddressUpdate] = None
    r"""Represents a postal address, e.g. for postal delivery or payments addresses. Given a postal address, a postal service can deliver items to a premise, P.O. Box or similar. It is not intended to model geographical locations (roads, towns, mountains).

    In typical usage an address would be created via user input or from importing existing data, depending on the type of process.

    Advice on address input / editing: - Use an i18n-ready address widget such as  https://github.com/google/libaddressinput) - Users should not be presented with UI elements for input or editing of  fields outside countries where that field is used.

    For more guidance on how to use this schema, please see: https://support.google.com/business/answer/6397478
    """

    mailing_addresses: Optional[List[PostalAddressUpdate]] = None
    r"""mailing address"""

    middle_names: Optional[str] = None
    r"""Middle names"""

    name_suffix: Annotated[
        Optional[PersonUpdateNameSuffix], PlainValidator(validate_open_enum(False))
    ] = None
    r"""Suffix of the person's name"""

    phone_numbers: Optional[List[str]] = None
    r"""phone numbers related to this person"""

    provided_identity_verification: Optional[ProvidedIdentityVerificationUpdate] = None
    r"""Clients must supply data and confirmation attesting to identity verification."""
