From 45ae6847cf56c7bc1b59025be1510b6e997a1c9a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 13:13:29 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +- src/Content/ContentSubmitParams/Policy.php | 7 +- .../Policy/LowQualityContent.php | 114 ++++++++++++++++++ 3 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 src/Content/ContentSubmitParams/Policy/LowQualityContent.php diff --git a/.stats.yml b/.stats.yml index ec34a10..e615fc9 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-3bb06bde0f76baa35ecc698b0c60371c9eadfd7b58c00b77cbc124d5be5dcb8b.yml -openapi_spec_hash: b4339d93d43fb725be0e98bd3bbf4f0b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-2a9024f55f158ede9f9d4811ab4035e470afc920d0f15513da6603d011b2bef7.yml +openapi_spec_hash: cc3275c46438bd043ac96e669e27276f config_hash: 9d144cc6c49d3fd53e5b4472c1e22165 diff --git a/src/Content/ContentSubmitParams/Policy.php b/src/Content/ContentSubmitParams/Policy.php index e3a83be..50bebdb 100644 --- a/src/Content/ContentSubmitParams/Policy.php +++ b/src/Content/ContentSubmitParams/Policy.php @@ -17,6 +17,7 @@ use ModerationAPI\Content\ContentSubmitParams\Policy\IllicitFirearms; use ModerationAPI\Content\ContentSubmitParams\Policy\IllicitGambling; use ModerationAPI\Content\ContentSubmitParams\Policy\IllicitTobacco; +use ModerationAPI\Content\ContentSubmitParams\Policy\LowQualityContent; use ModerationAPI\Content\ContentSubmitParams\Policy\PersonalInformation; use ModerationAPI\Content\ContentSubmitParams\Policy\PiiMasking; use ModerationAPI\Content\ContentSubmitParams\Policy\Political; @@ -55,6 +56,7 @@ * @phpstan-import-type ViolenceShape from \ModerationAPI\Content\ContentSubmitParams\Policy\Violence * @phpstan-import-type SelfHarmShape from \ModerationAPI\Content\ContentSubmitParams\Policy\SelfHarm * @phpstan-import-type SpamShape from \ModerationAPI\Content\ContentSubmitParams\Policy\Spam + * @phpstan-import-type LowQualityContentShape from \ModerationAPI\Content\ContentSubmitParams\Policy\LowQualityContent * @phpstan-import-type SelfPromotionShape from \ModerationAPI\Content\ContentSubmitParams\Policy\SelfPromotion * @phpstan-import-type PoliticalShape from \ModerationAPI\Content\ContentSubmitParams\Policy\Political * @phpstan-import-type ReligionShape from \ModerationAPI\Content\ContentSubmitParams\Policy\Religion @@ -64,8 +66,8 @@ * @phpstan-import-type URLRiskShape from \ModerationAPI\Content\ContentSubmitParams\Policy\URLRisk * @phpstan-import-type GuidelineShape from \ModerationAPI\Content\ContentSubmitParams\Policy\Guideline * - * @phpstan-type PolicyVariants = Toxicity|PersonalInformation|ToxicitySevere|Hate|Illicit|IllicitDrugs|IllicitAlcohol|IllicitFirearms|IllicitTobacco|IllicitGambling|Cannabis|Adult|Crypto|Sexual|Flirtation|Profanity|Violence|SelfHarm|Spam|SelfPromotion|Political|Religion|CodeAbuse|PiiMasking|URLMasking|URLRisk|Guideline - * @phpstan-type PolicyShape = PolicyVariants|ToxicityShape|PersonalInformationShape|ToxicitySevereShape|HateShape|IllicitShape|IllicitDrugsShape|IllicitAlcoholShape|IllicitFirearmsShape|IllicitTobaccoShape|IllicitGamblingShape|CannabisShape|AdultShape|CryptoShape|SexualShape|FlirtationShape|ProfanityShape|ViolenceShape|SelfHarmShape|SpamShape|SelfPromotionShape|PoliticalShape|ReligionShape|CodeAbuseShape|PiiMaskingShape|URLMaskingShape|URLRiskShape|GuidelineShape + * @phpstan-type PolicyVariants = Toxicity|PersonalInformation|ToxicitySevere|Hate|Illicit|IllicitDrugs|IllicitAlcohol|IllicitFirearms|IllicitTobacco|IllicitGambling|Cannabis|Adult|Crypto|Sexual|Flirtation|Profanity|Violence|SelfHarm|Spam|LowQualityContent|SelfPromotion|Political|Religion|CodeAbuse|PiiMasking|URLMasking|URLRisk|Guideline + * @phpstan-type PolicyShape = PolicyVariants|ToxicityShape|PersonalInformationShape|ToxicitySevereShape|HateShape|IllicitShape|IllicitDrugsShape|IllicitAlcoholShape|IllicitFirearmsShape|IllicitTobaccoShape|IllicitGamblingShape|CannabisShape|AdultShape|CryptoShape|SexualShape|FlirtationShape|ProfanityShape|ViolenceShape|SelfHarmShape|SpamShape|LowQualityContentShape|SelfPromotionShape|PoliticalShape|ReligionShape|CodeAbuseShape|PiiMaskingShape|URLMaskingShape|URLRiskShape|GuidelineShape */ final class Policy implements ConverterSource { @@ -96,6 +98,7 @@ public static function variants(): array Violence::class, SelfHarm::class, Spam::class, + LowQualityContent::class, SelfPromotion::class, Political::class, Religion::class, diff --git a/src/Content/ContentSubmitParams/Policy/LowQualityContent.php b/src/Content/ContentSubmitParams/Policy/LowQualityContent.php new file mode 100644 index 0000000..ab9b923 --- /dev/null +++ b/src/Content/ContentSubmitParams/Policy/LowQualityContent.php @@ -0,0 +1,114 @@ + */ + use SdkModel; + + /** @var 'low_quality' $id */ + #[Required] + public string $id = 'low_quality'; + + #[Required] + public bool $flag; + + /** + * Flag content with fewer than this many words as low-effort. Defaults to 3. Set to disable by omitting. + */ + #[Optional] + public ?int $minWords; + + #[Optional] + public ?float $threshold; + + /** + * `new LowQualityContent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * LowQualityContent::with(flag: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new LowQualityContent)->withFlag(...) + * ``` + */ + 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( + bool $flag, + ?int $minWords = null, + ?float $threshold = null + ): self { + $self = new self; + + $self['flag'] = $flag; + + null !== $minWords && $self['minWords'] = $minWords; + null !== $threshold && $self['threshold'] = $threshold; + + return $self; + } + + /** + * @param 'low_quality' $id + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + public function withFlag(bool $flag): self + { + $self = clone $this; + $self['flag'] = $flag; + + return $self; + } + + /** + * Flag content with fewer than this many words as low-effort. Defaults to 3. Set to disable by omitting. + */ + public function withMinWords(int $minWords): self + { + $self = clone $this; + $self['minWords'] = $minWords; + + return $self; + } + + public function withThreshold(float $threshold): self + { + $self = clone $this; + $self['threshold'] = $threshold; + + return $self; + } +} From a9901a3365201f271e54df8a44edb1355bce78f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 1 Jun 2026 13:13:54 +0000 Subject: [PATCH 2/2] release: 0.19.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 4ad3fef..e756293 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.18.0" + ".": "0.19.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b52a3af..97e8a37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.19.0 (2026-06-01) + +Full Changelog: [v0.18.0...v0.19.0](https://github.com/moderation-api/sdk-php/compare/v0.18.0...v0.19.0) + +### Features + +* **api:** api update ([45ae684](https://github.com/moderation-api/sdk-php/commit/45ae6847cf56c7bc1b59025be1510b6e997a1c9a)) + ## 0.18.0 (2026-05-19) Full Changelog: [v0.17.1...v0.18.0](https://github.com/moderation-api/sdk-php/compare/v0.17.1...v0.18.0) diff --git a/README.md b/README.md index 7dd8a9e..b8da17e 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.18.0" +composer require "moderation-api/sdk-php 0.19.0" ``` diff --git a/src/Version.php b/src/Version.php index 4db64c9..6909427 100644 --- a/src/Version.php +++ b/src/Version.php @@ -5,5 +5,5 @@ namespace ModerationAPI; // x-release-please-start-version -const VERSION = '0.18.0'; +const VERSION = '0.19.0'; // x-release-please-end