"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
# @generated-id: 311803d1f28e

from __future__ import annotations
from mistralai.client.types import BaseModel
from mistralai.client.utils import validate_const
import pydantic
from pydantic.functional_validators import AfterValidator
from typing import Literal
from typing_extensions import Annotated, TypedDict


class EncryptedPatchValueTypedDict(TypedDict):
    r"""Wrapper for encrypted patch values in selective json_patch encryption.

    When partial encryption mode is enabled and a patch targets an EncryptedStrField,
    the patch value is encrypted and wrapped in this structure.

    The type field acts as a discriminator to distinguish this from user data.
    """

    value: str
    type: Literal["__encrypted__"]


class EncryptedPatchValue(BaseModel):
    r"""Wrapper for encrypted patch values in selective json_patch encryption.

    When partial encryption mode is enabled and a patch targets an EncryptedStrField,
    the patch value is encrypted and wrapped in this structure.

    The type field acts as a discriminator to distinguish this from user data.
    """

    value: str

    type: Annotated[
        Annotated[
            Literal["__encrypted__"], AfterValidator(validate_const("__encrypted__"))
        ],
        pydantic.Field(alias="type"),
    ] = "__encrypted__"


try:
    EncryptedPatchValue.model_rebuild()
except NameError:
    pass
