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

from __future__ import annotations
from .decimalcreate import DecimalCreate, DecimalCreateTypedDict
from .ictdeposit_travelrulecreate import (
    IctDepositTravelRuleCreate,
    IctDepositTravelRuleCreateTypedDict,
)
from .retirementcontributioncreate import (
    RetirementContributionCreate,
    RetirementContributionCreateTypedDict,
)
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 Program(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""The name of the program the ICT deposit is associated with"""

    ICT_PROGRAM_UNSPECIFIED = "ICT_PROGRAM_UNSPECIFIED"
    BROKER_PARTNER = "BROKER_PARTNER"
    DEPOSIT_ONLY = "DEPOSIT_ONLY"
    BANKING_PARTNER = "BANKING_PARTNER"
    MONEY_TRANSMITTER = "MONEY_TRANSMITTER"
    WITHDRAWAL_ONLY = "WITHDRAWAL_ONLY"
    DIGITAL_PARTNER = "DIGITAL_PARTNER"


class IctDepositCreateTypedDict(TypedDict):
    r"""An Instant Cash Transfer. Funds are moved from a configured Firm account to a customer's brokerage account."""

    amount: DecimalCreateTypedDict
    r"""A representation of a decimal value, such as 2.5. Clients may convert values into language-native decimal formats, such as Java's [BigDecimal][] or Python's [decimal.Decimal][].

    [BigDecimal]:
    https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/BigDecimal.html
    [decimal.Decimal]: https://docs.python.org/3/library/decimal.html
    """
    client_transfer_id: str
    r"""External identifier supplied by the API caller. Each request must have a unique pairing of client_transfer_id and account."""
    program: Program
    r"""The name of the program the ICT deposit is associated with"""
    travel_rule: IctDepositTravelRuleCreateTypedDict
    r"""The travel rules associated with an ICT deposit"""
    retirement_contribution: NotRequired[RetirementContributionCreateTypedDict]
    r"""A contribution to a retirement account."""


class IctDepositCreate(BaseModel):
    r"""An Instant Cash Transfer. Funds are moved from a configured Firm account to a customer's brokerage account."""

    amount: DecimalCreate
    r"""A representation of a decimal value, such as 2.5. Clients may convert values into language-native decimal formats, such as Java's [BigDecimal][] or Python's [decimal.Decimal][].

    [BigDecimal]:
    https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/math/BigDecimal.html
    [decimal.Decimal]: https://docs.python.org/3/library/decimal.html
    """

    client_transfer_id: str
    r"""External identifier supplied by the API caller. Each request must have a unique pairing of client_transfer_id and account."""

    program: Annotated[Program, PlainValidator(validate_open_enum(False))]
    r"""The name of the program the ICT deposit is associated with"""

    travel_rule: IctDepositTravelRuleCreate
    r"""The travel rules associated with an ICT deposit"""

    retirement_contribution: Optional[RetirementContributionCreate] = None
    r"""A contribution to a retirement account."""
