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

from __future__ import annotations
from moovio_sdk.models.components import feeplan as components_feeplan
from moovio_sdk.types import BaseModel, UNSET_SENTINEL
from moovio_sdk.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
import pydantic
from pydantic import model_serializer
from typing import Dict, List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class ListFeePlansRequestTypedDict(TypedDict):
    account_id: str
    plan_i_ds: NotRequired[List[str]]
    r"""A comma-separated list of plan IDs to filter the results by."""


class ListFeePlansRequest(BaseModel):
    account_id: Annotated[
        str,
        pydantic.Field(alias="accountID"),
        FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
    ]

    plan_i_ds: Annotated[
        Optional[List[str]],
        pydantic.Field(alias="planIDs"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=False)),
    ] = None
    r"""A comma-separated list of plan IDs to filter the results by."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["planIDs"])
        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 ListFeePlansResponseTypedDict(TypedDict):
    headers: Dict[str, List[str]]
    result: List[components_feeplan.FeePlanTypedDict]


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

    result: List[components_feeplan.FeePlan]
