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

from __future__ import annotations
from .taxwithholdingmetadatacreate import (
    TaxWithholdingMetadataCreate,
    TaxWithholdingMetadataCreateTypedDict,
)
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 OperatingPurpose(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""The purpose of the operating account."""

    OPERATING_PURPOSE_UNSPECIFIED = "OPERATING_PURPOSE_UNSPECIFIED"
    CUSTODY = "CUSTODY"
    SEC_FEE = "SEC_FEE"
    TAF_FEE = "TAF_FEE"
    TEFRA_WITHHOLDING = "TEFRA_WITHHOLDING"
    SUSPENSE = "SUSPENSE"
    ALLOCATION = "ALLOCATION"
    ERROR = "ERROR"
    DEPOSIT = "DEPOSIT"
    WRITE_OFF = "WRITE_OFF"
    UNSECURED_RESERVE = "UNSECURED_RESERVE"
    PAYABLE = "PAYABLE"
    COMMISSION = "COMMISSION"
    ESCHEATMENT = "ESCHEATMENT"
    INTEREST_REVENUE = "INTEREST_REVENUE"
    STREET_DEPOSITORY = "STREET_DEPOSITORY"
    INVENTORY = "INVENTORY"
    TAX_WITHHOLDING = "TAX_WITHHOLDING"
    FEE = "FEE"
    PRINCIPAL_TRADING = "PRINCIPAL_TRADING"


class OperatingEnrollmentMetadataCreateTypedDict(TypedDict):
    r"""Enrollment metadata for the REGISTRATION_OPERATING enrollment type."""

    operating_purpose: OperatingPurpose
    r"""The purpose of the operating account."""
    subtitle: NotRequired[str]
    r"""Optional subtitle for the operating purpose"""
    tax_withholding_metadata: NotRequired[TaxWithholdingMetadataCreateTypedDict]
    r"""Enrollment metadata for TAX_WITHHOLDING operating purpose"""


class OperatingEnrollmentMetadataCreate(BaseModel):
    r"""Enrollment metadata for the REGISTRATION_OPERATING enrollment type."""

    operating_purpose: Annotated[
        OperatingPurpose, PlainValidator(validate_open_enum(False))
    ]
    r"""The purpose of the operating account."""

    subtitle: Optional[str] = None
    r"""Optional subtitle for the operating purpose"""

    tax_withholding_metadata: Optional[TaxWithholdingMetadataCreate] = None
    r"""Enrollment metadata for TAX_WITHHOLDING operating purpose"""
