From 0bf7d7ad30a1b5863420323d3ba65ffd973e35e4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 11 Sep 2026 15:57:33 +0000 Subject: [PATCH 1/3] feat(api): api update --- .stats.yml | 4 +- src/Content/ContentSubmitParams/Policy.php | 7 +- .../Policy/SexualMinors.php | 93 +++++++++++++++++++ 3 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 src/Content/ContentSubmitParams/Policy/SexualMinors.php diff --git a/.stats.yml b/.stats.yml index 7564488..12d701e 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-4e324c5b209f6b1e2451e0fbafd20b35ba5fe2b57e3c70dd082faad332c3b779.yml -openapi_spec_hash: e974a7107729bb684c55008102a17754 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-8aa8b467e498d92aa60d850a8f68c543143dfff638b970d366b62d7cac2b714f.yml +openapi_spec_hash: 6eae6b3bc43c06e205a3f156bf187a3a config_hash: 6e090a71f4d354167d93b4534a0e7f05 diff --git a/src/Content/ContentSubmitParams/Policy.php b/src/Content/ContentSubmitParams/Policy.php index f3222d6..dcf5bb8 100644 --- a/src/Content/ContentSubmitParams/Policy.php +++ b/src/Content/ContentSubmitParams/Policy.php @@ -27,6 +27,7 @@ use ModerationAPI\Content\ContentSubmitParams\Policy\SelfHarm; use ModerationAPI\Content\ContentSubmitParams\Policy\SelfPromotion; use ModerationAPI\Content\ContentSubmitParams\Policy\Sexual; +use ModerationAPI\Content\ContentSubmitParams\Policy\SexualMinors; use ModerationAPI\Content\ContentSubmitParams\Policy\Spam; use ModerationAPI\Content\ContentSubmitParams\Policy\Toxicity; use ModerationAPI\Content\ContentSubmitParams\Policy\ToxicitySevere; @@ -53,6 +54,7 @@ * @phpstan-import-type AdultShape from \ModerationAPI\Content\ContentSubmitParams\Policy\Adult * @phpstan-import-type CryptoShape from \ModerationAPI\Content\ContentSubmitParams\Policy\Crypto * @phpstan-import-type SexualShape from \ModerationAPI\Content\ContentSubmitParams\Policy\Sexual + * @phpstan-import-type SexualMinorsShape from \ModerationAPI\Content\ContentSubmitParams\Policy\SexualMinors * @phpstan-import-type FlirtationShape from \ModerationAPI\Content\ContentSubmitParams\Policy\Flirtation * @phpstan-import-type ProfanityShape from \ModerationAPI\Content\ContentSubmitParams\Policy\Profanity * @phpstan-import-type ViolenceShape from \ModerationAPI\Content\ContentSubmitParams\Policy\Violence @@ -70,8 +72,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|LowQualityContent|FaceDetection|SelfPromotion|Political|Religion|CodeAbuse|UnicodeSpoofing|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|FaceDetectionShape|SelfPromotionShape|PoliticalShape|ReligionShape|CodeAbuseShape|UnicodeSpoofingShape|PiiMaskingShape|URLMaskingShape|URLRiskShape|GuidelineShape + * @phpstan-type PolicyVariants = Toxicity|PersonalInformation|ToxicitySevere|Hate|Illicit|IllicitDrugs|IllicitAlcohol|IllicitFirearms|IllicitTobacco|IllicitGambling|Cannabis|Adult|Crypto|Sexual|SexualMinors|Flirtation|Profanity|Violence|SelfHarm|Spam|LowQualityContent|FaceDetection|SelfPromotion|Political|Religion|CodeAbuse|UnicodeSpoofing|PiiMasking|URLMasking|URLRisk|Guideline + * @phpstan-type PolicyShape = PolicyVariants|ToxicityShape|PersonalInformationShape|ToxicitySevereShape|HateShape|IllicitShape|IllicitDrugsShape|IllicitAlcoholShape|IllicitFirearmsShape|IllicitTobaccoShape|IllicitGamblingShape|CannabisShape|AdultShape|CryptoShape|SexualShape|SexualMinorsShape|FlirtationShape|ProfanityShape|ViolenceShape|SelfHarmShape|SpamShape|LowQualityContentShape|FaceDetectionShape|SelfPromotionShape|PoliticalShape|ReligionShape|CodeAbuseShape|UnicodeSpoofingShape|PiiMaskingShape|URLMaskingShape|URLRiskShape|GuidelineShape */ final class Policy implements ConverterSource { @@ -97,6 +99,7 @@ public static function variants(): array Adult::class, Crypto::class, Sexual::class, + SexualMinors::class, Flirtation::class, Profanity::class, Violence::class, diff --git a/src/Content/ContentSubmitParams/Policy/SexualMinors.php b/src/Content/ContentSubmitParams/Policy/SexualMinors.php new file mode 100644 index 0000000..63534c8 --- /dev/null +++ b/src/Content/ContentSubmitParams/Policy/SexualMinors.php @@ -0,0 +1,93 @@ + */ + use SdkModel; + + /** @var 'sexual_minors' $id */ + #[Required] + public string $id = 'sexual_minors'; + + #[Required] + public bool $flag; + + #[Optional] + public ?float $threshold; + + /** + * `new SexualMinors()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SexualMinors::with(flag: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SexualMinors)->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, ?float $threshold = null): self + { + $self = new self; + + $self['flag'] = $flag; + + null !== $threshold && $self['threshold'] = $threshold; + + return $self; + } + + /** + * @param 'sexual_minors' $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; + } + + public function withThreshold(float $threshold): self + { + $self = clone $this; + $self['threshold'] = $threshold; + + return $self; + } +} From c9a29e6a195bbb68863b7ca1acaa8d3667dff182 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 12 Sep 2026 12:15:37 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 4 ++-- src/ServiceContracts/AuthorsContract.php | 1 + src/ServiceContracts/AuthorsRawContract.php | 1 + src/Services/AuthorsRawService.php | 3 ++- src/Services/AuthorsService.php | 3 ++- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 12d701e..ac64174 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-8aa8b467e498d92aa60d850a8f68c543143dfff638b970d366b62d7cac2b714f.yml -openapi_spec_hash: 6eae6b3bc43c06e205a3f156bf187a3a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-a4c5163e3271601b36a74223b756d304ce8246f832f8c531d53cdd30f9ee4c68.yml +openapi_spec_hash: fd9fe8a54c1c46032bd5fccb995f04b8 config_hash: 6e090a71f4d354167d93b4534a0e7f05 diff --git a/src/ServiceContracts/AuthorsContract.php b/src/ServiceContracts/AuthorsContract.php index ee4c706..22662d8 100644 --- a/src/ServiceContracts/AuthorsContract.php +++ b/src/ServiceContracts/AuthorsContract.php @@ -120,6 +120,7 @@ public function list( /** * @api * + * @param string $id either external ID or the ID assigned by moderation API * @param RequestOpts|null $requestOptions * * @throws APIException diff --git a/src/ServiceContracts/AuthorsRawContract.php b/src/ServiceContracts/AuthorsRawContract.php index ac79720..e7b05a6 100644 --- a/src/ServiceContracts/AuthorsRawContract.php +++ b/src/ServiceContracts/AuthorsRawContract.php @@ -86,6 +86,7 @@ public function list( /** * @api * + * @param string $id either external ID or the ID assigned by moderation API * @param RequestOpts|null $requestOptions * * @return BaseResponse diff --git a/src/Services/AuthorsRawService.php b/src/Services/AuthorsRawService.php index 79310f6..0e6245c 100644 --- a/src/Services/AuthorsRawService.php +++ b/src/Services/AuthorsRawService.php @@ -186,8 +186,9 @@ public function list( /** * @api * - * Delete a specific author + * Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID. * + * @param string $id either external ID or the ID assigned by moderation API * @param RequestOpts|null $requestOptions * * @return BaseResponse diff --git a/src/Services/AuthorsService.php b/src/Services/AuthorsService.php index 7d2319d..ce67590 100644 --- a/src/Services/AuthorsService.php +++ b/src/Services/AuthorsService.php @@ -205,8 +205,9 @@ public function list( /** * @api * - * Delete a specific author + * Delete a specific author. This resets the author: status, blocks, trust level, metrics and action history are removed. The author is created again with a clean record the next time content is moderated for the same ID. * + * @param string $id either external ID or the ID assigned by moderation API * @param RequestOpts|null $requestOptions * * @throws APIException From 6d378c65e47424504e130c5aef2837a141f81074 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 00:38:41 +0000 Subject: [PATCH 3/3] release: 0.41.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ README.md | 2 +- src/Version.php | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0a40b9d..ea2682c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.40.0" + ".": "0.41.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d6945b..4b1c062 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.41.0 (2026-09-15) + +Full Changelog: [v0.40.0...v0.41.0](https://github.com/moderation-api/sdk-php/compare/v0.40.0...v0.41.0) + +### Features + +* **api:** api update ([c9a29e6](https://github.com/moderation-api/sdk-php/commit/c9a29e6a195bbb68863b7ca1acaa8d3667dff182)) +* **api:** api update ([0bf7d7a](https://github.com/moderation-api/sdk-php/commit/0bf7d7ad30a1b5863420323d3ba65ffd973e35e4)) + ## 0.40.0 (2026-08-28) Full Changelog: [v0.39.0...v0.40.0](https://github.com/moderation-api/sdk-php/compare/v0.39.0...v0.40.0) diff --git a/README.md b/README.md index 13049f2..42978e5 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.40.0" +composer require "moderation-api/sdk-php 0.41.0" ``` diff --git a/src/Version.php b/src/Version.php index fc5bcfc..e7b8522 100644 --- a/src/Version.php +++ b/src/Version.php @@ -5,5 +5,5 @@ namespace ModerationAPI; // x-release-please-start-version -const VERSION = '0.40.0'; +const VERSION = '0.41.0'; // x-release-please-end