Skip to content

Commit 5066879

Browse files
feat(api): api update
1 parent 43f90a0 commit 5066879

7 files changed

Lines changed: 6 additions & 139 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/moderation-api-6fe842e0549fd5b4fdb1cca0bf44fa9f71a107ca98eb30a9bb3e4d3c2adeaca9.yml
3-
openapi_spec_hash: ee56658b235950cbf3808b56ddde4919
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-4750d2b76a21489b3dd82d7b7ad6d4cccc33b9827821c7fb5120cfdcc23b9088.yml
3+
openapi_spec_hash: 61cd471624938b233f02dc17416946f2
44
config_hash: 13d10207114afb65f7ac4e21f4c0e358

‎src/moderation_api/resources/actions/actions.py‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ def create(
8888
]
8989
| Omit = omit,
9090
value_required: bool | Omit = omit,
91-
webhooks: Iterable[action_create_params.Webhook] | Omit = omit,
9291
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
9392
# The extra values given here take precedence over values defined on the client or passed to this method.
9493
extra_headers: Headers | None = None,
@@ -126,8 +125,6 @@ def create(
126125
127126
value_required: Whether the action requires a value to be executed.
128127
129-
webhooks: The action's webhooks.
130-
131128
extra_headers: Send extra headers
132129
133130
extra_query: Add additional query parameters to the request
@@ -151,7 +148,6 @@ def create(
151148
"queue_behaviour": queue_behaviour,
152149
"type": type,
153150
"value_required": value_required,
154-
"webhooks": webhooks,
155151
},
156152
action_create_params.ActionCreateParams,
157153
),
@@ -225,7 +221,6 @@ def update(
225221
]
226222
| Omit = omit,
227223
value_required: bool | Omit = omit,
228-
webhooks: Iterable[action_update_params.Webhook] | Omit = omit,
229224
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
230225
# The extra values given here take precedence over values defined on the client or passed to this method.
231226
extra_headers: Headers | None = None,
@@ -265,8 +260,6 @@ def update(
265260
266261
value_required: Whether the action requires a value to be executed.
267262
268-
webhooks: The action's webhooks.
269-
270263
extra_headers: Send extra headers
271264
272265
extra_query: Add additional query parameters to the request
@@ -292,7 +285,6 @@ def update(
292285
"queue_behaviour": queue_behaviour,
293286
"type": type,
294287
"value_required": value_required,
295-
"webhooks": webhooks,
296288
},
297289
action_update_params.ActionUpdateParams,
298290
),
@@ -425,7 +417,6 @@ async def create(
425417
]
426418
| Omit = omit,
427419
value_required: bool | Omit = omit,
428-
webhooks: Iterable[action_create_params.Webhook] | Omit = omit,
429420
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
430421
# The extra values given here take precedence over values defined on the client or passed to this method.
431422
extra_headers: Headers | None = None,
@@ -463,8 +454,6 @@ async def create(
463454
464455
value_required: Whether the action requires a value to be executed.
465456
466-
webhooks: The action's webhooks.
467-
468457
extra_headers: Send extra headers
469458
470459
extra_query: Add additional query parameters to the request
@@ -488,7 +477,6 @@ async def create(
488477
"queue_behaviour": queue_behaviour,
489478
"type": type,
490479
"value_required": value_required,
491-
"webhooks": webhooks,
492480
},
493481
action_create_params.ActionCreateParams,
494482
),
@@ -562,7 +550,6 @@ async def update(
562550
]
563551
| Omit = omit,
564552
value_required: bool | Omit = omit,
565-
webhooks: Iterable[action_update_params.Webhook] | Omit = omit,
566553
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
567554
# The extra values given here take precedence over values defined on the client or passed to this method.
568555
extra_headers: Headers | None = None,
@@ -602,8 +589,6 @@ async def update(
602589
603590
value_required: Whether the action requires a value to be executed.
604591
605-
webhooks: The action's webhooks.
606-
607592
extra_headers: Send extra headers
608593
609594
extra_query: Add additional query parameters to the request
@@ -629,7 +614,6 @@ async def update(
629614
"queue_behaviour": queue_behaviour,
630615
"type": type,
631616
"value_required": value_required,
632-
"webhooks": webhooks,
633617
},
634618
action_update_params.ActionUpdateParams,
635619
),

‎src/moderation_api/types/action_create_params.py‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
1010

11-
__all__ = ["ActionCreateParams", "PossibleValue", "Webhook"]
11+
__all__ = ["ActionCreateParams", "PossibleValue"]
1212

1313

1414
class ActionCreateParams(TypedDict, total=False):
@@ -71,24 +71,7 @@ class ActionCreateParams(TypedDict, total=False):
7171
value_required: Annotated[bool, PropertyInfo(alias="valueRequired")]
7272
"""Whether the action requires a value to be executed."""
7373

74-
webhooks: Iterable[Webhook]
75-
"""The action's webhooks."""
76-
7774

7875
class PossibleValue(TypedDict, total=False):
7976
value: Required[str]
8077
"""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"""

‎src/moderation_api/types/action_list_response.py‎

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,14 @@
77

88
from .._models import BaseModel
99

10-
__all__ = [
11-
"ActionListResponse",
12-
"ActionListResponseItem",
13-
"ActionListResponseItemPossibleValue",
14-
"ActionListResponseItemWebhook",
15-
]
10+
__all__ = ["ActionListResponse", "ActionListResponseItem", "ActionListResponseItemPossibleValue"]
1611

1712

1813
class ActionListResponseItemPossibleValue(BaseModel):
1914
value: str
2015
"""The value of the action."""
2116

2217

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-
4318
class ActionListResponseItem(BaseModel):
4419
id: str
4520
"""The ID of the action."""
@@ -84,9 +59,6 @@ class ActionListResponseItem(BaseModel):
8459
value_required: bool = FieldInfo(alias="valueRequired")
8560
"""Whether the action requires a value to be executed."""
8661

87-
webhooks: List[ActionListResponseItemWebhook]
88-
"""The action's webhooks."""
89-
9062
description: Optional[str] = None
9163
"""The description of the action."""
9264

‎src/moderation_api/types/action_retrieve_response.py‎

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,14 @@
77

88
from .._models import BaseModel
99

10-
__all__ = ["ActionRetrieveResponse", "PossibleValue", "Webhook"]
10+
__all__ = ["ActionRetrieveResponse", "PossibleValue"]
1111

1212

1313
class PossibleValue(BaseModel):
1414
value: str
1515
"""The value of the action."""
1616

1717

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-
3818
class ActionRetrieveResponse(BaseModel):
3919
id: str
4020
"""The ID of the action."""
@@ -79,9 +59,6 @@ class ActionRetrieveResponse(BaseModel):
7959
value_required: bool = FieldInfo(alias="valueRequired")
8060
"""Whether the action requires a value to be executed."""
8161

82-
webhooks: List[Webhook]
83-
"""The action's webhooks."""
84-
8562
description: Optional[str] = None
8663
"""The description of the action."""
8764

‎src/moderation_api/types/action_update_params.py‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .._types import SequenceNotStr
99
from .._utils import PropertyInfo
1010

11-
__all__ = ["ActionUpdateParams", "PossibleValue", "Webhook"]
11+
__all__ = ["ActionUpdateParams", "PossibleValue"]
1212

1313

1414
class ActionUpdateParams(TypedDict, total=False):
@@ -71,24 +71,7 @@ class ActionUpdateParams(TypedDict, total=False):
7171
value_required: Annotated[bool, PropertyInfo(alias="valueRequired")]
7272
"""Whether the action requires a value to be executed."""
7373

74-
webhooks: Iterable[Webhook]
75-
"""The action's webhooks."""
76-
7774

7875
class PossibleValue(TypedDict, total=False):
7976
value: Required[str]
8077
"""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"""

‎tests/api_resources/test_actions.py‎

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,6 @@ def test_method_create_with_all_params(self, client: ModerationAPI) -> None:
4646
queue_behaviour="REMOVE",
4747
type="AUTHOR_BLOCK",
4848
value_required=True,
49-
webhooks=[
50-
{
51-
"name": "name",
52-
"url": "https://example.com",
53-
"id": "id",
54-
"description": "description",
55-
}
56-
],
5749
)
5850
assert_matches_type(ActionCreateResponse, action, path=["response"])
5951

@@ -149,14 +141,6 @@ def test_method_update_with_all_params(self, client: ModerationAPI) -> None:
149141
queue_behaviour="REMOVE",
150142
type="AUTHOR_BLOCK",
151143
value_required=True,
152-
webhooks=[
153-
{
154-
"name": "name",
155-
"url": "https://example.com",
156-
"id": "id",
157-
"description": "description",
158-
}
159-
],
160144
)
161145
assert_matches_type(ActionUpdateResponse, action, path=["response"])
162146

@@ -301,14 +285,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncModeration
301285
queue_behaviour="REMOVE",
302286
type="AUTHOR_BLOCK",
303287
value_required=True,
304-
webhooks=[
305-
{
306-
"name": "name",
307-
"url": "https://example.com",
308-
"id": "id",
309-
"description": "description",
310-
}
311-
],
312288
)
313289
assert_matches_type(ActionCreateResponse, action, path=["response"])
314290

@@ -404,14 +380,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncModeration
404380
queue_behaviour="REMOVE",
405381
type="AUTHOR_BLOCK",
406382
value_required=True,
407-
webhooks=[
408-
{
409-
"name": "name",
410-
"url": "https://example.com",
411-
"id": "id",
412-
"description": "description",
413-
}
414-
],
415383
)
416384
assert_matches_type(ActionUpdateResponse, action, path=["response"])
417385

0 commit comments

Comments
 (0)