Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.18.0"
".": "1.19.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 27
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-6fe842e0549fd5b4fdb1cca0bf44fa9f71a107ca98eb30a9bb3e4d3c2adeaca9.yml
openapi_spec_hash: ee56658b235950cbf3808b56ddde4919
config_hash: 13d10207114afb65f7ac4e21f4c0e358
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-5d59d9b7fffd1ac6f329a62fdc42c97bfa7821168eeea0d686a2d48d90963c34.yml
openapi_spec_hash: 61cd471624938b233f02dc17416946f2
config_hash: 9d144cc6c49d3fd53e5b4472c1e22165
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.19.0 (2026-05-08)

Full Changelog: [v1.18.0...v1.19.0](https://github.com/moderation-api/sdk-python/compare/v1.18.0...v1.19.0)

### Features

* **api:** api update ([e5278b0](https://github.com/moderation-api/sdk-python/commit/e5278b0a492caa4ae55e5005cd7fd820abd2a952))
* **api:** manual updates ([9ddd936](https://github.com/moderation-api/sdk-python/commit/9ddd936295338e01483354cb11986bdcf81350ba))

## 1.18.0 (2026-05-06)

Full Changelog: [v1.17.0...v1.18.0](https://github.com/moderation-api/sdk-python/compare/v1.17.0...v1.18.0)
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Methods:
Types:

```python
from moderation_api.types import QueueRetrieveResponse, QueueGetStatsResponse
from moderation_api.types import WebhookEvent, QueueRetrieveResponse, QueueGetStatsResponse
```

Methods:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "moderation_api"
version = "1.18.0"
version = "1.19.0"
description = "The official Python library for the moderation-api API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion src/moderation_api/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "moderation_api"
__version__ = "1.18.0" # x-release-please-version
__version__ = "1.19.0" # x-release-please-version
16 changes: 0 additions & 16 deletions src/moderation_api/resources/actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def create(
]
| Omit = omit,
value_required: bool | Omit = omit,
webhooks: Iterable[action_create_params.Webhook] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -126,8 +125,6 @@ def create(

value_required: Whether the action requires a value to be executed.

webhooks: The action's webhooks.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -151,7 +148,6 @@ def create(
"queue_behaviour": queue_behaviour,
"type": type,
"value_required": value_required,
"webhooks": webhooks,
},
action_create_params.ActionCreateParams,
),
Expand Down Expand Up @@ -225,7 +221,6 @@ def update(
]
| Omit = omit,
value_required: bool | Omit = omit,
webhooks: Iterable[action_update_params.Webhook] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -265,8 +260,6 @@ def update(

value_required: Whether the action requires a value to be executed.

webhooks: The action's webhooks.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -292,7 +285,6 @@ def update(
"queue_behaviour": queue_behaviour,
"type": type,
"value_required": value_required,
"webhooks": webhooks,
},
action_update_params.ActionUpdateParams,
),
Expand Down Expand Up @@ -425,7 +417,6 @@ async def create(
]
| Omit = omit,
value_required: bool | Omit = omit,
webhooks: Iterable[action_create_params.Webhook] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -463,8 +454,6 @@ async def create(

value_required: Whether the action requires a value to be executed.

webhooks: The action's webhooks.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -488,7 +477,6 @@ async def create(
"queue_behaviour": queue_behaviour,
"type": type,
"value_required": value_required,
"webhooks": webhooks,
},
action_create_params.ActionCreateParams,
),
Expand Down Expand Up @@ -562,7 +550,6 @@ async def update(
]
| Omit = omit,
value_required: bool | Omit = omit,
webhooks: Iterable[action_update_params.Webhook] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand Down Expand Up @@ -602,8 +589,6 @@ async def update(

value_required: Whether the action requires a value to be executed.

webhooks: The action's webhooks.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -629,7 +614,6 @@ async def update(
"queue_behaviour": queue_behaviour,
"type": type,
"value_required": value_required,
"webhooks": webhooks,
},
action_update_params.ActionUpdateParams,
),
Expand Down
19 changes: 1 addition & 18 deletions src/moderation_api/types/action_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .._types import SequenceNotStr
from .._utils import PropertyInfo

__all__ = ["ActionCreateParams", "PossibleValue", "Webhook"]
__all__ = ["ActionCreateParams", "PossibleValue"]


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

webhooks: Iterable[Webhook]
"""The action's webhooks."""


class PossibleValue(TypedDict, total=False):
value: Required[str]
"""The value of the action."""


class Webhook(TypedDict, total=False):
name: Required[str]
"""The webhook's name, used to identify it in the dashboard"""

url: Required[str]
"""The webhook's URL. We'll call this URL when the event occurs."""

id: str
"""ID of an existing webhook or undefined if this is a new webhook."""

description: Optional[str]
"""The webhook's description"""
30 changes: 1 addition & 29 deletions src/moderation_api/types/action_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,14 @@

from .._models import BaseModel

__all__ = [
"ActionListResponse",
"ActionListResponseItem",
"ActionListResponseItemPossibleValue",
"ActionListResponseItemWebhook",
]
__all__ = ["ActionListResponse", "ActionListResponseItem", "ActionListResponseItemPossibleValue"]


class ActionListResponseItemPossibleValue(BaseModel):
value: str
"""The value of the action."""


class ActionListResponseItemWebhook(BaseModel):
id: str
"""The ID of the webhook."""

name: str
"""The webhook's name, used to identify it in the dashboard"""

url: str
"""The webhook's URL. We'll call this URL when the event occurs."""

description: Optional[str] = None
"""The webhook's description"""

moderation_action_id: Optional[str] = FieldInfo(alias="moderationActionId", default=None)
"""The ID of the moderation action to trigger the webhook on.

Only used for moderation action webhooks.
"""


class ActionListResponseItem(BaseModel):
id: str
"""The ID of the action."""
Expand Down Expand Up @@ -84,9 +59,6 @@ class ActionListResponseItem(BaseModel):
value_required: bool = FieldInfo(alias="valueRequired")
"""Whether the action requires a value to be executed."""

webhooks: List[ActionListResponseItemWebhook]
"""The action's webhooks."""

description: Optional[str] = None
"""The description of the action."""

Expand Down
25 changes: 1 addition & 24 deletions src/moderation_api/types/action_retrieve_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,14 @@

from .._models import BaseModel

__all__ = ["ActionRetrieveResponse", "PossibleValue", "Webhook"]
__all__ = ["ActionRetrieveResponse", "PossibleValue"]


class PossibleValue(BaseModel):
value: str
"""The value of the action."""


class Webhook(BaseModel):
id: str
"""The ID of the webhook."""

name: str
"""The webhook's name, used to identify it in the dashboard"""

url: str
"""The webhook's URL. We'll call this URL when the event occurs."""

description: Optional[str] = None
"""The webhook's description"""

moderation_action_id: Optional[str] = FieldInfo(alias="moderationActionId", default=None)
"""The ID of the moderation action to trigger the webhook on.

Only used for moderation action webhooks.
"""


class ActionRetrieveResponse(BaseModel):
id: str
"""The ID of the action."""
Expand Down Expand Up @@ -79,9 +59,6 @@ class ActionRetrieveResponse(BaseModel):
value_required: bool = FieldInfo(alias="valueRequired")
"""Whether the action requires a value to be executed."""

webhooks: List[Webhook]
"""The action's webhooks."""

description: Optional[str] = None
"""The description of the action."""

Expand Down
19 changes: 1 addition & 18 deletions src/moderation_api/types/action_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .._types import SequenceNotStr
from .._utils import PropertyInfo

__all__ = ["ActionUpdateParams", "PossibleValue", "Webhook"]
__all__ = ["ActionUpdateParams", "PossibleValue"]


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

webhooks: Iterable[Webhook]
"""The action's webhooks."""


class PossibleValue(TypedDict, total=False):
value: Required[str]
"""The value of the action."""


class Webhook(TypedDict, total=False):
name: Required[str]
"""The webhook's name, used to identify it in the dashboard"""

url: Required[str]
"""The webhook's URL. We'll call this URL when the event occurs."""

id: str
"""ID of an existing webhook or undefined if this is a new webhook."""

description: Optional[str]
"""The webhook's description"""
32 changes: 0 additions & 32 deletions tests/api_resources/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@ def test_method_create_with_all_params(self, client: ModerationAPI) -> None:
queue_behaviour="REMOVE",
type="AUTHOR_BLOCK",
value_required=True,
webhooks=[
{
"name": "name",
"url": "https://example.com",
"id": "id",
"description": "description",
}
],
)
assert_matches_type(ActionCreateResponse, action, path=["response"])

Expand Down Expand Up @@ -149,14 +141,6 @@ def test_method_update_with_all_params(self, client: ModerationAPI) -> None:
queue_behaviour="REMOVE",
type="AUTHOR_BLOCK",
value_required=True,
webhooks=[
{
"name": "name",
"url": "https://example.com",
"id": "id",
"description": "description",
}
],
)
assert_matches_type(ActionUpdateResponse, action, path=["response"])

Expand Down Expand Up @@ -301,14 +285,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncModeration
queue_behaviour="REMOVE",
type="AUTHOR_BLOCK",
value_required=True,
webhooks=[
{
"name": "name",
"url": "https://example.com",
"id": "id",
"description": "description",
}
],
)
assert_matches_type(ActionCreateResponse, action, path=["response"])

Expand Down Expand Up @@ -404,14 +380,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncModeration
queue_behaviour="REMOVE",
type="AUTHOR_BLOCK",
value_required=True,
webhooks=[
{
"name": "name",
"url": "https://example.com",
"id": "id",
"description": "description",
}
],
)
assert_matches_type(ActionUpdateResponse, action, path=["response"])

Expand Down
Loading