-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathaddcollectionitemserror.py
More file actions
39 lines (28 loc) · 1.13 KB
/
addcollectionitemserror.py
File metadata and controls
39 lines (28 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from enum import Enum
from glean.api_client.types import BaseModel, UNSET_SENTINEL
import pydantic
from pydantic import model_serializer
from typing import Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class AddCollectionItemsErrorErrorType(str, Enum):
EXISTING_ITEM = "EXISTING_ITEM"
class AddCollectionItemsErrorTypedDict(TypedDict):
error_type: NotRequired[AddCollectionItemsErrorErrorType]
class AddCollectionItemsError(BaseModel):
error_type: Annotated[
Optional[AddCollectionItemsErrorErrorType], pydantic.Field(alias="errorType")
] = None
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["errorType"])
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