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

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


class MetadataTypedDict(TypedDict):
    r"""Optional key-value metadata storage for product information. Sample values: {\"category\": \"ai_services\", \"tier\": \"enterprise\"}, {\"region\": \"global\", \"support_level\": \"premium\"}"""


class Metadata(BaseModel):
    r"""Optional key-value metadata storage for product information. Sample values: {\"category\": \"ai_services\", \"tier\": \"enterprise\"}, {\"region\": \"global\", \"support_level\": \"premium\"}"""


class CreateProductRequestTypedDict(TypedDict):
    description: str
    r"""Customer-visible product summary explaining capabilities and use cases. Sample values: 'Enterprise access to advanced language models for natural language tasks', 'Scalable data warehousing with real-time query capabilities', 'On-demand AI image generation using diffusion models', 'Distributed computing infrastructure for training deep learning models', 'High-performance vector similarity search database', 'Production-ready speech-to-text conversion service'"""
    merchant_id: str
    r"""Unique identifier for an organization"""
    name: str
    r"""Customer-facing product title shown in invoices and dashboards. Sample values: 'Large Language Model Service', 'Cloud Data Warehouse', 'AI Image Creator', 'Neural Network Training Platform', 'Vector Database', 'Speech Recognition API'"""
    metadata: NotRequired[MetadataTypedDict]
    r"""Optional key-value metadata storage for product information. Sample values: {\"category\": \"ai_services\", \"tier\": \"enterprise\"}, {\"region\": \"global\", \"support_level\": \"premium\"}"""


class CreateProductRequest(BaseModel):
    description: str
    r"""Customer-visible product summary explaining capabilities and use cases. Sample values: 'Enterprise access to advanced language models for natural language tasks', 'Scalable data warehousing with real-time query capabilities', 'On-demand AI image generation using diffusion models', 'Distributed computing infrastructure for training deep learning models', 'High-performance vector similarity search database', 'Production-ready speech-to-text conversion service'"""

    merchant_id: Annotated[str, pydantic.Field(alias="merchantId")]
    r"""Unique identifier for an organization"""

    name: str
    r"""Customer-facing product title shown in invoices and dashboards. Sample values: 'Large Language Model Service', 'Cloud Data Warehouse', 'AI Image Creator', 'Neural Network Training Platform', 'Vector Database', 'Speech Recognition API'"""

    metadata: Optional[Metadata] = None
    r"""Optional key-value metadata storage for product information. Sample values: {\"category\": \"ai_services\", \"tier\": \"enterprise\"}, {\"region\": \"global\", \"support_level\": \"premium\"}"""

    @model_serializer(mode="wrap")
    def serialize_model(self, handler):
        optional_fields = set(["metadata"])
        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


try:
    CreateProductRequest.model_rebuild()
except NameError:
    pass
