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

from __future__ import annotations
from ascend_sdk.models.components import (
    calculatecashbalanceresponse as components_calculatecashbalanceresponse,
    httpmetadata as components_httpmetadata,
    status as components_status,
)
from ascend_sdk.types import BaseModel
from ascend_sdk.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
from enum import Enum
import pydantic
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class Mechanism(str, Enum):
    r"""The withdraw mechanism to calculate the balance for. The mechanism determines what account activity will affect the balance."""

    MECHANISM_UNSPECIFIED = "MECHANISM_UNSPECIFIED"
    ACAT = "ACAT"
    ACH = "ACH"
    CASH_JOURNAL = "CASH_JOURNAL"
    CHECK = "CHECK"
    CREDIT = "CREDIT"
    FEE = "FEE"
    ICT = "ICT"
    PAYPAL = "PAYPAL"
    RTP = "RTP"
    TPJ = "TPJ"
    WIRE = "WIRE"


class CashBalancesCalculateCashBalanceRequestTypedDict(TypedDict):
    account_id: str
    r"""The account id."""
    mechanism: NotRequired[Mechanism]
    r"""The withdraw mechanism to calculate the balance for. The mechanism determines what account activity will affect the balance."""


class CashBalancesCalculateCashBalanceRequest(BaseModel):
    account_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The account id."""

    mechanism: Annotated[
        Optional[Mechanism],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""The withdraw mechanism to calculate the balance for. The mechanism determines what account activity will affect the balance."""


class CashBalancesCalculateCashBalanceResponseTypedDict(TypedDict):
    http_meta: components_httpmetadata.HTTPMetadataTypedDict
    calculate_cash_balance_response: NotRequired[
        components_calculatecashbalanceresponse.CalculateCashBalanceResponseTypedDict
    ]
    r"""OK"""
    status: NotRequired[components_status.StatusTypedDict]
    r"""INVALID_ARGUMENT: The request has an invalid argument."""


class CashBalancesCalculateCashBalanceResponse(BaseModel):
    http_meta: Annotated[
        Optional[components_httpmetadata.HTTPMetadata], pydantic.Field(exclude=True)
    ] = None

    calculate_cash_balance_response: Optional[
        components_calculatecashbalanceresponse.CalculateCashBalanceResponse
    ] = None
    r"""OK"""

    status: Optional[components_status.Status] = None
    r"""INVALID_ARGUMENT: The request has an invalid argument."""
