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

import datetime as dt
import typing

import pydantic
from ......core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .....commons.types.invoice_id import InvoiceId
from .....financials.types.allocation import Allocation
from .....financials.types.refund_reason import RefundReason
from .....non_insurance_payers.resources.v_1.types.non_insurance_payer import NonInsurancePayer
from .non_insurance_payer_refund_id import NonInsurancePayerRefundId


class NonInsurancePayerRefund(UniversalBaseModel):
    non_insurance_payer_refund_id: NonInsurancePayerRefundId
    non_insurance_payer: NonInsurancePayer
    amount_cents: int
    refund_timestamp: typing.Optional[dt.datetime] = None
    refund_note: typing.Optional[str] = None
    check_number: typing.Optional[str] = None
    allocations: typing.List[Allocation]
    refund_reason: typing.Optional[RefundReason] = None
    invoice_id: typing.Optional[InvoiceId] = None

    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
