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

from __future__ import annotations
from .decimalcreate import DecimalCreate, DecimalCreateTypedDict
from .retirementdistributioncreate import (
    RetirementDistributionCreate,
    RetirementDistributionCreateTypedDict,
)
from ascend_sdk.types import BaseModel
from typing import Optional
from typing_extensions import NotRequired, TypedDict


class AchWithdrawalCreateTypedDict(TypedDict):
    r"""A withdrawal transfer using the ACH mechanism."""

    bank_relationship: str
    r"""The bank relationship to be used for the ACH withdrawal."""
    client_transfer_id: str
    r"""The external identifier supplied by the API caller. Each request must have a unique pairing of `client_transfer_id` and `account`."""
    amount: NotRequired[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
    """
    full_disbursement: NotRequired[bool]
    r"""Whether the entire account balance is being withdrawn. Must not be true if the `amount` is specified."""
    memo: NotRequired[str]
    r"""The memo that will appear on the customer's bank statement."""
    retirement_distribution: NotRequired[RetirementDistributionCreateTypedDict]
    r"""A distribution from a retirement account."""


class AchWithdrawalCreate(BaseModel):
    r"""A withdrawal transfer using the ACH mechanism."""

    bank_relationship: str
    r"""The bank relationship to be used for the ACH withdrawal."""

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

    amount: Optional[DecimalCreate] = None
    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
    """

    full_disbursement: Optional[bool] = None
    r"""Whether the entire account balance is being withdrawn. Must not be true if the `amount` is specified."""

    memo: Optional[str] = None
    r"""The memo that will appear on the customer's bank statement."""

    retirement_distribution: Optional[RetirementDistributionCreate] = None
    r"""A distribution from a retirement account."""
