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.36.0"
".": "0.37.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: 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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
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.36.0"
composer require "moderation-api/sdk-php 0.37.0"
```

<!-- x-release-please-end -->
Expand Down
21 changes: 21 additions & 0 deletions src/Queue/QueueGetResponse/Queue/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -39,6 +41,7 @@
* languages?: list<string>|null,
* maxSeverity?: int|null,
* mediaTypes?: list<MediaType|value-of<MediaType>>|null,
* metadataFilters?: list<MetadataFilter|MetadataFilterShape>|null,
* minSeverity?: int|null,
* recommendationActions?: list<RecommendationAction|value-of<RecommendationAction>>|null,
* search?: list<string>|null,
Expand Down Expand Up @@ -117,6 +120,10 @@ final class Filter implements BaseModel
#[Optional(list: MediaType::class)]
public ?array $mediaTypes;

/** @var list<MetadataFilter>|null $metadataFilters */
#[Optional(list: MetadataFilter::class)]
public ?array $metadataFilters;

#[Optional]
public ?int $minSeverity;

Expand Down Expand Up @@ -157,6 +164,7 @@ public function __construct()
* @param list<string>|null $labels
* @param list<string>|null $languages
* @param list<MediaType|value-of<MediaType>>|null $mediaTypes
* @param list<MetadataFilter|MetadataFilterShape>|null $metadataFilters
* @param list<RecommendationAction|value-of<RecommendationAction>>|null $recommendationActions
* @param list<string>|null $search
* @param WithinUnit|value-of<WithinUnit>|null $withinUnit
Expand All @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -396,6 +406,17 @@ public function withMediaTypes(array $mediaTypes): self
return $self;
}

/**
* @param list<MetadataFilter|MetadataFilterShape> $metadataFilters
*/
public function withMetadataFilters(array $metadataFilters): self
{
$self = clone $this;
$self['metadataFilters'] = $metadataFilters;

return $self;
}

public function withMinSeverity(int $minSeverity): self
{
$self = clone $this;
Expand Down
74 changes: 74 additions & 0 deletions src/Queue/QueueGetResponse/Queue/Filter/MetadataFilter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

declare(strict_types=1);

namespace ModerationAPI\Queue\QueueGetResponse\Queue\Filter;

use ModerationAPI\Core\Attributes\Required;
use ModerationAPI\Core\Concerns\SdkModel;
use ModerationAPI\Core\Contracts\BaseModel;

/**
* @phpstan-type MetadataFilterShape = array{key: string, value: string}
*/
final class MetadataFilter implements BaseModel
{
/** @use SdkModel<MetadataFilterShape> */
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;
}
}
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.36.0';
const VERSION = '0.37.0';
// x-release-please-end