-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocumentcontent.py
More file actions
42 lines (31 loc) · 1.18 KB
/
documentcontent.py
File metadata and controls
42 lines (31 loc) · 1.18 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
40
41
42
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from glean.api_client.types import BaseModel, UNSET_SENTINEL
import pydantic
from pydantic import model_serializer
from typing import List, Optional
from typing_extensions import Annotated, NotRequired, TypedDict
class DocumentContentTypedDict(TypedDict):
full_text_list: NotRequired[List[str]]
r"""The plaintext content of the document."""
class DocumentContent(BaseModel):
full_text_list: Annotated[
Optional[List[str]], pydantic.Field(alias="fullTextList")
] = None
r"""The plaintext content of the document."""
@model_serializer(mode="wrap")
def serialize_model(self, handler):
optional_fields = set(["fullTextList"])
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, UNSET_SENTINEL))
if val != UNSET_SENTINEL:
if val is not None or k not in optional_fields:
m[k] = val
return m
try:
DocumentContent.model_rebuild()
except NameError:
pass