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

from __future__ import annotations
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_extensions import Annotated, TypedDict


class TaxAuthority(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""Tax Authority for Enrollment"""

    TAX_AUTHORITY_UNSPECIFIED = "TAX_AUTHORITY_UNSPECIFIED"
    AL = "AL"
    AK = "AK"
    AZ = "AZ"
    AR = "AR"
    CA = "CA"
    CO = "CO"
    CT = "CT"
    DE = "DE"
    FL = "FL"
    GA = "GA"
    HI = "HI"
    ID = "ID"
    IL = "IL"
    IN = "IN"
    IA = "IA"
    KS = "KS"
    KY = "KY"
    LA = "LA"
    ME = "ME"
    MD = "MD"
    MA = "MA"
    MI = "MI"
    MN = "MN"
    MS = "MS"
    MO = "MO"
    MT = "MT"
    NE = "NE"
    NV = "NV"
    NH = "NH"
    NJ = "NJ"
    NM = "NM"
    NY = "NY"
    NC = "NC"
    ND = "ND"
    OH = "OH"
    OK = "OK"
    OR = "OR"
    PA = "PA"
    RI = "RI"
    SC = "SC"
    SD = "SD"
    TN = "TN"
    TX = "TX"
    UT = "UT"
    VT = "VT"
    VA = "VA"
    WA = "WA"
    WV = "WV"
    WI = "WI"
    WY = "WY"
    IRS = "IRS"


class WithholdingType(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""A designation used by the custodian to determine how much federal income tax should be withheld from the proceeds of a sale"""

    WITHHOLDING_TYPE_UNSPECIFIED = "WITHHOLDING_TYPE_UNSPECIFIED"
    BACKUP = "BACKUP"
    BACKUP_PROCEEDS = "BACKUP_PROCEEDS"
    BACKUP_DIVIDENDS_AND_INTEREST = "BACKUP_DIVIDENDS_AND_INTEREST"
    IRA = "IRA"


class TaxWithholdingMetadataCreateTypedDict(TypedDict):
    r"""Enrollment metadata for TAX_WITHHOLDING operating purpose"""

    tax_authority: TaxAuthority
    r"""Tax Authority for Enrollment"""
    withholding_type: WithholdingType
    r"""A designation used by the custodian to determine how much federal income tax should be withheld from the proceeds of a sale"""


class TaxWithholdingMetadataCreate(BaseModel):
    r"""Enrollment metadata for TAX_WITHHOLDING operating purpose"""

    tax_authority: Annotated[TaxAuthority, PlainValidator(validate_open_enum(False))]
    r"""Tax Authority for Enrollment"""

    withholding_type: Annotated[
        WithholdingType, PlainValidator(validate_open_enum(False))
    ]
    r"""A designation used by the custodian to determine how much federal income tax should be withheld from the proceeds of a sale"""
