"""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 FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody11Type(str, Enum):
    DROPDOWN = "DROPDOWN"


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


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestValuesTypedDict(TypedDict):
    value: str


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestValues(BaseModel):
    value: str


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody11FieldMetaTypedDict(
    TypedDict
):
    type: (
        FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody11FieldMetaType
    )
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    values: NotRequired[
        List[FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestValuesTypedDict]
    ]
    default_value: NotRequired[str]


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody11FieldMeta(
    BaseModel
):
    type: (
        FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody11FieldMetaType
    )

    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[FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestValues]
    ] = None

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


class FieldUpdateTemplateFieldsFields11TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody11Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody11FieldMetaTypedDict
    ]
    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 FieldUpdateTemplateFieldsFields11(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody11Type

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

    field_meta: Annotated[
        Optional[
            FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody11FieldMeta
        ],
        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 FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody10Type(str, Enum):
    CHECKBOX = "CHECKBOX"


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


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


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsValues(BaseModel):
    id: float

    checked: bool

    value: str


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody10FieldMetaTypedDict(
    TypedDict
):
    type: (
        FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody10FieldMetaType
    )
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    values: NotRequired[
        List[FieldUpdateTemplateFieldsFieldsTemplatesFieldsValuesTypedDict]
    ]
    validation_rule: NotRequired[str]
    validation_length: NotRequired[float]


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody10FieldMeta(
    BaseModel
):
    type: (
        FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody10FieldMetaType
    )

    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[FieldUpdateTemplateFieldsFieldsTemplatesFieldsValues]] = None

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

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


class FieldUpdateTemplateFieldsFields10TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody10Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody10FieldMetaTypedDict
    ]
    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 FieldUpdateTemplateFieldsFields10(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody10Type

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

    field_meta: Annotated[
        Optional[
            FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody10FieldMeta
        ],
        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 FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody9Type(str, Enum):
    RADIO = "RADIO"


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


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


class FieldUpdateTemplateFieldsFieldsValues(BaseModel):
    id: float

    checked: bool

    value: str


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody9FieldMetaTypedDict(
    TypedDict
):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody9FieldMetaType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    values: NotRequired[List[FieldUpdateTemplateFieldsFieldsValuesTypedDict]]


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody9FieldMeta(
    BaseModel
):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody9FieldMetaType

    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[FieldUpdateTemplateFieldsFieldsValues]] = None


class FieldUpdateTemplateFieldsFields9TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody9Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody9FieldMetaTypedDict
    ]
    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 FieldUpdateTemplateFieldsFields9(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody9Type

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

    field_meta: Annotated[
        Optional[
            FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody9FieldMeta
        ],
        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 FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody8Type(str, Enum):
    NUMBER = "NUMBER"


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


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody8FieldMetaTypedDict(
    TypedDict
):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody8FieldMetaType
    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 FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody8FieldMeta(
    BaseModel
):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody8FieldMetaType

    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 FieldUpdateTemplateFieldsFields8TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody8Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody8FieldMetaTypedDict
    ]
    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 FieldUpdateTemplateFieldsFields8(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody8Type

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

    field_meta: Annotated[
        Optional[
            FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody8FieldMeta
        ],
        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 FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody7Type(str, Enum):
    TEXT = "TEXT"


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


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody7FieldMetaTypedDict(
    TypedDict
):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody7FieldMetaType
    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 FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody7FieldMeta(
    BaseModel
):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody7FieldMetaType

    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 FieldUpdateTemplateFieldsFields7TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody7Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody7FieldMetaTypedDict
    ]
    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 FieldUpdateTemplateFieldsFields7(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody7Type

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

    field_meta: Annotated[
        Optional[
            FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody7FieldMeta
        ],
        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 FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody6Type(str, Enum):
    DATE = "DATE"


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


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


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBodyFieldMeta(
    BaseModel
):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody6FieldMetaType

    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 FieldUpdateTemplateFieldsFields6TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody6Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBodyFieldMetaTypedDict
    ]
    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 FieldUpdateTemplateFieldsFields6(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody6Type

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

    field_meta: Annotated[
        Optional[
            FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBodyFieldMeta
        ],
        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 FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody5Type(str, Enum):
    EMAIL = "EMAIL"


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


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


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestFieldMeta(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody5FieldMetaType

    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 FieldUpdateTemplateFieldsFields5TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody5Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestFieldMetaTypedDict
    ]
    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 FieldUpdateTemplateFieldsFields5(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody5Type

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

    field_meta: Annotated[
        Optional[FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestFieldMeta],
        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 FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody4Type(str, Enum):
    NAME = "NAME"


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


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


class FieldUpdateTemplateFieldsFieldsTemplatesFieldsFieldMeta(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody4FieldMetaType

    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 FieldUpdateTemplateFieldsFields4TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody4Type
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[
        FieldUpdateTemplateFieldsFieldsTemplatesFieldsFieldMetaTypedDict
    ]
    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 FieldUpdateTemplateFieldsFields4(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBody4Type

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

    field_meta: Annotated[
        Optional[FieldUpdateTemplateFieldsFieldsTemplatesFieldsFieldMeta],
        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 FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestType(str, Enum):
    INITIALS = "INITIALS"


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


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


class FieldUpdateTemplateFieldsFieldsFieldMeta(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestRequestBodyType

    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 FieldUpdateTemplateFieldsFields3TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestType
    id: float
    r"""The ID of the field to update."""
    field_meta: NotRequired[FieldUpdateTemplateFieldsFieldsFieldMetaTypedDict]
    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 FieldUpdateTemplateFieldsFields3(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsRequestType

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

    field_meta: Annotated[
        Optional[FieldUpdateTemplateFieldsFieldsFieldMeta],
        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 FieldUpdateTemplateFieldsFieldsTemplatesFieldsType(str, Enum):
    FREE_SIGNATURE = "FREE_SIGNATURE"


class FieldUpdateTemplateFieldsFields2TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsType
    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 FieldUpdateTemplateFieldsFields2(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsTemplatesFieldsType

    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 FieldUpdateTemplateFieldsFieldsType(str, Enum):
    SIGNATURE = "SIGNATURE"


class FieldUpdateTemplateFieldsFields1TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldsType
    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 FieldUpdateTemplateFieldsFields1(BaseModel):
    type: FieldUpdateTemplateFieldsFieldsType

    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."""


FieldUpdateTemplateFieldsFieldsTypedDict = TypeAliasType(
    "FieldUpdateTemplateFieldsFieldsTypedDict",
    Union[
        FieldUpdateTemplateFieldsFields1TypedDict,
        FieldUpdateTemplateFieldsFields2TypedDict,
        FieldUpdateTemplateFieldsFields3TypedDict,
        FieldUpdateTemplateFieldsFields4TypedDict,
        FieldUpdateTemplateFieldsFields5TypedDict,
        FieldUpdateTemplateFieldsFields6TypedDict,
        FieldUpdateTemplateFieldsFields7TypedDict,
        FieldUpdateTemplateFieldsFields8TypedDict,
        FieldUpdateTemplateFieldsFields9TypedDict,
        FieldUpdateTemplateFieldsFields10TypedDict,
        FieldUpdateTemplateFieldsFields11TypedDict,
    ],
)


FieldUpdateTemplateFieldsFields = TypeAliasType(
    "FieldUpdateTemplateFieldsFields",
    Union[
        FieldUpdateTemplateFieldsFields1,
        FieldUpdateTemplateFieldsFields2,
        FieldUpdateTemplateFieldsFields3,
        FieldUpdateTemplateFieldsFields4,
        FieldUpdateTemplateFieldsFields5,
        FieldUpdateTemplateFieldsFields6,
        FieldUpdateTemplateFieldsFields7,
        FieldUpdateTemplateFieldsFields8,
        FieldUpdateTemplateFieldsFields9,
        FieldUpdateTemplateFieldsFields10,
        FieldUpdateTemplateFieldsFields11,
    ],
)


class FieldUpdateTemplateFieldsRequestBodyTypedDict(TypedDict):
    template_id: float
    fields: List[FieldUpdateTemplateFieldsFieldsTypedDict]


class FieldUpdateTemplateFieldsRequestBody(BaseModel):
    template_id: Annotated[float, pydantic.Field(alias="templateId")]

    fields: List[FieldUpdateTemplateFieldsFields]


class FieldUpdateTemplateFieldsTemplatesFieldsIssuesTypedDict(TypedDict):
    message: str


class FieldUpdateTemplateFieldsTemplatesFieldsIssues(BaseModel):
    message: str


class FieldUpdateTemplateFieldsTemplatesFieldsResponseResponseBodyData(BaseModel):
    message: str

    code: str

    issues: Optional[List[FieldUpdateTemplateFieldsTemplatesFieldsIssues]] = None


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

    data: FieldUpdateTemplateFieldsTemplatesFieldsResponseResponseBodyData

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

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


class FieldUpdateTemplateFieldsIssuesTypedDict(TypedDict):
    message: str


class FieldUpdateTemplateFieldsIssues(BaseModel):
    message: str


class FieldUpdateTemplateFieldsTemplatesFieldsResponseBodyData(BaseModel):
    message: str

    code: str

    issues: Optional[List[FieldUpdateTemplateFieldsIssues]] = None


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

    data: FieldUpdateTemplateFieldsTemplatesFieldsResponseBodyData

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

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


class FieldUpdateTemplateFieldsType(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 FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200ApplicationJSONResponseBodyFields9Type(
    str, Enum
):
    DROPDOWN = "dropdown"


class FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponseValuesTypedDict(
    TypedDict
):
    value: str


class FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponseValues(BaseModel):
    value: str


class FieldUpdateTemplateFieldsFieldMeta9TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200ApplicationJSONResponseBodyFields9Type
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    values: NotRequired[
        List[FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponseValuesTypedDict]
    ]
    default_value: NotRequired[str]


class FieldUpdateTemplateFieldsFieldMeta9(BaseModel):
    type: FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200ApplicationJSONResponseBodyFields9Type

    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[FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponseValues]
    ] = None

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


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


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


class FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsValues(BaseModel):
    id: float

    checked: bool

    value: str


class FieldUpdateTemplateFieldsFieldMeta8TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200ApplicationJSONResponseBodyFields8Type
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    values: NotRequired[
        List[FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsValuesTypedDict]
    ]
    validation_rule: NotRequired[str]
    validation_length: NotRequired[float]


class FieldUpdateTemplateFieldsFieldMeta8(BaseModel):
    type: FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200ApplicationJSONResponseBodyFields8Type

    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[FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsValues]] = (
        None
    )

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

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


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


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


class FieldUpdateTemplateFieldsFieldMetaValues(BaseModel):
    id: float

    checked: bool

    value: str


class FieldUpdateTemplateFieldsFieldMeta7TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200ApplicationJSONResponseBodyFieldsType
    label: NotRequired[str]
    placeholder: NotRequired[str]
    required: NotRequired[bool]
    read_only: NotRequired[bool]
    values: NotRequired[List[FieldUpdateTemplateFieldsFieldMetaValuesTypedDict]]


class FieldUpdateTemplateFieldsFieldMeta7(BaseModel):
    type: FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200ApplicationJSONResponseBodyFieldsType

    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[FieldUpdateTemplateFieldsFieldMetaValues]] = None


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


class FieldUpdateTemplateFieldsFieldMeta6TypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200ApplicationJSONResponseBodyType
    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 FieldUpdateTemplateFieldsFieldMeta6(BaseModel):
    type: FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200ApplicationJSONResponseBodyType

    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 FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200ApplicationJSONType(
    str, Enum
):
    TEXT = "text"


class FieldUpdateTemplateFieldsFieldMeta5TypedDict(TypedDict):
    type: (
        FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200ApplicationJSONType
    )
    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 FieldUpdateTemplateFieldsFieldMeta5(BaseModel):
    type: (
        FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200ApplicationJSONType
    )

    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 FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200Type(str, Enum):
    DATE = "date"


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


class FieldUpdateTemplateFieldsFieldMeta4(BaseModel):
    type: FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponse200Type

    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 FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponseType(str, Enum):
    EMAIL = "email"


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


class FieldUpdateTemplateFieldsFieldMeta3(BaseModel):
    type: FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsResponseType

    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 FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsType(str, Enum):
    NAME = "name"


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


class FieldUpdateTemplateFieldsFieldMeta2(BaseModel):
    type: FieldUpdateTemplateFieldsFieldMetaTemplatesFieldsType

    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 FieldUpdateTemplateFieldsFieldMetaType(str, Enum):
    INITIALS = "initials"


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


class FieldUpdateTemplateFieldsFieldMeta1(BaseModel):
    type: FieldUpdateTemplateFieldsFieldMetaType

    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


FieldUpdateTemplateFieldsFieldMetaTypedDict = TypeAliasType(
    "FieldUpdateTemplateFieldsFieldMetaTypedDict",
    Union[
        FieldUpdateTemplateFieldsFieldMeta1TypedDict,
        FieldUpdateTemplateFieldsFieldMeta2TypedDict,
        FieldUpdateTemplateFieldsFieldMeta3TypedDict,
        FieldUpdateTemplateFieldsFieldMeta4TypedDict,
        FieldUpdateTemplateFieldsFieldMeta7TypedDict,
        FieldUpdateTemplateFieldsFieldMeta9TypedDict,
        FieldUpdateTemplateFieldsFieldMeta5TypedDict,
        FieldUpdateTemplateFieldsFieldMeta8TypedDict,
        FieldUpdateTemplateFieldsFieldMeta6TypedDict,
    ],
)


FieldUpdateTemplateFieldsFieldMeta = TypeAliasType(
    "FieldUpdateTemplateFieldsFieldMeta",
    Union[
        FieldUpdateTemplateFieldsFieldMeta1,
        FieldUpdateTemplateFieldsFieldMeta2,
        FieldUpdateTemplateFieldsFieldMeta3,
        FieldUpdateTemplateFieldsFieldMeta4,
        FieldUpdateTemplateFieldsFieldMeta7,
        FieldUpdateTemplateFieldsFieldMeta9,
        FieldUpdateTemplateFieldsFieldMeta5,
        FieldUpdateTemplateFieldsFieldMeta8,
        FieldUpdateTemplateFieldsFieldMeta6,
    ],
)


class FieldUpdateTemplateFieldsTemplatesFieldsFieldsTypedDict(TypedDict):
    type: FieldUpdateTemplateFieldsType
    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[FieldUpdateTemplateFieldsFieldMetaTypedDict]
    position_x: NotRequired[Any]
    position_y: NotRequired[Any]
    width: NotRequired[Any]
    height: NotRequired[Any]


class FieldUpdateTemplateFieldsTemplatesFieldsFields(BaseModel):
    type: FieldUpdateTemplateFieldsType

    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[FieldUpdateTemplateFieldsFieldMeta], 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 FieldUpdateTemplateFieldsResponseBodyTypedDict(TypedDict):
    r"""Successful response"""

    fields: List[FieldUpdateTemplateFieldsTemplatesFieldsFieldsTypedDict]


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

    fields: List[FieldUpdateTemplateFieldsTemplatesFieldsFields]
