Skip to content

Commit 02bdf8f

Browse files
chore: add missing docstrings
1 parent d181564 commit 02bdf8f

10 files changed

Lines changed: 99 additions & 0 deletions

‎src/moderation_api/types/actions/execute_execute_response.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,7 @@
66

77

88
class ExecuteExecuteResponse(BaseModel):
9+
"""Execution result"""
10+
911
success: bool
1012
"""Whether the action was executed successfully"""

‎src/moderation_api/types/author_create_params.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ class AuthorCreateParams(TypedDict, total=False):
4141

4242

4343
class MetadataTyped(TypedDict, total=False):
44+
"""Additional metadata provided by your system.
45+
46+
We recommend including any relevant information that may assist in the moderation process.
47+
"""
48+
4449
email_verified: Optional[bool]
4550
"""Whether the author's email is verified"""
4651

‎src/moderation_api/types/author_create_response.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212

1313
class Block(BaseModel):
14+
"""Block or suspension details, if applicable. Null if the author is enabled."""
15+
1416
reason: Optional[str] = None
1517
"""The moderators reason why the author was blocked or suspended."""
1618

@@ -19,6 +21,11 @@ class Block(BaseModel):
1921

2022

2123
class Metadata(BaseModel):
24+
"""Additional metadata provided by your system.
25+
26+
We recommend including any relevant information that may assist in the moderation process.
27+
"""
28+
2229
email_verified: Optional[bool] = None
2330
"""Whether the author's email is verified"""
2431

@@ -59,6 +66,8 @@ class Metrics(BaseModel):
5966

6067

6168
class RiskEvaluation(BaseModel):
69+
"""Risk assessment details, if available."""
70+
6271
risk_level: Optional[float] = None
6372
"""Calculated risk level based on more than 10 behavioral signals."""
6473

‎src/moderation_api/types/author_list_response.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121

2222
class AuthorBlock(BaseModel):
23+
"""Block or suspension details, if applicable. Null if the author is enabled."""
24+
2325
reason: Optional[str] = None
2426
"""The moderators reason why the author was blocked or suspended."""
2527

@@ -28,6 +30,11 @@ class AuthorBlock(BaseModel):
2830

2931

3032
class AuthorMetadata(BaseModel):
33+
"""Additional metadata provided by your system.
34+
35+
We recommend including any relevant information that may assist in the moderation process.
36+
"""
37+
3138
email_verified: Optional[bool] = None
3239
"""Whether the author's email is verified"""
3340

@@ -68,6 +75,8 @@ class AuthorMetrics(BaseModel):
6875

6976

7077
class AuthorRiskEvaluation(BaseModel):
78+
"""Risk assessment details, if available."""
79+
7180
risk_level: Optional[float] = None
7281
"""Calculated risk level based on more than 10 behavioral signals."""
7382

‎src/moderation_api/types/author_retrieve_response.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212

1313
class Block(BaseModel):
14+
"""Block or suspension details, if applicable. Null if the author is enabled."""
15+
1416
reason: Optional[str] = None
1517
"""The moderators reason why the author was blocked or suspended."""
1618

@@ -19,6 +21,11 @@ class Block(BaseModel):
1921

2022

2123
class Metadata(BaseModel):
24+
"""Additional metadata provided by your system.
25+
26+
We recommend including any relevant information that may assist in the moderation process.
27+
"""
28+
2229
email_verified: Optional[bool] = None
2330
"""Whether the author's email is verified"""
2431

@@ -59,6 +66,8 @@ class Metrics(BaseModel):
5966

6067

6168
class RiskEvaluation(BaseModel):
69+
"""Risk assessment details, if available."""
70+
6271
risk_level: Optional[float] = None
6372
"""Calculated risk level based on more than 10 behavioral signals."""
6473

‎src/moderation_api/types/author_update_params.py‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ class AuthorUpdateParams(TypedDict, total=False):
3838

3939

4040
class MetadataTyped(TypedDict, total=False):
41+
"""Additional metadata provided by your system.
42+
43+
We recommend including any relevant information that may assist in the moderation process.
44+
"""
45+
4146
email_verified: Optional[bool]
4247
"""Whether the author's email is verified"""
4348

‎src/moderation_api/types/author_update_response.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212

1313
class Block(BaseModel):
14+
"""Block or suspension details, if applicable. Null if the author is enabled."""
15+
1416
reason: Optional[str] = None
1517
"""The moderators reason why the author was blocked or suspended."""
1618

@@ -19,6 +21,11 @@ class Block(BaseModel):
1921

2022

2123
class Metadata(BaseModel):
24+
"""Additional metadata provided by your system.
25+
26+
We recommend including any relevant information that may assist in the moderation process.
27+
"""
28+
2229
email_verified: Optional[bool] = None
2330
"""Whether the author's email is verified"""
2431

@@ -59,6 +66,8 @@ class Metrics(BaseModel):
5966

6067

6168
class RiskEvaluation(BaseModel):
69+
"""Risk assessment details, if available."""
70+
6271
risk_level: Optional[float] = None
6372
"""Calculated risk level based on more than 10 behavioral signals."""
6473

‎src/moderation_api/types/content_submit_params.py‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,55 +85,71 @@ class ContentSubmitParams(TypedDict, total=False):
8585

8686

8787
class ContentText(TypedDict, total=False):
88+
"""Text"""
89+
8890
text: Required[str]
8991
"""The content text"""
9092

9193
type: Required[Literal["text"]]
9294

9395

9496
class ContentImage(TypedDict, total=False):
97+
"""Image"""
98+
9599
type: Required[Literal["image"]]
96100

97101
url: Required[str]
98102
"""A public URL of the image content"""
99103

100104

101105
class ContentVideo(TypedDict, total=False):
106+
"""Video"""
107+
102108
type: Required[Literal["video"]]
103109

104110
url: Required[str]
105111
"""A public URL of the video content"""
106112

107113

108114
class ContentAudio(TypedDict, total=False):
115+
"""Audio"""
116+
109117
type: Required[Literal["audio"]]
110118

111119
url: Required[str]
112120
"""The URL of the audio content"""
113121

114122

115123
class ContentObjectDataText(TypedDict, total=False):
124+
"""Text"""
125+
116126
text: Required[str]
117127
"""The content text"""
118128

119129
type: Required[Literal["text"]]
120130

121131

122132
class ContentObjectDataImage(TypedDict, total=False):
133+
"""Image"""
134+
123135
type: Required[Literal["image"]]
124136

125137
url: Required[str]
126138
"""A public URL of the image content"""
127139

128140

129141
class ContentObjectDataVideo(TypedDict, total=False):
142+
"""Video"""
143+
130144
type: Required[Literal["video"]]
131145

132146
url: Required[str]
133147
"""A public URL of the video content"""
134148

135149

136150
class ContentObjectDataAudio(TypedDict, total=False):
151+
"""Audio"""
152+
137153
type: Required[Literal["audio"]]
138154

139155
url: Required[str]
@@ -146,6 +162,8 @@ class ContentObjectDataAudio(TypedDict, total=False):
146162

147163

148164
class ContentObject(TypedDict, total=False):
165+
"""Object"""
166+
149167
data: Required[Dict[str, ContentObjectData]]
150168
"""Values in the object. Can be mixed content types."""
151169

‎src/moderation_api/types/content_submit_response.py‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232

3333

3434
class AuthorBlock(BaseModel):
35+
"""Block or suspension details, if applicable. Null if the author is enabled."""
36+
3537
reason: Optional[str] = None
3638
"""The moderators reason why the author was blocked or suspended."""
3739

@@ -48,6 +50,11 @@ class AuthorTrustLevel(BaseModel):
4850

4951

5052
class Author(BaseModel):
53+
"""The author of the content if your account has authors enabled.
54+
55+
Requires you to send authorId when submitting content.
56+
"""
57+
5158
id: str
5259
"""Author ID in Moderation API"""
5360

@@ -64,27 +71,35 @@ class Author(BaseModel):
6471

6572

6673
class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemText(BaseModel):
74+
"""Text"""
75+
6776
text: str
6877
"""The content text"""
6978

7079
type: Literal["text"]
7180

7281

7382
class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemImage(BaseModel):
83+
"""Image"""
84+
7485
type: Literal["image"]
7586

7687
url: str
7788
"""A public URL of the image content"""
7889

7990

8091
class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemVideo(BaseModel):
92+
"""Video"""
93+
8194
type: Literal["video"]
8295

8396
url: str
8497
"""A public URL of the video content"""
8598

8699

87100
class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObjectContentItemAudio(BaseModel):
101+
"""Audio"""
102+
88103
type: Literal["audio"]
89104

90105
url: str
@@ -100,6 +115,8 @@ class ContentModifiedModifiedNestedObjectContentContentModifiedModifiedNestedObj
100115

101116

102117
class Content(BaseModel):
118+
"""Potentially modified content."""
119+
103120
id: str
104121
"""The unique identifier for the content.
105122
@@ -119,6 +136,8 @@ class Content(BaseModel):
119136

120137

121138
class Evaluation(BaseModel):
139+
"""The evaluation of the content after running the channel policies."""
140+
122141
flag_probability: float
123142
"""The probability that the content should be flagged."""
124143

@@ -136,6 +155,8 @@ class Evaluation(BaseModel):
136155

137156

138157
class InsightSentimentInsight(BaseModel):
158+
"""Sentiment insight"""
159+
139160
id: Literal["sentiment"]
140161

141162
probability: float
@@ -146,6 +167,8 @@ class InsightSentimentInsight(BaseModel):
146167

147168

148169
class InsightLanguageInsight(BaseModel):
170+
"""Language insight"""
171+
149172
id: Literal["language"]
150173

151174
probability: float
@@ -159,6 +182,8 @@ class InsightLanguageInsight(BaseModel):
159182

160183

161184
class Meta(BaseModel):
185+
"""Metadata about the moderation request"""
186+
162187
channel_key: str
163188
"""The unique key of the channel where the content was handled.
164189
@@ -183,6 +208,8 @@ class PolicyClassifierOutputLabel(BaseModel):
183208

184209

185210
class PolicyClassifierOutput(BaseModel):
211+
"""Classifier policy."""
212+
186213
id: str
187214
"""The unique identifier for the classifier output."""
188215

@@ -207,6 +234,8 @@ class PolicyEntityMatcherOutputMatch(BaseModel):
207234

208235

209236
class PolicyEntityMatcherOutput(BaseModel):
237+
"""Entity matcher policy."""
238+
210239
id: str
211240

212241
flagged: bool
@@ -224,6 +253,8 @@ class PolicyEntityMatcherOutput(BaseModel):
224253

225254

226255
class Recommendation(BaseModel):
256+
"""The recommendation for the content based on the evaluation."""
257+
227258
action: Literal["review", "allow", "reject"]
228259
"""The action to take based on the recommendation"""
229260

‎src/moderation_api/types/wordlist_get_embedding_status_response.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99

1010
class WordlistGetEmbeddingStatusResponse(BaseModel):
11+
"""Embedding status details"""
12+
1113
progress: float
1214
"""Percentage of words that have been embedded (0-100)"""
1315

0 commit comments

Comments
 (0)