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.40.0"
".": "0.41.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-4e324c5b209f6b1e2451e0fbafd20b35ba5fe2b57e3c70dd082faad332c3b779.yml
openapi_spec_hash: e974a7107729bb684c55008102a17754
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api/moderation-api-a4c5163e3271601b36a74223b756d304ce8246f832f8c531d53cdd30f9ee4c68.yml
openapi_spec_hash: fd9fe8a54c1c46032bd5fccb995f04b8
config_hash: 6e090a71f4d354167d93b4534a0e7f05
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
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.40.0"
composer require "moderation-api/sdk-php 0.41.0"
```

<!-- x-release-please-end -->
Expand Down
7 changes: 5 additions & 2 deletions src/Content/ContentSubmitParams/Policy.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
Expand All @@ -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
{
Expand All @@ -97,6 +99,7 @@ public static function variants(): array
Adult::class,
Crypto::class,
Sexual::class,
SexualMinors::class,
Flirtation::class,
Profanity::class,
Violence::class,
Expand Down
93 changes: 93 additions & 0 deletions src/Content/ContentSubmitParams/Policy/SexualMinors.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?php

declare(strict_types=1);

namespace ModerationAPI\Content\ContentSubmitParams\Policy;

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

/**
* @phpstan-type SexualMinorsShape = array{
* id: 'sexual_minors', flag: bool, threshold?: float|null
* }
*/
final class SexualMinors implements BaseModel
{
/** @use SdkModel<SexualMinorsShape> */
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;
}
}
1 change: 1 addition & 0 deletions src/ServiceContracts/AuthorsContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/ServiceContracts/AuthorsRawContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<AuthorDeleteResponse>
Expand Down
3 changes: 2 additions & 1 deletion src/Services/AuthorsRawService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<AuthorDeleteResponse>
Expand Down
3 changes: 2 additions & 1 deletion src/Services/AuthorsService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.40.0';
const VERSION = '0.41.0';
// x-release-please-end