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,274 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ..._types import Body, Query, Headers, NotGiven, SequenceNotStr, not_given
|
|
8
|
+
from ..._utils import maybe_transform, async_maybe_transform
|
|
9
|
+
from ..._compat import cached_property
|
|
10
|
+
from ..._resource import SyncAPIResource, AsyncAPIResource
|
|
11
|
+
from ..._response import (
|
|
12
|
+
to_raw_response_wrapper,
|
|
13
|
+
to_streamed_response_wrapper,
|
|
14
|
+
async_to_raw_response_wrapper,
|
|
15
|
+
async_to_streamed_response_wrapper,
|
|
16
|
+
)
|
|
17
|
+
from ..._base_client import make_request_options
|
|
18
|
+
from ...types.wordlist import word_add_params, word_remove_params
|
|
19
|
+
from ...types.wordlist.word_add_response import WordAddResponse
|
|
20
|
+
from ...types.wordlist.word_remove_response import WordRemoveResponse
|
|
21
|
+
|
|
22
|
+
__all__ = ["WordsResource", "AsyncWordsResource"]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class WordsResource(SyncAPIResource):
|
|
26
|
+
@cached_property
|
|
27
|
+
def with_raw_response(self) -> WordsResourceWithRawResponse:
|
|
28
|
+
"""
|
|
29
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
30
|
+
the raw response object instead of the parsed content.
|
|
31
|
+
|
|
32
|
+
For more information, see https://www.github.com/moderation-api/sdk-python#accessing-raw-response-data-eg-headers
|
|
33
|
+
"""
|
|
34
|
+
return WordsResourceWithRawResponse(self)
|
|
35
|
+
|
|
36
|
+
@cached_property
|
|
37
|
+
def with_streaming_response(self) -> WordsResourceWithStreamingResponse:
|
|
38
|
+
"""
|
|
39
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
40
|
+
|
|
41
|
+
For more information, see https://www.github.com/moderation-api/sdk-python#with_streaming_response
|
|
42
|
+
"""
|
|
43
|
+
return WordsResourceWithStreamingResponse(self)
|
|
44
|
+
|
|
45
|
+
def add(
|
|
46
|
+
self,
|
|
47
|
+
id: str,
|
|
48
|
+
*,
|
|
49
|
+
words: SequenceNotStr[str],
|
|
50
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
51
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
52
|
+
extra_headers: Headers | None = None,
|
|
53
|
+
extra_query: Query | None = None,
|
|
54
|
+
extra_body: Body | None = None,
|
|
55
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
56
|
+
) -> WordAddResponse:
|
|
57
|
+
"""
|
|
58
|
+
Add words to an existing wordlist
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
id: ID of the wordlist to add words to
|
|
62
|
+
|
|
63
|
+
words: Array of words to add to the wordlist. Duplicate words will be ignored.
|
|
64
|
+
|
|
65
|
+
extra_headers: Send extra headers
|
|
66
|
+
|
|
67
|
+
extra_query: Add additional query parameters to the request
|
|
68
|
+
|
|
69
|
+
extra_body: Add additional JSON properties to the request
|
|
70
|
+
|
|
71
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
72
|
+
"""
|
|
73
|
+
if not id:
|
|
74
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
75
|
+
return self._post(
|
|
76
|
+
f"/wordlist/{id}/words",
|
|
77
|
+
body=maybe_transform({"words": words}, word_add_params.WordAddParams),
|
|
78
|
+
options=make_request_options(
|
|
79
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
80
|
+
),
|
|
81
|
+
cast_to=WordAddResponse,
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
def remove(
|
|
85
|
+
self,
|
|
86
|
+
id: str,
|
|
87
|
+
*,
|
|
88
|
+
words: SequenceNotStr[str],
|
|
89
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
90
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
91
|
+
extra_headers: Headers | None = None,
|
|
92
|
+
extra_query: Query | None = None,
|
|
93
|
+
extra_body: Body | None = None,
|
|
94
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
95
|
+
) -> WordRemoveResponse:
|
|
96
|
+
"""
|
|
97
|
+
Remove words from an existing wordlist
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
id: ID of the wordlist to remove words from
|
|
101
|
+
|
|
102
|
+
words: Array of words to remove from the wordlist
|
|
103
|
+
|
|
104
|
+
extra_headers: Send extra headers
|
|
105
|
+
|
|
106
|
+
extra_query: Add additional query parameters to the request
|
|
107
|
+
|
|
108
|
+
extra_body: Add additional JSON properties to the request
|
|
109
|
+
|
|
110
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
111
|
+
"""
|
|
112
|
+
if not id:
|
|
113
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
114
|
+
return self._delete(
|
|
115
|
+
f"/wordlist/{id}/words",
|
|
116
|
+
options=make_request_options(
|
|
117
|
+
extra_headers=extra_headers,
|
|
118
|
+
extra_query=extra_query,
|
|
119
|
+
extra_body=extra_body,
|
|
120
|
+
timeout=timeout,
|
|
121
|
+
query=maybe_transform({"words": words}, word_remove_params.WordRemoveParams),
|
|
122
|
+
),
|
|
123
|
+
cast_to=WordRemoveResponse,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class AsyncWordsResource(AsyncAPIResource):
|
|
128
|
+
@cached_property
|
|
129
|
+
def with_raw_response(self) -> AsyncWordsResourceWithRawResponse:
|
|
130
|
+
"""
|
|
131
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
132
|
+
the raw response object instead of the parsed content.
|
|
133
|
+
|
|
134
|
+
For more information, see https://www.github.com/moderation-api/sdk-python#accessing-raw-response-data-eg-headers
|
|
135
|
+
"""
|
|
136
|
+
return AsyncWordsResourceWithRawResponse(self)
|
|
137
|
+
|
|
138
|
+
@cached_property
|
|
139
|
+
def with_streaming_response(self) -> AsyncWordsResourceWithStreamingResponse:
|
|
140
|
+
"""
|
|
141
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
142
|
+
|
|
143
|
+
For more information, see https://www.github.com/moderation-api/sdk-python#with_streaming_response
|
|
144
|
+
"""
|
|
145
|
+
return AsyncWordsResourceWithStreamingResponse(self)
|
|
146
|
+
|
|
147
|
+
async def add(
|
|
148
|
+
self,
|
|
149
|
+
id: str,
|
|
150
|
+
*,
|
|
151
|
+
words: SequenceNotStr[str],
|
|
152
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
153
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
154
|
+
extra_headers: Headers | None = None,
|
|
155
|
+
extra_query: Query | None = None,
|
|
156
|
+
extra_body: Body | None = None,
|
|
157
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
158
|
+
) -> WordAddResponse:
|
|
159
|
+
"""
|
|
160
|
+
Add words to an existing wordlist
|
|
161
|
+
|
|
162
|
+
Args:
|
|
163
|
+
id: ID of the wordlist to add words to
|
|
164
|
+
|
|
165
|
+
words: Array of words to add to the wordlist. Duplicate words will be ignored.
|
|
166
|
+
|
|
167
|
+
extra_headers: Send extra headers
|
|
168
|
+
|
|
169
|
+
extra_query: Add additional query parameters to the request
|
|
170
|
+
|
|
171
|
+
extra_body: Add additional JSON properties to the request
|
|
172
|
+
|
|
173
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
174
|
+
"""
|
|
175
|
+
if not id:
|
|
176
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
177
|
+
return await self._post(
|
|
178
|
+
f"/wordlist/{id}/words",
|
|
179
|
+
body=await async_maybe_transform({"words": words}, word_add_params.WordAddParams),
|
|
180
|
+
options=make_request_options(
|
|
181
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
182
|
+
),
|
|
183
|
+
cast_to=WordAddResponse,
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
async def remove(
|
|
187
|
+
self,
|
|
188
|
+
id: str,
|
|
189
|
+
*,
|
|
190
|
+
words: SequenceNotStr[str],
|
|
191
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
192
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
193
|
+
extra_headers: Headers | None = None,
|
|
194
|
+
extra_query: Query | None = None,
|
|
195
|
+
extra_body: Body | None = None,
|
|
196
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
197
|
+
) -> WordRemoveResponse:
|
|
198
|
+
"""
|
|
199
|
+
Remove words from an existing wordlist
|
|
200
|
+
|
|
201
|
+
Args:
|
|
202
|
+
id: ID of the wordlist to remove words from
|
|
203
|
+
|
|
204
|
+
words: Array of words to remove from the wordlist
|
|
205
|
+
|
|
206
|
+
extra_headers: Send extra headers
|
|
207
|
+
|
|
208
|
+
extra_query: Add additional query parameters to the request
|
|
209
|
+
|
|
210
|
+
extra_body: Add additional JSON properties to the request
|
|
211
|
+
|
|
212
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
213
|
+
"""
|
|
214
|
+
if not id:
|
|
215
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
216
|
+
return await self._delete(
|
|
217
|
+
f"/wordlist/{id}/words",
|
|
218
|
+
options=make_request_options(
|
|
219
|
+
extra_headers=extra_headers,
|
|
220
|
+
extra_query=extra_query,
|
|
221
|
+
extra_body=extra_body,
|
|
222
|
+
timeout=timeout,
|
|
223
|
+
query=await async_maybe_transform({"words": words}, word_remove_params.WordRemoveParams),
|
|
224
|
+
),
|
|
225
|
+
cast_to=WordRemoveResponse,
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
class WordsResourceWithRawResponse:
|
|
230
|
+
def __init__(self, words: WordsResource) -> None:
|
|
231
|
+
self._words = words
|
|
232
|
+
|
|
233
|
+
self.add = to_raw_response_wrapper(
|
|
234
|
+
words.add,
|
|
235
|
+
)
|
|
236
|
+
self.remove = to_raw_response_wrapper(
|
|
237
|
+
words.remove,
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
class AsyncWordsResourceWithRawResponse:
|
|
242
|
+
def __init__(self, words: AsyncWordsResource) -> None:
|
|
243
|
+
self._words = words
|
|
244
|
+
|
|
245
|
+
self.add = async_to_raw_response_wrapper(
|
|
246
|
+
words.add,
|
|
247
|
+
)
|
|
248
|
+
self.remove = async_to_raw_response_wrapper(
|
|
249
|
+
words.remove,
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
class WordsResourceWithStreamingResponse:
|
|
254
|
+
def __init__(self, words: WordsResource) -> None:
|
|
255
|
+
self._words = words
|
|
256
|
+
|
|
257
|
+
self.add = to_streamed_response_wrapper(
|
|
258
|
+
words.add,
|
|
259
|
+
)
|
|
260
|
+
self.remove = to_streamed_response_wrapper(
|
|
261
|
+
words.remove,
|
|
262
|
+
)
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
class AsyncWordsResourceWithStreamingResponse:
|
|
266
|
+
def __init__(self, words: AsyncWordsResource) -> None:
|
|
267
|
+
self._words = words
|
|
268
|
+
|
|
269
|
+
self.add = async_to_streamed_response_wrapper(
|
|
270
|
+
words.add,
|
|
271
|
+
)
|
|
272
|
+
self.remove = async_to_streamed_response_wrapper(
|
|
273
|
+
words.remove,
|
|
274
|
+
)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .action_list_params import ActionListParams as ActionListParams
|
|
6
|
+
from .author_list_params import AuthorListParams as AuthorListParams
|
|
7
|
+
from .action_create_params import ActionCreateParams as ActionCreateParams
|
|
8
|
+
from .action_list_response import ActionListResponse as ActionListResponse
|
|
9
|
+
from .action_update_params import ActionUpdateParams as ActionUpdateParams
|
|
10
|
+
from .auth_create_response import AuthCreateResponse as AuthCreateResponse
|
|
11
|
+
from .author_create_params import AuthorCreateParams as AuthorCreateParams
|
|
12
|
+
from .author_list_response import AuthorListResponse as AuthorListResponse
|
|
13
|
+
from .author_update_params import AuthorUpdateParams as AuthorUpdateParams
|
|
14
|
+
from .account_list_response import AccountListResponse as AccountListResponse
|
|
15
|
+
from .content_submit_params import ContentSubmitParams as ContentSubmitParams
|
|
16
|
+
from .action_create_response import ActionCreateResponse as ActionCreateResponse
|
|
17
|
+
from .action_delete_response import ActionDeleteResponse as ActionDeleteResponse
|
|
18
|
+
from .action_update_response import ActionUpdateResponse as ActionUpdateResponse
|
|
19
|
+
from .auth_retrieve_response import AuthRetrieveResponse as AuthRetrieveResponse
|
|
20
|
+
from .author_create_response import AuthorCreateResponse as AuthorCreateResponse
|
|
21
|
+
from .author_delete_response import AuthorDeleteResponse as AuthorDeleteResponse
|
|
22
|
+
from .author_update_response import AuthorUpdateResponse as AuthorUpdateResponse
|
|
23
|
+
from .queue_get_stats_params import QueueGetStatsParams as QueueGetStatsParams
|
|
24
|
+
from .wordlist_list_response import WordlistListResponse as WordlistListResponse
|
|
25
|
+
from .wordlist_update_params import WordlistUpdateParams as WordlistUpdateParams
|
|
26
|
+
from .content_submit_response import ContentSubmitResponse as ContentSubmitResponse
|
|
27
|
+
from .queue_retrieve_response import QueueRetrieveResponse as QueueRetrieveResponse
|
|
28
|
+
from .action_retrieve_response import ActionRetrieveResponse as ActionRetrieveResponse
|
|
29
|
+
from .author_retrieve_response import AuthorRetrieveResponse as AuthorRetrieveResponse
|
|
30
|
+
from .queue_get_stats_response import QueueGetStatsResponse as QueueGetStatsResponse
|
|
31
|
+
from .wordlist_update_response import WordlistUpdateResponse as WordlistUpdateResponse
|
|
32
|
+
from .wordlist_retrieve_response import WordlistRetrieveResponse as WordlistRetrieveResponse
|
|
33
|
+
from .wordlist_get_embedding_status_response import (
|
|
34
|
+
WordlistGetEmbeddingStatusResponse as WordlistGetEmbeddingStatusResponse,
|
|
35
|
+
)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["AccountListResponse", "CurrentProject"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CurrentProject(BaseModel):
|
|
11
|
+
id: str
|
|
12
|
+
"""ID of the current project"""
|
|
13
|
+
|
|
14
|
+
name: str
|
|
15
|
+
"""Name of the current project"""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class AccountListResponse(BaseModel):
|
|
19
|
+
id: str
|
|
20
|
+
"""ID of the account"""
|
|
21
|
+
|
|
22
|
+
paid_plan_name: str
|
|
23
|
+
"""Name of the paid plan"""
|
|
24
|
+
|
|
25
|
+
remaining_quota: float
|
|
26
|
+
"""Remaining quota"""
|
|
27
|
+
|
|
28
|
+
text_api_quota: float
|
|
29
|
+
"""Text API quota"""
|
|
30
|
+
|
|
31
|
+
current_project: Optional[CurrentProject] = None
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Iterable, Optional
|
|
6
|
+
from typing_extensions import Literal, Required, Annotated, TypedDict
|
|
7
|
+
|
|
8
|
+
from .._types import SequenceNotStr
|
|
9
|
+
from .._utils import PropertyInfo
|
|
10
|
+
|
|
11
|
+
__all__ = ["ActionCreateParams", "PossibleValue", "Webhook"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ActionCreateParams(TypedDict, total=False):
|
|
15
|
+
name: Required[str]
|
|
16
|
+
"""The name of the action."""
|
|
17
|
+
|
|
18
|
+
built_in: Annotated[Optional[bool], PropertyInfo(alias="builtIn")]
|
|
19
|
+
"""Whether the action is a built-in action or a custom one."""
|
|
20
|
+
|
|
21
|
+
description: Optional[str]
|
|
22
|
+
"""The description of the action."""
|
|
23
|
+
|
|
24
|
+
filter_in_queue_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="filterInQueueIds")]
|
|
25
|
+
"""The IDs of the queues the action is available in."""
|
|
26
|
+
|
|
27
|
+
free_text: Annotated[bool, PropertyInfo(alias="freeText")]
|
|
28
|
+
"""
|
|
29
|
+
Whether the action allows any text to be entered as a value or if it must be one
|
|
30
|
+
of the possible values.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
key: Optional[str]
|
|
34
|
+
"""User defined key of the action."""
|
|
35
|
+
|
|
36
|
+
position: Literal["ALL_QUEUES", "SOME_QUEUES", "HIDDEN"]
|
|
37
|
+
"""
|
|
38
|
+
Show the action in all queues, selected queues or no queues (to use via API
|
|
39
|
+
only).
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
possible_values: Annotated[Iterable[PossibleValue], PropertyInfo(alias="possibleValues")]
|
|
43
|
+
"""The possible values of the action.
|
|
44
|
+
|
|
45
|
+
The user will be prompted to select one of these values when executing the
|
|
46
|
+
action.
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
queue_behaviour: Annotated[Literal["REMOVE", "ADD", "NO_CHANGE"], PropertyInfo(alias="queueBehaviour")]
|
|
50
|
+
"""
|
|
51
|
+
Whether the action resolves and removes the item, unresolves and re-add it to
|
|
52
|
+
the queue, or does not change the resolve status.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
type: Optional[
|
|
56
|
+
Literal[
|
|
57
|
+
"AUTHOR_BLOCK",
|
|
58
|
+
"AUTHOR_BLOCK_TEMP",
|
|
59
|
+
"AUTHOR_UNBLOCK",
|
|
60
|
+
"AUTHOR_DELETE",
|
|
61
|
+
"AUTHOR_REPORT",
|
|
62
|
+
"AUTHOR_WARN",
|
|
63
|
+
"AUTHOR_CUSTOM",
|
|
64
|
+
"ITEM_REJECT",
|
|
65
|
+
"ITEM_ALLOW",
|
|
66
|
+
"ITEM_CUSTOM",
|
|
67
|
+
]
|
|
68
|
+
]
|
|
69
|
+
"""The type of the action."""
|
|
70
|
+
|
|
71
|
+
value_required: Annotated[bool, PropertyInfo(alias="valueRequired")]
|
|
72
|
+
"""Whether the action requires a value to be executed."""
|
|
73
|
+
|
|
74
|
+
webhooks: Iterable[Webhook]
|
|
75
|
+
"""The action's webhooks."""
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class PossibleValue(TypedDict, total=False):
|
|
79
|
+
value: Required[str]
|
|
80
|
+
"""The value of the action."""
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class Webhook(TypedDict, total=False):
|
|
84
|
+
name: Required[str]
|
|
85
|
+
"""The webhook's name, used to identify it in the dashboard"""
|
|
86
|
+
|
|
87
|
+
url: Required[str]
|
|
88
|
+
"""The webhook's URL. We'll call this URL when the event occurs."""
|
|
89
|
+
|
|
90
|
+
id: str
|
|
91
|
+
"""ID of an existing webhook or undefined if this is a new webhook."""
|
|
92
|
+
|
|
93
|
+
description: Optional[str]
|
|
94
|
+
"""The webhook's description"""
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from pydantic import Field as FieldInfo
|
|
7
|
+
|
|
8
|
+
from .._models import BaseModel
|
|
9
|
+
|
|
10
|
+
__all__ = ["ActionCreateResponse", "PossibleValue"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PossibleValue(BaseModel):
|
|
14
|
+
value: str
|
|
15
|
+
"""The value of the action."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ActionCreateResponse(BaseModel):
|
|
19
|
+
id: str
|
|
20
|
+
"""The ID of the action."""
|
|
21
|
+
|
|
22
|
+
built_in: Optional[bool] = FieldInfo(alias="builtIn", default=None)
|
|
23
|
+
"""Whether the action is a built-in action or a custom one."""
|
|
24
|
+
|
|
25
|
+
created_at: str = FieldInfo(alias="createdAt")
|
|
26
|
+
"""The date the action was created."""
|
|
27
|
+
|
|
28
|
+
filter_in_queue_ids: List[str] = FieldInfo(alias="filterInQueueIds")
|
|
29
|
+
"""The IDs of the queues the action is available in."""
|
|
30
|
+
|
|
31
|
+
free_text: bool = FieldInfo(alias="freeText")
|
|
32
|
+
"""
|
|
33
|
+
Whether the action allows any text to be entered as a value or if it must be one
|
|
34
|
+
of the possible values.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
name: str
|
|
38
|
+
"""The name of the action."""
|
|
39
|
+
|
|
40
|
+
position: Literal["ALL_QUEUES", "SOME_QUEUES", "HIDDEN"]
|
|
41
|
+
"""
|
|
42
|
+
Show the action in all queues, selected queues or no queues (to use via API
|
|
43
|
+
only).
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
possible_values: List[PossibleValue] = FieldInfo(alias="possibleValues")
|
|
47
|
+
"""The possible values of the action.
|
|
48
|
+
|
|
49
|
+
The user will be prompted to select one of these values when executing the
|
|
50
|
+
action.
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
queue_behaviour: Literal["REMOVE", "ADD", "NO_CHANGE"] = FieldInfo(alias="queueBehaviour")
|
|
54
|
+
"""
|
|
55
|
+
Whether the action resolves and removes the item, unresolves and re-add it to
|
|
56
|
+
the queue, or does not change the resolve status.
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
value_required: bool = FieldInfo(alias="valueRequired")
|
|
60
|
+
"""Whether the action requires a value to be executed."""
|
|
61
|
+
|
|
62
|
+
description: Optional[str] = None
|
|
63
|
+
"""The description of the action."""
|
|
64
|
+
|
|
65
|
+
key: Optional[str] = None
|
|
66
|
+
"""User defined key of the action."""
|
|
67
|
+
|
|
68
|
+
type: Optional[
|
|
69
|
+
Literal[
|
|
70
|
+
"AUTHOR_BLOCK",
|
|
71
|
+
"AUTHOR_BLOCK_TEMP",
|
|
72
|
+
"AUTHOR_UNBLOCK",
|
|
73
|
+
"AUTHOR_DELETE",
|
|
74
|
+
"AUTHOR_REPORT",
|
|
75
|
+
"AUTHOR_WARN",
|
|
76
|
+
"AUTHOR_CUSTOM",
|
|
77
|
+
"ITEM_REJECT",
|
|
78
|
+
"ITEM_ALLOW",
|
|
79
|
+
"ITEM_CUSTOM",
|
|
80
|
+
]
|
|
81
|
+
] = None
|
|
82
|
+
"""The type of the action."""
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["ActionDeleteResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ActionDeleteResponse(BaseModel):
|
|
9
|
+
id: str
|
|
10
|
+
"""The ID of the action."""
|
|
11
|
+
|
|
12
|
+
deleted: bool
|
|
13
|
+
"""Whether the action was deleted."""
|
|
@@ -0,0 +1,13 @@
|
|
|
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 Annotated, TypedDict
|
|
6
|
+
|
|
7
|
+
from .._utils import PropertyInfo
|
|
8
|
+
|
|
9
|
+
__all__ = ["ActionListParams"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ActionListParams(TypedDict, total=False):
|
|
13
|
+
queue_id: Annotated[str, PropertyInfo(alias="queueId")]
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from typing_extensions import Literal, TypeAlias
|
|
5
|
+
|
|
6
|
+
from pydantic import Field as FieldInfo
|
|
7
|
+
|
|
8
|
+
from .._models import BaseModel
|
|
9
|
+
|
|
10
|
+
__all__ = [
|
|
11
|
+
"ActionListResponse",
|
|
12
|
+
"ActionListResponseItem",
|
|
13
|
+
"ActionListResponseItemPossibleValue",
|
|
14
|
+
"ActionListResponseItemWebhook",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ActionListResponseItemPossibleValue(BaseModel):
|
|
19
|
+
value: str
|
|
20
|
+
"""The value of the action."""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class ActionListResponseItemWebhook(BaseModel):
|
|
24
|
+
id: str
|
|
25
|
+
"""The ID of the webhook."""
|
|
26
|
+
|
|
27
|
+
name: str
|
|
28
|
+
"""The webhook's name, used to identify it in the dashboard"""
|
|
29
|
+
|
|
30
|
+
url: str
|
|
31
|
+
"""The webhook's URL. We'll call this URL when the event occurs."""
|
|
32
|
+
|
|
33
|
+
description: Optional[str] = None
|
|
34
|
+
"""The webhook's description"""
|
|
35
|
+
|
|
36
|
+
moderation_action_id: Optional[str] = FieldInfo(alias="moderationActionId", default=None)
|
|
37
|
+
"""The ID of the moderation action to trigger the webhook on.
|
|
38
|
+
|
|
39
|
+
Only used for moderation action webhooks.
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class ActionListResponseItem(BaseModel):
|
|
44
|
+
id: str
|
|
45
|
+
"""The ID of the action."""
|
|
46
|
+
|
|
47
|
+
built_in: Optional[bool] = FieldInfo(alias="builtIn", default=None)
|
|
48
|
+
"""Whether the action is a built-in action or a custom one."""
|
|
49
|
+
|
|
50
|
+
created_at: str = FieldInfo(alias="createdAt")
|
|
51
|
+
"""The date the action was created."""
|
|
52
|
+
|
|
53
|
+
filter_in_queue_ids: List[str] = FieldInfo(alias="filterInQueueIds")
|
|
54
|
+
"""The IDs of the queues the action is available in."""
|
|
55
|
+
|
|
56
|
+
free_text: bool = FieldInfo(alias="freeText")
|
|
57
|
+
"""
|
|
58
|
+
Whether the action allows any text to be entered as a value or if it must be one
|
|
59
|
+
of the possible values.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
name: str
|
|
63
|
+
"""The name of the action."""
|
|
64
|
+
|
|
65
|
+
position: Literal["ALL_QUEUES", "SOME_QUEUES", "HIDDEN"]
|
|
66
|
+
"""
|
|
67
|
+
Show the action in all queues, selected queues or no queues (to use via API
|
|
68
|
+
only).
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
possible_values: List[ActionListResponseItemPossibleValue] = FieldInfo(alias="possibleValues")
|
|
72
|
+
"""The possible values of the action.
|
|
73
|
+
|
|
74
|
+
The user will be prompted to select one of these values when executing the
|
|
75
|
+
action.
|
|
76
|
+
"""
|
|
77
|
+
|
|
78
|
+
queue_behaviour: Literal["REMOVE", "ADD", "NO_CHANGE"] = FieldInfo(alias="queueBehaviour")
|
|
79
|
+
"""
|
|
80
|
+
Whether the action resolves and removes the item, unresolves and re-add it to
|
|
81
|
+
the queue, or does not change the resolve status.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
value_required: bool = FieldInfo(alias="valueRequired")
|
|
85
|
+
"""Whether the action requires a value to be executed."""
|
|
86
|
+
|
|
87
|
+
webhooks: List[ActionListResponseItemWebhook]
|
|
88
|
+
"""The action's webhooks."""
|
|
89
|
+
|
|
90
|
+
description: Optional[str] = None
|
|
91
|
+
"""The description of the action."""
|
|
92
|
+
|
|
93
|
+
key: Optional[str] = None
|
|
94
|
+
"""User defined key of the action."""
|
|
95
|
+
|
|
96
|
+
type: Optional[
|
|
97
|
+
Literal[
|
|
98
|
+
"AUTHOR_BLOCK",
|
|
99
|
+
"AUTHOR_BLOCK_TEMP",
|
|
100
|
+
"AUTHOR_UNBLOCK",
|
|
101
|
+
"AUTHOR_DELETE",
|
|
102
|
+
"AUTHOR_REPORT",
|
|
103
|
+
"AUTHOR_WARN",
|
|
104
|
+
"AUTHOR_CUSTOM",
|
|
105
|
+
"ITEM_REJECT",
|
|
106
|
+
"ITEM_ALLOW",
|
|
107
|
+
"ITEM_CUSTOM",
|
|
108
|
+
]
|
|
109
|
+
] = None
|
|
110
|
+
"""The type of the action."""
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
ActionListResponse: TypeAlias = List[ActionListResponseItem]
|