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

from __future__ import annotations
from paygentic_sdk.types import BaseModel, UNSET_SENTINEL
from paygentic_sdk.utils import FieldMetadata, PathParamMetadata, RequestMetadata
from pydantic import model_serializer
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict


class UpdateFeeRequestBodyTypedDict(TypedDict):
    description: NotRequired[str]
    r"""Revised explanation of what the fee represents."""
    name: NotRequired[str]
    r"""Updated label for the fee."""


class UpdateFeeRequestBody(BaseModel):
    description: Optional[str] = None
    r"""Revised explanation of what the fee represents."""

    name: Optional[str] = None
    r"""Updated label for the fee."""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["description", "name"])
        serialized = handler(self)
        m = {}

        for n, f in type(self).model_fields.items():
            k = f.alias or n
            val = serialized.get(k)

            if val != UNSET_SENTINEL:
                if val is not None or k not in optional_fields:
                    m[k] = val

        return m


class UpdateFeeRequestTypedDict(TypedDict):
    id: str
    r"""The unique identifier of the fee"""
    request_body: UpdateFeeRequestBodyTypedDict


class UpdateFeeRequest(BaseModel):
    id: Annotated[
        str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
    ]
    r"""The unique identifier of the fee"""

    request_body: Annotated[
        UpdateFeeRequestBody,
        FieldMetadata(request=RequestMetadata(media_type="application/json")),
    ]
