# 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 .company_details import CompanyDetails
from .guarantor_details import GuarantorDetails
from .responsible_relationship import ResponsibleRelationship
from .vital_core_schemas_db_schemas_lab_test_insurance_person_details import (
    VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails,
)


class ClientFacingInsurance(UniversalBaseModel):
    member_id: str
    payor_code: str
    relationship: ResponsibleRelationship
    insured: VitalCoreSchemasDbSchemasLabTestInsurancePersonDetails
    company: CompanyDetails
    group_id: typing.Optional[str] = None
    guarantor: typing.Optional[GuarantorDetails] = 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
