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

from __future__ import annotations
from .select_option import SelectOption, SelectOptionTypedDict
from .status import Status, StatusTypedDict
from attio.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
from attio.utils import (
    FieldMetadata,
    PathParamMetadata,
    QueryParamMetadata,
    get_discriminator,
)
from datetime import datetime
from pydantic import Discriminator, Tag, model_serializer
from typing import List, Literal, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesRequestTypedDict(
    TypedDict
):
    object: str
    record_id: str
    attribute: str
    show_historic: NotRequired[bool]
    limit: NotRequired[int]
    offset: NotRequired[int]


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesRequest(BaseModel):
    object: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]

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

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

    show_historic: Annotated[
        Optional[bool],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = False

    limit: Annotated[
        Optional[int],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None

    offset: Annotated[
        Optional[int],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["show_historic", "limit", "offset"])
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesNotFoundType = Literal[
    "invalid_request_error",
]


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesNotFoundCode = Literal[
    "not_found",
]


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesBadRequestType = Literal[
    "invalid_request_error",
]


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCodeValidationType = Literal[
    "validation_type",
]


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType17 = (
    Literal[
        "api-token",
        "workspace-member",
        "system",
        "app",
    ]
)
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor17TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType17
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor17(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType17
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeTimestamp = (
    Literal["timestamp",]
)
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataTimestampTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor17TypedDict
    r"""The actor that created this value."""
    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeTimestamp
    )
    r"""The attribute type of the value."""
    value: str
    r"""A timestamp string value"""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataTimestamp(
    BaseModel
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor17
    )
    r"""The actor that created this value."""

    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeTimestamp
    )
    r"""The attribute type of the value."""

    value: str
    r"""A timestamp string value"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType16 = (
    Literal[
        "api-token",
        "workspace-member",
        "system",
        "app",
    ]
)
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor16TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType16
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor16(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType16
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeText = Literal[
    "text",
]
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataTextTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor16TypedDict
    r"""The actor that created this value."""
    value: str
    r"""A raw text field. Values are limited to 10MB."""
    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeText
    )
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataText(BaseModel):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor16
    )
    r"""The actor that created this value."""

    value: str
    r"""A raw text field. Values are limited to 10MB."""

    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeText
    )
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType15 = (
    Literal[
        "api-token",
        "workspace-member",
        "system",
        "app",
    ]
)
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor15TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType15
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor15(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType15
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeSelect = Literal[
    "select",
]
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataSelectTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor15TypedDict
    r"""The actor that created this value."""
    option: SelectOptionTypedDict
    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeSelect
    )
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataSelect(BaseModel):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor15
    )
    r"""The actor that created this value."""

    option: SelectOption

    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeSelect
    )
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType14 = (
    Literal[
        "api-token",
        "workspace-member",
        "system",
        "app",
    ]
)
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor14TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType14
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor14(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType14
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeRating = Literal[
    "rating",
]
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataRatingTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor14TypedDict
    r"""The actor that created this value."""
    value: float
    r"""A number between 0 and 5 (inclusive) to represent a star rating."""
    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeRating
    )
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataRating(BaseModel):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor14
    )
    r"""The actor that created this value."""

    value: float
    r"""A number between 0 and 5 (inclusive) to represent a star rating."""

    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeRating
    )
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType13 = (
    Literal[
        "api-token",
        "workspace-member",
        "system",
        "app",
    ]
)
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor13TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType13
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor13(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType13
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeStatus = Literal[
    "status",
]
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataStatusTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor13TypedDict
    r"""The actor that created this value."""
    status: StatusTypedDict
    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeStatus
    )
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataStatus(BaseModel):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor13
    )
    r"""The actor that created this value."""

    status: Status

    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeStatus
    )
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType12 = (
    Literal[
        "api-token",
        "workspace-member",
        "system",
        "app",
    ]
)
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor12TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType12
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor12(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType12
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCountryCode2 = Literal[
    "AF",
    "AX",
    "AL",
    "DZ",
    "AS",
    "AD",
    "AO",
    "AI",
    "AQ",
    "AG",
    "AR",
    "AM",
    "AW",
    "AU",
    "AT",
    "AZ",
    "BS",
    "BH",
    "BD",
    "BB",
    "BY",
    "BE",
    "BZ",
    "BJ",
    "BM",
    "BT",
    "BO",
    "BA",
    "BW",
    "BV",
    "BR",
    "IO",
    "BN",
    "BG",
    "BF",
    "BI",
    "KH",
    "CM",
    "CA",
    "CV",
    "KY",
    "CF",
    "TD",
    "CL",
    "CN",
    "CX",
    "CC",
    "CO",
    "KM",
    "CG",
    "CD",
    "CK",
    "CR",
    "CI",
    "HR",
    "CU",
    "CW",
    "CY",
    "CZ",
    "DK",
    "DJ",
    "DM",
    "DO",
    "EC",
    "EG",
    "SV",
    "GQ",
    "ER",
    "EE",
    "ET",
    "FK",
    "FO",
    "FJ",
    "FI",
    "FR",
    "GF",
    "PF",
    "TF",
    "GA",
    "GM",
    "GE",
    "DE",
    "GH",
    "GI",
    "GR",
    "GL",
    "GD",
    "GP",
    "GU",
    "GT",
    "GG",
    "GN",
    "GW",
    "GY",
    "HT",
    "HM",
    "VA",
    "HN",
    "HK",
    "HU",
    "IS",
    "IN",
    "ID",
    "IR",
    "IQ",
    "IE",
    "IM",
    "IL",
    "IT",
    "JM",
    "JP",
    "JE",
    "JO",
    "KZ",
    "KE",
    "KI",
    "KR",
    "KW",
    "KG",
    "LA",
    "LV",
    "LB",
    "LS",
    "LR",
    "LY",
    "LI",
    "LT",
    "LU",
    "MO",
    "MK",
    "MG",
    "MW",
    "MY",
    "MV",
    "ML",
    "MT",
    "MH",
    "MQ",
    "MR",
    "MU",
    "YT",
    "MX",
    "FM",
    "MD",
    "MC",
    "MN",
    "ME",
    "MS",
    "MA",
    "MZ",
    "MM",
    "NA",
    "NR",
    "NP",
    "NL",
    "AN",
    "NC",
    "NZ",
    "NI",
    "NE",
    "NG",
    "NU",
    "NF",
    "MP",
    "NO",
    "OM",
    "PK",
    "PW",
    "PS",
    "PA",
    "PG",
    "PY",
    "PE",
    "PH",
    "PN",
    "PL",
    "PT",
    "PR",
    "QA",
    "RE",
    "RO",
    "RU",
    "RW",
    "BL",
    "SH",
    "KN",
    "LC",
    "MF",
    "PM",
    "VC",
    "WS",
    "SM",
    "ST",
    "SA",
    "SN",
    "SS",
    "RS",
    "SC",
    "SL",
    "SG",
    "SK",
    "SI",
    "SB",
    "SO",
    "ZA",
    "GS",
    "ES",
    "LK",
    "SD",
    "SR",
    "SJ",
    "SZ",
    "SE",
    "CH",
    "SY",
    "TW",
    "TJ",
    "TZ",
    "TH",
    "TL",
    "TG",
    "TK",
    "TO",
    "TT",
    "TN",
    "TR",
    "TM",
    "TC",
    "TV",
    "UG",
    "UA",
    "AE",
    "GB",
    "US",
    "UM",
    "UY",
    "UZ",
    "VU",
    "VE",
    "VN",
    "VG",
    "VI",
    "WF",
    "EH",
    "YE",
    "ZM",
    "ZW",
    "BQ",
    "KP",
    "SX",
    "XK",
    "AC",
]
r"""The ISO 3166-1 alpha-2 country code representing the country that this phone number belongs to."""


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypePhoneNumber = (
    Literal["phone-number",]
)
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataPhoneNumberTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor12TypedDict
    r"""The actor that created this value."""
    original_phone_number: str
    r"""The raw, original phone number, as inputted."""
    country_code: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCountryCode2
    r"""The ISO 3166-1 alpha-2 country code representing the country that this phone number belongs to."""
    phone_number: str
    attribute_type: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypePhoneNumber
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataPhoneNumber(
    BaseModel
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor12
    )
    r"""The actor that created this value."""

    original_phone_number: str
    r"""The raw, original phone number, as inputted."""

    country_code: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCountryCode2
    r"""The ISO 3166-1 alpha-2 country code representing the country that this phone number belongs to."""

    phone_number: str

    attribute_type: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypePhoneNumber
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType11 = (
    Literal[
        "api-token",
        "workspace-member",
        "system",
        "app",
    ]
)
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor11TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType11
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor11(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType11
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypePersonalName = (
    Literal["personal-name",]
)
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataPersonalNameTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor11TypedDict
    r"""The actor that created this value."""
    first_name: str
    r"""The first name."""
    last_name: str
    r"""The last name."""
    full_name: str
    r"""The full name."""
    attribute_type: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypePersonalName
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataPersonalName(
    BaseModel
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor11
    )
    r"""The actor that created this value."""

    first_name: str
    r"""The first name."""

    last_name: str
    r"""The last name."""

    full_name: str
    r"""The full name."""

    attribute_type: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypePersonalName
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType10 = (
    Literal[
        "api-token",
        "workspace-member",
        "system",
        "app",
    ]
)
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor10TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType10
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor10(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType10
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeNumber = Literal[
    "number",
]
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataNumberTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor10TypedDict
    r"""The actor that created this value."""
    value: float
    r"""Numbers are persisted as 64 bit floats."""
    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeNumber
    )
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataNumber(BaseModel):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor10
    )
    r"""The actor that created this value."""

    value: float
    r"""Numbers are persisted as 64 bit floats."""

    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeNumber
    )
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType9 = Literal[
    "api-token",
    "workspace-member",
    "system",
    "app",
]
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor9TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType9
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor9(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType9
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCountryCode1 = Literal[
    "AF",
    "AX",
    "AL",
    "DZ",
    "AS",
    "AD",
    "AO",
    "AI",
    "AQ",
    "AG",
    "AR",
    "AM",
    "AW",
    "AU",
    "AT",
    "AZ",
    "BS",
    "BH",
    "BD",
    "BB",
    "BY",
    "BE",
    "BZ",
    "BJ",
    "BM",
    "BT",
    "BO",
    "BA",
    "BW",
    "BV",
    "BR",
    "IO",
    "BN",
    "BG",
    "BF",
    "BI",
    "KH",
    "CM",
    "CA",
    "CV",
    "KY",
    "CF",
    "TD",
    "CL",
    "CN",
    "CX",
    "CC",
    "CO",
    "KM",
    "CG",
    "CD",
    "CK",
    "CR",
    "CI",
    "HR",
    "CU",
    "CW",
    "CY",
    "CZ",
    "DK",
    "DJ",
    "DM",
    "DO",
    "EC",
    "EG",
    "SV",
    "GQ",
    "ER",
    "EE",
    "ET",
    "FK",
    "FO",
    "FJ",
    "FI",
    "FR",
    "GF",
    "PF",
    "TF",
    "GA",
    "GM",
    "GE",
    "DE",
    "GH",
    "GI",
    "GR",
    "GL",
    "GD",
    "GP",
    "GU",
    "GT",
    "GG",
    "GN",
    "GW",
    "GY",
    "HT",
    "HM",
    "VA",
    "HN",
    "HK",
    "HU",
    "IS",
    "IN",
    "ID",
    "IR",
    "IQ",
    "IE",
    "IM",
    "IL",
    "IT",
    "JM",
    "JP",
    "JE",
    "JO",
    "KZ",
    "KE",
    "KI",
    "KR",
    "KW",
    "KG",
    "LA",
    "LV",
    "LB",
    "LS",
    "LR",
    "LY",
    "LI",
    "LT",
    "LU",
    "MO",
    "MK",
    "MG",
    "MW",
    "MY",
    "MV",
    "ML",
    "MT",
    "MH",
    "MQ",
    "MR",
    "MU",
    "YT",
    "MX",
    "FM",
    "MD",
    "MC",
    "MN",
    "ME",
    "MS",
    "MA",
    "MZ",
    "MM",
    "NA",
    "NR",
    "NP",
    "NL",
    "AN",
    "NC",
    "NZ",
    "NI",
    "NE",
    "NG",
    "NU",
    "NF",
    "MP",
    "NO",
    "OM",
    "PK",
    "PW",
    "PS",
    "PA",
    "PG",
    "PY",
    "PE",
    "PH",
    "PN",
    "PL",
    "PT",
    "PR",
    "QA",
    "RE",
    "RO",
    "RU",
    "RW",
    "BL",
    "SH",
    "KN",
    "LC",
    "MF",
    "PM",
    "VC",
    "WS",
    "SM",
    "ST",
    "SA",
    "SN",
    "SS",
    "RS",
    "SC",
    "SL",
    "SG",
    "SK",
    "SI",
    "SB",
    "SO",
    "ZA",
    "GS",
    "ES",
    "LK",
    "SD",
    "SR",
    "SJ",
    "SZ",
    "SE",
    "CH",
    "SY",
    "TW",
    "TJ",
    "TZ",
    "TH",
    "TL",
    "TG",
    "TK",
    "TO",
    "TT",
    "TN",
    "TR",
    "TM",
    "TC",
    "TV",
    "UG",
    "UA",
    "AE",
    "GB",
    "US",
    "UM",
    "UY",
    "UZ",
    "VU",
    "VE",
    "VN",
    "VG",
    "VI",
    "WF",
    "EH",
    "YE",
    "ZM",
    "ZW",
    "BQ",
    "KP",
    "SX",
    "XK",
    "AC",
]
r"""The ISO 3166-1 alpha-2 country code for the country this location is in."""


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeLocation = (
    Literal["location",]
)
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataLocationTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor9TypedDict
    r"""The actor that created this value."""
    line_1: Nullable[str]
    r"""The first line of the address. Note that this value is not currently represented in the UI but will be persisted and readable through API calls."""
    line_2: Nullable[str]
    r"""The second line of the address. Note that this value is not currently represented in the UI but will be persisted and readable through API calls."""
    line_3: Nullable[str]
    r"""The third line of the address. Note that this value is not currently represented in the UI but will be persisted and readable through API calls."""
    line_4: Nullable[str]
    r"""The fourth line of the address. Note that this value is not currently represented in the UI but will be persisted and readable through API calls."""
    locality: Nullable[str]
    r"""The town, neighborhood or area the location is in."""
    region: Nullable[str]
    r"""The state, county, province or region that the location is in."""
    postcode: Nullable[str]
    r"""The postcode or zip code for the location. Note that this value is not currently represented in the UI but will be persisted and readable through API calls.}"""
    country_code: Nullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCountryCode1
    ]
    r"""The ISO 3166-1 alpha-2 country code for the country this location is in."""
    latitude: Nullable[str]
    r"""The latitude of the location. Validated by the regular expression `/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)$/`. Values are stored with up to 9 decimal places of precision. Note that this value is not currently represented in the UI but will be persisted and readable through API calls.}"""
    longitude: Nullable[str]
    r"""The longitude of the location. Validated by the regular expression `/^[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/`. Values are stored with up to 9 decimal places of precision. Note that this value is not currently represented in the UI but will be persisted and readable through API calls.}"""
    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeLocation
    )
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataLocation(BaseModel):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor9
    )
    r"""The actor that created this value."""

    line_1: Nullable[str]
    r"""The first line of the address. Note that this value is not currently represented in the UI but will be persisted and readable through API calls."""

    line_2: Nullable[str]
    r"""The second line of the address. Note that this value is not currently represented in the UI but will be persisted and readable through API calls."""

    line_3: Nullable[str]
    r"""The third line of the address. Note that this value is not currently represented in the UI but will be persisted and readable through API calls."""

    line_4: Nullable[str]
    r"""The fourth line of the address. Note that this value is not currently represented in the UI but will be persisted and readable through API calls."""

    locality: Nullable[str]
    r"""The town, neighborhood or area the location is in."""

    region: Nullable[str]
    r"""The state, county, province or region that the location is in."""

    postcode: Nullable[str]
    r"""The postcode or zip code for the location. Note that this value is not currently represented in the UI but will be persisted and readable through API calls.}"""

    country_code: Nullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCountryCode1
    ]
    r"""The ISO 3166-1 alpha-2 country code for the country this location is in."""

    latitude: Nullable[str]
    r"""The latitude of the location. Validated by the regular expression `/^[-+]?([1-8]?\d(\.\d+)?|90(\.0+)?)$/`. Values are stored with up to 9 decimal places of precision. Note that this value is not currently represented in the UI but will be persisted and readable through API calls.}"""

    longitude: Nullable[str]
    r"""The longitude of the location. Validated by the regular expression `/^[-+]?(180(\.0+)?|((1[0-7]\d)|([1-9]?\d))(\.\d+)?)$/`. Values are stored with up to 9 decimal places of precision. Note that this value is not currently represented in the UI but will be persisted and readable through API calls.}"""

    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeLocation
    )
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType8 = Literal[
    "api-token",
    "workspace-member",
    "system",
    "app",
]
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor8TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType8
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor8(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType8
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesInteractionType = Literal[
    "calendar-event",
    "call",
    "chat-thread",
    "email",
    "in-person-meeting",
    "meeting",
]
r"""The type of interaction e.g. calendar or email."""


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesOwnerActorType = Literal[
    "api-token",
    "workspace-member",
    "system",
    "app",
]
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesOwnerActorTypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesOwnerActorType
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesOwnerActor(BaseModel):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesOwnerActorType
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeInteraction = (
    Literal["interaction",]
)
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataInteractionTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor8TypedDict
    r"""The actor that created this value."""
    interaction_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesInteractionType
    )
    r"""The type of interaction e.g. calendar or email."""
    interacted_at: datetime
    r"""When the interaction occurred."""
    owner_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesOwnerActorTypedDict
    )
    r"""The actor that created this value."""
    attribute_type: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeInteraction
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataInteraction(
    BaseModel
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor8
    )
    r"""The actor that created this value."""

    interaction_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesInteractionType
    )
    r"""The type of interaction e.g. calendar or email."""

    interacted_at: datetime
    r"""When the interaction occurred."""

    owner_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesOwnerActor
    r"""The actor that created this value."""

    attribute_type: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeInteraction
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType7 = Literal[
    "api-token",
    "workspace-member",
    "system",
    "app",
]
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor7TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType7
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor7(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType7
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeRecordReference = Literal[
    "record-reference",
]
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataRecordReferenceTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor7TypedDict
    r"""The actor that created this value."""
    target_object: str
    r"""A slug identifying the object that the referenced record belongs to."""
    target_record_id: str
    r"""A UUID to identify the referenced record."""
    attribute_type: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeRecordReference
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataRecordReference(
    BaseModel
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor7
    )
    r"""The actor that created this value."""

    target_object: str
    r"""A slug identifying the object that the referenced record belongs to."""

    target_record_id: str
    r"""A UUID to identify the referenced record."""

    attribute_type: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeRecordReference
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType6 = Literal[
    "api-token",
    "workspace-member",
    "system",
    "app",
]
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor6TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType6
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor6(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType6
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeEmailAddress = (
    Literal["email-address",]
)
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataEmailAddressTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor6TypedDict
    r"""The actor that created this value."""
    original_email_address: str
    email_address: str
    email_domain: str
    email_root_domain: str
    email_local_specifier: str
    attribute_type: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeEmailAddress
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataEmailAddress(
    BaseModel
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor6
    )
    r"""The actor that created this value."""

    original_email_address: str

    email_address: str

    email_domain: str

    email_root_domain: str

    email_local_specifier: str

    attribute_type: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeEmailAddress
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType5 = Literal[
    "api-token",
    "workspace-member",
    "system",
    "app",
]
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor5TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType5
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor5(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType5
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeDomain = Literal[
    "domain",
]
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataDomainTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor5TypedDict
    r"""The actor that created this value."""
    domain: str
    root_domain: str
    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeDomain
    )
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataDomain(BaseModel):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor5
    )
    r"""The actor that created this value."""

    domain: str

    root_domain: str

    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeDomain
    )
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType4 = Literal[
    "api-token",
    "workspace-member",
    "system",
    "app",
]
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor4TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType4
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor4(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType4
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeDate = Literal[
    "date",
]
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataDateTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor4TypedDict
    r"""The actor that created this value."""
    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeDate
    )
    r"""The attribute type of the value."""
    value: str
    r"""A date represents a single calendar year, month and day, independent of timezone. If hours, months, seconds or timezones are provided, they will be trimmed. For example, \"2023\" and \"2023-01\" will be coerced into \"2023-01-01\", and \"2023-01-02\", \"2023-01-02T13:00\", \"2023-01-02T14:00:00\", \"2023-01-02T15:00:00.000000000\", and \"2023-01-02T15:00:00.000000000+02:00\" will all be coerced to \"2023-01-02\". If a timezone is provided that would result in a different calendar date in UTC, the date will be coerced to UTC and then the timezone component will be trimmed. For example, the value \"2023-01-02T23:00:00-10:00\" will be returned as \"2023-01-03\". The maximum date is \"9999-12-31\"."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataDate(BaseModel):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor4
    )
    r"""The actor that created this value."""

    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeDate
    )
    r"""The attribute type of the value."""

    value: str
    r"""A date represents a single calendar year, month and day, independent of timezone. If hours, months, seconds or timezones are provided, they will be trimmed. For example, \"2023\" and \"2023-01\" will be coerced into \"2023-01-01\", and \"2023-01-02\", \"2023-01-02T13:00\", \"2023-01-02T14:00:00\", \"2023-01-02T15:00:00.000000000\", and \"2023-01-02T15:00:00.000000000+02:00\" will all be coerced to \"2023-01-02\". If a timezone is provided that would result in a different calendar date in UTC, the date will be coerced to UTC and then the timezone component will be trimmed. For example, the value \"2023-01-02T23:00:00-10:00\" will be returned as \"2023-01-03\". The maximum date is \"9999-12-31\"."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType3 = Literal[
    "api-token",
    "workspace-member",
    "system",
    "app",
]
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor3TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType3
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor3(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType3
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCurrencyCode = Literal[
    "ARS",
    "AUD",
    "BRL",
    "BGN",
    "CAD",
    "CLP",
    "CNY",
    "COP",
    "CZK",
    "DKK",
    "EUR",
    "FJD",
    "HKD",
    "HUF",
    "ISK",
    "INR",
    "ILS",
    "JPY",
    "KES",
    "KRW",
    "MYR",
    "MXN",
    "NTD",
    "NZD",
    "NGN",
    "NOK",
    "XPF",
    "PEN",
    "PHP",
    "PLN",
    "GBP",
    "RWF",
    "SAR",
    "SGD",
    "ZAR",
    "SEK",
    "CHF",
    "THB",
    "AED",
    "UYU",
    "USD",
]
r"""The ISO4217 currency code representing the currency that the value is stored in."""


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeCurrency = (
    Literal["currency",]
)
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataCurrencyTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor3TypedDict
    r"""The actor that created this value."""
    currency_value: float
    r"""A numerical representation of the currency value. A decimal with a max of 4 decimal places."""
    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeCurrency
    )
    r"""The attribute type of the value."""
    currency_code: NotRequired[
        Nullable[GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCurrencyCode]
    ]
    r"""The ISO4217 currency code representing the currency that the value is stored in."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataCurrency(BaseModel):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor3
    )
    r"""The actor that created this value."""

    currency_value: float
    r"""A numerical representation of the currency value. A decimal with a max of 4 decimal places."""

    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeCurrency
    )
    r"""The attribute type of the value."""

    currency_code: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCurrencyCode
    ] = UNSET
    r"""The ISO4217 currency code representing the currency that the value is stored in."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["currency_code"])
        nullable_fields = set(["active_until", "currency_code"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType2 = Literal[
    "api-token",
    "workspace-member",
    "system",
    "app",
]
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor2TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType2
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor2(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType2
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeCheckbox = (
    Literal["checkbox",]
)
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataCheckboxTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor2TypedDict
    r"""The actor that created this value."""
    value: bool
    r"""A boolean representing whether the checkbox is checked or not. The string values 'true' and 'false' are also accepted."""
    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeCheckbox
    )
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataCheckbox(BaseModel):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor2
    )
    r"""The actor that created this value."""

    value: bool
    r"""A boolean representing whether the checkbox is checked or not. The string values 'true' and 'false' are also accepted."""

    attribute_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeCheckbox
    )
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType1 = Literal[
    "api-token",
    "workspace-member",
    "system",
    "app",
]
r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor1TypedDict(
    TypedDict
):
    r"""The actor that created this value."""

    id: NotRequired[Nullable[str]]
    r"""An ID to identify the actor."""
    type: NotRequired[
        Nullable[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType1
        ]
    ]
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor1(
    BaseModel
):
    r"""The actor that created this value."""

    id: OptionalNullable[str] = UNSET
    r"""An ID to identify the actor."""

    type: OptionalNullable[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActorType1
    ] = UNSET
    r"""The type of actor. [Read more information on actor types here](/docs/actors)."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["id", "type"])
        nullable_fields = set(["id", "type"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k, serialized.get(n))
            is_nullable_and_explicitly_set = (
                k in nullable_fields
                and (self.__pydantic_fields_set__.intersection({n}))  # pylint: disable=no-member
            )

            if val != UNSET_SENTINEL:
                if (
                    val is not None
                    or k not in optional_fields
                    or is_nullable_and_explicitly_set
                ):
                    m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesReferencedActorType = Literal[
    "api-token",
    "workspace-member",
    "system",
    "app",
]
r"""The type of the referenced actor. [Read more information on actor types here](/docs/actors)."""


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeActorReference = Literal[
    "actor-reference",
]
r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataActorReferenceTypedDict(
    TypedDict
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""
    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""
    created_by_actor: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor1TypedDict
    r"""The actor that created this value."""
    referenced_actor_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesReferencedActorType
    )
    r"""The type of the referenced actor. [Read more information on actor types here](/docs/actors)."""
    referenced_actor_id: Nullable[str]
    r"""The ID of the referenced actor."""
    attribute_type: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeActorReference
    r"""The attribute type of the value."""


class GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataActorReference(
    BaseModel
):
    active_from: datetime
    r"""The point in time at which this value was made \"active\". `active_from` can be considered roughly analogous to `created_at`."""

    active_until: Nullable[datetime]
    r"""The point in time at which this value was deactivated. If `null`, the value is active."""

    created_by_actor: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesCreatedByActor1
    )
    r"""The actor that created this value."""

    referenced_actor_type: (
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesReferencedActorType
    )
    r"""The type of the referenced actor. [Read more information on actor types here](/docs/actors)."""

    referenced_actor_id: Nullable[str]
    r"""The ID of the referenced actor."""

    attribute_type: GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesAttributeTypeActorReference
    r"""The attribute type of the value."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        serialized = handler(self)
        m = {}

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

            if val != UNSET_SENTINEL:
                m[k] = val

        return m


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataUnionTypedDict = TypeAliasType(
    "GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataUnionTypedDict",
    Union[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataNumberTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataCheckboxTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataTimestampTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataDateTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataTextTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataSelectTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataRatingTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataStatusTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataDomainTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataRecordReferenceTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataActorReferenceTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataCurrencyTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataPersonalNameTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataPhoneNumberTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataInteractionTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataEmailAddressTypedDict,
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataLocationTypedDict,
    ],
)


GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataUnion = Annotated[
    Union[
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataActorReference,
            Tag("actor-reference"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataCheckbox,
            Tag("checkbox"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataCurrency,
            Tag("currency"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataDate,
            Tag("date"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataDomain,
            Tag("domain"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataEmailAddress,
            Tag("email-address"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataRecordReference,
            Tag("record-reference"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataInteraction,
            Tag("interaction"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataLocation,
            Tag("location"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataNumber,
            Tag("number"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataPersonalName,
            Tag("personal-name"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataPhoneNumber,
            Tag("phone-number"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataStatus,
            Tag("status"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataRating,
            Tag("rating"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataSelect,
            Tag("select"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataText,
            Tag("text"),
        ],
        Annotated[
            GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataTimestamp,
            Tag("timestamp"),
        ],
    ],
    Discriminator(lambda m: get_discriminator(m, "attribute_type", "attribute_type")),
]


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

    data: List[
        GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataUnionTypedDict
    ]


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

    data: List[GetV2ObjectsObjectRecordsRecordIDAttributesAttributeValuesDataUnion]
