# 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 .canonical_clinical_trial_association import CanonicalClinicalTrialAssociation
from .canonical_non_insurance_payer_id import CanonicalNonInsurancePayerId
from .period import Period


class CanonicalNonInsurancePayerAssociation(UniversalBaseModel):
    id: CanonicalNonInsurancePayerId
    member_id: typing.Optional[str] = None
    period: typing.Optional[Period] = None
    clinical_trial_info: typing.Optional[typing.List[CanonicalClinicalTrialAssociation]] = pydantic.Field(default=None)
    """
    A patient cannot be associated with a given trial more than once
    """

    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
