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

from __future__ import annotations

import typing

import typing_extensions

from .billing_provider_allocation_target import BillingProviderAllocationTarget
from .claim_allocation_target import ClaimAllocationTarget
from .service_line_allocation_target import ServiceLineAllocationTarget

try:
    import pydantic.v1 as pydantic  # type: ignore
except ImportError:
    import pydantic  # type: ignore


class AllocationTarget_ServiceLine(ServiceLineAllocationTarget):
    type: typing_extensions.Literal["service_line"]

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True


class AllocationTarget_Claim(ClaimAllocationTarget):
    type: typing_extensions.Literal["claim"]

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True


class AllocationTarget_BillingProviderId(BillingProviderAllocationTarget):
    type: typing_extensions.Literal["billing_provider_id"]

    class Config:
        frozen = True
        smart_union = True
        allow_population_by_field_name = True


class AllocationTarget_Unattributed(pydantic.BaseModel):
    type: typing_extensions.Literal["unattributed"]

    class Config:
        frozen = True
        smart_union = True


AllocationTarget = typing.Union[
    AllocationTarget_ServiceLine,
    AllocationTarget_Claim,
    AllocationTarget_BillingProviderId,
    AllocationTarget_Unattributed,
]
