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

from __future__ import annotations
from .select_option import SelectOption, SelectOptionTypedDict
from attio.types import BaseModel
from attio.utils import FieldMetadata, PathParamMetadata, RequestMetadata
from typing import Literal, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


PatchV2TargetIdentifierAttributesAttributeOptionsOptionTarget = Literal[
    "objects",
    "lists",
]
r"""Whether the attribute is on an object or a list."""


class PatchV2TargetIdentifierAttributesAttributeOptionsOptionDataTypedDict(TypedDict):
    title: NotRequired[str]
    r"""The Title of the select option"""
    is_archived: NotRequired[bool]
    r"""Whether or not to archive the select option. See our [archiving guide](/docs/archiving-vs-deleting) for more information on archiving."""


class PatchV2TargetIdentifierAttributesAttributeOptionsOptionData(BaseModel):
    title: Optional[str] = None
    r"""The Title of the select option"""

    is_archived: Optional[bool] = None
    r"""Whether or not to archive the select option. See our [archiving guide](/docs/archiving-vs-deleting) for more information on archiving."""


class PatchV2TargetIdentifierAttributesAttributeOptionsOptionRequestBodyTypedDict(
    TypedDict
):
    data: PatchV2TargetIdentifierAttributesAttributeOptionsOptionDataTypedDict


class PatchV2TargetIdentifierAttributesAttributeOptionsOptionRequestBody(BaseModel):
    data: PatchV2TargetIdentifierAttributesAttributeOptionsOptionData


class PatchV2TargetIdentifierAttributesAttributeOptionsOptionRequestTypedDict(
    TypedDict
):
    target: PatchV2TargetIdentifierAttributesAttributeOptionsOptionTarget
    r"""Whether the attribute is on an object or a list."""
    identifier: str
    attribute: str
    option: str
    request_body: (
        PatchV2TargetIdentifierAttributesAttributeOptionsOptionRequestBodyTypedDict
    )


class PatchV2TargetIdentifierAttributesAttributeOptionsOptionRequest(BaseModel):
    target: Annotated[
        PatchV2TargetIdentifierAttributesAttributeOptionsOptionTarget,
        FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
    ]
    r"""Whether the attribute is on an object or a list."""

    identifier: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]

    attribute: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]

    option: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]

    request_body: Annotated[
        PatchV2TargetIdentifierAttributesAttributeOptionsOptionRequestBody,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]


PatchV2TargetIdentifierAttributesAttributeOptionsOptionConflictType = Literal[
    "invalid_request_error",
]


PatchV2TargetIdentifierAttributesAttributeOptionsOptionConflictCode = Literal[
    "slug_conflict",
]


PatchV2TargetIdentifierAttributesAttributeOptionsOptionNotFoundType = Literal[
    "invalid_request_error",
]


PatchV2TargetIdentifierAttributesAttributeOptionsOptionNotFoundCode = Literal[
    "not_found",
]


PatchV2TargetIdentifierAttributesAttributeOptionsOptionBadRequestType = Literal[
    "invalid_request_error",
]


PatchV2TargetIdentifierAttributesAttributeOptionsOptionCodeValueNotFound = Literal[
    "value_not_found",
]


class PatchV2TargetIdentifierAttributesAttributeOptionsOptionResponseTypedDict(
    TypedDict
):
    r"""Success"""

    data: SelectOptionTypedDict


class PatchV2TargetIdentifierAttributesAttributeOptionsOptionResponse(BaseModel):
    r"""Success"""

    data: SelectOption
