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

import typing

import pydantic
from ......core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .....commons.types.claim_id import ClaimId
from .patient_payment_info import PatientPaymentInfo
from .service_line_itemization import ServiceLineItemization


class InvoiceItemizationResponse(UniversalBaseModel):
    claim_id: ClaimId = pydantic.Field()
    """
    The ID of the claim associated with the invoice itemization.
    """

    patient_balance_cents: int = pydantic.Field()
    """
    The total patient balance in cents for the claim. Negative values indicate a credit balance.
    """

    claim_level_patient_payments: PatientPaymentInfo
    service_line_itemization: typing.List[ServiceLineItemization] = pydantic.Field()
    """
    A list of service line itemizations for the claim.
    """

    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
