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

from __future__ import annotations
from .postaladdressupdate import PostalAddressUpdate, PostalAddressUpdateTypedDict
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 InterestedPartyUpdateStatementDeliveryPreference(
    str, Enum, metaclass=utils.OpenEnumMeta
):
    r"""Delivery method instruction for account statements for a given Interested Party; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `PHYSICAL` on party creation"""

    DELIVERY_PREFERENCE_UNSPECIFIED = "DELIVERY_PREFERENCE_UNSPECIFIED"
    DIGITAL = "DIGITAL"
    PHYSICAL = "PHYSICAL"
    SUPPRESS = "SUPPRESS"


class InterestedPartyUpdateTradeConfirmationDeliveryPreference(
    str, Enum, metaclass=utils.OpenEnumMeta
):
    r"""Delivery method instruction for trade confirmations for a given Interested Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `PHYSICAL` on party creation"""

    DELIVERY_PREFERENCE_UNSPECIFIED = "DELIVERY_PREFERENCE_UNSPECIFIED"
    DIGITAL = "DIGITAL"
    PHYSICAL = "PHYSICAL"
    SUPPRESS = "SUPPRESS"


class InterestedPartyUpdateTypedDict(TypedDict):
    r"""An interested party."""

    mailing_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
    """
    recipient: NotRequired[str]
    r"""The sending address name for mailings to Interested Parties The name of an Interested Party; Used for envelope/communication addressing"""
    statement_delivery_preference: NotRequired[
        InterestedPartyUpdateStatementDeliveryPreference
    ]
    r"""Delivery method instruction for account statements for a given Interested Party; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `PHYSICAL` on party creation"""
    trade_confirmation_delivery_preference: NotRequired[
        InterestedPartyUpdateTradeConfirmationDeliveryPreference
    ]
    r"""Delivery method instruction for trade confirmations for a given Interested Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `PHYSICAL` on party creation"""


class InterestedPartyUpdate(BaseModel):
    r"""An interested party."""

    mailing_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
    """

    recipient: Optional[str] = None
    r"""The sending address name for mailings to Interested Parties The name of an Interested Party; Used for envelope/communication addressing"""

    statement_delivery_preference: Annotated[
        Optional[InterestedPartyUpdateStatementDeliveryPreference],
        PlainValidator(validate_open_enum(False)),
    ] = None
    r"""Delivery method instruction for account statements for a given Interested Party; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `PHYSICAL` on party creation"""

    trade_confirmation_delivery_preference: Annotated[
        Optional[InterestedPartyUpdateTradeConfirmationDeliveryPreference],
        PlainValidator(validate_open_enum(False)),
    ] = None
    r"""Delivery method instruction for trade confirmations for a given Interested Party record; Can be `DIGITAL`, `PHYSICAL`, `SUPPRESS`; Defaults to `PHYSICAL` on party creation"""
