"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
# @generated-id: 6afe7b95a53c

from __future__ import annotations
from mollie.types import BaseModel, UNSET_SENTINEL
import pydantic
from pydantic import model_serializer
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class AccountDetailsTypedDict(TypedDict):
    r"""The account holder details and bank account information for the business account."""

    account_holder_name: str
    r"""The name of the account holder."""
    currency: str
    r"""The currency of the account in ISO 4217 format."""
    iban: str
    r"""The IBAN (International Bank Account Number) of the account."""
    name: NotRequired[str]
    r"""A name of the account."""
    bic: NotRequired[str]
    r"""The BIC (Bank Identifier Code) of the account."""


class AccountDetails(BaseModel):
    r"""The account holder details and bank account information for the business account."""

    account_holder_name: Annotated[str, pydantic.Field(alias="accountHolderName")]
    r"""The name of the account holder."""

    currency: str
    r"""The currency of the account in ISO 4217 format."""

    iban: str
    r"""The IBAN (International Bank Account Number) of the account."""

    name: Optional[str] = None
    r"""A name of the account."""

    bic: Optional[str] = None
    r"""The BIC (Bank Identifier Code) of the account."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["name", "bic"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


try:
    AccountDetails.model_rebuild()
except NameError:
    pass
