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

from __future__ import annotations

import typing

import pydantic
from ......core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from .....commons.types.claim_id import ClaimId
from .....commons.types.provider_id import ProviderId
from .....commons.types.service_line_id import ServiceLineId


class InsuranceWriteOffTarget_ServiceLineId(UniversalBaseModel):
    value: ServiceLineId
    type: typing.Literal["service_line_id"] = "service_line_id"

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

        class Config:
            frozen = True
            smart_union = True


class InsuranceWriteOffTarget_ClaimId(UniversalBaseModel):
    value: ClaimId
    type: typing.Literal["claim_id"] = "claim_id"

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

        class Config:
            frozen = True
            smart_union = True


class InsuranceWriteOffTarget_BillingProviderId(UniversalBaseModel):
    value: ProviderId
    type: typing.Literal["billing_provider_id"] = "billing_provider_id"

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

        class Config:
            frozen = True
            smart_union = True


InsuranceWriteOffTarget = typing.Union[
    InsuranceWriteOffTarget_ServiceLineId, InsuranceWriteOffTarget_ClaimId, InsuranceWriteOffTarget_BillingProviderId
]
