"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from documenso_sdk import utils
from documenso_sdk.types import BaseModel, Nullable, UNSET_SENTINEL
from enum import Enum
import pydantic
from pydantic import model_serializer
from typing import Any, List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody11Type(str, Enum):
    DROPDOWN = "DROPDOWN"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody11FieldMetaType(
    str, Enum
):
    DROPDOWN = "dropdown"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestValuesTypedDict(TypedDict):
    value: str


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestValues(BaseModel):
    value: str


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody11FieldMetaTypedDict(
    TypedDict
):
    type: (
        FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody11FieldMetaType
    )
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    values: NotRequired[
        List[FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestValuesTypedDict]
    ]
    default_value: NotRequired[str]


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody11FieldMeta(
    BaseModel
):
    type: (
        FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody11FieldMetaType
    )

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    values: Optional[
        List[FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestValues]
    ] = None

    default_value: Annotated[Optional[str], pydantic.Field(alias="defaultValue")] = None


class FieldUpdateDocumentFieldsFields11TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody11Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody11FieldMetaTypedDict
    ]
    page_number: NotRequired[float]
    r"""The page number the field will be on."""
    page_x: NotRequired[float]
    r"""The X coordinate of where the field will be placed."""
    page_y: NotRequired[float]
    r"""The Y coordinate of where the field will be placed."""
    width: NotRequired[float]
    r"""The width of the field."""
    height: NotRequired[float]
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFields11(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody11Type

    id: float
    r"""The ID of the field to update."""

    field_meta: Annotated[
        Optional[
            FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody11FieldMeta
        ],
        pydantic.Field(alias="fieldMeta"),
    ] = None

    page_number: Annotated[Optional[float], pydantic.Field(alias="pageNumber")] = None
    r"""The page number the field will be on."""

    page_x: Annotated[Optional[float], pydantic.Field(alias="pageX")] = None
    r"""The X coordinate of where the field will be placed."""

    page_y: Annotated[Optional[float], pydantic.Field(alias="pageY")] = None
    r"""The Y coordinate of where the field will be placed."""

    width: Optional[float] = None
    r"""The width of the field."""

    height: Optional[float] = None
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody10Type(str, Enum):
    CHECKBOX = "CHECKBOX"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody10FieldMetaType(
    str, Enum
):
    CHECKBOX = "checkbox"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsValuesTypedDict(TypedDict):
    id: float
    checked: bool
    value: str


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsValues(BaseModel):
    id: float

    checked: bool

    value: str


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody10FieldMetaTypedDict(
    TypedDict
):
    type: (
        FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody10FieldMetaType
    )
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    values: NotRequired[
        List[FieldUpdateDocumentFieldsFieldsDocumentsFieldsValuesTypedDict]
    ]
    validation_rule: NotRequired[str]
    validation_length: NotRequired[float]


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody10FieldMeta(
    BaseModel
):
    type: (
        FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody10FieldMetaType
    )

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    values: Optional[List[FieldUpdateDocumentFieldsFieldsDocumentsFieldsValues]] = None

    validation_rule: Annotated[
        Optional[str], pydantic.Field(alias="validationRule")
    ] = None

    validation_length: Annotated[
        Optional[float], pydantic.Field(alias="validationLength")
    ] = None


class FieldUpdateDocumentFieldsFields10TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody10Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody10FieldMetaTypedDict
    ]
    page_number: NotRequired[float]
    r"""The page number the field will be on."""
    page_x: NotRequired[float]
    r"""The X coordinate of where the field will be placed."""
    page_y: NotRequired[float]
    r"""The Y coordinate of where the field will be placed."""
    width: NotRequired[float]
    r"""The width of the field."""
    height: NotRequired[float]
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFields10(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody10Type

    id: float
    r"""The ID of the field to update."""

    field_meta: Annotated[
        Optional[
            FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody10FieldMeta
        ],
        pydantic.Field(alias="fieldMeta"),
    ] = None

    page_number: Annotated[Optional[float], pydantic.Field(alias="pageNumber")] = None
    r"""The page number the field will be on."""

    page_x: Annotated[Optional[float], pydantic.Field(alias="pageX")] = None
    r"""The X coordinate of where the field will be placed."""

    page_y: Annotated[Optional[float], pydantic.Field(alias="pageY")] = None
    r"""The Y coordinate of where the field will be placed."""

    width: Optional[float] = None
    r"""The width of the field."""

    height: Optional[float] = None
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody9Type(str, Enum):
    RADIO = "RADIO"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody9FieldMetaType(
    str, Enum
):
    RADIO = "radio"


class FieldUpdateDocumentFieldsFieldsValuesTypedDict(TypedDict):
    id: float
    checked: bool
    value: str


class FieldUpdateDocumentFieldsFieldsValues(BaseModel):
    id: float

    checked: bool

    value: str


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody9FieldMetaTypedDict(
    TypedDict
):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody9FieldMetaType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    values: NotRequired[List[FieldUpdateDocumentFieldsFieldsValuesTypedDict]]


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody9FieldMeta(
    BaseModel
):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody9FieldMetaType

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    values: Optional[List[FieldUpdateDocumentFieldsFieldsValues]] = None


class FieldUpdateDocumentFieldsFields9TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody9Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody9FieldMetaTypedDict
    ]
    page_number: NotRequired[float]
    r"""The page number the field will be on."""
    page_x: NotRequired[float]
    r"""The X coordinate of where the field will be placed."""
    page_y: NotRequired[float]
    r"""The Y coordinate of where the field will be placed."""
    width: NotRequired[float]
    r"""The width of the field."""
    height: NotRequired[float]
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFields9(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody9Type

    id: float
    r"""The ID of the field to update."""

    field_meta: Annotated[
        Optional[
            FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody9FieldMeta
        ],
        pydantic.Field(alias="fieldMeta"),
    ] = None

    page_number: Annotated[Optional[float], pydantic.Field(alias="pageNumber")] = None
    r"""The page number the field will be on."""

    page_x: Annotated[Optional[float], pydantic.Field(alias="pageX")] = None
    r"""The X coordinate of where the field will be placed."""

    page_y: Annotated[Optional[float], pydantic.Field(alias="pageY")] = None
    r"""The Y coordinate of where the field will be placed."""

    width: Optional[float] = None
    r"""The width of the field."""

    height: Optional[float] = None
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody8Type(str, Enum):
    NUMBER = "NUMBER"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody8FieldMetaType(
    str, Enum
):
    NUMBER = "number"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody8FieldMetaTypedDict(
    TypedDict
):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody8FieldMetaType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    number_format: NotRequired[str]
    value: NotRequired[str]
    min_value: NotRequired[float]
    max_value: NotRequired[float]
    font_size: NotRequired[float]


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody8FieldMeta(
    BaseModel
):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody8FieldMetaType

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    number_format: Annotated[Optional[str], pydantic.Field(alias="numberFormat")] = None

    value: Optional[str] = None

    min_value: Annotated[Optional[float], pydantic.Field(alias="minValue")] = None

    max_value: Annotated[Optional[float], pydantic.Field(alias="maxValue")] = None

    font_size: Annotated[Optional[float], pydantic.Field(alias="fontSize")] = None


class FieldUpdateDocumentFieldsFields8TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody8Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody8FieldMetaTypedDict
    ]
    page_number: NotRequired[float]
    r"""The page number the field will be on."""
    page_x: NotRequired[float]
    r"""The X coordinate of where the field will be placed."""
    page_y: NotRequired[float]
    r"""The Y coordinate of where the field will be placed."""
    width: NotRequired[float]
    r"""The width of the field."""
    height: NotRequired[float]
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFields8(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody8Type

    id: float
    r"""The ID of the field to update."""

    field_meta: Annotated[
        Optional[
            FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody8FieldMeta
        ],
        pydantic.Field(alias="fieldMeta"),
    ] = None

    page_number: Annotated[Optional[float], pydantic.Field(alias="pageNumber")] = None
    r"""The page number the field will be on."""

    page_x: Annotated[Optional[float], pydantic.Field(alias="pageX")] = None
    r"""The X coordinate of where the field will be placed."""

    page_y: Annotated[Optional[float], pydantic.Field(alias="pageY")] = None
    r"""The Y coordinate of where the field will be placed."""

    width: Optional[float] = None
    r"""The width of the field."""

    height: Optional[float] = None
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody7Type(str, Enum):
    TEXT = "TEXT"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody7FieldMetaType(
    str, Enum
):
    TEXT = "text"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody7FieldMetaTypedDict(
    TypedDict
):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody7FieldMetaType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    text: NotRequired[str]
    character_limit: NotRequired[float]
    font_size: NotRequired[float]


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody7FieldMeta(
    BaseModel
):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody7FieldMetaType

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    text: Optional[str] = None

    character_limit: Annotated[
        Optional[float], pydantic.Field(alias="characterLimit")
    ] = None

    font_size: Annotated[Optional[float], pydantic.Field(alias="fontSize")] = None


class FieldUpdateDocumentFieldsFields7TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody7Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody7FieldMetaTypedDict
    ]
    page_number: NotRequired[float]
    r"""The page number the field will be on."""
    page_x: NotRequired[float]
    r"""The X coordinate of where the field will be placed."""
    page_y: NotRequired[float]
    r"""The Y coordinate of where the field will be placed."""
    width: NotRequired[float]
    r"""The width of the field."""
    height: NotRequired[float]
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFields7(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody7Type

    id: float
    r"""The ID of the field to update."""

    field_meta: Annotated[
        Optional[
            FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody7FieldMeta
        ],
        pydantic.Field(alias="fieldMeta"),
    ] = None

    page_number: Annotated[Optional[float], pydantic.Field(alias="pageNumber")] = None
    r"""The page number the field will be on."""

    page_x: Annotated[Optional[float], pydantic.Field(alias="pageX")] = None
    r"""The X coordinate of where the field will be placed."""

    page_y: Annotated[Optional[float], pydantic.Field(alias="pageY")] = None
    r"""The Y coordinate of where the field will be placed."""

    width: Optional[float] = None
    r"""The width of the field."""

    height: Optional[float] = None
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody6Type(str, Enum):
    DATE = "DATE"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody6FieldMetaType(
    str, Enum
):
    DATE = "date"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBodyFieldMetaTypedDict(
    TypedDict
):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody6FieldMetaType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    font_size: NotRequired[float]


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBodyFieldMeta(
    BaseModel
):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody6FieldMetaType

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    font_size: Annotated[Optional[float], pydantic.Field(alias="fontSize")] = None


class FieldUpdateDocumentFieldsFields6TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody6Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBodyFieldMetaTypedDict
    ]
    page_number: NotRequired[float]
    r"""The page number the field will be on."""
    page_x: NotRequired[float]
    r"""The X coordinate of where the field will be placed."""
    page_y: NotRequired[float]
    r"""The Y coordinate of where the field will be placed."""
    width: NotRequired[float]
    r"""The width of the field."""
    height: NotRequired[float]
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFields6(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody6Type

    id: float
    r"""The ID of the field to update."""

    field_meta: Annotated[
        Optional[
            FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBodyFieldMeta
        ],
        pydantic.Field(alias="fieldMeta"),
    ] = None

    page_number: Annotated[Optional[float], pydantic.Field(alias="pageNumber")] = None
    r"""The page number the field will be on."""

    page_x: Annotated[Optional[float], pydantic.Field(alias="pageX")] = None
    r"""The X coordinate of where the field will be placed."""

    page_y: Annotated[Optional[float], pydantic.Field(alias="pageY")] = None
    r"""The Y coordinate of where the field will be placed."""

    width: Optional[float] = None
    r"""The width of the field."""

    height: Optional[float] = None
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody5Type(str, Enum):
    EMAIL = "EMAIL"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody5FieldMetaType(
    str, Enum
):
    EMAIL = "email"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestFieldMetaTypedDict(
    TypedDict
):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody5FieldMetaType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    font_size: NotRequired[float]


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestFieldMeta(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody5FieldMetaType

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    font_size: Annotated[Optional[float], pydantic.Field(alias="fontSize")] = None


class FieldUpdateDocumentFieldsFields5TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody5Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestFieldMetaTypedDict
    ]
    page_number: NotRequired[float]
    r"""The page number the field will be on."""
    page_x: NotRequired[float]
    r"""The X coordinate of where the field will be placed."""
    page_y: NotRequired[float]
    r"""The Y coordinate of where the field will be placed."""
    width: NotRequired[float]
    r"""The width of the field."""
    height: NotRequired[float]
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFields5(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody5Type

    id: float
    r"""The ID of the field to update."""

    field_meta: Annotated[
        Optional[FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestFieldMeta],
        pydantic.Field(alias="fieldMeta"),
    ] = None

    page_number: Annotated[Optional[float], pydantic.Field(alias="pageNumber")] = None
    r"""The page number the field will be on."""

    page_x: Annotated[Optional[float], pydantic.Field(alias="pageX")] = None
    r"""The X coordinate of where the field will be placed."""

    page_y: Annotated[Optional[float], pydantic.Field(alias="pageY")] = None
    r"""The Y coordinate of where the field will be placed."""

    width: Optional[float] = None
    r"""The width of the field."""

    height: Optional[float] = None
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody4Type(str, Enum):
    NAME = "NAME"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody4FieldMetaType(
    str, Enum
):
    NAME = "name"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsFieldMetaTypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody4FieldMetaType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    font_size: NotRequired[float]


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsFieldMeta(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody4FieldMetaType

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    font_size: Annotated[Optional[float], pydantic.Field(alias="fontSize")] = None


class FieldUpdateDocumentFieldsFields4TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody4Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateDocumentFieldsFieldsDocumentsFieldsFieldMetaTypedDict
    ]
    page_number: NotRequired[float]
    r"""The page number the field will be on."""
    page_x: NotRequired[float]
    r"""The X coordinate of where the field will be placed."""
    page_y: NotRequired[float]
    r"""The Y coordinate of where the field will be placed."""
    width: NotRequired[float]
    r"""The width of the field."""
    height: NotRequired[float]
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFields4(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBody4Type

    id: float
    r"""The ID of the field to update."""

    field_meta: Annotated[
        Optional[FieldUpdateDocumentFieldsFieldsDocumentsFieldsFieldMeta],
        pydantic.Field(alias="fieldMeta"),
    ] = None

    page_number: Annotated[Optional[float], pydantic.Field(alias="pageNumber")] = None
    r"""The page number the field will be on."""

    page_x: Annotated[Optional[float], pydantic.Field(alias="pageX")] = None
    r"""The X coordinate of where the field will be placed."""

    page_y: Annotated[Optional[float], pydantic.Field(alias="pageY")] = None
    r"""The Y coordinate of where the field will be placed."""

    width: Optional[float] = None
    r"""The width of the field."""

    height: Optional[float] = None
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestType(str, Enum):
    INITIALS = "INITIALS"


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBodyType(str, Enum):
    INITIALS = "initials"


class FieldUpdateDocumentFieldsFieldsFieldMetaTypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBodyType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    font_size: NotRequired[float]


class FieldUpdateDocumentFieldsFieldsFieldMeta(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestRequestBodyType

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    font_size: Annotated[Optional[float], pydantic.Field(alias="fontSize")] = None


class FieldUpdateDocumentFieldsFields3TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestType
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[FieldUpdateDocumentFieldsFieldsFieldMetaTypedDict]
    page_number: NotRequired[float]
    r"""The page number the field will be on."""
    page_x: NotRequired[float]
    r"""The X coordinate of where the field will be placed."""
    page_y: NotRequired[float]
    r"""The Y coordinate of where the field will be placed."""
    width: NotRequired[float]
    r"""The width of the field."""
    height: NotRequired[float]
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFields3(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsRequestType

    id: float
    r"""The ID of the field to update."""

    field_meta: Annotated[
        Optional[FieldUpdateDocumentFieldsFieldsFieldMeta],
        pydantic.Field(alias="fieldMeta"),
    ] = None

    page_number: Annotated[Optional[float], pydantic.Field(alias="pageNumber")] = None
    r"""The page number the field will be on."""

    page_x: Annotated[Optional[float], pydantic.Field(alias="pageX")] = None
    r"""The X coordinate of where the field will be placed."""

    page_y: Annotated[Optional[float], pydantic.Field(alias="pageY")] = None
    r"""The Y coordinate of where the field will be placed."""

    width: Optional[float] = None
    r"""The width of the field."""

    height: Optional[float] = None
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFieldsDocumentsFieldsType(str, Enum):
    FREE_SIGNATURE = "FREE_SIGNATURE"


class FieldUpdateDocumentFieldsFields2TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsType
    id: float
    r"""The ID of the field to update."""
    page_number: NotRequired[float]
    r"""The page number the field will be on."""
    page_x: NotRequired[float]
    r"""The X coordinate of where the field will be placed."""
    page_y: NotRequired[float]
    r"""The Y coordinate of where the field will be placed."""
    width: NotRequired[float]
    r"""The width of the field."""
    height: NotRequired[float]
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFields2(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsDocumentsFieldsType

    id: float
    r"""The ID of the field to update."""

    page_number: Annotated[Optional[float], pydantic.Field(alias="pageNumber")] = None
    r"""The page number the field will be on."""

    page_x: Annotated[Optional[float], pydantic.Field(alias="pageX")] = None
    r"""The X coordinate of where the field will be placed."""

    page_y: Annotated[Optional[float], pydantic.Field(alias="pageY")] = None
    r"""The Y coordinate of where the field will be placed."""

    width: Optional[float] = None
    r"""The width of the field."""

    height: Optional[float] = None
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFieldsType(str, Enum):
    SIGNATURE = "SIGNATURE"


class FieldUpdateDocumentFieldsFields1TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldsType
    id: float
    r"""The ID of the field to update."""
    page_number: NotRequired[float]
    r"""The page number the field will be on."""
    page_x: NotRequired[float]
    r"""The X coordinate of where the field will be placed."""
    page_y: NotRequired[float]
    r"""The Y coordinate of where the field will be placed."""
    width: NotRequired[float]
    r"""The width of the field."""
    height: NotRequired[float]
    r"""The height of the field."""


class FieldUpdateDocumentFieldsFields1(BaseModel):
    type: FieldUpdateDocumentFieldsFieldsType

    id: float
    r"""The ID of the field to update."""

    page_number: Annotated[Optional[float], pydantic.Field(alias="pageNumber")] = None
    r"""The page number the field will be on."""

    page_x: Annotated[Optional[float], pydantic.Field(alias="pageX")] = None
    r"""The X coordinate of where the field will be placed."""

    page_y: Annotated[Optional[float], pydantic.Field(alias="pageY")] = None
    r"""The Y coordinate of where the field will be placed."""

    width: Optional[float] = None
    r"""The width of the field."""

    height: Optional[float] = None
    r"""The height of the field."""


FieldUpdateDocumentFieldsFieldsTypedDict = TypeAliasType(
    "FieldUpdateDocumentFieldsFieldsTypedDict",
    Union[
        FieldUpdateDocumentFieldsFields1TypedDict,
        FieldUpdateDocumentFieldsFields2TypedDict,
        FieldUpdateDocumentFieldsFields3TypedDict,
        FieldUpdateDocumentFieldsFields4TypedDict,
        FieldUpdateDocumentFieldsFields5TypedDict,
        FieldUpdateDocumentFieldsFields6TypedDict,
        FieldUpdateDocumentFieldsFields7TypedDict,
        FieldUpdateDocumentFieldsFields8TypedDict,
        FieldUpdateDocumentFieldsFields9TypedDict,
        FieldUpdateDocumentFieldsFields10TypedDict,
        FieldUpdateDocumentFieldsFields11TypedDict,
    ],
)


FieldUpdateDocumentFieldsFields = TypeAliasType(
    "FieldUpdateDocumentFieldsFields",
    Union[
        FieldUpdateDocumentFieldsFields1,
        FieldUpdateDocumentFieldsFields2,
        FieldUpdateDocumentFieldsFields3,
        FieldUpdateDocumentFieldsFields4,
        FieldUpdateDocumentFieldsFields5,
        FieldUpdateDocumentFieldsFields6,
        FieldUpdateDocumentFieldsFields7,
        FieldUpdateDocumentFieldsFields8,
        FieldUpdateDocumentFieldsFields9,
        FieldUpdateDocumentFieldsFields10,
        FieldUpdateDocumentFieldsFields11,
    ],
)


class FieldUpdateDocumentFieldsRequestBodyTypedDict(TypedDict):
    document_id: float
    fields: List[FieldUpdateDocumentFieldsFieldsTypedDict]


class FieldUpdateDocumentFieldsRequestBody(BaseModel):
    document_id: Annotated[float, pydantic.Field(alias="documentId")]

    fields: List[FieldUpdateDocumentFieldsFields]


class FieldUpdateDocumentFieldsDocumentsFieldsIssuesTypedDict(TypedDict):
    message: str


class FieldUpdateDocumentFieldsDocumentsFieldsIssues(BaseModel):
    message: str


class FieldUpdateDocumentFieldsDocumentsFieldsResponseResponseBodyData(BaseModel):
    message: str

    code: str

    issues: Optional[List[FieldUpdateDocumentFieldsDocumentsFieldsIssues]] = None


class FieldUpdateDocumentFieldsDocumentsFieldsResponseResponseBody(Exception):
    r"""Internal server error"""

    data: FieldUpdateDocumentFieldsDocumentsFieldsResponseResponseBodyData

    def __init__(
        self, data: FieldUpdateDocumentFieldsDocumentsFieldsResponseResponseBodyData
    ):
        self.data = data

    def __str__(self) -> str:
        return utils.marshal_json(
            self.data, FieldUpdateDocumentFieldsDocumentsFieldsResponseResponseBodyData
        )


class FieldUpdateDocumentFieldsIssuesTypedDict(TypedDict):
    message: str


class FieldUpdateDocumentFieldsIssues(BaseModel):
    message: str


class FieldUpdateDocumentFieldsDocumentsFieldsResponseBodyData(BaseModel):
    message: str

    code: str

    issues: Optional[List[FieldUpdateDocumentFieldsIssues]] = None


class FieldUpdateDocumentFieldsDocumentsFieldsResponseBody(Exception):
    r"""Invalid input data"""

    data: FieldUpdateDocumentFieldsDocumentsFieldsResponseBodyData

    def __init__(self, data: FieldUpdateDocumentFieldsDocumentsFieldsResponseBodyData):
        self.data = data

    def __str__(self) -> str:
        return utils.marshal_json(
            self.data, FieldUpdateDocumentFieldsDocumentsFieldsResponseBodyData
        )


class FieldUpdateDocumentFieldsType(str, Enum):
    SIGNATURE = "SIGNATURE"
    FREE_SIGNATURE = "FREE_SIGNATURE"
    INITIALS = "INITIALS"
    NAME = "NAME"
    EMAIL = "EMAIL"
    DATE = "DATE"
    TEXT = "TEXT"
    NUMBER = "NUMBER"
    RADIO = "RADIO"
    CHECKBOX = "CHECKBOX"
    DROPDOWN = "DROPDOWN"


class FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONResponseBodyFields9Type(
    str, Enum
):
    DROPDOWN = "dropdown"


class FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponseValuesTypedDict(
    TypedDict
):
    value: str


class FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponseValues(BaseModel):
    value: str


class FieldUpdateDocumentFieldsFieldMeta9TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONResponseBodyFields9Type
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    values: NotRequired[
        List[FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponseValuesTypedDict]
    ]
    default_value: NotRequired[str]


class FieldUpdateDocumentFieldsFieldMeta9(BaseModel):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONResponseBodyFields9Type

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    values: Optional[
        List[FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponseValues]
    ] = None

    default_value: Annotated[Optional[str], pydantic.Field(alias="defaultValue")] = None


class FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONResponseBodyFields8Type(
    str, Enum
):
    CHECKBOX = "checkbox"


class FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsValuesTypedDict(TypedDict):
    id: float
    checked: bool
    value: str


class FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsValues(BaseModel):
    id: float

    checked: bool

    value: str


class FieldUpdateDocumentFieldsFieldMeta8TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONResponseBodyFields8Type
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    values: NotRequired[
        List[FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsValuesTypedDict]
    ]
    validation_rule: NotRequired[str]
    validation_length: NotRequired[float]


class FieldUpdateDocumentFieldsFieldMeta8(BaseModel):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONResponseBodyFields8Type

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    values: Optional[List[FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsValues]] = (
        None
    )

    validation_rule: Annotated[
        Optional[str], pydantic.Field(alias="validationRule")
    ] = None

    validation_length: Annotated[
        Optional[float], pydantic.Field(alias="validationLength")
    ] = None


class FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONResponseBodyFieldsType(
    str, Enum
):
    RADIO = "radio"


class FieldUpdateDocumentFieldsFieldMetaValuesTypedDict(TypedDict):
    id: float
    checked: bool
    value: str


class FieldUpdateDocumentFieldsFieldMetaValues(BaseModel):
    id: float

    checked: bool

    value: str


class FieldUpdateDocumentFieldsFieldMeta7TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONResponseBodyFieldsType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    values: NotRequired[List[FieldUpdateDocumentFieldsFieldMetaValuesTypedDict]]


class FieldUpdateDocumentFieldsFieldMeta7(BaseModel):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONResponseBodyFieldsType

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    values: Optional[List[FieldUpdateDocumentFieldsFieldMetaValues]] = None


class FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONResponseBodyType(
    str, Enum
):
    NUMBER = "number"


class FieldUpdateDocumentFieldsFieldMeta6TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONResponseBodyType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    number_format: NotRequired[str]
    value: NotRequired[str]
    min_value: NotRequired[float]
    max_value: NotRequired[float]
    font_size: NotRequired[float]


class FieldUpdateDocumentFieldsFieldMeta6(BaseModel):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONResponseBodyType

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    number_format: Annotated[Optional[str], pydantic.Field(alias="numberFormat")] = None

    value: Optional[str] = None

    min_value: Annotated[Optional[float], pydantic.Field(alias="minValue")] = None

    max_value: Annotated[Optional[float], pydantic.Field(alias="maxValue")] = None

    font_size: Annotated[Optional[float], pydantic.Field(alias="fontSize")] = None


class FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONType(
    str, Enum
):
    TEXT = "text"


class FieldUpdateDocumentFieldsFieldMeta5TypedDict(TypedDict):
    type: (
        FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONType
    )
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    text: NotRequired[str]
    character_limit: NotRequired[float]
    font_size: NotRequired[float]


class FieldUpdateDocumentFieldsFieldMeta5(BaseModel):
    type: (
        FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200ApplicationJSONType
    )

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    text: Optional[str] = None

    character_limit: Annotated[
        Optional[float], pydantic.Field(alias="characterLimit")
    ] = None

    font_size: Annotated[Optional[float], pydantic.Field(alias="fontSize")] = None


class FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200Type(str, Enum):
    DATE = "date"


class FieldUpdateDocumentFieldsFieldMeta4TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200Type
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    font_size: NotRequired[float]


class FieldUpdateDocumentFieldsFieldMeta4(BaseModel):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponse200Type

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    font_size: Annotated[Optional[float], pydantic.Field(alias="fontSize")] = None


class FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponseType(str, Enum):
    EMAIL = "email"


class FieldUpdateDocumentFieldsFieldMeta3TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponseType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    font_size: NotRequired[float]


class FieldUpdateDocumentFieldsFieldMeta3(BaseModel):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsResponseType

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    font_size: Annotated[Optional[float], pydantic.Field(alias="fontSize")] = None


class FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsType(str, Enum):
    NAME = "name"


class FieldUpdateDocumentFieldsFieldMeta2TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    font_size: NotRequired[float]


class FieldUpdateDocumentFieldsFieldMeta2(BaseModel):
    type: FieldUpdateDocumentFieldsFieldMetaDocumentsFieldsType

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    font_size: Annotated[Optional[float], pydantic.Field(alias="fontSize")] = None


class FieldUpdateDocumentFieldsFieldMetaType(str, Enum):
    INITIALS = "initials"


class FieldUpdateDocumentFieldsFieldMeta1TypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsFieldMetaType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    font_size: NotRequired[float]


class FieldUpdateDocumentFieldsFieldMeta1(BaseModel):
    type: FieldUpdateDocumentFieldsFieldMetaType

    label: Optional[str] = None

    placeholder: Optional[str] = None

    required: Optional[bool] = None

    read_only: Annotated[Optional[bool], pydantic.Field(alias="readOnly")] = None

    font_size: Annotated[Optional[float], pydantic.Field(alias="fontSize")] = None


FieldUpdateDocumentFieldsFieldMetaTypedDict = TypeAliasType(
    "FieldUpdateDocumentFieldsFieldMetaTypedDict",
    Union[
        FieldUpdateDocumentFieldsFieldMeta1TypedDict,
        FieldUpdateDocumentFieldsFieldMeta2TypedDict,
        FieldUpdateDocumentFieldsFieldMeta3TypedDict,
        FieldUpdateDocumentFieldsFieldMeta4TypedDict,
        FieldUpdateDocumentFieldsFieldMeta7TypedDict,
        FieldUpdateDocumentFieldsFieldMeta9TypedDict,
        FieldUpdateDocumentFieldsFieldMeta5TypedDict,
        FieldUpdateDocumentFieldsFieldMeta8TypedDict,
        FieldUpdateDocumentFieldsFieldMeta6TypedDict,
    ],
)


FieldUpdateDocumentFieldsFieldMeta = TypeAliasType(
    "FieldUpdateDocumentFieldsFieldMeta",
    Union[
        FieldUpdateDocumentFieldsFieldMeta1,
        FieldUpdateDocumentFieldsFieldMeta2,
        FieldUpdateDocumentFieldsFieldMeta3,
        FieldUpdateDocumentFieldsFieldMeta4,
        FieldUpdateDocumentFieldsFieldMeta7,
        FieldUpdateDocumentFieldsFieldMeta9,
        FieldUpdateDocumentFieldsFieldMeta5,
        FieldUpdateDocumentFieldsFieldMeta8,
        FieldUpdateDocumentFieldsFieldMeta6,
    ],
)


class FieldUpdateDocumentFieldsDocumentsFieldsFieldsTypedDict(TypedDict):
    type: FieldUpdateDocumentFieldsType
    id: int
    secondary_id: str
    document_id: Nullable[int]
    template_id: Nullable[int]
    recipient_id: int
    page: float
    r"""The page number of the field on the document. Starts from 1."""
    custom_text: str
    inserted: bool
    field_meta: Nullable[FieldUpdateDocumentFieldsFieldMetaTypedDict]
    position_x: NotRequired[Any]
    position_y: NotRequired[Any]
    width: NotRequired[Any]
    height: NotRequired[Any]


class FieldUpdateDocumentFieldsDocumentsFieldsFields(BaseModel):
    type: FieldUpdateDocumentFieldsType

    id: int

    secondary_id: Annotated[str, pydantic.Field(alias="secondaryId")]

    document_id: Annotated[Nullable[int], pydantic.Field(alias="documentId")]

    template_id: Annotated[Nullable[int], pydantic.Field(alias="templateId")]

    recipient_id: Annotated[int, pydantic.Field(alias="recipientId")]

    page: float
    r"""The page number of the field on the document. Starts from 1."""

    custom_text: Annotated[str, pydantic.Field(alias="customText")]

    inserted: bool

    field_meta: Annotated[
        Nullable[FieldUpdateDocumentFieldsFieldMeta], pydantic.Field(alias="fieldMeta")
    ]

    position_x: Annotated[Optional[Any], pydantic.Field(alias="positionX")] = None

    position_y: Annotated[Optional[Any], pydantic.Field(alias="positionY")] = None

    width: Optional[Any] = None

    height: Optional[Any] = None

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = ["positionX", "positionY", "width", "height"]
        nullable_fields = ["documentId", "templateId", "fieldMeta"]
        null_default_fields = []

        serialized = handler(self)

        m = {}

        for n, f in self.model_fields.items():
            k = f.alias or n
            val = serialized.get(k)
            serialized.pop(k, None)

            optional_nullable = k in optional_fields and k in nullable_fields
            is_set = (
                self.__pydantic_fields_set__.intersection({n})
                or k in null_default_fields
            )  # pylint: disable=no-member

            if val is not None and val != UNSET_SENTINEL:
                m[k] = val
            elif val != UNSET_SENTINEL and (
                not k in optional_fields or (optional_nullable and is_set)
            ):
                m[k] = val

        return m


class FieldUpdateDocumentFieldsResponseBodyTypedDict(TypedDict):
    r"""Successful response"""

    fields: List[FieldUpdateDocumentFieldsDocumentsFieldsFieldsTypedDict]


class FieldUpdateDocumentFieldsResponseBody(BaseModel):
    r"""Successful response"""

    fields: List[FieldUpdateDocumentFieldsDocumentsFieldsFields]
