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

from ..core.pydantic_utilities import UniversalBaseModel
import typing
import pydantic
import typing_extensions
from .detokenize_record_response_value_type import DetokenizeRecordResponseValueType
from ..core.serialization import FieldMetadata
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class V1DetokenizeRecordResponse(UniversalBaseModel):
    token: typing.Optional[str] = pydantic.Field(default=None)
    """
    Token of the record.
    """

    value_type: typing_extensions.Annotated[
        typing.Optional[DetokenizeRecordResponseValueType], FieldMetadata(alias="valueType")
    ] = None
    value: typing.Optional[str] = pydantic.Field(default=None)
    """
    Data corresponding to the token.
    """

    error: typing.Optional[str] = pydantic.Field(default=None)
    """
    Error if token isn't found.
    """

    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
