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.18.0"
".": "0.19.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: 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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
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.18.0"
composer require "moderation-api/sdk-php 0.19.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 @@ -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;
Expand Down Expand Up @@ -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
Expand All @@ -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
{
Expand Down Expand Up @@ -96,6 +98,7 @@ public static function variants(): array
Violence::class,
SelfHarm::class,
Spam::class,
LowQualityContent::class,
SelfPromotion::class,
Political::class,
Religion::class,
Expand Down
114 changes: 114 additions & 0 deletions src/Content/ContentSubmitParams/Policy/LowQualityContent.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?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 LowQualityContentShape = array{
* id: 'low_quality', flag: bool, minWords?: int|null, threshold?: float|null
* }
*/
final class LowQualityContent implements BaseModel
{
/** @use SdkModel<LowQualityContentShape> */
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;
}
}
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.18.0';
const VERSION = '0.19.0';
// x-release-please-end