diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 157f035..51acdaa 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.36.0" + ".": "0.37.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index d3bce85..2a0a3b0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 34 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-84d41b47e1aa2a4f88499d983faca8584fe3ef5b2ec8e39d1ae382e83684f46a.yml -openapi_spec_hash: cf456138123b0c2921b5771d2948331b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-94aa0ec14d586e4ce13f5613fd5f5b035b198ccf40c076b9cfff0354b61cf592.yml +openapi_spec_hash: 4719205e164a915edc953d43b5f7368a config_hash: 6e090a71f4d354167d93b4534a0e7f05 diff --git a/CHANGELOG.md b/CHANGELOG.md index a2c0b1b..9e30b9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.37.0 (2026-08-26) + +Full Changelog: [v0.36.0...v0.37.0](https://github.com/moderation-api/sdk-php/compare/v0.36.0...v0.37.0) + +### Features + +* **api:** api update ([33e942b](https://github.com/moderation-api/sdk-php/commit/33e942baaba8959aa7e93d2c25475665b9550e03)) + ## 0.36.0 (2026-08-24) Full Changelog: [v0.35.0...v0.36.0](https://github.com/moderation-api/sdk-php/compare/v0.35.0...v0.36.0) diff --git a/README.md b/README.md index 420b41d..45b044b 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.36.0" +composer require "moderation-api/sdk-php 0.37.0" ``` diff --git a/src/Queue/QueueGetResponse/Queue/Filter.php b/src/Queue/QueueGetResponse/Queue/Filter.php index 8b92b0b..b84488e 100644 --- a/src/Queue/QueueGetResponse/Queue/Filter.php +++ b/src/Queue/QueueGetResponse/Queue/Filter.php @@ -14,11 +14,13 @@ use ModerationAPI\Queue\QueueGetResponse\Queue\Filter\FilterLabel; use ModerationAPI\Queue\QueueGetResponse\Queue\Filter\IsFlagged; use ModerationAPI\Queue\QueueGetResponse\Queue\Filter\MediaType; +use ModerationAPI\Queue\QueueGetResponse\Queue\Filter\MetadataFilter; use ModerationAPI\Queue\QueueGetResponse\Queue\Filter\RecommendationAction; use ModerationAPI\Queue\QueueGetResponse\Queue\Filter\WithinUnit; /** * @phpstan-import-type FilterLabelShape from \ModerationAPI\Queue\QueueGetResponse\Queue\Filter\FilterLabel + * @phpstan-import-type MetadataFilterShape from \ModerationAPI\Queue\QueueGetResponse\Queue\Filter\MetadataFilter * * @phpstan-type FilterShape = array{ * afterDate?: string|null, @@ -39,6 +41,7 @@ * languages?: list|null, * maxSeverity?: int|null, * mediaTypes?: list>|null, + * metadataFilters?: list|null, * minSeverity?: int|null, * recommendationActions?: list>|null, * search?: list|null, @@ -117,6 +120,10 @@ final class Filter implements BaseModel #[Optional(list: MediaType::class)] public ?array $mediaTypes; + /** @var list|null $metadataFilters */ + #[Optional(list: MetadataFilter::class)] + public ?array $metadataFilters; + #[Optional] public ?int $minSeverity; @@ -157,6 +164,7 @@ public function __construct() * @param list|null $labels * @param list|null $languages * @param list>|null $mediaTypes + * @param list|null $metadataFilters * @param list>|null $recommendationActions * @param list|null $search * @param WithinUnit|value-of|null $withinUnit @@ -180,6 +188,7 @@ public static function with( ?array $languages = null, ?int $maxSeverity = null, ?array $mediaTypes = null, + ?array $metadataFilters = null, ?int $minSeverity = null, ?array $recommendationActions = null, ?array $search = null, @@ -206,6 +215,7 @@ public static function with( null !== $languages && $self['languages'] = $languages; null !== $maxSeverity && $self['maxSeverity'] = $maxSeverity; null !== $mediaTypes && $self['mediaTypes'] = $mediaTypes; + null !== $metadataFilters && $self['metadataFilters'] = $metadataFilters; null !== $minSeverity && $self['minSeverity'] = $minSeverity; null !== $recommendationActions && $self['recommendationActions'] = $recommendationActions; null !== $search && $self['search'] = $search; @@ -396,6 +406,17 @@ public function withMediaTypes(array $mediaTypes): self return $self; } + /** + * @param list $metadataFilters + */ + public function withMetadataFilters(array $metadataFilters): self + { + $self = clone $this; + $self['metadataFilters'] = $metadataFilters; + + return $self; + } + public function withMinSeverity(int $minSeverity): self { $self = clone $this; diff --git a/src/Queue/QueueGetResponse/Queue/Filter/MetadataFilter.php b/src/Queue/QueueGetResponse/Queue/Filter/MetadataFilter.php new file mode 100644 index 0000000..d4fe5fb --- /dev/null +++ b/src/Queue/QueueGetResponse/Queue/Filter/MetadataFilter.php @@ -0,0 +1,74 @@ + */ + use SdkModel; + + #[Required] + public string $key; + + #[Required] + public string $value; + + /** + * `new MetadataFilter()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * MetadataFilter::with(key: ..., value: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new MetadataFilter)->withKey(...)->withValue(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $key, string $value): self + { + $self = new self; + + $self['key'] = $key; + $self['value'] = $value; + + return $self; + } + + public function withKey(string $key): self + { + $self = clone $this; + $self['key'] = $key; + + return $self; + } + + public function withValue(string $value): self + { + $self = clone $this; + $self['value'] = $value; + + return $self; + } +} diff --git a/src/Version.php b/src/Version.php index b059f67..6e372e1 100644 --- a/src/Version.php +++ b/src/Version.php @@ -5,5 +5,5 @@ namespace ModerationAPI; // x-release-please-start-version -const VERSION = '0.36.0'; +const VERSION = '0.37.0'; // x-release-please-end