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

from __future__ import annotations
from .contactresponse import ContactResponse, ContactResponseTypedDict
from .errorresponse import ErrorResponse, ErrorResponseTypedDict
from postivo_client.types import BaseModel
from postivo_client.utils import FieldMetadata, QueryParamMetadata
from typing import Dict, List, Optional, Union
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict


class ListContactsRequestTypedDict(TypedDict):
    page: NotRequired[int]
    r"""Page number of results"""
    limit: NotRequired[int]
    r"""Results limit per page."""


class ListContactsRequest(BaseModel):
    page: Annotated[
        Optional[int],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = 1
    r"""Page number of results"""

    limit: Annotated[
        Optional[int],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = 10
    r"""Results limit per page."""


ListContactsResponseResultTypedDict = TypeAliasType(
    "ListContactsResponseResultTypedDict",
    Union[ErrorResponseTypedDict, List[ContactResponseTypedDict]],
)


ListContactsResponseResult = TypeAliasType(
    "ListContactsResponseResult", Union[ErrorResponse, List[ContactResponse]]
)


class ListContactsResponseTypedDict(TypedDict):
    headers: Dict[str, List[str]]
    result: ListContactsResponseResultTypedDict


class ListContactsResponse(BaseModel):
    headers: Dict[str, List[str]]

    result: ListContactsResponseResult
