From bb93572f6223dc8b60bb06e14cc97e562d384daa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 08:39:54 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +-- .../Data/Object_/Item.php | 27 +++++++++++++++++++ .../Data/Object_/Item.php | 27 +++++++++++++++++++ .../Data/Object_/Item.php | 27 +++++++++++++++++++ .../Data/Object_/Item.php | 27 +++++++++++++++++++ 5 files changed, 110 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6265db3..3729e09 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 27 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-9c5291067ec36cba0c9ef772c5c8eb10238fb332f1f25d0e31f3f2ad87c24e5e.yml -openapi_spec_hash: 790cc0a36d6ed693c06a285c441ab977 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-e2abce1482c148fbbce5c7a7048691afc45935d1bde7feddea11c522ad47a3a1.yml +openapi_spec_hash: 3b3b86090b2243f865bc5aea8554c737 config_hash: 9d144cc6c49d3fd53e5b4472c1e22165 diff --git a/src/Queue/WebhookEvent/QueueItemActionEvent/Data/Object_/Item.php b/src/Queue/WebhookEvent/QueueItemActionEvent/Data/Object_/Item.php index 7ece031..89d3d96 100644 --- a/src/Queue/WebhookEvent/QueueItemActionEvent/Data/Object_/Item.php +++ b/src/Queue/WebhookEvent/QueueItemActionEvent/Data/Object_/Item.php @@ -32,6 +32,7 @@ * content: ContentShape, * conversationID: string|null, * flagged: bool|null, + * flaggedFields: list, * labels: list|null, * language: string|null, * metaType: null|MetaType|value-of, @@ -88,6 +89,14 @@ final class Item implements BaseModel #[Required] public ?bool $flagged; + /** + * For object content, the field keys (e.g. "bio") that triggered a flag. Empty when no fields were flagged or the content is not an object. + * + * @var list $flaggedFields + */ + #[Required('flagged_fields', list: 'string')] + public array $flaggedFields; + /** * Moderation labels applied to the content. * @@ -137,6 +146,7 @@ final class Item implements BaseModel * content: ..., * conversationID: ..., * flagged: ..., + * flaggedFields: ..., * labels: ..., * language: ..., * metaType: ..., @@ -156,6 +166,7 @@ final class Item implements BaseModel * ->withContent(...) * ->withConversationID(...) * ->withFlagged(...) + * ->withFlaggedFields(...) * ->withLabels(...) * ->withLanguage(...) * ->withMetaType(...) @@ -175,6 +186,7 @@ public function __construct() * * @param ClientAction|ClientActionShape|null $clientAction * @param ContentShape $content + * @param list $flaggedFields * @param list|null $labels * @param MetaType|value-of|null $metaType * @param array|null $metadata @@ -187,6 +199,7 @@ public static function with( Text|array|Image|Video|Audio|Object_ $content, ?string $conversationID, ?bool $flagged, + array $flaggedFields, ?array $labels, ?string $language, MetaType|string|null $metaType, @@ -202,6 +215,7 @@ public static function with( $self['content'] = $content; $self['conversationID'] = $conversationID; $self['flagged'] = $flagged; + $self['flaggedFields'] = $flaggedFields; $self['labels'] = $labels; $self['language'] = $language; $self['metaType'] = $metaType; @@ -294,6 +308,19 @@ public function withFlagged(?bool $flagged): self return $self; } + /** + * For object content, the field keys (e.g. "bio") that triggered a flag. Empty when no fields were flagged or the content is not an object. + * + * @param list $flaggedFields + */ + public function withFlaggedFields(array $flaggedFields): self + { + $self = clone $this; + $self['flaggedFields'] = $flaggedFields; + + return $self; + } + /** * Moderation labels applied to the content. * diff --git a/src/Queue/WebhookEvent/QueueItemAllowedEvent/Data/Object_/Item.php b/src/Queue/WebhookEvent/QueueItemAllowedEvent/Data/Object_/Item.php index d740537..b763162 100644 --- a/src/Queue/WebhookEvent/QueueItemAllowedEvent/Data/Object_/Item.php +++ b/src/Queue/WebhookEvent/QueueItemAllowedEvent/Data/Object_/Item.php @@ -32,6 +32,7 @@ * content: ContentShape, * conversationID: string|null, * flagged: bool|null, + * flaggedFields: list, * labels: list|null, * language: string|null, * metaType: null|MetaType|value-of, @@ -88,6 +89,14 @@ final class Item implements BaseModel #[Required] public ?bool $flagged; + /** + * For object content, the field keys (e.g. "bio") that triggered a flag. Empty when no fields were flagged or the content is not an object. + * + * @var list $flaggedFields + */ + #[Required('flagged_fields', list: 'string')] + public array $flaggedFields; + /** * Moderation labels applied to the content. * @@ -137,6 +146,7 @@ final class Item implements BaseModel * content: ..., * conversationID: ..., * flagged: ..., + * flaggedFields: ..., * labels: ..., * language: ..., * metaType: ..., @@ -156,6 +166,7 @@ final class Item implements BaseModel * ->withContent(...) * ->withConversationID(...) * ->withFlagged(...) + * ->withFlaggedFields(...) * ->withLabels(...) * ->withLanguage(...) * ->withMetaType(...) @@ -175,6 +186,7 @@ public function __construct() * * @param ClientAction|ClientActionShape|null $clientAction * @param ContentShape $content + * @param list $flaggedFields * @param list|null $labels * @param MetaType|value-of|null $metaType * @param array|null $metadata @@ -187,6 +199,7 @@ public static function with( Text|array|Image|Video|Audio|Object_ $content, ?string $conversationID, ?bool $flagged, + array $flaggedFields, ?array $labels, ?string $language, MetaType|string|null $metaType, @@ -202,6 +215,7 @@ public static function with( $self['content'] = $content; $self['conversationID'] = $conversationID; $self['flagged'] = $flagged; + $self['flaggedFields'] = $flaggedFields; $self['labels'] = $labels; $self['language'] = $language; $self['metaType'] = $metaType; @@ -294,6 +308,19 @@ public function withFlagged(?bool $flagged): self return $self; } + /** + * For object content, the field keys (e.g. "bio") that triggered a flag. Empty when no fields were flagged or the content is not an object. + * + * @param list $flaggedFields + */ + public function withFlaggedFields(array $flaggedFields): self + { + $self = clone $this; + $self['flaggedFields'] = $flaggedFields; + + return $self; + } + /** * Moderation labels applied to the content. * diff --git a/src/Queue/WebhookEvent/QueueItemCompletedEvent/Data/Object_/Item.php b/src/Queue/WebhookEvent/QueueItemCompletedEvent/Data/Object_/Item.php index c3a2194..91f535e 100644 --- a/src/Queue/WebhookEvent/QueueItemCompletedEvent/Data/Object_/Item.php +++ b/src/Queue/WebhookEvent/QueueItemCompletedEvent/Data/Object_/Item.php @@ -30,6 +30,7 @@ * content: ContentShape, * conversationID: string|null, * flagged: bool|null, + * flaggedFields: list, * labels: list|null, * language: string|null, * metaType: null|MetaType|value-of, @@ -86,6 +87,14 @@ final class Item implements BaseModel #[Required] public ?bool $flagged; + /** + * For object content, the field keys (e.g. "bio") that triggered a flag. Empty when no fields were flagged or the content is not an object. + * + * @var list $flaggedFields + */ + #[Required('flagged_fields', list: 'string')] + public array $flaggedFields; + /** * Moderation labels applied to the content. * @@ -135,6 +144,7 @@ final class Item implements BaseModel * content: ..., * conversationID: ..., * flagged: ..., + * flaggedFields: ..., * labels: ..., * language: ..., * metaType: ..., @@ -154,6 +164,7 @@ final class Item implements BaseModel * ->withContent(...) * ->withConversationID(...) * ->withFlagged(...) + * ->withFlaggedFields(...) * ->withLabels(...) * ->withLanguage(...) * ->withMetaType(...) @@ -173,6 +184,7 @@ public function __construct() * * @param ClientAction|ClientActionShape|null $clientAction * @param ContentShape $content + * @param list $flaggedFields * @param list|null $labels * @param MetaType|value-of|null $metaType * @param array|null $metadata @@ -185,6 +197,7 @@ public static function with( Text|array|Image|Video|Audio|Object_ $content, ?string $conversationID, ?bool $flagged, + array $flaggedFields, ?array $labels, ?string $language, MetaType|string|null $metaType, @@ -200,6 +213,7 @@ public static function with( $self['content'] = $content; $self['conversationID'] = $conversationID; $self['flagged'] = $flagged; + $self['flaggedFields'] = $flaggedFields; $self['labels'] = $labels; $self['language'] = $language; $self['metaType'] = $metaType; @@ -292,6 +306,19 @@ public function withFlagged(?bool $flagged): self return $self; } + /** + * For object content, the field keys (e.g. "bio") that triggered a flag. Empty when no fields were flagged or the content is not an object. + * + * @param list $flaggedFields + */ + public function withFlaggedFields(array $flaggedFields): self + { + $self = clone $this; + $self['flaggedFields'] = $flaggedFields; + + return $self; + } + /** * Moderation labels applied to the content. * diff --git a/src/Queue/WebhookEvent/QueueItemRejectedEvent/Data/Object_/Item.php b/src/Queue/WebhookEvent/QueueItemRejectedEvent/Data/Object_/Item.php index 524b361..63e603b 100644 --- a/src/Queue/WebhookEvent/QueueItemRejectedEvent/Data/Object_/Item.php +++ b/src/Queue/WebhookEvent/QueueItemRejectedEvent/Data/Object_/Item.php @@ -32,6 +32,7 @@ * content: ContentShape, * conversationID: string|null, * flagged: bool|null, + * flaggedFields: list, * labels: list|null, * language: string|null, * metaType: null|MetaType|value-of, @@ -88,6 +89,14 @@ final class Item implements BaseModel #[Required] public ?bool $flagged; + /** + * For object content, the field keys (e.g. "bio") that triggered a flag. Empty when no fields were flagged or the content is not an object. + * + * @var list $flaggedFields + */ + #[Required('flagged_fields', list: 'string')] + public array $flaggedFields; + /** * Moderation labels applied to the content. * @@ -137,6 +146,7 @@ final class Item implements BaseModel * content: ..., * conversationID: ..., * flagged: ..., + * flaggedFields: ..., * labels: ..., * language: ..., * metaType: ..., @@ -156,6 +166,7 @@ final class Item implements BaseModel * ->withContent(...) * ->withConversationID(...) * ->withFlagged(...) + * ->withFlaggedFields(...) * ->withLabels(...) * ->withLanguage(...) * ->withMetaType(...) @@ -175,6 +186,7 @@ public function __construct() * * @param ClientAction|ClientActionShape|null $clientAction * @param ContentShape $content + * @param list $flaggedFields * @param list|null $labels * @param MetaType|value-of|null $metaType * @param array|null $metadata @@ -187,6 +199,7 @@ public static function with( Text|array|Image|Video|Audio|Object_ $content, ?string $conversationID, ?bool $flagged, + array $flaggedFields, ?array $labels, ?string $language, MetaType|string|null $metaType, @@ -202,6 +215,7 @@ public static function with( $self['content'] = $content; $self['conversationID'] = $conversationID; $self['flagged'] = $flagged; + $self['flaggedFields'] = $flaggedFields; $self['labels'] = $labels; $self['language'] = $language; $self['metaType'] = $metaType; @@ -294,6 +308,19 @@ public function withFlagged(?bool $flagged): self return $self; } + /** + * For object content, the field keys (e.g. "bio") that triggered a flag. Empty when no fields were flagged or the content is not an object. + * + * @param list $flaggedFields + */ + public function withFlaggedFields(array $flaggedFields): self + { + $self = clone $this; + $self['flaggedFields'] = $flaggedFields; + + return $self; + } + /** * Moderation labels applied to the content. * From 6f18811d95adc54e65bf72f0cee30616bbcb5c5b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 08:40:16 +0000 Subject: [PATCH 2/2] release: 0.22.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 2 +- src/Version.php | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 86b0e83..cb9d254 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.21.0" + ".": "0.22.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c639db..f57cd68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.22.0 (2026-06-02) + +Full Changelog: [v0.21.0...v0.22.0](https://github.com/moderation-api/sdk-php/compare/v0.21.0...v0.22.0) + +### Features + +* **api:** api update ([bb93572](https://github.com/moderation-api/sdk-php/commit/bb93572f6223dc8b60bb06e14cc97e562d384daa)) + ## 0.21.0 (2026-06-02) Full Changelog: [v0.20.0...v0.21.0](https://github.com/moderation-api/sdk-php/compare/v0.20.0...v0.21.0) diff --git a/README.md b/README.md index 2f42b62..f22065f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The REST API documentation can be found on [docs.moderationapi.com](https://docs ``` -composer require "moderation-api/sdk-php 0.21.0" +composer require "moderation-api/sdk-php 0.22.0" ``` diff --git a/src/Version.php b/src/Version.php index e3755cc..72c3f7d 100644 --- a/src/Version.php +++ b/src/Version.php @@ -5,5 +5,5 @@ namespace ModerationAPI; // x-release-please-start-version -const VERSION = '0.21.0'; +const VERSION = '0.22.0'; // x-release-please-end