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 @@
{
".": "0.21.0"
".": "0.22.0"
}
4 changes: 2 additions & 2 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-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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The REST API documentation can be found on [docs.moderationapi.com](https://docs
<!-- x-release-please-start-version -->

```
composer require "moderation-api/sdk-php 0.21.0"
composer require "moderation-api/sdk-php 0.22.0"
```

<!-- x-release-please-end -->
Expand Down
27 changes: 27 additions & 0 deletions src/Queue/WebhookEvent/QueueItemActionEvent/Data/Object_/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* content: ContentShape,
* conversationID: string|null,
* flagged: bool|null,
* flaggedFields: list<string>,
* labels: list<Label|LabelShape>|null,
* language: string|null,
* metaType: null|MetaType|value-of<MetaType>,
Expand Down Expand Up @@ -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<string> $flaggedFields
*/
#[Required('flagged_fields', list: 'string')]
public array $flaggedFields;

/**
* Moderation labels applied to the content.
*
Expand Down Expand Up @@ -137,6 +146,7 @@ final class Item implements BaseModel
* content: ...,
* conversationID: ...,
* flagged: ...,
* flaggedFields: ...,
* labels: ...,
* language: ...,
* metaType: ...,
Expand All @@ -156,6 +166,7 @@ final class Item implements BaseModel
* ->withContent(...)
* ->withConversationID(...)
* ->withFlagged(...)
* ->withFlaggedFields(...)
* ->withLabels(...)
* ->withLanguage(...)
* ->withMetaType(...)
Expand All @@ -175,6 +186,7 @@ public function __construct()
*
* @param ClientAction|ClientActionShape|null $clientAction
* @param ContentShape $content
* @param list<string> $flaggedFields
* @param list<Label|LabelShape>|null $labels
* @param MetaType|value-of<MetaType>|null $metaType
* @param array<string,mixed>|null $metadata
Expand All @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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<string> $flaggedFields
*/
public function withFlaggedFields(array $flaggedFields): self
{
$self = clone $this;
$self['flaggedFields'] = $flaggedFields;

return $self;
}

/**
* Moderation labels applied to the content.
*
Expand Down
27 changes: 27 additions & 0 deletions src/Queue/WebhookEvent/QueueItemAllowedEvent/Data/Object_/Item.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* content: ContentShape,
* conversationID: string|null,
* flagged: bool|null,
* flaggedFields: list<string>,
* labels: list<Label|LabelShape>|null,
* language: string|null,
* metaType: null|MetaType|value-of<MetaType>,
Expand Down Expand Up @@ -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<string> $flaggedFields
*/
#[Required('flagged_fields', list: 'string')]
public array $flaggedFields;

/**
* Moderation labels applied to the content.
*
Expand Down Expand Up @@ -137,6 +146,7 @@ final class Item implements BaseModel
* content: ...,
* conversationID: ...,
* flagged: ...,
* flaggedFields: ...,
* labels: ...,
* language: ...,
* metaType: ...,
Expand All @@ -156,6 +166,7 @@ final class Item implements BaseModel
* ->withContent(...)
* ->withConversationID(...)
* ->withFlagged(...)
* ->withFlaggedFields(...)
* ->withLabels(...)
* ->withLanguage(...)
* ->withMetaType(...)
Expand All @@ -175,6 +186,7 @@ public function __construct()
*
* @param ClientAction|ClientActionShape|null $clientAction
* @param ContentShape $content
* @param list<string> $flaggedFields
* @param list<Label|LabelShape>|null $labels
* @param MetaType|value-of<MetaType>|null $metaType
* @param array<string,mixed>|null $metadata
Expand All @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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<string> $flaggedFields
*/
public function withFlaggedFields(array $flaggedFields): self
{
$self = clone $this;
$self['flaggedFields'] = $flaggedFields;

return $self;
}

/**
* Moderation labels applied to the content.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* content: ContentShape,
* conversationID: string|null,
* flagged: bool|null,
* flaggedFields: list<string>,
* labels: list<Label|LabelShape>|null,
* language: string|null,
* metaType: null|MetaType|value-of<MetaType>,
Expand Down Expand Up @@ -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<string> $flaggedFields
*/
#[Required('flagged_fields', list: 'string')]
public array $flaggedFields;

/**
* Moderation labels applied to the content.
*
Expand Down Expand Up @@ -135,6 +144,7 @@ final class Item implements BaseModel
* content: ...,
* conversationID: ...,
* flagged: ...,
* flaggedFields: ...,
* labels: ...,
* language: ...,
* metaType: ...,
Expand All @@ -154,6 +164,7 @@ final class Item implements BaseModel
* ->withContent(...)
* ->withConversationID(...)
* ->withFlagged(...)
* ->withFlaggedFields(...)
* ->withLabels(...)
* ->withLanguage(...)
* ->withMetaType(...)
Expand All @@ -173,6 +184,7 @@ public function __construct()
*
* @param ClientAction|ClientActionShape|null $clientAction
* @param ContentShape $content
* @param list<string> $flaggedFields
* @param list<Label|LabelShape>|null $labels
* @param MetaType|value-of<MetaType>|null $metaType
* @param array<string,mixed>|null $metadata
Expand All @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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<string> $flaggedFields
*/
public function withFlaggedFields(array $flaggedFields): self
{
$self = clone $this;
$self['flaggedFields'] = $flaggedFields;

return $self;
}

/**
* Moderation labels applied to the content.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* content: ContentShape,
* conversationID: string|null,
* flagged: bool|null,
* flaggedFields: list<string>,
* labels: list<Label|LabelShape>|null,
* language: string|null,
* metaType: null|MetaType|value-of<MetaType>,
Expand Down Expand Up @@ -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<string> $flaggedFields
*/
#[Required('flagged_fields', list: 'string')]
public array $flaggedFields;

/**
* Moderation labels applied to the content.
*
Expand Down Expand Up @@ -137,6 +146,7 @@ final class Item implements BaseModel
* content: ...,
* conversationID: ...,
* flagged: ...,
* flaggedFields: ...,
* labels: ...,
* language: ...,
* metaType: ...,
Expand All @@ -156,6 +166,7 @@ final class Item implements BaseModel
* ->withContent(...)
* ->withConversationID(...)
* ->withFlagged(...)
* ->withFlaggedFields(...)
* ->withLabels(...)
* ->withLanguage(...)
* ->withMetaType(...)
Expand All @@ -175,6 +186,7 @@ public function __construct()
*
* @param ClientAction|ClientActionShape|null $clientAction
* @param ContentShape $content
* @param list<string> $flaggedFields
* @param list<Label|LabelShape>|null $labels
* @param MetaType|value-of<MetaType>|null $metaType
* @param array<string,mixed>|null $metadata
Expand All @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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<string> $flaggedFields
*/
public function withFlaggedFields(array $flaggedFields): self
{
$self = clone $this;
$self['flaggedFields'] = $flaggedFields;

return $self;
}

/**
* Moderation labels applied to the content.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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