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

from __future__ import annotations
from .v3_globaleventrules_rulesetruleresponse import (
    V3GlobalEventRulesRulesetRuleResponse,
    V3GlobalEventRulesRulesetRuleResponseTypedDict,
)
import pydantic
from squadcast_sdk.types import BaseModel
from squadcast_sdk.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
from typing import Callable, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class GlobalEventRulesListRulesetRulesRequestTypedDict(TypedDict):
    ger_id: int
    alert_source_version: str
    alert_source_shortname: str
    page_size: NotRequired[int]
    page_number: NotRequired[int]
    filters_search: NotRequired[str]


class GlobalEventRulesListRulesetRulesRequest(BaseModel):
    ger_id: Annotated[
        int, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]

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

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

    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_search: Annotated[
        Optional[str],
        pydantic.Field(alias="filters.search"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
    ] = None


class GlobalEventRulesListRulesetRulesMetaTypedDict(TypedDict):
    total_count: int


class GlobalEventRulesListRulesetRulesMeta(BaseModel):
    total_count: int


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

    data: List[V3GlobalEventRulesRulesetRuleResponseTypedDict]
    meta: GlobalEventRulesListRulesetRulesMetaTypedDict


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

    data: List[V3GlobalEventRulesRulesetRuleResponse]

    meta: GlobalEventRulesListRulesetRulesMeta


class GlobalEventRulesListRulesetRulesResponseTypedDict(TypedDict):
    result: GlobalEventRulesListRulesetRulesResponseBodyTypedDict


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

    result: GlobalEventRulesListRulesetRulesResponseBody
