mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-31 12:30:30 +08:00
docs: Mintlify MDX docs + docs.json; bump Speakeasy to 1.787.0 (#382)
This commit is contained in:
@@ -4,9 +4,10 @@ from __future__ import annotations
|
||||
from openrouter.components import (
|
||||
listobservabilitydestinationsresponse as components_listobservabilitydestinationsresponse,
|
||||
)
|
||||
from openrouter.types import BaseModel
|
||||
from openrouter.types import BaseModel, UNSET_SENTINEL
|
||||
from openrouter.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
|
||||
import pydantic
|
||||
from pydantic import model_serializer
|
||||
from typing import Awaitable, Callable, Optional, Union
|
||||
from typing_extensions import Annotated, NotRequired, TypedDict
|
||||
|
||||
@@ -56,6 +57,24 @@ class ListObservabilityDestinationsGlobals(BaseModel):
|
||||
|
||||
"""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = set(
|
||||
["HTTP-Referer", "X-OpenRouter-Title", "X-OpenRouter-Categories"]
|
||||
)
|
||||
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 ListObservabilityDestinationsRequestTypedDict(TypedDict):
|
||||
http_referer: NotRequired[str]
|
||||
@@ -126,6 +145,31 @@ class ListObservabilityDestinationsRequest(BaseModel):
|
||||
] = None
|
||||
r"""Optional workspace ID to filter by. Defaults to the authenticated entity's default workspace."""
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = set(
|
||||
[
|
||||
"HTTP-Referer",
|
||||
"X-OpenRouter-Title",
|
||||
"X-OpenRouter-Categories",
|
||||
"offset",
|
||||
"limit",
|
||||
"workspace_id",
|
||||
]
|
||||
)
|
||||
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 ListObservabilityDestinationsResponseTypedDict(TypedDict):
|
||||
result: components_listobservabilitydestinationsresponse.ListObservabilityDestinationsResponseTypedDict
|
||||
|
||||
Reference in New Issue
Block a user