# This file was auto-generated by Fern from our API Definition.

from ...core.pydantic_utilities import UniversalBaseModel
import pydantic
from .currency_code import CurrencyCode
from .payment_method_balance_status import PaymentMethodBalanceStatus
import typing
import datetime as dt
from ...core.pydantic_utilities import IS_PYDANTIC_V2


class PaymentMethodBalanceResponse(UniversalBaseModel):
    available_balance: float = pydantic.Field(alias="availableBalance")
    currency: CurrencyCode
    status: PaymentMethodBalanceStatus = pydantic.Field()
    """
    If the status is UNAVAILABLE, the account does not support this operation. If the status is ERROR, the account may need to be re-linked with Plaid.
    """

    updated_at: typing.Optional[dt.datetime] = pydantic.Field(alias="updatedAt", default=None)
    """
    The time the balance was last updated. Will be null if the balance has never been updated.
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
