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

from __future__ import annotations
from attio.types import BaseModel, UNSET_SENTINEL
from attio.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
from pydantic import model_serializer
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class GetV2ObjectsObjectRecordsRecordIDEntriesRequestTypedDict(TypedDict):
    object: str
    record_id: str
    limit: NotRequired[int]
    offset: NotRequired[int]


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

    record_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=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(["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


class GetV2ObjectsObjectRecordsRecordIDEntriesDataTypedDict(TypedDict):
    list_id: str
    r"""A UUID identifying the list that this record is in."""
    list_api_slug: str
    r"""A human-readable slug for the list for use in URLs and responses."""
    entry_id: str
    r"""A UUID identifying this entry on the list."""
    created_at: str
    r"""When this entry was created."""


class GetV2ObjectsObjectRecordsRecordIDEntriesData(BaseModel):
    list_id: str
    r"""A UUID identifying the list that this record is in."""

    list_api_slug: str
    r"""A human-readable slug for the list for use in URLs and responses."""

    entry_id: str
    r"""A UUID identifying this entry on the list."""

    created_at: str
    r"""When this entry was created."""


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

    data: List[GetV2ObjectsObjectRecordsRecordIDEntriesDataTypedDict]


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

    data: List[GetV2ObjectsObjectRecordsRecordIDEntriesData]
