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

from __future__ import annotations
from .v3_globaleventrules_globaleventruleinlist import (
    V3GlobalEventRulesGlobalEventRuleInList,
    V3GlobalEventRulesGlobalEventRuleInListTypedDict,
)
import pydantic
from squadcast_sdk.types import BaseModel
from squadcast_sdk.utils import FieldMetadata, QueryParamMetadata
from typing import Callable, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class GlobalEventRulesListGlobalEventRulesRequestTypedDict(TypedDict):
    owner_id: str
    page_size: NotRequired[int]
    page_number: NotRequired[int]
    filters_owner_id: NotRequired[List[str]]
    filters_search: NotRequired[str]


class GlobalEventRulesListGlobalEventRulesRequest(BaseModel):
    owner_id: Annotated[
        str, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
    ]

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

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

    filters_owner_id: Annotated[
        Optional[List[str]],
        pydantic.Field(alias="filters.owner_id[]"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None

    filters_search: Annotated[
        Optional[str],
        pydantic.Field(alias="filters.search"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None


class GlobalEventRulesListGlobalEventRulesMetaTypedDict(TypedDict):
    total_count: int


class GlobalEventRulesListGlobalEventRulesMeta(BaseModel):
    total_count: int


class GlobalEventRulesListGlobalEventRulesResponseBodyTypedDict(TypedDict):
    r"""The request has succeeded."""

    data: List[V3GlobalEventRulesGlobalEventRuleInListTypedDict]
    meta: GlobalEventRulesListGlobalEventRulesMetaTypedDict


class GlobalEventRulesListGlobalEventRulesResponseBody(BaseModel):
    r"""The request has succeeded."""

    data: List[V3GlobalEventRulesGlobalEventRuleInList]

    meta: GlobalEventRulesListGlobalEventRulesMeta


class GlobalEventRulesListGlobalEventRulesResponseTypedDict(TypedDict):
    result: GlobalEventRulesListGlobalEventRulesResponseBodyTypedDict


class GlobalEventRulesListGlobalEventRulesResponse(BaseModel):
    next: Callable[[], Optional[GlobalEventRulesListGlobalEventRulesResponse]]

    result: GlobalEventRulesListGlobalEventRulesResponseBody
