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

from __future__ import annotations
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 BankAccountUpdateType(str, Enum, metaclass=utils.OpenEnumMeta):
    r"""The bank account type."""

    TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED"
    CHECKING = "CHECKING"
    SAVINGS = "SAVINGS"


class BankAccountUpdateTypedDict(TypedDict):
    r"""A representation of a bank account."""

    account_number: NotRequired[str]
    r"""The bank account number. This value will be masked in responses."""
    owner: NotRequired[str]
    r"""The name of the bank account owner."""
    routing_number: NotRequired[str]
    r"""The bank routing number (either ABA or BIC)."""
    type: NotRequired[BankAccountUpdateType]
    r"""The bank account type."""


class BankAccountUpdate(BaseModel):
    r"""A representation of a bank account."""

    account_number: Optional[str] = None
    r"""The bank account number. This value will be masked in responses."""

    owner: Optional[str] = None
    r"""The name of the bank account owner."""

    routing_number: Optional[str] = None
    r"""The bank routing number (either ABA or BIC)."""

    type: Annotated[
        Optional[BankAccountUpdateType], PlainValidator(validate_open_enum(False))
    ] = None
    r"""The bank account type."""
