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,105 @@
|
|
|
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__ = ["ActionRetrieveResponse", "PossibleValue", "Webhook"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PossibleValue(BaseModel):
|
|
14
|
+
value: str
|
|
15
|
+
"""The value of the action."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class Webhook(BaseModel):
|
|
19
|
+
id: str
|
|
20
|
+
"""The ID of the webhook."""
|
|
21
|
+
|
|
22
|
+
name: str
|
|
23
|
+
"""The webhook's name, used to identify it in the dashboard"""
|
|
24
|
+
|
|
25
|
+
url: str
|
|
26
|
+
"""The webhook's URL. We'll call this URL when the event occurs."""
|
|
27
|
+
|
|
28
|
+
description: Optional[str] = None
|
|
29
|
+
"""The webhook's description"""
|
|
30
|
+
|
|
31
|
+
moderation_action_id: Optional[str] = FieldInfo(alias="moderationActionId", default=None)
|
|
32
|
+
"""The ID of the moderation action to trigger the webhook on.
|
|
33
|
+
|
|
34
|
+
Only used for moderation action webhooks.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class ActionRetrieveResponse(BaseModel):
|
|
39
|
+
id: str
|
|
40
|
+
"""The ID of the action."""
|
|
41
|
+
|
|
42
|
+
built_in: Optional[bool] = FieldInfo(alias="builtIn", default=None)
|
|
43
|
+
"""Whether the action is a built-in action or a custom one."""
|
|
44
|
+
|
|
45
|
+
created_at: str = FieldInfo(alias="createdAt")
|
|
46
|
+
"""The date the action was created."""
|
|
47
|
+
|
|
48
|
+
filter_in_queue_ids: List[str] = FieldInfo(alias="filterInQueueIds")
|
|
49
|
+
"""The IDs of the queues the action is available in."""
|
|
50
|
+
|
|
51
|
+
free_text: bool = FieldInfo(alias="freeText")
|
|
52
|
+
"""
|
|
53
|
+
Whether the action allows any text to be entered as a value or if it must be one
|
|
54
|
+
of the possible values.
|
|
55
|
+
"""
|
|
56
|
+
|
|
57
|
+
name: str
|
|
58
|
+
"""The name of the action."""
|
|
59
|
+
|
|
60
|
+
position: Literal["ALL_QUEUES", "SOME_QUEUES", "HIDDEN"]
|
|
61
|
+
"""
|
|
62
|
+
Show the action in all queues, selected queues or no queues (to use via API
|
|
63
|
+
only).
|
|
64
|
+
"""
|
|
65
|
+
|
|
66
|
+
possible_values: List[PossibleValue] = FieldInfo(alias="possibleValues")
|
|
67
|
+
"""The possible values of the action.
|
|
68
|
+
|
|
69
|
+
The user will be prompted to select one of these values when executing the
|
|
70
|
+
action.
|
|
71
|
+
"""
|
|
72
|
+
|
|
73
|
+
queue_behaviour: Literal["REMOVE", "ADD", "NO_CHANGE"] = FieldInfo(alias="queueBehaviour")
|
|
74
|
+
"""
|
|
75
|
+
Whether the action resolves and removes the item, unresolves and re-add it to
|
|
76
|
+
the queue, or does not change the resolve status.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
value_required: bool = FieldInfo(alias="valueRequired")
|
|
80
|
+
"""Whether the action requires a value to be executed."""
|
|
81
|
+
|
|
82
|
+
webhooks: List[Webhook]
|
|
83
|
+
"""The action's webhooks."""
|
|
84
|
+
|
|
85
|
+
description: Optional[str] = None
|
|
86
|
+
"""The description of the action."""
|
|
87
|
+
|
|
88
|
+
key: Optional[str] = None
|
|
89
|
+
"""User defined key of the action."""
|
|
90
|
+
|
|
91
|
+
type: Optional[
|
|
92
|
+
Literal[
|
|
93
|
+
"AUTHOR_BLOCK",
|
|
94
|
+
"AUTHOR_BLOCK_TEMP",
|
|
95
|
+
"AUTHOR_UNBLOCK",
|
|
96
|
+
"AUTHOR_DELETE",
|
|
97
|
+
"AUTHOR_REPORT",
|
|
98
|
+
"AUTHOR_WARN",
|
|
99
|
+
"AUTHOR_CUSTOM",
|
|
100
|
+
"ITEM_REJECT",
|
|
101
|
+
"ITEM_ALLOW",
|
|
102
|
+
"ITEM_CUSTOM",
|
|
103
|
+
]
|
|
104
|
+
] = None
|
|
105
|
+
"""The type of the action."""
|
|
@@ -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__ = ["ActionUpdateParams", "PossibleValue", "Webhook"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ActionUpdateParams(TypedDict, total=False):
|
|
15
|
+
built_in: Annotated[Optional[bool], PropertyInfo(alias="builtIn")]
|
|
16
|
+
"""Whether the action is a built-in action or a custom one."""
|
|
17
|
+
|
|
18
|
+
description: Optional[str]
|
|
19
|
+
"""The description of the action."""
|
|
20
|
+
|
|
21
|
+
filter_in_queue_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="filterInQueueIds")]
|
|
22
|
+
"""The IDs of the queues the action is available in."""
|
|
23
|
+
|
|
24
|
+
free_text: Annotated[bool, PropertyInfo(alias="freeText")]
|
|
25
|
+
"""
|
|
26
|
+
Whether the action allows any text to be entered as a value or if it must be one
|
|
27
|
+
of the possible values.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
key: Optional[str]
|
|
31
|
+
"""User defined key of the action."""
|
|
32
|
+
|
|
33
|
+
name: str
|
|
34
|
+
"""The name 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__ = ["ActionUpdateResponse", "PossibleValue"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class PossibleValue(BaseModel):
|
|
14
|
+
value: str
|
|
15
|
+
"""The value of the action."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ActionUpdateResponse(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,8 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .execute_execute_params import ExecuteExecuteParams as ExecuteExecuteParams
|
|
6
|
+
from .execute_execute_response import ExecuteExecuteResponse as ExecuteExecuteResponse
|
|
7
|
+
from .execute_execute_by_id_params import ExecuteExecuteByIDParams as ExecuteExecuteByIDParams
|
|
8
|
+
from .execute_execute_by_id_response import ExecuteExecuteByIDResponse as ExecuteExecuteByIDResponse
|
|
@@ -0,0 +1,24 @@
|
|
|
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 ..._types import SequenceNotStr
|
|
8
|
+
from ..._utils import PropertyInfo
|
|
9
|
+
|
|
10
|
+
__all__ = ["ExecuteExecuteByIDParams"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ExecuteExecuteByIDParams(TypedDict, total=False):
|
|
14
|
+
author_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="authorIds")]
|
|
15
|
+
"""IDs of the authors to apply the action to"""
|
|
16
|
+
|
|
17
|
+
content_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="contentIds")]
|
|
18
|
+
"""The IDs of the content items to perform the action on."""
|
|
19
|
+
|
|
20
|
+
queue_id: Annotated[str, PropertyInfo(alias="queueId")]
|
|
21
|
+
"""The ID of the queue the action was performed from if any."""
|
|
22
|
+
|
|
23
|
+
value: str
|
|
24
|
+
"""The value of the action. Useful to set a reason for the action etc."""
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List
|
|
4
|
+
|
|
5
|
+
from pydantic import Field as FieldInfo
|
|
6
|
+
|
|
7
|
+
from ..._models import BaseModel
|
|
8
|
+
|
|
9
|
+
__all__ = ["ExecuteExecuteByIDResponse"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ExecuteExecuteByIDResponse(BaseModel):
|
|
13
|
+
action_id: str = FieldInfo(alias="actionId")
|
|
14
|
+
"""The ID of the action."""
|
|
15
|
+
|
|
16
|
+
ids: List[str]
|
|
17
|
+
"""The IDs of the content items."""
|
|
18
|
+
|
|
19
|
+
success: bool
|
|
20
|
+
"""Action executed successfully."""
|
|
@@ -0,0 +1,30 @@
|
|
|
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 Required, Annotated, TypedDict
|
|
6
|
+
|
|
7
|
+
from ..._types import SequenceNotStr
|
|
8
|
+
from ..._utils import PropertyInfo
|
|
9
|
+
|
|
10
|
+
__all__ = ["ExecuteExecuteParams"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ExecuteExecuteParams(TypedDict, total=False):
|
|
14
|
+
action_key: Required[Annotated[str, PropertyInfo(alias="actionKey")]]
|
|
15
|
+
"""ID or key of the action to execute"""
|
|
16
|
+
|
|
17
|
+
author_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="authorIds")]
|
|
18
|
+
"""IDs of the authors to apply the action to. Provide this or contentIds."""
|
|
19
|
+
|
|
20
|
+
content_ids: Annotated[SequenceNotStr[str], PropertyInfo(alias="contentIds")]
|
|
21
|
+
"""IDs of the content items to apply the action to. Provide this or authorIds."""
|
|
22
|
+
|
|
23
|
+
duration: float
|
|
24
|
+
"""Optional duration in milliseconds for actions with timeouts"""
|
|
25
|
+
|
|
26
|
+
queue_id: Annotated[str, PropertyInfo(alias="queueId")]
|
|
27
|
+
"""Optional queue ID if the action is queue-specific"""
|
|
28
|
+
|
|
29
|
+
value: str
|
|
30
|
+
"""Optional value to provide with the action"""
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from ..._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["ExecuteExecuteResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ExecuteExecuteResponse(BaseModel):
|
|
9
|
+
success: bool
|
|
10
|
+
"""Whether the action was executed successfully"""
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from .._models import BaseModel
|
|
4
|
+
|
|
5
|
+
__all__ = ["AuthCreateResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AuthCreateResponse(BaseModel):
|
|
9
|
+
message: str
|
|
10
|
+
"""Message of the authentication"""
|
|
11
|
+
|
|
12
|
+
project: str
|
|
13
|
+
"""Name of the authenticated project"""
|
|
14
|
+
|
|
15
|
+
status: str
|
|
16
|
+
"""Status of the authentication"""
|
|
@@ -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__ = ["AuthRetrieveResponse"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class AuthRetrieveResponse(BaseModel):
|
|
9
|
+
message: str
|
|
10
|
+
"""Message of the authentication"""
|
|
11
|
+
|
|
12
|
+
status: str
|
|
13
|
+
"""Status of the authentication"""
|
|
@@ -0,0 +1,57 @@
|
|
|
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 Dict, Union, Optional
|
|
6
|
+
from typing_extensions import Required, TypeAlias, TypedDict
|
|
7
|
+
|
|
8
|
+
__all__ = ["AuthorCreateParams", "Metadata"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AuthorCreateParams(TypedDict, total=False):
|
|
12
|
+
external_id: Required[str]
|
|
13
|
+
"""External ID of the user, typically the ID of the author in your database."""
|
|
14
|
+
|
|
15
|
+
email: Optional[str]
|
|
16
|
+
"""Author email address"""
|
|
17
|
+
|
|
18
|
+
external_link: Optional[str]
|
|
19
|
+
"""URL of the author's external profile"""
|
|
20
|
+
|
|
21
|
+
first_seen: float
|
|
22
|
+
"""Timestamp when author first appeared"""
|
|
23
|
+
|
|
24
|
+
last_seen: float
|
|
25
|
+
"""Timestamp of last activity"""
|
|
26
|
+
|
|
27
|
+
manual_trust_level: Optional[float]
|
|
28
|
+
|
|
29
|
+
metadata: Metadata
|
|
30
|
+
"""Additional metadata provided by your system.
|
|
31
|
+
|
|
32
|
+
We recommend including any relevant information that may assist in the
|
|
33
|
+
moderation process.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
name: Optional[str]
|
|
37
|
+
"""Author name or identifier"""
|
|
38
|
+
|
|
39
|
+
profile_picture: Optional[str]
|
|
40
|
+
"""URL of the author's profile picture"""
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class MetadataTyped(TypedDict, total=False):
|
|
44
|
+
email_verified: Optional[bool]
|
|
45
|
+
"""Whether the author's email is verified"""
|
|
46
|
+
|
|
47
|
+
identity_verified: Optional[bool]
|
|
48
|
+
"""Whether the author's identity is verified"""
|
|
49
|
+
|
|
50
|
+
is_paying_customer: Optional[bool]
|
|
51
|
+
"""Whether the author is a paying customer"""
|
|
52
|
+
|
|
53
|
+
phone_verified: Optional[bool]
|
|
54
|
+
"""Whether the author's phone number is verified"""
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
Metadata: TypeAlias = Union[MetadataTyped, Dict[str, object]]
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING, Dict, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from pydantic import Field as FieldInfo
|
|
7
|
+
|
|
8
|
+
from .._models import BaseModel
|
|
9
|
+
|
|
10
|
+
__all__ = ["AuthorCreateResponse", "Block", "Metadata", "Metrics", "RiskEvaluation", "TrustLevel"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Block(BaseModel):
|
|
14
|
+
reason: Optional[str] = None
|
|
15
|
+
"""The moderators reason why the author was blocked or suspended."""
|
|
16
|
+
|
|
17
|
+
until: Optional[float] = None
|
|
18
|
+
"""The timestamp until which they are blocked if the author is suspended."""
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Metadata(BaseModel):
|
|
22
|
+
email_verified: Optional[bool] = None
|
|
23
|
+
"""Whether the author's email is verified"""
|
|
24
|
+
|
|
25
|
+
identity_verified: Optional[bool] = None
|
|
26
|
+
"""Whether the author's identity is verified"""
|
|
27
|
+
|
|
28
|
+
is_paying_customer: Optional[bool] = None
|
|
29
|
+
"""Whether the author is a paying customer"""
|
|
30
|
+
|
|
31
|
+
phone_verified: Optional[bool] = None
|
|
32
|
+
"""Whether the author's phone number is verified"""
|
|
33
|
+
|
|
34
|
+
if TYPE_CHECKING:
|
|
35
|
+
# Some versions of Pydantic <2.8.0 have a bug and don’t allow assigning a
|
|
36
|
+
# value to this field, so for compatibility we avoid doing it at runtime.
|
|
37
|
+
__pydantic_extra__: Dict[str, object] = FieldInfo(init=False) # pyright: ignore[reportIncompatibleVariableOverride]
|
|
38
|
+
|
|
39
|
+
# Stub to indicate that arbitrary properties are accepted.
|
|
40
|
+
# To access properties that are not valid identifiers you can use `getattr`, e.g.
|
|
41
|
+
# `getattr(obj, '$type')`
|
|
42
|
+
def __getattr__(self, attr: str) -> object: ...
|
|
43
|
+
else:
|
|
44
|
+
__pydantic_extra__: Dict[str, object]
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class Metrics(BaseModel):
|
|
48
|
+
flagged_content: float
|
|
49
|
+
"""Number of flagged content pieces"""
|
|
50
|
+
|
|
51
|
+
total_content: float
|
|
52
|
+
"""Total pieces of content"""
|
|
53
|
+
|
|
54
|
+
average_sentiment: Optional[float] = None
|
|
55
|
+
"""Average sentiment score of content (-1 to 1).
|
|
56
|
+
|
|
57
|
+
Requires a sentiment model in your project.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class RiskEvaluation(BaseModel):
|
|
62
|
+
risk_level: Optional[float] = None
|
|
63
|
+
"""Calculated risk level based on more than 10 behavioral signals."""
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class TrustLevel(BaseModel):
|
|
67
|
+
level: float
|
|
68
|
+
"""Author trust level (-1, 0, 1, 2, 3, or 4)"""
|
|
69
|
+
|
|
70
|
+
manual: bool
|
|
71
|
+
"""True if the trust level was set manually by a moderator"""
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class AuthorCreateResponse(BaseModel):
|
|
75
|
+
id: str
|
|
76
|
+
"""Author ID in Moderation API"""
|
|
77
|
+
|
|
78
|
+
block: Optional[Block] = None
|
|
79
|
+
"""Block or suspension details, if applicable. Null if the author is enabled."""
|
|
80
|
+
|
|
81
|
+
first_seen: float
|
|
82
|
+
"""Timestamp when author first appeared"""
|
|
83
|
+
|
|
84
|
+
last_seen: float
|
|
85
|
+
"""Timestamp of last activity"""
|
|
86
|
+
|
|
87
|
+
metadata: Metadata
|
|
88
|
+
"""Additional metadata provided by your system.
|
|
89
|
+
|
|
90
|
+
We recommend including any relevant information that may assist in the
|
|
91
|
+
moderation process.
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
metrics: Metrics
|
|
95
|
+
|
|
96
|
+
risk_evaluation: Optional[RiskEvaluation] = None
|
|
97
|
+
"""Risk assessment details, if available."""
|
|
98
|
+
|
|
99
|
+
status: Literal["enabled", "suspended", "blocked"]
|
|
100
|
+
"""Current author status"""
|
|
101
|
+
|
|
102
|
+
trust_level: TrustLevel
|
|
103
|
+
|
|
104
|
+
email: Optional[str] = None
|
|
105
|
+
"""Author email address"""
|
|
106
|
+
|
|
107
|
+
external_id: Optional[str] = None
|
|
108
|
+
"""The author's ID from your system"""
|
|
109
|
+
|
|
110
|
+
external_link: Optional[str] = None
|
|
111
|
+
"""URL of the author's external profile"""
|
|
112
|
+
|
|
113
|
+
last_incident: Optional[float] = None
|
|
114
|
+
"""Timestamp of last incident"""
|
|
115
|
+
|
|
116
|
+
name: Optional[str] = None
|
|
117
|
+
"""Author name or identifier"""
|
|
118
|
+
|
|
119
|
+
profile_picture: Optional[str] = None
|
|
120
|
+
"""URL of the author's profile picture"""
|
|
@@ -0,0 +1,40 @@
|
|
|
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, Annotated, TypedDict
|
|
6
|
+
|
|
7
|
+
from .._utils import PropertyInfo
|
|
8
|
+
|
|
9
|
+
__all__ = ["AuthorListParams"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AuthorListParams(TypedDict, total=False):
|
|
13
|
+
content_types: Annotated[str, PropertyInfo(alias="contentTypes")]
|
|
14
|
+
|
|
15
|
+
last_active_date: Annotated[str, PropertyInfo(alias="lastActiveDate")]
|
|
16
|
+
|
|
17
|
+
member_since_date: Annotated[str, PropertyInfo(alias="memberSinceDate")]
|
|
18
|
+
|
|
19
|
+
page_number: Annotated[float, PropertyInfo(alias="pageNumber")]
|
|
20
|
+
"""Page number to fetch"""
|
|
21
|
+
|
|
22
|
+
page_size: Annotated[float, PropertyInfo(alias="pageSize")]
|
|
23
|
+
"""Number of authors per page"""
|
|
24
|
+
|
|
25
|
+
sort_by: Annotated[
|
|
26
|
+
Literal[
|
|
27
|
+
"trustLevel",
|
|
28
|
+
"violationCount",
|
|
29
|
+
"reportCount",
|
|
30
|
+
"memberSince",
|
|
31
|
+
"lastActive",
|
|
32
|
+
"contentCount",
|
|
33
|
+
"flaggedContentRatio",
|
|
34
|
+
"averageSentiment",
|
|
35
|
+
],
|
|
36
|
+
PropertyInfo(alias="sortBy"),
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
sort_direction: Annotated[Literal["asc", "desc"], PropertyInfo(alias="sortDirection")]
|
|
40
|
+
"""Sort direction"""
|