Skip to content

Commit 05eb966

Browse files
feat(api): api update
1 parent 489783a commit 05eb966

10 files changed

Lines changed: 46 additions & 2 deletions

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 27
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-9c7780b743898a6c0abf377cb05d4fa4c7a6e2273c3b9176faaa2c80f8c07f28.yml
3-
openapi_spec_hash: 54c716ac4e888bfddc2c6402192bb33a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-6fe842e0549fd5b4fdb1cca0bf44fa9f71a107ca98eb30a9bb3e4d3c2adeaca9.yml
3+
openapi_spec_hash: ee56658b235950cbf3808b56ddde4919
44
config_hash: 13d10207114afb65f7ac4e21f4c0e358

‎src/moderation_api/resources/authors.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def create(
5252
self,
5353
*,
5454
external_id: str,
55+
company: Optional[str] | Omit = omit,
5556
email: Optional[str] | Omit = omit,
5657
external_link: Optional[str] | Omit = omit,
5758
first_seen: float | Omit = omit,
@@ -75,6 +76,8 @@ def create(
7576
Args:
7677
external_id: External ID of the user, typically the ID of the author in your database.
7778
79+
company: The author's company or organization
80+
7881
email: Author email address
7982
8083
external_link: URL of the author's external profile
@@ -103,6 +106,7 @@ def create(
103106
body=maybe_transform(
104107
{
105108
"external_id": external_id,
109+
"company": company,
106110
"email": email,
107111
"external_link": external_link,
108112
"first_seen": first_seen,
@@ -160,6 +164,7 @@ def update(
160164
self,
161165
id: str,
162166
*,
167+
company: Optional[str] | Omit = omit,
163168
email: Optional[str] | Omit = omit,
164169
external_link: Optional[str] | Omit = omit,
165170
first_seen: float | Omit = omit,
@@ -181,6 +186,8 @@ def update(
181186
Args:
182187
id: Either external ID or the ID assigned by moderation API.
183188
189+
company: The author's company or organization
190+
184191
email: Author email address
185192
186193
external_link: URL of the author's external profile
@@ -210,6 +217,7 @@ def update(
210217
path_template("/authors/{id}", id=id),
211218
body=maybe_transform(
212219
{
220+
"company": company,
213221
"email": email,
214222
"external_link": external_link,
215223
"first_seen": first_seen,
@@ -353,6 +361,7 @@ async def create(
353361
self,
354362
*,
355363
external_id: str,
364+
company: Optional[str] | Omit = omit,
356365
email: Optional[str] | Omit = omit,
357366
external_link: Optional[str] | Omit = omit,
358367
first_seen: float | Omit = omit,
@@ -376,6 +385,8 @@ async def create(
376385
Args:
377386
external_id: External ID of the user, typically the ID of the author in your database.
378387
388+
company: The author's company or organization
389+
379390
email: Author email address
380391
381392
external_link: URL of the author's external profile
@@ -404,6 +415,7 @@ async def create(
404415
body=await async_maybe_transform(
405416
{
406417
"external_id": external_id,
418+
"company": company,
407419
"email": email,
408420
"external_link": external_link,
409421
"first_seen": first_seen,
@@ -461,6 +473,7 @@ async def update(
461473
self,
462474
id: str,
463475
*,
476+
company: Optional[str] | Omit = omit,
464477
email: Optional[str] | Omit = omit,
465478
external_link: Optional[str] | Omit = omit,
466479
first_seen: float | Omit = omit,
@@ -482,6 +495,8 @@ async def update(
482495
Args:
483496
id: Either external ID or the ID assigned by moderation API.
484497
498+
company: The author's company or organization
499+
485500
email: Author email address
486501
487502
external_link: URL of the author's external profile
@@ -511,6 +526,7 @@ async def update(
511526
path_template("/authors/{id}", id=id),
512527
body=await async_maybe_transform(
513528
{
529+
"company": company,
514530
"email": email,
515531
"external_link": external_link,
516532
"first_seen": first_seen,

‎src/moderation_api/types/author_create_params.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class AuthorCreateParams(TypedDict, total=False):
1212
external_id: Required[str]
1313
"""External ID of the user, typically the ID of the author in your database."""
1414

15+
company: Optional[str]
16+
"""The author's company or organization"""
17+
1518
email: Optional[str]
1619
"""Author email address"""
1720

‎src/moderation_api/types/author_create_response.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ class AuthorCreateResponse(BaseModel):
110110

111111
trust_level: TrustLevel
112112

113+
company: Optional[str] = None
114+
"""The author's company or organization"""
115+
113116
email: Optional[str] = None
114117
"""Author email address"""
115118

‎src/moderation_api/types/author_list_response.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ class Author(BaseModel):
119119

120120
trust_level: AuthorTrustLevel
121121

122+
company: Optional[str] = None
123+
"""The author's company or organization"""
124+
122125
email: Optional[str] = None
123126
"""Author email address"""
124127

‎src/moderation_api/types/author_retrieve_response.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ class AuthorRetrieveResponse(BaseModel):
110110

111111
trust_level: TrustLevel
112112

113+
company: Optional[str] = None
114+
"""The author's company or organization"""
115+
113116
email: Optional[str] = None
114117
"""Author email address"""
115118

‎src/moderation_api/types/author_update_params.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010

1111
class AuthorUpdateParams(TypedDict, total=False):
12+
company: Optional[str]
13+
"""The author's company or organization"""
14+
1215
email: Optional[str]
1316
"""Author email address"""
1417

‎src/moderation_api/types/author_update_response.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ class AuthorUpdateResponse(BaseModel):
110110

111111
trust_level: TrustLevel
112112

113+
company: Optional[str] = None
114+
"""The author's company or organization"""
115+
113116
email: Optional[str] = None
114117
"""Author email address"""
115118

‎src/moderation_api/types/content_submit_params.py‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,12 @@ class PolicyURLRisk(TypedDict, total=False):
432432
precedence over allowlists.
433433
"""
434434

435+
flag_link_shorteners: Annotated[bool, PropertyInfo(alias="flagLinkShorteners")]
436+
"""
437+
When true, any URL detected as a free link shortener (bit.ly, t.co, tinyurl,
438+
etc.) is always flagged regardless of risk score. Allowlist matches still win.
439+
"""
440+
435441
threshold: float
436442

437443

‎tests/api_resources/test_authors.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def test_method_create(self, client: ModerationAPI) -> None:
3636
def test_method_create_with_all_params(self, client: ModerationAPI) -> None:
3737
author = client.authors.create(
3838
external_id="external_id",
39+
company="company",
3940
email="dev@stainless.com",
4041
external_link="https://example.com",
4142
first_seen=0,
@@ -133,6 +134,7 @@ def test_method_update(self, client: ModerationAPI) -> None:
133134
def test_method_update_with_all_params(self, client: ModerationAPI) -> None:
134135
author = client.authors.update(
135136
id="id",
137+
company="company",
136138
email="dev@stainless.com",
137139
external_link="https://example.com",
138140
first_seen=0,
@@ -286,6 +288,7 @@ async def test_method_create(self, async_client: AsyncModerationAPI) -> None:
286288
async def test_method_create_with_all_params(self, async_client: AsyncModerationAPI) -> None:
287289
author = await async_client.authors.create(
288290
external_id="external_id",
291+
company="company",
289292
email="dev@stainless.com",
290293
external_link="https://example.com",
291294
first_seen=0,
@@ -383,6 +386,7 @@ async def test_method_update(self, async_client: AsyncModerationAPI) -> None:
383386
async def test_method_update_with_all_params(self, async_client: AsyncModerationAPI) -> None:
384387
author = await async_client.authors.update(
385388
id="id",
389+
company="company",
386390
email="dev@stainless.com",
387391
external_link="https://example.com",
388392
first_seen=0,

0 commit comments

Comments
 (0)