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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .money import Money
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class ProcessingFee(UncheckedBaseModel):
    """
    Represents the Square processing fee.
    """

    effective_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The timestamp of when the fee takes effect, in RFC 3339 format.
    """

    type: typing.Optional[str] = pydantic.Field(default=None)
    """
    The type of fee assessed or adjusted. The fee type can be `INITIAL` or `ADJUSTMENT`.
    """

    amount_money: typing.Optional[Money] = pydantic.Field(default=None)
    """
    The fee amount, which might be negative, that is assessed or adjusted by Square.
    
    Positive values represent funds being assessed, while negative values represent
    funds being returned.
    """

    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
