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

from __future__ import annotations
from .getintegrationsintegrationidcustomfieldspositiveresponse import (
    GetIntegrationsIntegrationIDCustomFieldsPositiveResponse,
    GetIntegrationsIntegrationIDCustomFieldsPositiveResponseTypedDict,
)
from kombo.types import BaseModel
from kombo.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
from typing import Awaitable, Callable, Optional, Union
from typing_extensions import Annotated, NotRequired, TypedDict


class GetIntegrationsIntegrationIDCustomFieldsRequestTypedDict(TypedDict):
    integration_id: str
    r"""GET /integrations/:integration_id/custom-fields Parameter"""
    cursor: NotRequired[str]
    r"""An optional cursor string used for pagination. This can be retrieved from the `next` property of the previous page response."""
    page_size: NotRequired[int]
    r"""The number of results to return per page. Maximum is 250."""


class GetIntegrationsIntegrationIDCustomFieldsRequest(BaseModel):
    integration_id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""GET /integrations/:integration_id/custom-fields Parameter"""

    cursor: Annotated[
        Optional[str],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None
    r"""An optional cursor string used for pagination. This can be retrieved from the `next` property of the previous page response."""

    page_size: Annotated[
        Optional[int],
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = 100
    r"""The number of results to return per page. Maximum is 250."""


class GetIntegrationsIntegrationIDCustomFieldsResponseTypedDict(TypedDict):
    result: GetIntegrationsIntegrationIDCustomFieldsPositiveResponseTypedDict


class GetIntegrationsIntegrationIDCustomFieldsResponse(BaseModel):
    next: Union[
        Callable[[], Optional[GetIntegrationsIntegrationIDCustomFieldsResponse]],
        Callable[
            [], Awaitable[Optional[GetIntegrationsIntegrationIDCustomFieldsResponse]]
        ],
    ]

    result: GetIntegrationsIntegrationIDCustomFieldsPositiveResponse
