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

import typing

import pydantic
import typing_extensions
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
from ...core.serialization import FieldMetadata
from .search_response_resource_type import SearchResponseResourceType


class SearchResponse(UniversalBaseModel):
    resource_type: typing_extensions.Annotated[
        typing.Optional[SearchResponseResourceType],
        FieldMetadata(alias="resourceType"),
        pydantic.Field(alias="resourceType", description="The FHIR resource type identified for the search"),
    ] = None
    search_params: typing_extensions.Annotated[
        typing.Optional[str],
        FieldMetadata(alias="searchParams"),
        pydantic.Field(
            alias="searchParams",
            description="FHIR search parameters in standard query string format.\nParameters are formatted according to the FHIR specification with appropriate operators.\nCode parameters are resolved to standard terminology codes (SNOMED CT, LOINC, RxNorm, ICD-10-CM).",
        ),
    ] = 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
