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

from ......core.pydantic_utilities import UniversalBaseModel
from .....commons.types.charge_capture_bundle_id import ChargeCaptureBundleId
import typing
from .....commons.types.encounter_id import EncounterId
from .charge_capture_bundle_status import ChargeCaptureBundleStatus
import pydantic
from .....charge_capture.resources.v_1.types.charge_capture import ChargeCapture
from .charge_bundle_error import ChargeBundleError
from ......core.pydantic_utilities import IS_PYDANTIC_V2


class ChargeCaptureBundle(UniversalBaseModel):
    id: ChargeCaptureBundleId
    created_encounter_id: typing.Optional[EncounterId] = None
    status: ChargeCaptureBundleStatus = pydantic.Field()
    """
    Status of the Bundle, Successful means that the Bundle created a corresponding Claim
    """

    charge_captures: typing.List[ChargeCapture] = pydantic.Field()
    """
    All the underlying ChargeCaptures that are present in a ChargeCaptureBundle.
    """

    errors: typing.List[ChargeBundleError] = pydantic.Field()
    """
    All errors that were found when the bundle was attempted to be created.
    Errors can correspond to the Bundle as a whole or specific underlying Charge Captures.
    """

    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
