diff --git a/.github/release-notes/v1.0.0.md b/.github/release-notes/v1.0.0.md index 566a291..85aa6b8 100644 --- a/.github/release-notes/v1.0.0.md +++ b/.github/release-notes/v1.0.0.md @@ -10,7 +10,7 @@ composer require moderation-api/sdk-php:^1.0 - Requires PHP 8.2 or later (was 8.1). - The namespace is `ModerationApi` (was `ModerationAPI`). Create the client with `ModerationApi\ModerationApi::builder()->setSecurity($key)->build()`. -- Requests are typed objects, for example `new Operations\SubmitContentRequest(content: new Operations\TextRequest(text: '...'))`, and responses carry the result in `->object`. +- Requests are typed objects, for example `new Operations\SubmitContentRequestBody(content: new Operations\TextRequest(text: '...'))`, and responses carry the result in `->object`. - Verify webhooks with `ModerationApi\WebhookSignature::constructEvent($payload, $signature)`. ### What's new diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 5bb2f25..2d519b3 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 0199302d-9d48-4081-a021-a66e7a11ce41 management: - docChecksum: c27787b45fc5b72aafff31ba945a9e61 + docChecksum: 38730339aa1da77855e86c169896f12f docVersion: 1.1.0 speakeasyVersion: internal generationVersion: internal - releaseVersion: 1.1.0 - configChecksum: 02c26a6ca40c5c5326664594c00efaf8 + releaseVersion: 1.1.1 + configChecksum: fc3cb529f9d6cc0b51976839fc7521ff repoURL: https://github.com/moderation-api/sdk-php installationURL: https://github.com/moderation-api/sdk-php.git published: true @@ -1460,7 +1460,7 @@ trackedFiles: src/Models/Operations/WithinUnit.php: last_write_checksum: sha1:2bcee79806e20da2d6ea91de1185cbef7b687a2c src/ModerationApi.php: - last_write_checksum: sha1:51aa6c5b26801f0dedc546eff7fa3e210972787f + last_write_checksum: sha1:125a0b3d40a2adc7cb0392536b632611a2842a16 src/ModerationApiBuilder.php: last_write_checksum: sha1:16809f5bed82b4ad4c18f3322de18d04e32a372d src/Projects.php: @@ -1468,7 +1468,7 @@ trackedFiles: src/Queue.php: last_write_checksum: sha1:6e827e98b2489b7f06b1d5869e54f47e6ae2816c src/SDKConfiguration.php: - last_write_checksum: sha1:83f89b5b0365374df283316c53a96f9cfc99f1d5 + last_write_checksum: sha1:63ff169e43e51e25c2eaa43940df61e4c0fdcd25 src/Utils/BigDecimalHandler.php: last_write_checksum: sha1:2d36b5ae690b042acfcdfe7e7277d44c5055416f src/Utils/BigIntHandler.php: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index f55c7a4..6ca615d 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false php: - version: 1.1.0 + version: 1.1.1 additionalDependencies: autoload: {} autoload-dev: {} diff --git a/.speakeasy/openapi.json b/.speakeasy/openapi.json index 88ae723..31ff464 100644 --- a/.speakeasy/openapi.json +++ b/.speakeasy/openapi.json @@ -7,7 +7,7 @@ }, "servers": [ { - "url": "https://moderationapi.com/api/v1" + "url": "https://api.moderationapi.com/v1" } ], "tags": [ diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bae090..ccf9000 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.1.1 (2026-10-22) + +Full Changelog: [v1.1.0...v1.1.1](https://github.com/moderation-api/sdk-php/compare/v1.1.0...v1.1.1) + +### Chores + +- Update the generated code. + ## 1.1.0 (2026-10-22) Full Changelog: [v1.0.0...v1.1.0](https://github.com/moderation-api/sdk-php/compare/v1.0.0...v1.1.0) diff --git a/README.md b/README.md index d2a32f0..9779bf7 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ $sdk = ModerationApi::builder() ->build(); // Text -$sdk->content->submit(new Operations\SubmitContentRequest( +$sdk->content->submit(new Operations\SubmitContentRequestBody( content: new Operations\TextRequest(text: 'Your text here'), contentId: 'message-123', // your ID for the content authorId: 'user-123', // your ID for the user who wrote it @@ -119,18 +119,18 @@ $sdk->content->submit(new Operations\SubmitContentRequest( )); // Image, video and audio: send a URL -$sdk->content->submit(new Operations\SubmitContentRequest( +$sdk->content->submit(new Operations\SubmitContentRequestBody( content: new Operations\ImageRequest(url: 'https://example.com/image.jpg'), )); -$sdk->content->submit(new Operations\SubmitContentRequest( +$sdk->content->submit(new Operations\SubmitContentRequestBody( content: new Operations\VideoRequest(url: 'https://example.com/video.mp4'), )); -$sdk->content->submit(new Operations\SubmitContentRequest( +$sdk->content->submit(new Operations\SubmitContentRequestBody( content: new Operations\AudioRequest(url: 'https://example.com/audio.mp3'), )); // An object with several fields, moderated together -$sdk->content->submit(new Operations\SubmitContentRequest( +$sdk->content->submit(new Operations\SubmitContentRequestBody( content: new Operations\ObjectT(data: [ 'title' => new Operations\DataText(text: 'Post title'), 'body' => new Operations\DataText(text: 'Post content'), @@ -144,7 +144,7 @@ $sdk->content->submit(new Operations\SubmitContentRequest( `evaluation->flagged` tells you if any policy flagged the content. `recommendation->action` is the action the API recommends after it applies your thresholds and rules: `allow`, `review` or `reject`. ```php -$response = $sdk->content->submit(new Operations\SubmitContentRequest( +$response = $sdk->content->submit(new Operations\SubmitContentRequestBody( content: new Operations\TextRequest(text: 'Some content'), )); $result = $response->object; @@ -494,7 +494,7 @@ use ModerationApi; use ModerationApi\Models\Operations; $sdk = ModerationApi\ModerationApi::builder() - ->setServerURL('https://moderationapi.com/api/v1') + ->setServerURL('https://api.moderationapi.com/v1') ->setSecurity( '' ) diff --git a/src/ModerationApi.php b/src/ModerationApi.php index 1b8ab1b..0f5948b 100644 --- a/src/ModerationApi.php +++ b/src/ModerationApi.php @@ -20,7 +20,7 @@ class ModerationApi { public const SERVERS = [ - 'https://moderationapi.com/api/v1', + 'https://api.moderationapi.com/v1', ]; public Authors $authors; diff --git a/src/SDKConfiguration.php b/src/SDKConfiguration.php index 15ed7c6..cdc315e 100644 --- a/src/SDKConfiguration.php +++ b/src/SDKConfiguration.php @@ -26,11 +26,11 @@ class SDKConfiguration public string $openapiDocVersion = '1.1.0'; - public string $sdkVersion = '1.1.0'; + public string $sdkVersion = '1.1.1'; public string $genVersion = 'internal'; - public string $userAgent = 'speakeasy-sdk/php 1.1.0 internal 1.1.0 moderation-api/sdk-php'; + public string $userAgent = 'speakeasy-sdk/php 1.1.1 internal 1.1.0 moderation-api/sdk-php'; public ?RetryConfig $retryConfig = null;