moderation_api 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- moderation_api/__init__.py +102 -0
- moderation_api/_base_client.py +1995 -0
- moderation_api/_client.py +454 -0
- moderation_api/_compat.py +219 -0
- moderation_api/_constants.py +14 -0
- moderation_api/_exceptions.py +108 -0
- moderation_api/_files.py +123 -0
- moderation_api/_models.py +857 -0
- moderation_api/_qs.py +150 -0
- moderation_api/_resource.py +43 -0
- moderation_api/_response.py +832 -0
- moderation_api/_streaming.py +333 -0
- moderation_api/_types.py +260 -0
- moderation_api/_utils/__init__.py +64 -0
- moderation_api/_utils/_compat.py +45 -0
- moderation_api/_utils/_datetime_parse.py +136 -0
- moderation_api/_utils/_logs.py +25 -0
- moderation_api/_utils/_proxy.py +65 -0
- moderation_api/_utils/_reflection.py +42 -0
- moderation_api/_utils/_resources_proxy.py +24 -0
- moderation_api/_utils/_streams.py +12 -0
- moderation_api/_utils/_sync.py +58 -0
- moderation_api/_utils/_transform.py +457 -0
- moderation_api/_utils/_typing.py +156 -0
- moderation_api/_utils/_utils.py +421 -0
- moderation_api/_version.py +4 -0
- moderation_api/lib/.keep +4 -0
- moderation_api/py.typed +0 -0
- moderation_api/resources/__init__.py +103 -0
- moderation_api/resources/account.py +135 -0
- moderation_api/resources/actions/__init__.py +33 -0
- moderation_api/resources/actions/actions.py +810 -0
- moderation_api/resources/actions/execute.py +354 -0
- moderation_api/resources/auth.py +204 -0
- moderation_api/resources/authors.py +714 -0
- moderation_api/resources/content.py +244 -0
- moderation_api/resources/queue/__init__.py +33 -0
- moderation_api/resources/queue/items.py +445 -0
- moderation_api/resources/queue/queue.py +302 -0
- moderation_api/resources/wordlist/__init__.py +33 -0
- moderation_api/resources/wordlist/wordlist.py +470 -0
- moderation_api/resources/wordlist/words.py +274 -0
- moderation_api/types/__init__.py +35 -0
- moderation_api/types/account_list_response.py +31 -0
- moderation_api/types/action_create_params.py +94 -0
- moderation_api/types/action_create_response.py +82 -0
- moderation_api/types/action_delete_response.py +13 -0
- moderation_api/types/action_list_params.py +13 -0
- moderation_api/types/action_list_response.py +113 -0
- moderation_api/types/action_retrieve_response.py +105 -0
- moderation_api/types/action_update_params.py +94 -0
- moderation_api/types/action_update_response.py +82 -0
- moderation_api/types/actions/__init__.py +8 -0
- moderation_api/types/actions/execute_execute_by_id_params.py +24 -0
- moderation_api/types/actions/execute_execute_by_id_response.py +20 -0
- moderation_api/types/actions/execute_execute_params.py +30 -0
- moderation_api/types/actions/execute_execute_response.py +10 -0
- moderation_api/types/auth_create_response.py +16 -0
- moderation_api/types/auth_retrieve_response.py +13 -0
- moderation_api/types/author_create_params.py +57 -0
- moderation_api/types/author_create_response.py +120 -0
- moderation_api/types/author_delete_response.py +9 -0
- moderation_api/types/author_list_params.py +40 -0
- moderation_api/types/author_list_response.py +147 -0
- moderation_api/types/author_retrieve_response.py +120 -0
- moderation_api/types/author_update_params.py +54 -0
- moderation_api/types/author_update_response.py +120 -0
- moderation_api/types/content_submit_params.py +352 -0
- moderation_api/types/content_submit_response.py +269 -0
- moderation_api/types/queue/__init__.py +10 -0
- moderation_api/types/queue/item_list_params.py +36 -0
- moderation_api/types/queue/item_list_response.py +90 -0
- moderation_api/types/queue/item_resolve_params.py +15 -0
- moderation_api/types/queue/item_resolve_response.py +19 -0
- moderation_api/types/queue/item_unresolve_params.py +15 -0
- moderation_api/types/queue/item_unresolve_response.py +17 -0
- moderation_api/types/queue_get_stats_params.py +14 -0
- moderation_api/types/queue_get_stats_response.py +110 -0
- moderation_api/types/queue_retrieve_response.py +64 -0
- moderation_api/types/wordlist/__init__.py +8 -0
- moderation_api/types/wordlist/word_add_params.py +14 -0
- moderation_api/types/wordlist/word_add_response.py +20 -0
- moderation_api/types/wordlist/word_remove_params.py +14 -0
- moderation_api/types/wordlist/word_remove_response.py +20 -0
- moderation_api/types/wordlist_get_embedding_status_response.py +18 -0
- moderation_api/types/wordlist_list_response.py +30 -0
- moderation_api/types/wordlist_retrieve_response.py +32 -0
- moderation_api/types/wordlist_update_params.py +29 -0
- moderation_api/types/wordlist_update_response.py +32 -0
- moderation_api-1.0.0.dist-info/METADATA +458 -0
- moderation_api-1.0.0.dist-info/RECORD +93 -0
- moderation_api-1.0.0.dist-info/WHEEL +4 -0
- moderation_api-1.0.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,445 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Literal
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
10
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
11
|
+
from ..._compat import cached_property
|
|
12
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
13
|
+
from ..._response import (
|
|
14
|
+
to_raw_response_wrapper,
|
|
15
|
+
to_streamed_response_wrapper,
|
|
16
|
+
async_to_raw_response_wrapper,
|
|
17
|
+
async_to_streamed_response_wrapper,
|
|
18
|
+
)
|
|
19
|
+
from ...types.queue import item_list_params, item_resolve_params, item_unresolve_params
|
|
20
|
+
from ..._base_client import make_request_options
|
|
21
|
+
from ...types.queue.item_list_response import ItemListResponse
|
|
22
|
+
from ...types.queue.item_resolve_response import ItemResolveResponse
|
|
23
|
+
from ...types.queue.item_unresolve_response import ItemUnresolveResponse
|
|
24
|
+
|
|
25
|
+
__all__ = ["ItemsResource", "AsyncItemsResource"]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class ItemsResource(SyncAPIResource):
|
|
29
|
+
@cached_property
|
|
30
|
+
def with_raw_response(self) -> ItemsResourceWithRawResponse:
|
|
31
|
+
"""
|
|
32
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
33
|
+
the raw response object instead of the parsed content.
|
|
34
|
+
|
|
35
|
+
For more information, see https://www.github.com/moderation-api/sdk-python#accessing-raw-response-data-eg-headers
|
|
36
|
+
"""
|
|
37
|
+
return ItemsResourceWithRawResponse(self)
|
|
38
|
+
|
|
39
|
+
@cached_property
|
|
40
|
+
def with_streaming_response(self) -> ItemsResourceWithStreamingResponse:
|
|
41
|
+
"""
|
|
42
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
43
|
+
|
|
44
|
+
For more information, see https://www.github.com/moderation-api/sdk-python#with_streaming_response
|
|
45
|
+
"""
|
|
46
|
+
return ItemsResourceWithStreamingResponse(self)
|
|
47
|
+
|
|
48
|
+
def list(
|
|
49
|
+
self,
|
|
50
|
+
id: str,
|
|
51
|
+
*,
|
|
52
|
+
after_date: str | Omit = omit,
|
|
53
|
+
author_id: str | Omit = omit,
|
|
54
|
+
before_date: str | Omit = omit,
|
|
55
|
+
conversation_ids: str | Omit = omit,
|
|
56
|
+
filtered_action_ids: str | Omit = omit,
|
|
57
|
+
include_resolved: str | Omit = omit,
|
|
58
|
+
labels: str | Omit = omit,
|
|
59
|
+
page_number: float | Omit = omit,
|
|
60
|
+
page_size: float | Omit = omit,
|
|
61
|
+
sort_direction: Literal["asc", "desc"] | Omit = omit,
|
|
62
|
+
sort_field: Literal["createdAt", "severity", "reviewedAt"] | Omit = omit,
|
|
63
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
64
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
65
|
+
extra_headers: Headers | None = None,
|
|
66
|
+
extra_query: Query | None = None,
|
|
67
|
+
extra_body: Body | None = None,
|
|
68
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
69
|
+
) -> ItemListResponse:
|
|
70
|
+
"""
|
|
71
|
+
Get paginated list of items in a moderation queue with filtering options
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
id: The queue ID
|
|
75
|
+
|
|
76
|
+
page_number: Page number to fetch
|
|
77
|
+
|
|
78
|
+
page_size: Number of items per page
|
|
79
|
+
|
|
80
|
+
sort_direction: Sort direction
|
|
81
|
+
|
|
82
|
+
extra_headers: Send extra headers
|
|
83
|
+
|
|
84
|
+
extra_query: Add additional query parameters to the request
|
|
85
|
+
|
|
86
|
+
extra_body: Add additional JSON properties to the request
|
|
87
|
+
|
|
88
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
89
|
+
"""
|
|
90
|
+
if not id:
|
|
91
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
92
|
+
return self._get(
|
|
93
|
+
f"/queue/{id}/items",
|
|
94
|
+
options=make_request_options(
|
|
95
|
+
extra_headers=extra_headers,
|
|
96
|
+
extra_query=extra_query,
|
|
97
|
+
extra_body=extra_body,
|
|
98
|
+
timeout=timeout,
|
|
99
|
+
query=maybe_transform(
|
|
100
|
+
{
|
|
101
|
+
"after_date": after_date,
|
|
102
|
+
"author_id": author_id,
|
|
103
|
+
"before_date": before_date,
|
|
104
|
+
"conversation_ids": conversation_ids,
|
|
105
|
+
"filtered_action_ids": filtered_action_ids,
|
|
106
|
+
"include_resolved": include_resolved,
|
|
107
|
+
"labels": labels,
|
|
108
|
+
"page_number": page_number,
|
|
109
|
+
"page_size": page_size,
|
|
110
|
+
"sort_direction": sort_direction,
|
|
111
|
+
"sort_field": sort_field,
|
|
112
|
+
},
|
|
113
|
+
item_list_params.ItemListParams,
|
|
114
|
+
),
|
|
115
|
+
),
|
|
116
|
+
cast_to=ItemListResponse,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
def resolve(
|
|
120
|
+
self,
|
|
121
|
+
item_id: str,
|
|
122
|
+
*,
|
|
123
|
+
id: str,
|
|
124
|
+
comment: str | Omit = omit,
|
|
125
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
126
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
127
|
+
extra_headers: Headers | None = None,
|
|
128
|
+
extra_query: Query | None = None,
|
|
129
|
+
extra_body: Body | None = None,
|
|
130
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
131
|
+
) -> ItemResolveResponse:
|
|
132
|
+
"""
|
|
133
|
+
Mark a queue item as resolved with a specific moderation action
|
|
134
|
+
|
|
135
|
+
Args:
|
|
136
|
+
id: The queue ID
|
|
137
|
+
|
|
138
|
+
item_id: The item ID to resolve
|
|
139
|
+
|
|
140
|
+
comment: Optional comment
|
|
141
|
+
|
|
142
|
+
extra_headers: Send extra headers
|
|
143
|
+
|
|
144
|
+
extra_query: Add additional query parameters to the request
|
|
145
|
+
|
|
146
|
+
extra_body: Add additional JSON properties to the request
|
|
147
|
+
|
|
148
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
149
|
+
"""
|
|
150
|
+
if not id:
|
|
151
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
152
|
+
if not item_id:
|
|
153
|
+
raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
|
|
154
|
+
return self._post(
|
|
155
|
+
f"/queue/{id}/items/{item_id}/resolve",
|
|
156
|
+
body=maybe_transform({"comment": comment}, item_resolve_params.ItemResolveParams),
|
|
157
|
+
options=make_request_options(
|
|
158
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
159
|
+
),
|
|
160
|
+
cast_to=ItemResolveResponse,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
def unresolve(
|
|
164
|
+
self,
|
|
165
|
+
item_id: str,
|
|
166
|
+
*,
|
|
167
|
+
id: str,
|
|
168
|
+
comment: str | Omit = omit,
|
|
169
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
170
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
171
|
+
extra_headers: Headers | None = None,
|
|
172
|
+
extra_query: Query | None = None,
|
|
173
|
+
extra_body: Body | None = None,
|
|
174
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
175
|
+
) -> ItemUnresolveResponse:
|
|
176
|
+
"""
|
|
177
|
+
Mark a previously resolved queue item as unresolved/pending
|
|
178
|
+
|
|
179
|
+
Args:
|
|
180
|
+
id: The queue ID
|
|
181
|
+
|
|
182
|
+
item_id: The item ID to unresolve
|
|
183
|
+
|
|
184
|
+
comment: Optional reason for unresolving the item
|
|
185
|
+
|
|
186
|
+
extra_headers: Send extra headers
|
|
187
|
+
|
|
188
|
+
extra_query: Add additional query parameters to the request
|
|
189
|
+
|
|
190
|
+
extra_body: Add additional JSON properties to the request
|
|
191
|
+
|
|
192
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
193
|
+
"""
|
|
194
|
+
if not id:
|
|
195
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
196
|
+
if not item_id:
|
|
197
|
+
raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
|
|
198
|
+
return self._post(
|
|
199
|
+
f"/queue/{id}/items/{item_id}/unresolve",
|
|
200
|
+
body=maybe_transform({"comment": comment}, item_unresolve_params.ItemUnresolveParams),
|
|
201
|
+
options=make_request_options(
|
|
202
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
203
|
+
),
|
|
204
|
+
cast_to=ItemUnresolveResponse,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
class AsyncItemsResource(AsyncAPIResource):
|
|
209
|
+
@cached_property
|
|
210
|
+
def with_raw_response(self) -> AsyncItemsResourceWithRawResponse:
|
|
211
|
+
"""
|
|
212
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
213
|
+
the raw response object instead of the parsed content.
|
|
214
|
+
|
|
215
|
+
For more information, see https://www.github.com/moderation-api/sdk-python#accessing-raw-response-data-eg-headers
|
|
216
|
+
"""
|
|
217
|
+
return AsyncItemsResourceWithRawResponse(self)
|
|
218
|
+
|
|
219
|
+
@cached_property
|
|
220
|
+
def with_streaming_response(self) -> AsyncItemsResourceWithStreamingResponse:
|
|
221
|
+
"""
|
|
222
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
223
|
+
|
|
224
|
+
For more information, see https://www.github.com/moderation-api/sdk-python#with_streaming_response
|
|
225
|
+
"""
|
|
226
|
+
return AsyncItemsResourceWithStreamingResponse(self)
|
|
227
|
+
|
|
228
|
+
async def list(
|
|
229
|
+
self,
|
|
230
|
+
id: str,
|
|
231
|
+
*,
|
|
232
|
+
after_date: str | Omit = omit,
|
|
233
|
+
author_id: str | Omit = omit,
|
|
234
|
+
before_date: str | Omit = omit,
|
|
235
|
+
conversation_ids: str | Omit = omit,
|
|
236
|
+
filtered_action_ids: str | Omit = omit,
|
|
237
|
+
include_resolved: str | Omit = omit,
|
|
238
|
+
labels: str | Omit = omit,
|
|
239
|
+
page_number: float | Omit = omit,
|
|
240
|
+
page_size: float | Omit = omit,
|
|
241
|
+
sort_direction: Literal["asc", "desc"] | Omit = omit,
|
|
242
|
+
sort_field: Literal["createdAt", "severity", "reviewedAt"] | Omit = omit,
|
|
243
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
244
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
245
|
+
extra_headers: Headers | None = None,
|
|
246
|
+
extra_query: Query | None = None,
|
|
247
|
+
extra_body: Body | None = None,
|
|
248
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
249
|
+
) -> ItemListResponse:
|
|
250
|
+
"""
|
|
251
|
+
Get paginated list of items in a moderation queue with filtering options
|
|
252
|
+
|
|
253
|
+
Args:
|
|
254
|
+
id: The queue ID
|
|
255
|
+
|
|
256
|
+
page_number: Page number to fetch
|
|
257
|
+
|
|
258
|
+
page_size: Number of items per page
|
|
259
|
+
|
|
260
|
+
sort_direction: Sort direction
|
|
261
|
+
|
|
262
|
+
extra_headers: Send extra headers
|
|
263
|
+
|
|
264
|
+
extra_query: Add additional query parameters to the request
|
|
265
|
+
|
|
266
|
+
extra_body: Add additional JSON properties to the request
|
|
267
|
+
|
|
268
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
269
|
+
"""
|
|
270
|
+
if not id:
|
|
271
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
272
|
+
return await self._get(
|
|
273
|
+
f"/queue/{id}/items",
|
|
274
|
+
options=make_request_options(
|
|
275
|
+
extra_headers=extra_headers,
|
|
276
|
+
extra_query=extra_query,
|
|
277
|
+
extra_body=extra_body,
|
|
278
|
+
timeout=timeout,
|
|
279
|
+
query=await async_maybe_transform(
|
|
280
|
+
{
|
|
281
|
+
"after_date": after_date,
|
|
282
|
+
"author_id": author_id,
|
|
283
|
+
"before_date": before_date,
|
|
284
|
+
"conversation_ids": conversation_ids,
|
|
285
|
+
"filtered_action_ids": filtered_action_ids,
|
|
286
|
+
"include_resolved": include_resolved,
|
|
287
|
+
"labels": labels,
|
|
288
|
+
"page_number": page_number,
|
|
289
|
+
"page_size": page_size,
|
|
290
|
+
"sort_direction": sort_direction,
|
|
291
|
+
"sort_field": sort_field,
|
|
292
|
+
},
|
|
293
|
+
item_list_params.ItemListParams,
|
|
294
|
+
),
|
|
295
|
+
),
|
|
296
|
+
cast_to=ItemListResponse,
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
async def resolve(
|
|
300
|
+
self,
|
|
301
|
+
item_id: str,
|
|
302
|
+
*,
|
|
303
|
+
id: str,
|
|
304
|
+
comment: str | Omit = omit,
|
|
305
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
306
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
307
|
+
extra_headers: Headers | None = None,
|
|
308
|
+
extra_query: Query | None = None,
|
|
309
|
+
extra_body: Body | None = None,
|
|
310
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
311
|
+
) -> ItemResolveResponse:
|
|
312
|
+
"""
|
|
313
|
+
Mark a queue item as resolved with a specific moderation action
|
|
314
|
+
|
|
315
|
+
Args:
|
|
316
|
+
id: The queue ID
|
|
317
|
+
|
|
318
|
+
item_id: The item ID to resolve
|
|
319
|
+
|
|
320
|
+
comment: Optional comment
|
|
321
|
+
|
|
322
|
+
extra_headers: Send extra headers
|
|
323
|
+
|
|
324
|
+
extra_query: Add additional query parameters to the request
|
|
325
|
+
|
|
326
|
+
extra_body: Add additional JSON properties to the request
|
|
327
|
+
|
|
328
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
329
|
+
"""
|
|
330
|
+
if not id:
|
|
331
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
332
|
+
if not item_id:
|
|
333
|
+
raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
|
|
334
|
+
return await self._post(
|
|
335
|
+
f"/queue/{id}/items/{item_id}/resolve",
|
|
336
|
+
body=await async_maybe_transform({"comment": comment}, item_resolve_params.ItemResolveParams),
|
|
337
|
+
options=make_request_options(
|
|
338
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
339
|
+
),
|
|
340
|
+
cast_to=ItemResolveResponse,
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
async def unresolve(
|
|
344
|
+
self,
|
|
345
|
+
item_id: str,
|
|
346
|
+
*,
|
|
347
|
+
id: str,
|
|
348
|
+
comment: str | Omit = omit,
|
|
349
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
350
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
351
|
+
extra_headers: Headers | None = None,
|
|
352
|
+
extra_query: Query | None = None,
|
|
353
|
+
extra_body: Body | None = None,
|
|
354
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
355
|
+
) -> ItemUnresolveResponse:
|
|
356
|
+
"""
|
|
357
|
+
Mark a previously resolved queue item as unresolved/pending
|
|
358
|
+
|
|
359
|
+
Args:
|
|
360
|
+
id: The queue ID
|
|
361
|
+
|
|
362
|
+
item_id: The item ID to unresolve
|
|
363
|
+
|
|
364
|
+
comment: Optional reason for unresolving the item
|
|
365
|
+
|
|
366
|
+
extra_headers: Send extra headers
|
|
367
|
+
|
|
368
|
+
extra_query: Add additional query parameters to the request
|
|
369
|
+
|
|
370
|
+
extra_body: Add additional JSON properties to the request
|
|
371
|
+
|
|
372
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
373
|
+
"""
|
|
374
|
+
if not id:
|
|
375
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
376
|
+
if not item_id:
|
|
377
|
+
raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}")
|
|
378
|
+
return await self._post(
|
|
379
|
+
f"/queue/{id}/items/{item_id}/unresolve",
|
|
380
|
+
body=await async_maybe_transform({"comment": comment}, item_unresolve_params.ItemUnresolveParams),
|
|
381
|
+
options=make_request_options(
|
|
382
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
383
|
+
),
|
|
384
|
+
cast_to=ItemUnresolveResponse,
|
|
385
|
+
)
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
class ItemsResourceWithRawResponse:
|
|
389
|
+
def __init__(self, items: ItemsResource) -> None:
|
|
390
|
+
self._items = items
|
|
391
|
+
|
|
392
|
+
self.list = to_raw_response_wrapper(
|
|
393
|
+
items.list,
|
|
394
|
+
)
|
|
395
|
+
self.resolve = to_raw_response_wrapper(
|
|
396
|
+
items.resolve,
|
|
397
|
+
)
|
|
398
|
+
self.unresolve = to_raw_response_wrapper(
|
|
399
|
+
items.unresolve,
|
|
400
|
+
)
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
class AsyncItemsResourceWithRawResponse:
|
|
404
|
+
def __init__(self, items: AsyncItemsResource) -> None:
|
|
405
|
+
self._items = items
|
|
406
|
+
|
|
407
|
+
self.list = async_to_raw_response_wrapper(
|
|
408
|
+
items.list,
|
|
409
|
+
)
|
|
410
|
+
self.resolve = async_to_raw_response_wrapper(
|
|
411
|
+
items.resolve,
|
|
412
|
+
)
|
|
413
|
+
self.unresolve = async_to_raw_response_wrapper(
|
|
414
|
+
items.unresolve,
|
|
415
|
+
)
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
class ItemsResourceWithStreamingResponse:
|
|
419
|
+
def __init__(self, items: ItemsResource) -> None:
|
|
420
|
+
self._items = items
|
|
421
|
+
|
|
422
|
+
self.list = to_streamed_response_wrapper(
|
|
423
|
+
items.list,
|
|
424
|
+
)
|
|
425
|
+
self.resolve = to_streamed_response_wrapper(
|
|
426
|
+
items.resolve,
|
|
427
|
+
)
|
|
428
|
+
self.unresolve = to_streamed_response_wrapper(
|
|
429
|
+
items.unresolve,
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
class AsyncItemsResourceWithStreamingResponse:
|
|
434
|
+
def __init__(self, items: AsyncItemsResource) -> None:
|
|
435
|
+
self._items = items
|
|
436
|
+
|
|
437
|
+
self.list = async_to_streamed_response_wrapper(
|
|
438
|
+
items.list,
|
|
439
|
+
)
|
|
440
|
+
self.resolve = async_to_streamed_response_wrapper(
|
|
441
|
+
items.resolve,
|
|
442
|
+
)
|
|
443
|
+
self.unresolve = async_to_streamed_response_wrapper(
|
|
444
|
+
items.unresolve,
|
|
445
|
+
)
|