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

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


class CashJournalCreateTypedDict(TypedDict):
    r"""A cash journal transfer. Funds are moved from a source account to a destination account"""

    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 `source_account`"""
    destination_account: str
    r"""The account that funds will be moved to"""
    source_account: str
    r"""The account that funds will be moved from"""
    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 source account balance is being withdrawn Must not be true if the `amount` is specified"""
    retirement_contribution: NotRequired[RetirementContributionCreateTypedDict]
    r"""A contribution to a retirement account."""
    retirement_distribution: NotRequired[RetirementDistributionCreateTypedDict]
    r"""A distribution from a retirement account."""


class CashJournalCreate(BaseModel):
    r"""A cash journal transfer. Funds are moved from a source account to a destination account"""

    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 `source_account`"""

    destination_account: str
    r"""The account that funds will be moved to"""

    source_account: str
    r"""The account that funds will be moved from"""

    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 source account balance is being withdrawn Must not be true if the `amount` is specified"""

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

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