Skip to content

Commit d5460a2

Browse files
feat(api): api update
1 parent f951db0 commit d5460a2

4 files changed

Lines changed: 20 additions & 2 deletions

File tree

.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%2Fmoderation-api-07681c3b51c92b9d92d71f11e9245c37a37ac1ea6df730cd730e85968064d814.yml
3-
openapi_spec_hash: 48bffabe129598fc41a232cf5469bd4b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-c4b4a6dd58ac7acb74655c95e375be9c52d9b4b23a6b4c40ac6fceeb3e91f8ed.yml
3+
openapi_spec_hash: 436eb030ad0ba2f3c53382a40ec9f4c9
44
config_hash: 6a52f6ae7d55cf3b4e91538cc7752aeb

src/moderation_api/resources/content.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def submit(
5757
meta_type: Literal["profile", "message", "post", "comment", "event", "product", "review", "other"]
5858
| Omit = omit,
5959
policies: Iterable[content_submit_params.Policy] | Omit = omit,
60+
timestamp: float | Omit = omit,
6061
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6162
# The extra values given here take precedence over values defined on the client or passed to this method.
6263
extra_headers: Headers | None = None,
@@ -85,6 +86,9 @@ def submit(
8586
8687
policies: (Enterprise) override the channel policies for this moderation request only.
8788
89+
timestamp: Unix timestamp (in milliseconds) of when the content was created. Use if content
90+
is not submitted in real-time.
91+
8892
extra_headers: Send extra headers
8993
9094
extra_query: Add additional query parameters to the request
@@ -106,6 +110,7 @@ def submit(
106110
"metadata": metadata,
107111
"meta_type": meta_type,
108112
"policies": policies,
113+
"timestamp": timestamp,
109114
},
110115
content_submit_params.ContentSubmitParams,
111116
),
@@ -149,6 +154,7 @@ async def submit(
149154
meta_type: Literal["profile", "message", "post", "comment", "event", "product", "review", "other"]
150155
| Omit = omit,
151156
policies: Iterable[content_submit_params.Policy] | Omit = omit,
157+
timestamp: float | Omit = omit,
152158
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
153159
# The extra values given here take precedence over values defined on the client or passed to this method.
154160
extra_headers: Headers | None = None,
@@ -177,6 +183,9 @@ async def submit(
177183
178184
policies: (Enterprise) override the channel policies for this moderation request only.
179185
186+
timestamp: Unix timestamp (in milliseconds) of when the content was created. Use if content
187+
is not submitted in real-time.
188+
180189
extra_headers: Send extra headers
181190
182191
extra_query: Add additional query parameters to the request
@@ -198,6 +207,7 @@ async def submit(
198207
"metadata": metadata,
199208
"meta_type": meta_type,
200209
"policies": policies,
210+
"timestamp": timestamp,
201211
},
202212
content_submit_params.ContentSubmitParams,
203213
),

src/moderation_api/types/content_submit_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,12 @@ class ContentSubmitParams(TypedDict, total=False):
8383
policies: Iterable[Policy]
8484
"""(Enterprise) override the channel policies for this moderation request only."""
8585

86+
timestamp: float
87+
"""Unix timestamp (in milliseconds) of when the content was created.
88+
89+
Use if content is not submitted in real-time.
90+
"""
91+
8692

8793
class ContentText(TypedDict, total=False):
8894
"""Text"""

tests/api_resources/test_content.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def test_method_submit_with_all_params(self, client: ModerationAPI) -> None:
5050
"threshold": 0,
5151
}
5252
],
53+
timestamp=0,
5354
)
5455
assert_matches_type(ContentSubmitResponse, content, path=["response"])
5556

@@ -124,6 +125,7 @@ async def test_method_submit_with_all_params(self, async_client: AsyncModeration
124125
"threshold": 0,
125126
}
126127
],
128+
timestamp=0,
127129
)
128130
assert_matches_type(ContentSubmitResponse, content, path=["response"])
129131

0 commit comments

Comments
 (0)