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

from __future__ import annotations
from moovio_sdk.models.components import adjustment as components_adjustment
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 ListAdjustmentsRequestTypedDict(TypedDict):
    account_id: str
    wallet_id: NotRequired[str]
    r"""A wallet ID to filter adjustments by."""


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

    wallet_id: Annotated[
        Optional[str],
        pydantic.Field(alias="walletID"),
        FieldMetadata(query=QueryParamMetadata(style="form", explode=False)),
    ] = None
    r"""A wallet ID to filter adjustments by."""

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


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

    result: List[components_adjustment.Adjustment]
