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

import typing
import uuid

import pydantic
from ......core.pydantic_utilities import IS_PYDANTIC_V2
from .....commons.types.regions import Regions
from .....organization_providers.resources.v_3.types.organization_provider_v_2 import OrganizationProviderV2
from .base_credentialing_span import BaseCredentialingSpan
from .provider_credentialing_span_id import ProviderCredentialingSpanId


class ProviderCredentialingSpan(BaseCredentialingSpan):
    provider_credentialing_span_id: ProviderCredentialingSpanId
    rendering_provider: OrganizationProviderV2 = pydantic.Field()
    """
    The rendering provider covered by the credentialing span.
    """

    regions: Regions = pydantic.Field()
    """
    The states covered by the credentialing span. A span may be national and cover all states.
    """

    medallion_payer_enrollment_id: typing.Optional[uuid.UUID] = pydantic.Field(default=None)
    """
    Provider ID for the related medallion payer enrollment.
    """

    source: str = pydantic.Field()
    """
    Source of the credentialing span.
    """

    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
