diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5547f83..10f3091 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.1" + ".": "0.2.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 53699ba..e7f91f4 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%2Fmoderation-api-00998c942fa9c81cb927833a3ebb681744bf59757610d9e6ce64ecf71ff2c13e.yml -openapi_spec_hash: 73a0d08c06aa948c82999fe0bca9a5e9 -config_hash: d3a21c98941e21d1937472ca25c37abb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-3eaa6a0657e9f67ea196c65d3b604c71f5406108983981ec696642563fda0a93.yml +openapi_spec_hash: c417a44bb9fa62a02eca68bbb307c712 +config_hash: 6a52f6ae7d55cf3b4e91538cc7752aeb diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d9e060..2e8d960 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.2.0 (2025-12-06) + +Full Changelog: [v0.1.1...v0.2.0](https://github.com/moderation-api/sdk-php/compare/v0.1.1...v0.2.0) + +### Features + +* allow both model class instances and arrays in setters ([1274a2b](https://github.com/moderation-api/sdk-php/commit/1274a2bd53a9f15182101eec6c3859936d03c36d)) +* **api:** api update ([8d25646](https://github.com/moderation-api/sdk-php/commit/8d25646629a65b87ea31fccc053f2b4f45d13a2c)) + ## 0.1.1 (2025-12-05) Full Changelog: [v0.1.0...v0.1.1](https://github.com/moderation-api/sdk-php/compare/v0.1.0...v0.1.1) diff --git a/README.md b/README.md index f3a03f2..a37a2d9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The REST API documentation can be found on [docs.moderationapi.com](https://docs ``` -composer require "moderation-api/sdk-php 0.1.1" +composer require "moderation-api/sdk-php 0.2.0" ``` diff --git a/scripts/lint b/scripts/lint index 13f2f01..211ce90 100755 --- a/scripts/lint +++ b/scripts/lint @@ -5,4 +5,4 @@ set -e cd -- "$(dirname -- "$0")/.." echo "==> Running PHPStan" -exec -- ./vendor/bin/phpstan analyse --memory-limit=2G +exec -- ./vendor/bin/phpstan analyse --memory-limit=12G diff --git a/src/Account/AccountListResponse.php b/src/Account/AccountListResponse.php index 256ef66..3374b77 100644 --- a/src/Account/AccountListResponse.php +++ b/src/Account/AccountListResponse.php @@ -83,22 +83,24 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param CurrentProject|array{id: string, name: string} $current_project */ public static function with( string $id, string $paid_plan_name, float $remaining_quota, float $text_api_quota, - ?CurrentProject $current_project = null, + CurrentProject|array|null $current_project = null, ): self { $obj = new self; - $obj->id = $id; - $obj->paid_plan_name = $paid_plan_name; - $obj->remaining_quota = $remaining_quota; - $obj->text_api_quota = $text_api_quota; + $obj['id'] = $id; + $obj['paid_plan_name'] = $paid_plan_name; + $obj['remaining_quota'] = $remaining_quota; + $obj['text_api_quota'] = $text_api_quota; - null !== $current_project && $obj->current_project = $current_project; + null !== $current_project && $obj['current_project'] = $current_project; return $obj; } @@ -109,7 +111,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -120,7 +122,7 @@ public function withID(string $id): self public function withPaidPlanName(string $paidPlanName): self { $obj = clone $this; - $obj->paid_plan_name = $paidPlanName; + $obj['paid_plan_name'] = $paidPlanName; return $obj; } @@ -131,7 +133,7 @@ public function withPaidPlanName(string $paidPlanName): self public function withRemainingQuota(float $remainingQuota): self { $obj = clone $this; - $obj->remaining_quota = $remainingQuota; + $obj['remaining_quota'] = $remainingQuota; return $obj; } @@ -142,15 +144,19 @@ public function withRemainingQuota(float $remainingQuota): self public function withTextAPIQuota(float $textAPIQuota): self { $obj = clone $this; - $obj->text_api_quota = $textAPIQuota; + $obj['text_api_quota'] = $textAPIQuota; return $obj; } - public function withCurrentProject(CurrentProject $currentProject): self - { + /** + * @param CurrentProject|array{id: string, name: string} $currentProject + */ + public function withCurrentProject( + CurrentProject|array $currentProject + ): self { $obj = clone $this; - $obj->current_project = $currentProject; + $obj['current_project'] = $currentProject; return $obj; } diff --git a/src/Account/AccountListResponse/CurrentProject.php b/src/Account/AccountListResponse/CurrentProject.php index 3cb8509..fe034aa 100644 --- a/src/Account/AccountListResponse/CurrentProject.php +++ b/src/Account/AccountListResponse/CurrentProject.php @@ -56,8 +56,8 @@ public static function with(string $id, string $name): self { $obj = new self; - $obj->id = $id; - $obj->name = $name; + $obj['id'] = $id; + $obj['name'] = $name; return $obj; } @@ -68,7 +68,7 @@ public static function with(string $id, string $name): self public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -79,7 +79,7 @@ public function withID(string $id): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } diff --git a/src/Actions/ActionCreateParams.php b/src/Actions/ActionCreateParams.php index ed3be48..7f9b449 100644 --- a/src/Actions/ActionCreateParams.php +++ b/src/Actions/ActionCreateParams.php @@ -27,11 +27,13 @@ * freeText?: bool, * key?: string|null, * position?: Position|value-of, - * possibleValues?: list, + * possibleValues?: list, * queueBehaviour?: QueueBehaviour|value-of, * type?: null|Type|value-of, * valueRequired?: bool, - * webhooks?: list, + * webhooks?: list, * } */ final class ActionCreateParams implements BaseModel @@ -150,10 +152,12 @@ public function __construct() * * @param list $filterInQueueIds * @param Position|value-of $position - * @param list $possibleValues + * @param list $possibleValues * @param QueueBehaviour|value-of $queueBehaviour * @param Type|value-of|null $type - * @param list $webhooks + * @param list $webhooks */ public static function with( string $name, @@ -171,19 +175,19 @@ public static function with( ): self { $obj = new self; - $obj->name = $name; + $obj['name'] = $name; - null !== $builtIn && $obj->builtIn = $builtIn; - null !== $description && $obj->description = $description; - null !== $filterInQueueIds && $obj->filterInQueueIds = $filterInQueueIds; - null !== $freeText && $obj->freeText = $freeText; - null !== $key && $obj->key = $key; + null !== $builtIn && $obj['builtIn'] = $builtIn; + null !== $description && $obj['description'] = $description; + null !== $filterInQueueIds && $obj['filterInQueueIds'] = $filterInQueueIds; + null !== $freeText && $obj['freeText'] = $freeText; + null !== $key && $obj['key'] = $key; null !== $position && $obj['position'] = $position; - null !== $possibleValues && $obj->possibleValues = $possibleValues; + null !== $possibleValues && $obj['possibleValues'] = $possibleValues; null !== $queueBehaviour && $obj['queueBehaviour'] = $queueBehaviour; null !== $type && $obj['type'] = $type; - null !== $valueRequired && $obj->valueRequired = $valueRequired; - null !== $webhooks && $obj->webhooks = $webhooks; + null !== $valueRequired && $obj['valueRequired'] = $valueRequired; + null !== $webhooks && $obj['webhooks'] = $webhooks; return $obj; } @@ -194,7 +198,7 @@ public static function with( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -205,7 +209,7 @@ public function withName(string $name): self public function withBuiltIn(?bool $builtIn): self { $obj = clone $this; - $obj->builtIn = $builtIn; + $obj['builtIn'] = $builtIn; return $obj; } @@ -216,7 +220,7 @@ public function withBuiltIn(?bool $builtIn): self public function withDescription(?string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -229,7 +233,7 @@ public function withDescription(?string $description): self public function withFilterInQueueIDs(array $filterInQueueIDs): self { $obj = clone $this; - $obj->filterInQueueIds = $filterInQueueIDs; + $obj['filterInQueueIds'] = $filterInQueueIDs; return $obj; } @@ -240,7 +244,7 @@ public function withFilterInQueueIDs(array $filterInQueueIDs): self public function withFreeText(bool $freeText): self { $obj = clone $this; - $obj->freeText = $freeText; + $obj['freeText'] = $freeText; return $obj; } @@ -251,7 +255,7 @@ public function withFreeText(bool $freeText): self public function withKey(?string $key): self { $obj = clone $this; - $obj->key = $key; + $obj['key'] = $key; return $obj; } @@ -272,12 +276,12 @@ public function withPosition(Position|string $position): self /** * The possible values of the action. The user will be prompted to select one of these values when executing the action. * - * @param list $possibleValues + * @param list $possibleValues */ public function withPossibleValues(array $possibleValues): self { $obj = clone $this; - $obj->possibleValues = $possibleValues; + $obj['possibleValues'] = $possibleValues; return $obj; } @@ -315,7 +319,7 @@ public function withType(Type|string|null $type): self public function withValueRequired(bool $valueRequired): self { $obj = clone $this; - $obj->valueRequired = $valueRequired; + $obj['valueRequired'] = $valueRequired; return $obj; } @@ -323,12 +327,14 @@ public function withValueRequired(bool $valueRequired): self /** * The action's webhooks. * - * @param list $webhooks + * @param list $webhooks */ public function withWebhooks(array $webhooks): self { $obj = clone $this; - $obj->webhooks = $webhooks; + $obj['webhooks'] = $webhooks; return $obj; } diff --git a/src/Actions/ActionCreateParams/PossibleValue.php b/src/Actions/ActionCreateParams/PossibleValue.php index f3ff2d4..94d8a1a 100644 --- a/src/Actions/ActionCreateParams/PossibleValue.php +++ b/src/Actions/ActionCreateParams/PossibleValue.php @@ -50,7 +50,7 @@ public static function with(string $value): self { $obj = new self; - $obj->value = $value; + $obj['value'] = $value; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $value): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Actions/ActionCreateParams/Webhook.php b/src/Actions/ActionCreateParams/Webhook.php index e6d3cbf..7e4f09a 100644 --- a/src/Actions/ActionCreateParams/Webhook.php +++ b/src/Actions/ActionCreateParams/Webhook.php @@ -74,11 +74,11 @@ public static function with( ): self { $obj = new self; - $obj->name = $name; - $obj->url = $url; + $obj['name'] = $name; + $obj['url'] = $url; - null !== $id && $obj->id = $id; - null !== $description && $obj->description = $description; + null !== $id && $obj['id'] = $id; + null !== $description && $obj['description'] = $description; return $obj; } @@ -89,7 +89,7 @@ public static function with( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -100,7 +100,7 @@ public function withName(string $name): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -111,7 +111,7 @@ public function withURL(string $url): self public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -122,7 +122,7 @@ public function withID(string $id): self public function withDescription(?string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } diff --git a/src/Actions/ActionDeleteResponse.php b/src/Actions/ActionDeleteResponse.php index 90de61c..208ae8d 100644 --- a/src/Actions/ActionDeleteResponse.php +++ b/src/Actions/ActionDeleteResponse.php @@ -60,8 +60,8 @@ public static function with(string $id, bool $deleted): self { $obj = new self; - $obj->id = $id; - $obj->deleted = $deleted; + $obj['id'] = $id; + $obj['deleted'] = $deleted; return $obj; } @@ -72,7 +72,7 @@ public static function with(string $id, bool $deleted): self public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -83,7 +83,7 @@ public function withID(string $id): self public function withDeleted(bool $deleted): self { $obj = clone $this; - $obj->deleted = $deleted; + $obj['deleted'] = $deleted; return $obj; } diff --git a/src/Actions/ActionGetResponse.php b/src/Actions/ActionGetResponse.php index 0badb34..ed95145 100644 --- a/src/Actions/ActionGetResponse.php +++ b/src/Actions/ActionGetResponse.php @@ -185,9 +185,15 @@ public function __construct() * * @param list $filterInQueueIds * @param Position|value-of $position - * @param list $possibleValues + * @param list $possibleValues * @param QueueBehaviour|value-of $queueBehaviour - * @param list $webhooks + * @param list $webhooks * @param Type|value-of|null $type */ public static function with( @@ -208,20 +214,20 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->builtIn = $builtIn; - $obj->createdAt = $createdAt; - $obj->filterInQueueIds = $filterInQueueIds; - $obj->freeText = $freeText; - $obj->name = $name; + $obj['id'] = $id; + $obj['builtIn'] = $builtIn; + $obj['createdAt'] = $createdAt; + $obj['filterInQueueIds'] = $filterInQueueIds; + $obj['freeText'] = $freeText; + $obj['name'] = $name; $obj['position'] = $position; - $obj->possibleValues = $possibleValues; + $obj['possibleValues'] = $possibleValues; $obj['queueBehaviour'] = $queueBehaviour; - $obj->valueRequired = $valueRequired; - $obj->webhooks = $webhooks; + $obj['valueRequired'] = $valueRequired; + $obj['webhooks'] = $webhooks; - null !== $description && $obj->description = $description; - null !== $key && $obj->key = $key; + null !== $description && $obj['description'] = $description; + null !== $key && $obj['key'] = $key; null !== $type && $obj['type'] = $type; return $obj; @@ -233,7 +239,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -244,7 +250,7 @@ public function withID(string $id): self public function withBuiltIn(?bool $builtIn): self { $obj = clone $this; - $obj->builtIn = $builtIn; + $obj['builtIn'] = $builtIn; return $obj; } @@ -255,7 +261,7 @@ public function withBuiltIn(?bool $builtIn): self public function withCreatedAt(string $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } @@ -268,7 +274,7 @@ public function withCreatedAt(string $createdAt): self public function withFilterInQueueIDs(array $filterInQueueIDs): self { $obj = clone $this; - $obj->filterInQueueIds = $filterInQueueIDs; + $obj['filterInQueueIds'] = $filterInQueueIDs; return $obj; } @@ -279,7 +285,7 @@ public function withFilterInQueueIDs(array $filterInQueueIDs): self public function withFreeText(bool $freeText): self { $obj = clone $this; - $obj->freeText = $freeText; + $obj['freeText'] = $freeText; return $obj; } @@ -290,7 +296,7 @@ public function withFreeText(bool $freeText): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -311,12 +317,12 @@ public function withPosition(Position|string $position): self /** * The possible values of the action. The user will be prompted to select one of these values when executing the action. * - * @param list $possibleValues + * @param list $possibleValues */ public function withPossibleValues(array $possibleValues): self { $obj = clone $this; - $obj->possibleValues = $possibleValues; + $obj['possibleValues'] = $possibleValues; return $obj; } @@ -341,7 +347,7 @@ public function withQueueBehaviour( public function withValueRequired(bool $valueRequired): self { $obj = clone $this; - $obj->valueRequired = $valueRequired; + $obj['valueRequired'] = $valueRequired; return $obj; } @@ -349,12 +355,18 @@ public function withValueRequired(bool $valueRequired): self /** * The action's webhooks. * - * @param list $webhooks + * @param list $webhooks */ public function withWebhooks(array $webhooks): self { $obj = clone $this; - $obj->webhooks = $webhooks; + $obj['webhooks'] = $webhooks; return $obj; } @@ -365,7 +377,7 @@ public function withWebhooks(array $webhooks): self public function withDescription(?string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -376,7 +388,7 @@ public function withDescription(?string $description): self public function withKey(?string $key): self { $obj = clone $this; - $obj->key = $key; + $obj['key'] = $key; return $obj; } diff --git a/src/Actions/ActionGetResponse/PossibleValue.php b/src/Actions/ActionGetResponse/PossibleValue.php index b2fb365..012ad96 100644 --- a/src/Actions/ActionGetResponse/PossibleValue.php +++ b/src/Actions/ActionGetResponse/PossibleValue.php @@ -50,7 +50,7 @@ public static function with(string $value): self { $obj = new self; - $obj->value = $value; + $obj['value'] = $value; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $value): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Actions/ActionGetResponse/Webhook.php b/src/Actions/ActionGetResponse/Webhook.php index b4526b0..7bd6f83 100644 --- a/src/Actions/ActionGetResponse/Webhook.php +++ b/src/Actions/ActionGetResponse/Webhook.php @@ -85,12 +85,12 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->name = $name; - $obj->url = $url; + $obj['id'] = $id; + $obj['name'] = $name; + $obj['url'] = $url; - null !== $description && $obj->description = $description; - null !== $moderationActionId && $obj->moderationActionId = $moderationActionId; + null !== $description && $obj['description'] = $description; + null !== $moderationActionId && $obj['moderationActionId'] = $moderationActionId; return $obj; } @@ -101,7 +101,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -112,7 +112,7 @@ public function withID(string $id): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -123,7 +123,7 @@ public function withName(string $name): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -134,7 +134,7 @@ public function withURL(string $url): self public function withDescription(?string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -145,7 +145,7 @@ public function withDescription(?string $description): self public function withModerationActionID(?string $moderationActionID): self { $obj = clone $this; - $obj->moderationActionId = $moderationActionID; + $obj['moderationActionId'] = $moderationActionID; return $obj; } diff --git a/src/Actions/ActionListParams.php b/src/Actions/ActionListParams.php index 89512ab..7f13d32 100644 --- a/src/Actions/ActionListParams.php +++ b/src/Actions/ActionListParams.php @@ -39,7 +39,7 @@ public static function with(?string $queueId = null): self { $obj = new self; - null !== $queueId && $obj->queueId = $queueId; + null !== $queueId && $obj['queueId'] = $queueId; return $obj; } @@ -47,7 +47,7 @@ public static function with(?string $queueId = null): self public function withQueueID(string $queueID): self { $obj = clone $this; - $obj->queueId = $queueID; + $obj['queueId'] = $queueID; return $obj; } diff --git a/src/Actions/ActionListResponseItem.php b/src/Actions/ActionListResponseItem.php index 11e1624..326c585 100644 --- a/src/Actions/ActionListResponseItem.php +++ b/src/Actions/ActionListResponseItem.php @@ -181,9 +181,15 @@ public function __construct() * * @param list $filterInQueueIds * @param Position|value-of $position - * @param list $possibleValues + * @param list $possibleValues * @param QueueBehaviour|value-of $queueBehaviour - * @param list $webhooks + * @param list $webhooks * @param Type|value-of|null $type */ public static function with( @@ -204,20 +210,20 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->builtIn = $builtIn; - $obj->createdAt = $createdAt; - $obj->filterInQueueIds = $filterInQueueIds; - $obj->freeText = $freeText; - $obj->name = $name; + $obj['id'] = $id; + $obj['builtIn'] = $builtIn; + $obj['createdAt'] = $createdAt; + $obj['filterInQueueIds'] = $filterInQueueIds; + $obj['freeText'] = $freeText; + $obj['name'] = $name; $obj['position'] = $position; - $obj->possibleValues = $possibleValues; + $obj['possibleValues'] = $possibleValues; $obj['queueBehaviour'] = $queueBehaviour; - $obj->valueRequired = $valueRequired; - $obj->webhooks = $webhooks; + $obj['valueRequired'] = $valueRequired; + $obj['webhooks'] = $webhooks; - null !== $description && $obj->description = $description; - null !== $key && $obj->key = $key; + null !== $description && $obj['description'] = $description; + null !== $key && $obj['key'] = $key; null !== $type && $obj['type'] = $type; return $obj; @@ -229,7 +235,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -240,7 +246,7 @@ public function withID(string $id): self public function withBuiltIn(?bool $builtIn): self { $obj = clone $this; - $obj->builtIn = $builtIn; + $obj['builtIn'] = $builtIn; return $obj; } @@ -251,7 +257,7 @@ public function withBuiltIn(?bool $builtIn): self public function withCreatedAt(string $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } @@ -264,7 +270,7 @@ public function withCreatedAt(string $createdAt): self public function withFilterInQueueIDs(array $filterInQueueIDs): self { $obj = clone $this; - $obj->filterInQueueIds = $filterInQueueIDs; + $obj['filterInQueueIds'] = $filterInQueueIDs; return $obj; } @@ -275,7 +281,7 @@ public function withFilterInQueueIDs(array $filterInQueueIDs): self public function withFreeText(bool $freeText): self { $obj = clone $this; - $obj->freeText = $freeText; + $obj['freeText'] = $freeText; return $obj; } @@ -286,7 +292,7 @@ public function withFreeText(bool $freeText): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -307,12 +313,12 @@ public function withPosition(Position|string $position): self /** * The possible values of the action. The user will be prompted to select one of these values when executing the action. * - * @param list $possibleValues + * @param list $possibleValues */ public function withPossibleValues(array $possibleValues): self { $obj = clone $this; - $obj->possibleValues = $possibleValues; + $obj['possibleValues'] = $possibleValues; return $obj; } @@ -337,7 +343,7 @@ public function withQueueBehaviour( public function withValueRequired(bool $valueRequired): self { $obj = clone $this; - $obj->valueRequired = $valueRequired; + $obj['valueRequired'] = $valueRequired; return $obj; } @@ -345,12 +351,18 @@ public function withValueRequired(bool $valueRequired): self /** * The action's webhooks. * - * @param list $webhooks + * @param list $webhooks */ public function withWebhooks(array $webhooks): self { $obj = clone $this; - $obj->webhooks = $webhooks; + $obj['webhooks'] = $webhooks; return $obj; } @@ -361,7 +373,7 @@ public function withWebhooks(array $webhooks): self public function withDescription(?string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -372,7 +384,7 @@ public function withDescription(?string $description): self public function withKey(?string $key): self { $obj = clone $this; - $obj->key = $key; + $obj['key'] = $key; return $obj; } diff --git a/src/Actions/ActionListResponseItem/PossibleValue.php b/src/Actions/ActionListResponseItem/PossibleValue.php index 5e4ebe8..98988ce 100644 --- a/src/Actions/ActionListResponseItem/PossibleValue.php +++ b/src/Actions/ActionListResponseItem/PossibleValue.php @@ -50,7 +50,7 @@ public static function with(string $value): self { $obj = new self; - $obj->value = $value; + $obj['value'] = $value; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $value): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Actions/ActionListResponseItem/Webhook.php b/src/Actions/ActionListResponseItem/Webhook.php index c7e13b3..e90b742 100644 --- a/src/Actions/ActionListResponseItem/Webhook.php +++ b/src/Actions/ActionListResponseItem/Webhook.php @@ -85,12 +85,12 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->name = $name; - $obj->url = $url; + $obj['id'] = $id; + $obj['name'] = $name; + $obj['url'] = $url; - null !== $description && $obj->description = $description; - null !== $moderationActionId && $obj->moderationActionId = $moderationActionId; + null !== $description && $obj['description'] = $description; + null !== $moderationActionId && $obj['moderationActionId'] = $moderationActionId; return $obj; } @@ -101,7 +101,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -112,7 +112,7 @@ public function withID(string $id): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -123,7 +123,7 @@ public function withName(string $name): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -134,7 +134,7 @@ public function withURL(string $url): self public function withDescription(?string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -145,7 +145,7 @@ public function withDescription(?string $description): self public function withModerationActionID(?string $moderationActionID): self { $obj = clone $this; - $obj->moderationActionId = $moderationActionID; + $obj['moderationActionId'] = $moderationActionID; return $obj; } diff --git a/src/Actions/ActionNewResponse.php b/src/Actions/ActionNewResponse.php index 1a06c96..fa9c736 100644 --- a/src/Actions/ActionNewResponse.php +++ b/src/Actions/ActionNewResponse.php @@ -173,7 +173,7 @@ public function __construct() * * @param list $filterInQueueIds * @param Position|value-of $position - * @param list $possibleValues + * @param list $possibleValues * @param QueueBehaviour|value-of $queueBehaviour * @param Type|value-of|null $type */ @@ -194,19 +194,19 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->builtIn = $builtIn; - $obj->createdAt = $createdAt; - $obj->filterInQueueIds = $filterInQueueIds; - $obj->freeText = $freeText; - $obj->name = $name; + $obj['id'] = $id; + $obj['builtIn'] = $builtIn; + $obj['createdAt'] = $createdAt; + $obj['filterInQueueIds'] = $filterInQueueIds; + $obj['freeText'] = $freeText; + $obj['name'] = $name; $obj['position'] = $position; - $obj->possibleValues = $possibleValues; + $obj['possibleValues'] = $possibleValues; $obj['queueBehaviour'] = $queueBehaviour; - $obj->valueRequired = $valueRequired; + $obj['valueRequired'] = $valueRequired; - null !== $description && $obj->description = $description; - null !== $key && $obj->key = $key; + null !== $description && $obj['description'] = $description; + null !== $key && $obj['key'] = $key; null !== $type && $obj['type'] = $type; return $obj; @@ -218,7 +218,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -229,7 +229,7 @@ public function withID(string $id): self public function withBuiltIn(?bool $builtIn): self { $obj = clone $this; - $obj->builtIn = $builtIn; + $obj['builtIn'] = $builtIn; return $obj; } @@ -240,7 +240,7 @@ public function withBuiltIn(?bool $builtIn): self public function withCreatedAt(string $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } @@ -253,7 +253,7 @@ public function withCreatedAt(string $createdAt): self public function withFilterInQueueIDs(array $filterInQueueIDs): self { $obj = clone $this; - $obj->filterInQueueIds = $filterInQueueIDs; + $obj['filterInQueueIds'] = $filterInQueueIDs; return $obj; } @@ -264,7 +264,7 @@ public function withFilterInQueueIDs(array $filterInQueueIDs): self public function withFreeText(bool $freeText): self { $obj = clone $this; - $obj->freeText = $freeText; + $obj['freeText'] = $freeText; return $obj; } @@ -275,7 +275,7 @@ public function withFreeText(bool $freeText): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -296,12 +296,12 @@ public function withPosition(Position|string $position): self /** * The possible values of the action. The user will be prompted to select one of these values when executing the action. * - * @param list $possibleValues + * @param list $possibleValues */ public function withPossibleValues(array $possibleValues): self { $obj = clone $this; - $obj->possibleValues = $possibleValues; + $obj['possibleValues'] = $possibleValues; return $obj; } @@ -326,7 +326,7 @@ public function withQueueBehaviour( public function withValueRequired(bool $valueRequired): self { $obj = clone $this; - $obj->valueRequired = $valueRequired; + $obj['valueRequired'] = $valueRequired; return $obj; } @@ -337,7 +337,7 @@ public function withValueRequired(bool $valueRequired): self public function withDescription(?string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -348,7 +348,7 @@ public function withDescription(?string $description): self public function withKey(?string $key): self { $obj = clone $this; - $obj->key = $key; + $obj['key'] = $key; return $obj; } diff --git a/src/Actions/ActionNewResponse/PossibleValue.php b/src/Actions/ActionNewResponse/PossibleValue.php index b7a6686..92ebb0a 100644 --- a/src/Actions/ActionNewResponse/PossibleValue.php +++ b/src/Actions/ActionNewResponse/PossibleValue.php @@ -50,7 +50,7 @@ public static function with(string $value): self { $obj = new self; - $obj->value = $value; + $obj['value'] = $value; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $value): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Actions/ActionUpdateParams.php b/src/Actions/ActionUpdateParams.php index 4b366c9..0198946 100644 --- a/src/Actions/ActionUpdateParams.php +++ b/src/Actions/ActionUpdateParams.php @@ -27,11 +27,13 @@ * key?: string|null, * name?: string, * position?: Position|value-of, - * possibleValues?: list, + * possibleValues?: list, * queueBehaviour?: QueueBehaviour|value-of, * type?: null|Type|value-of, * valueRequired?: bool, - * webhooks?: list, + * webhooks?: list, * } */ final class ActionUpdateParams implements BaseModel @@ -136,10 +138,12 @@ public function __construct() * * @param list $filterInQueueIds * @param Position|value-of $position - * @param list $possibleValues + * @param list $possibleValues * @param QueueBehaviour|value-of $queueBehaviour * @param Type|value-of|null $type - * @param list $webhooks + * @param list $webhooks */ public static function with( ?bool $builtIn = null, @@ -157,18 +161,18 @@ public static function with( ): self { $obj = new self; - null !== $builtIn && $obj->builtIn = $builtIn; - null !== $description && $obj->description = $description; - null !== $filterInQueueIds && $obj->filterInQueueIds = $filterInQueueIds; - null !== $freeText && $obj->freeText = $freeText; - null !== $key && $obj->key = $key; - null !== $name && $obj->name = $name; + null !== $builtIn && $obj['builtIn'] = $builtIn; + null !== $description && $obj['description'] = $description; + null !== $filterInQueueIds && $obj['filterInQueueIds'] = $filterInQueueIds; + null !== $freeText && $obj['freeText'] = $freeText; + null !== $key && $obj['key'] = $key; + null !== $name && $obj['name'] = $name; null !== $position && $obj['position'] = $position; - null !== $possibleValues && $obj->possibleValues = $possibleValues; + null !== $possibleValues && $obj['possibleValues'] = $possibleValues; null !== $queueBehaviour && $obj['queueBehaviour'] = $queueBehaviour; null !== $type && $obj['type'] = $type; - null !== $valueRequired && $obj->valueRequired = $valueRequired; - null !== $webhooks && $obj->webhooks = $webhooks; + null !== $valueRequired && $obj['valueRequired'] = $valueRequired; + null !== $webhooks && $obj['webhooks'] = $webhooks; return $obj; } @@ -179,7 +183,7 @@ public static function with( public function withBuiltIn(?bool $builtIn): self { $obj = clone $this; - $obj->builtIn = $builtIn; + $obj['builtIn'] = $builtIn; return $obj; } @@ -190,7 +194,7 @@ public function withBuiltIn(?bool $builtIn): self public function withDescription(?string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -203,7 +207,7 @@ public function withDescription(?string $description): self public function withFilterInQueueIDs(array $filterInQueueIDs): self { $obj = clone $this; - $obj->filterInQueueIds = $filterInQueueIDs; + $obj['filterInQueueIds'] = $filterInQueueIDs; return $obj; } @@ -214,7 +218,7 @@ public function withFilterInQueueIDs(array $filterInQueueIDs): self public function withFreeText(bool $freeText): self { $obj = clone $this; - $obj->freeText = $freeText; + $obj['freeText'] = $freeText; return $obj; } @@ -225,7 +229,7 @@ public function withFreeText(bool $freeText): self public function withKey(?string $key): self { $obj = clone $this; - $obj->key = $key; + $obj['key'] = $key; return $obj; } @@ -236,7 +240,7 @@ public function withKey(?string $key): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -257,12 +261,12 @@ public function withPosition(Position|string $position): self /** * The possible values of the action. The user will be prompted to select one of these values when executing the action. * - * @param list $possibleValues + * @param list $possibleValues */ public function withPossibleValues(array $possibleValues): self { $obj = clone $this; - $obj->possibleValues = $possibleValues; + $obj['possibleValues'] = $possibleValues; return $obj; } @@ -300,7 +304,7 @@ public function withType(Type|string|null $type): self public function withValueRequired(bool $valueRequired): self { $obj = clone $this; - $obj->valueRequired = $valueRequired; + $obj['valueRequired'] = $valueRequired; return $obj; } @@ -308,12 +312,14 @@ public function withValueRequired(bool $valueRequired): self /** * The action's webhooks. * - * @param list $webhooks + * @param list $webhooks */ public function withWebhooks(array $webhooks): self { $obj = clone $this; - $obj->webhooks = $webhooks; + $obj['webhooks'] = $webhooks; return $obj; } diff --git a/src/Actions/ActionUpdateParams/PossibleValue.php b/src/Actions/ActionUpdateParams/PossibleValue.php index e04119c..1ac637b 100644 --- a/src/Actions/ActionUpdateParams/PossibleValue.php +++ b/src/Actions/ActionUpdateParams/PossibleValue.php @@ -50,7 +50,7 @@ public static function with(string $value): self { $obj = new self; - $obj->value = $value; + $obj['value'] = $value; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $value): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Actions/ActionUpdateParams/Webhook.php b/src/Actions/ActionUpdateParams/Webhook.php index 0cf31ad..47504d3 100644 --- a/src/Actions/ActionUpdateParams/Webhook.php +++ b/src/Actions/ActionUpdateParams/Webhook.php @@ -74,11 +74,11 @@ public static function with( ): self { $obj = new self; - $obj->name = $name; - $obj->url = $url; + $obj['name'] = $name; + $obj['url'] = $url; - null !== $id && $obj->id = $id; - null !== $description && $obj->description = $description; + null !== $id && $obj['id'] = $id; + null !== $description && $obj['description'] = $description; return $obj; } @@ -89,7 +89,7 @@ public static function with( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -100,7 +100,7 @@ public function withName(string $name): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -111,7 +111,7 @@ public function withURL(string $url): self public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -122,7 +122,7 @@ public function withID(string $id): self public function withDescription(?string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } diff --git a/src/Actions/ActionUpdateResponse.php b/src/Actions/ActionUpdateResponse.php index 0163997..60f788c 100644 --- a/src/Actions/ActionUpdateResponse.php +++ b/src/Actions/ActionUpdateResponse.php @@ -173,7 +173,7 @@ public function __construct() * * @param list $filterInQueueIds * @param Position|value-of $position - * @param list $possibleValues + * @param list $possibleValues * @param QueueBehaviour|value-of $queueBehaviour * @param Type|value-of|null $type */ @@ -194,19 +194,19 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->builtIn = $builtIn; - $obj->createdAt = $createdAt; - $obj->filterInQueueIds = $filterInQueueIds; - $obj->freeText = $freeText; - $obj->name = $name; + $obj['id'] = $id; + $obj['builtIn'] = $builtIn; + $obj['createdAt'] = $createdAt; + $obj['filterInQueueIds'] = $filterInQueueIds; + $obj['freeText'] = $freeText; + $obj['name'] = $name; $obj['position'] = $position; - $obj->possibleValues = $possibleValues; + $obj['possibleValues'] = $possibleValues; $obj['queueBehaviour'] = $queueBehaviour; - $obj->valueRequired = $valueRequired; + $obj['valueRequired'] = $valueRequired; - null !== $description && $obj->description = $description; - null !== $key && $obj->key = $key; + null !== $description && $obj['description'] = $description; + null !== $key && $obj['key'] = $key; null !== $type && $obj['type'] = $type; return $obj; @@ -218,7 +218,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -229,7 +229,7 @@ public function withID(string $id): self public function withBuiltIn(?bool $builtIn): self { $obj = clone $this; - $obj->builtIn = $builtIn; + $obj['builtIn'] = $builtIn; return $obj; } @@ -240,7 +240,7 @@ public function withBuiltIn(?bool $builtIn): self public function withCreatedAt(string $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } @@ -253,7 +253,7 @@ public function withCreatedAt(string $createdAt): self public function withFilterInQueueIDs(array $filterInQueueIDs): self { $obj = clone $this; - $obj->filterInQueueIds = $filterInQueueIDs; + $obj['filterInQueueIds'] = $filterInQueueIDs; return $obj; } @@ -264,7 +264,7 @@ public function withFilterInQueueIDs(array $filterInQueueIDs): self public function withFreeText(bool $freeText): self { $obj = clone $this; - $obj->freeText = $freeText; + $obj['freeText'] = $freeText; return $obj; } @@ -275,7 +275,7 @@ public function withFreeText(bool $freeText): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -296,12 +296,12 @@ public function withPosition(Position|string $position): self /** * The possible values of the action. The user will be prompted to select one of these values when executing the action. * - * @param list $possibleValues + * @param list $possibleValues */ public function withPossibleValues(array $possibleValues): self { $obj = clone $this; - $obj->possibleValues = $possibleValues; + $obj['possibleValues'] = $possibleValues; return $obj; } @@ -326,7 +326,7 @@ public function withQueueBehaviour( public function withValueRequired(bool $valueRequired): self { $obj = clone $this; - $obj->valueRequired = $valueRequired; + $obj['valueRequired'] = $valueRequired; return $obj; } @@ -337,7 +337,7 @@ public function withValueRequired(bool $valueRequired): self public function withDescription(?string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -348,7 +348,7 @@ public function withDescription(?string $description): self public function withKey(?string $key): self { $obj = clone $this; - $obj->key = $key; + $obj['key'] = $key; return $obj; } diff --git a/src/Actions/ActionUpdateResponse/PossibleValue.php b/src/Actions/ActionUpdateResponse/PossibleValue.php index 2ac3fa5..e16dfab 100644 --- a/src/Actions/ActionUpdateResponse/PossibleValue.php +++ b/src/Actions/ActionUpdateResponse/PossibleValue.php @@ -50,7 +50,7 @@ public static function with(string $value): self { $obj = new self; - $obj->value = $value; + $obj['value'] = $value; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $value): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Actions/Execute/ExecuteExecuteByIDParams.php b/src/Actions/Execute/ExecuteExecuteByIDParams.php index d6d83ef..7c09d3f 100644 --- a/src/Actions/Execute/ExecuteExecuteByIDParams.php +++ b/src/Actions/Execute/ExecuteExecuteByIDParams.php @@ -77,10 +77,10 @@ public static function with( ): self { $obj = new self; - null !== $authorIds && $obj->authorIds = $authorIds; - null !== $contentIds && $obj->contentIds = $contentIds; - null !== $queueId && $obj->queueId = $queueId; - null !== $value && $obj->value = $value; + null !== $authorIds && $obj['authorIds'] = $authorIds; + null !== $contentIds && $obj['contentIds'] = $contentIds; + null !== $queueId && $obj['queueId'] = $queueId; + null !== $value && $obj['value'] = $value; return $obj; } @@ -93,7 +93,7 @@ public static function with( public function withAuthorIDs(array $authorIDs): self { $obj = clone $this; - $obj->authorIds = $authorIDs; + $obj['authorIds'] = $authorIDs; return $obj; } @@ -106,7 +106,7 @@ public function withAuthorIDs(array $authorIDs): self public function withContentIDs(array $contentIDs): self { $obj = clone $this; - $obj->contentIds = $contentIDs; + $obj['contentIds'] = $contentIDs; return $obj; } @@ -117,7 +117,7 @@ public function withContentIDs(array $contentIDs): self public function withQueueID(string $queueID): self { $obj = clone $this; - $obj->queueId = $queueID; + $obj['queueId'] = $queueID; return $obj; } @@ -128,7 +128,7 @@ public function withQueueID(string $queueID): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Actions/Execute/ExecuteExecuteByIDResponse.php b/src/Actions/Execute/ExecuteExecuteByIDResponse.php index ea01305..d5e6976 100644 --- a/src/Actions/Execute/ExecuteExecuteByIDResponse.php +++ b/src/Actions/Execute/ExecuteExecuteByIDResponse.php @@ -78,9 +78,9 @@ public static function with( ): self { $obj = new self; - $obj->actionId = $actionId; - $obj->ids = $ids; - $obj->success = $success; + $obj['actionId'] = $actionId; + $obj['ids'] = $ids; + $obj['success'] = $success; return $obj; } @@ -91,7 +91,7 @@ public static function with( public function withActionID(string $actionID): self { $obj = clone $this; - $obj->actionId = $actionID; + $obj['actionId'] = $actionID; return $obj; } @@ -104,7 +104,7 @@ public function withActionID(string $actionID): self public function withIDs(array $ids): self { $obj = clone $this; - $obj->ids = $ids; + $obj['ids'] = $ids; return $obj; } @@ -115,7 +115,7 @@ public function withIDs(array $ids): self public function withSuccess(bool $success): self { $obj = clone $this; - $obj->success = $success; + $obj['success'] = $success; return $obj; } diff --git a/src/Actions/Execute/ExecuteExecuteParams.php b/src/Actions/Execute/ExecuteExecuteParams.php index dfbf2e1..406ffea 100644 --- a/src/Actions/Execute/ExecuteExecuteParams.php +++ b/src/Actions/Execute/ExecuteExecuteParams.php @@ -106,13 +106,13 @@ public static function with( ): self { $obj = new self; - $obj->actionKey = $actionKey; + $obj['actionKey'] = $actionKey; - null !== $authorIds && $obj->authorIds = $authorIds; - null !== $contentIds && $obj->contentIds = $contentIds; - null !== $duration && $obj->duration = $duration; - null !== $queueId && $obj->queueId = $queueId; - null !== $value && $obj->value = $value; + null !== $authorIds && $obj['authorIds'] = $authorIds; + null !== $contentIds && $obj['contentIds'] = $contentIds; + null !== $duration && $obj['duration'] = $duration; + null !== $queueId && $obj['queueId'] = $queueId; + null !== $value && $obj['value'] = $value; return $obj; } @@ -123,7 +123,7 @@ public static function with( public function withActionKey(string $actionKey): self { $obj = clone $this; - $obj->actionKey = $actionKey; + $obj['actionKey'] = $actionKey; return $obj; } @@ -136,7 +136,7 @@ public function withActionKey(string $actionKey): self public function withAuthorIDs(array $authorIDs): self { $obj = clone $this; - $obj->authorIds = $authorIDs; + $obj['authorIds'] = $authorIDs; return $obj; } @@ -149,7 +149,7 @@ public function withAuthorIDs(array $authorIDs): self public function withContentIDs(array $contentIDs): self { $obj = clone $this; - $obj->contentIds = $contentIDs; + $obj['contentIds'] = $contentIDs; return $obj; } @@ -160,7 +160,7 @@ public function withContentIDs(array $contentIDs): self public function withDuration(float $duration): self { $obj = clone $this; - $obj->duration = $duration; + $obj['duration'] = $duration; return $obj; } @@ -171,7 +171,7 @@ public function withDuration(float $duration): self public function withQueueID(string $queueID): self { $obj = clone $this; - $obj->queueId = $queueID; + $obj['queueId'] = $queueID; return $obj; } @@ -182,7 +182,7 @@ public function withQueueID(string $queueID): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Actions/Execute/ExecuteExecuteResponse.php b/src/Actions/Execute/ExecuteExecuteResponse.php index 354f420..2eece6f 100644 --- a/src/Actions/Execute/ExecuteExecuteResponse.php +++ b/src/Actions/Execute/ExecuteExecuteResponse.php @@ -56,7 +56,7 @@ public static function with(bool $success): self { $obj = new self; - $obj->success = $success; + $obj['success'] = $success; return $obj; } @@ -67,7 +67,7 @@ public static function with(bool $success): self public function withSuccess(bool $success): self { $obj = clone $this; - $obj->success = $success; + $obj['success'] = $success; return $obj; } diff --git a/src/Auth/AuthGetResponse.php b/src/Auth/AuthGetResponse.php index f7de1bb..947bd13 100644 --- a/src/Auth/AuthGetResponse.php +++ b/src/Auth/AuthGetResponse.php @@ -60,8 +60,8 @@ public static function with(string $message, string $status): self { $obj = new self; - $obj->message = $message; - $obj->status = $status; + $obj['message'] = $message; + $obj['status'] = $status; return $obj; } @@ -72,7 +72,7 @@ public static function with(string $message, string $status): self public function withMessage(string $message): self { $obj = clone $this; - $obj->message = $message; + $obj['message'] = $message; return $obj; } @@ -83,7 +83,7 @@ public function withMessage(string $message): self public function withStatus(string $status): self { $obj = clone $this; - $obj->status = $status; + $obj['status'] = $status; return $obj; } diff --git a/src/Auth/AuthNewResponse.php b/src/Auth/AuthNewResponse.php index c98c97b..0bb3710 100644 --- a/src/Auth/AuthNewResponse.php +++ b/src/Auth/AuthNewResponse.php @@ -71,9 +71,9 @@ public static function with( ): self { $obj = new self; - $obj->message = $message; - $obj->project = $project; - $obj->status = $status; + $obj['message'] = $message; + $obj['project'] = $project; + $obj['status'] = $status; return $obj; } @@ -84,7 +84,7 @@ public static function with( public function withMessage(string $message): self { $obj = clone $this; - $obj->message = $message; + $obj['message'] = $message; return $obj; } @@ -95,7 +95,7 @@ public function withMessage(string $message): self public function withProject(string $project): self { $obj = clone $this; - $obj->project = $project; + $obj['project'] = $project; return $obj; } @@ -106,7 +106,7 @@ public function withProject(string $project): self public function withStatus(string $status): self { $obj = clone $this; - $obj->status = $status; + $obj['status'] = $status; return $obj; } diff --git a/src/Authors/AuthorCreateParams.php b/src/Authors/AuthorCreateParams.php index ed8139d..9f62ed9 100644 --- a/src/Authors/AuthorCreateParams.php +++ b/src/Authors/AuthorCreateParams.php @@ -22,7 +22,12 @@ * first_seen?: float, * last_seen?: float, * manual_trust_level?: float|null, - * metadata?: Metadata, + * metadata?: Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * }, * name?: string|null, * profile_picture?: string|null, * } @@ -107,6 +112,13 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * } $metadata */ public static function with( string $external_id, @@ -115,22 +127,22 @@ public static function with( ?float $first_seen = null, ?float $last_seen = null, ?float $manual_trust_level = null, - ?Metadata $metadata = null, + Metadata|array|null $metadata = null, ?string $name = null, ?string $profile_picture = null, ): self { $obj = new self; - $obj->external_id = $external_id; + $obj['external_id'] = $external_id; - null !== $email && $obj->email = $email; - null !== $external_link && $obj->external_link = $external_link; - null !== $first_seen && $obj->first_seen = $first_seen; - null !== $last_seen && $obj->last_seen = $last_seen; - null !== $manual_trust_level && $obj->manual_trust_level = $manual_trust_level; - null !== $metadata && $obj->metadata = $metadata; - null !== $name && $obj->name = $name; - null !== $profile_picture && $obj->profile_picture = $profile_picture; + null !== $email && $obj['email'] = $email; + null !== $external_link && $obj['external_link'] = $external_link; + null !== $first_seen && $obj['first_seen'] = $first_seen; + null !== $last_seen && $obj['last_seen'] = $last_seen; + null !== $manual_trust_level && $obj['manual_trust_level'] = $manual_trust_level; + null !== $metadata && $obj['metadata'] = $metadata; + null !== $name && $obj['name'] = $name; + null !== $profile_picture && $obj['profile_picture'] = $profile_picture; return $obj; } @@ -141,7 +153,7 @@ public static function with( public function withExternalID(string $externalID): self { $obj = clone $this; - $obj->external_id = $externalID; + $obj['external_id'] = $externalID; return $obj; } @@ -152,7 +164,7 @@ public function withExternalID(string $externalID): self public function withEmail(?string $email): self { $obj = clone $this; - $obj->email = $email; + $obj['email'] = $email; return $obj; } @@ -163,7 +175,7 @@ public function withEmail(?string $email): self public function withExternalLink(?string $externalLink): self { $obj = clone $this; - $obj->external_link = $externalLink; + $obj['external_link'] = $externalLink; return $obj; } @@ -174,7 +186,7 @@ public function withExternalLink(?string $externalLink): self public function withFirstSeen(float $firstSeen): self { $obj = clone $this; - $obj->first_seen = $firstSeen; + $obj['first_seen'] = $firstSeen; return $obj; } @@ -185,7 +197,7 @@ public function withFirstSeen(float $firstSeen): self public function withLastSeen(float $lastSeen): self { $obj = clone $this; - $obj->last_seen = $lastSeen; + $obj['last_seen'] = $lastSeen; return $obj; } @@ -193,18 +205,25 @@ public function withLastSeen(float $lastSeen): self public function withManualTrustLevel(?float $manualTrustLevel): self { $obj = clone $this; - $obj->manual_trust_level = $manualTrustLevel; + $obj['manual_trust_level'] = $manualTrustLevel; return $obj; } /** * Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. - */ - public function withMetadata(Metadata $metadata): self + * + * @param Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * } $metadata + */ + public function withMetadata(Metadata|array $metadata): self { $obj = clone $this; - $obj->metadata = $metadata; + $obj['metadata'] = $metadata; return $obj; } @@ -215,7 +234,7 @@ public function withMetadata(Metadata $metadata): self public function withName(?string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -226,7 +245,7 @@ public function withName(?string $name): self public function withProfilePicture(?string $profilePicture): self { $obj = clone $this; - $obj->profile_picture = $profilePicture; + $obj['profile_picture'] = $profilePicture; return $obj; } diff --git a/src/Authors/AuthorCreateParams/Metadata.php b/src/Authors/AuthorCreateParams/Metadata.php index 7e512d2..b7c1fe8 100644 --- a/src/Authors/AuthorCreateParams/Metadata.php +++ b/src/Authors/AuthorCreateParams/Metadata.php @@ -65,10 +65,10 @@ public static function with( ): self { $obj = new self; - null !== $email_verified && $obj->email_verified = $email_verified; - null !== $identity_verified && $obj->identity_verified = $identity_verified; - null !== $is_paying_customer && $obj->is_paying_customer = $is_paying_customer; - null !== $phone_verified && $obj->phone_verified = $phone_verified; + null !== $email_verified && $obj['email_verified'] = $email_verified; + null !== $identity_verified && $obj['identity_verified'] = $identity_verified; + null !== $is_paying_customer && $obj['is_paying_customer'] = $is_paying_customer; + null !== $phone_verified && $obj['phone_verified'] = $phone_verified; return $obj; } @@ -79,7 +79,7 @@ public static function with( public function withEmailVerified(?bool $emailVerified): self { $obj = clone $this; - $obj->email_verified = $emailVerified; + $obj['email_verified'] = $emailVerified; return $obj; } @@ -90,7 +90,7 @@ public function withEmailVerified(?bool $emailVerified): self public function withIdentityVerified(?bool $identityVerified): self { $obj = clone $this; - $obj->identity_verified = $identityVerified; + $obj['identity_verified'] = $identityVerified; return $obj; } @@ -101,7 +101,7 @@ public function withIdentityVerified(?bool $identityVerified): self public function withIsPayingCustomer(?bool $isPayingCustomer): self { $obj = clone $this; - $obj->is_paying_customer = $isPayingCustomer; + $obj['is_paying_customer'] = $isPayingCustomer; return $obj; } @@ -112,7 +112,7 @@ public function withIsPayingCustomer(?bool $isPayingCustomer): self public function withPhoneVerified(?bool $phoneVerified): self { $obj = clone $this; - $obj->phone_verified = $phoneVerified; + $obj['phone_verified'] = $phoneVerified; return $obj; } diff --git a/src/Authors/AuthorDeleteResponse.php b/src/Authors/AuthorDeleteResponse.php index 823b497..43d00f3 100644 --- a/src/Authors/AuthorDeleteResponse.php +++ b/src/Authors/AuthorDeleteResponse.php @@ -51,7 +51,7 @@ public static function with(bool $success): self { $obj = new self; - $obj->success = $success; + $obj['success'] = $success; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $success): self public function withSuccess(bool $success): self { $obj = clone $this; - $obj->success = $success; + $obj['success'] = $success; return $obj; } diff --git a/src/Authors/AuthorGetResponse.php b/src/Authors/AuthorGetResponse.php index 78d9379..44c6af7 100644 --- a/src/Authors/AuthorGetResponse.php +++ b/src/Authors/AuthorGetResponse.php @@ -171,18 +171,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param Block|array{reason?: string|null, until?: float|null}|null $block + * @param Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * } $metadata + * @param Metrics|array{ + * flagged_content: float, total_content: float, average_sentiment?: float|null + * } $metrics + * @param RiskEvaluation|array{risk_level?: float|null}|null $risk_evaluation * @param Status|value-of $status + * @param TrustLevel|array{level: float, manual: bool} $trust_level */ public static function with( string $id, - ?Block $block, + Block|array|null $block, float $first_seen, float $last_seen, - Metadata $metadata, - Metrics $metrics, - ?RiskEvaluation $risk_evaluation, + Metadata|array $metadata, + Metrics|array $metrics, + RiskEvaluation|array|null $risk_evaluation, Status|string $status, - TrustLevel $trust_level, + TrustLevel|array $trust_level, ?string $email = null, ?string $external_id = null, ?string $external_link = null, @@ -192,22 +204,22 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->block = $block; - $obj->first_seen = $first_seen; - $obj->last_seen = $last_seen; - $obj->metadata = $metadata; - $obj->metrics = $metrics; - $obj->risk_evaluation = $risk_evaluation; + $obj['id'] = $id; + $obj['block'] = $block; + $obj['first_seen'] = $first_seen; + $obj['last_seen'] = $last_seen; + $obj['metadata'] = $metadata; + $obj['metrics'] = $metrics; + $obj['risk_evaluation'] = $risk_evaluation; $obj['status'] = $status; - $obj->trust_level = $trust_level; + $obj['trust_level'] = $trust_level; - null !== $email && $obj->email = $email; - null !== $external_id && $obj->external_id = $external_id; - null !== $external_link && $obj->external_link = $external_link; - null !== $last_incident && $obj->last_incident = $last_incident; - null !== $name && $obj->name = $name; - null !== $profile_picture && $obj->profile_picture = $profile_picture; + null !== $email && $obj['email'] = $email; + null !== $external_id && $obj['external_id'] = $external_id; + null !== $external_link && $obj['external_link'] = $external_link; + null !== $last_incident && $obj['last_incident'] = $last_incident; + null !== $name && $obj['name'] = $name; + null !== $profile_picture && $obj['profile_picture'] = $profile_picture; return $obj; } @@ -218,18 +230,20 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } /** * Block or suspension details, if applicable. Null if the author is enabled. + * + * @param Block|array{reason?: string|null, until?: float|null}|null $block */ - public function withBlock(?Block $block): self + public function withBlock(Block|array|null $block): self { $obj = clone $this; - $obj->block = $block; + $obj['block'] = $block; return $obj; } @@ -240,7 +254,7 @@ public function withBlock(?Block $block): self public function withFirstSeen(float $firstSeen): self { $obj = clone $this; - $obj->first_seen = $firstSeen; + $obj['first_seen'] = $firstSeen; return $obj; } @@ -251,37 +265,52 @@ public function withFirstSeen(float $firstSeen): self public function withLastSeen(float $lastSeen): self { $obj = clone $this; - $obj->last_seen = $lastSeen; + $obj['last_seen'] = $lastSeen; return $obj; } /** * Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + * + * @param Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * } $metadata */ - public function withMetadata(Metadata $metadata): self + public function withMetadata(Metadata|array $metadata): self { $obj = clone $this; - $obj->metadata = $metadata; + $obj['metadata'] = $metadata; return $obj; } - public function withMetrics(Metrics $metrics): self + /** + * @param Metrics|array{ + * flagged_content: float, total_content: float, average_sentiment?: float|null + * } $metrics + */ + public function withMetrics(Metrics|array $metrics): self { $obj = clone $this; - $obj->metrics = $metrics; + $obj['metrics'] = $metrics; return $obj; } /** * Risk assessment details, if available. + * + * @param RiskEvaluation|array{risk_level?: float|null}|null $riskEvaluation */ - public function withRiskEvaluation(?RiskEvaluation $riskEvaluation): self - { + public function withRiskEvaluation( + RiskEvaluation|array|null $riskEvaluation + ): self { $obj = clone $this; - $obj->risk_evaluation = $riskEvaluation; + $obj['risk_evaluation'] = $riskEvaluation; return $obj; } @@ -299,10 +328,13 @@ public function withStatus(Status|string $status): self return $obj; } - public function withTrustLevel(TrustLevel $trustLevel): self + /** + * @param TrustLevel|array{level: float, manual: bool} $trustLevel + */ + public function withTrustLevel(TrustLevel|array $trustLevel): self { $obj = clone $this; - $obj->trust_level = $trustLevel; + $obj['trust_level'] = $trustLevel; return $obj; } @@ -313,7 +345,7 @@ public function withTrustLevel(TrustLevel $trustLevel): self public function withEmail(?string $email): self { $obj = clone $this; - $obj->email = $email; + $obj['email'] = $email; return $obj; } @@ -324,7 +356,7 @@ public function withEmail(?string $email): self public function withExternalID(?string $externalID): self { $obj = clone $this; - $obj->external_id = $externalID; + $obj['external_id'] = $externalID; return $obj; } @@ -335,7 +367,7 @@ public function withExternalID(?string $externalID): self public function withExternalLink(?string $externalLink): self { $obj = clone $this; - $obj->external_link = $externalLink; + $obj['external_link'] = $externalLink; return $obj; } @@ -346,7 +378,7 @@ public function withExternalLink(?string $externalLink): self public function withLastIncident(?float $lastIncident): self { $obj = clone $this; - $obj->last_incident = $lastIncident; + $obj['last_incident'] = $lastIncident; return $obj; } @@ -357,7 +389,7 @@ public function withLastIncident(?float $lastIncident): self public function withName(?string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -368,7 +400,7 @@ public function withName(?string $name): self public function withProfilePicture(?string $profilePicture): self { $obj = clone $this; - $obj->profile_picture = $profilePicture; + $obj['profile_picture'] = $profilePicture; return $obj; } diff --git a/src/Authors/AuthorGetResponse/Block.php b/src/Authors/AuthorGetResponse/Block.php index 066f5e4..c1bb986 100644 --- a/src/Authors/AuthorGetResponse/Block.php +++ b/src/Authors/AuthorGetResponse/Block.php @@ -46,8 +46,8 @@ public static function with( ): self { $obj = new self; - null !== $reason && $obj->reason = $reason; - null !== $until && $obj->until = $until; + null !== $reason && $obj['reason'] = $reason; + null !== $until && $obj['until'] = $until; return $obj; } @@ -58,7 +58,7 @@ public static function with( public function withReason(?string $reason): self { $obj = clone $this; - $obj->reason = $reason; + $obj['reason'] = $reason; return $obj; } @@ -69,7 +69,7 @@ public function withReason(?string $reason): self public function withUntil(?float $until): self { $obj = clone $this; - $obj->until = $until; + $obj['until'] = $until; return $obj; } diff --git a/src/Authors/AuthorGetResponse/Metadata.php b/src/Authors/AuthorGetResponse/Metadata.php index db7ee51..b9edf25 100644 --- a/src/Authors/AuthorGetResponse/Metadata.php +++ b/src/Authors/AuthorGetResponse/Metadata.php @@ -65,10 +65,10 @@ public static function with( ): self { $obj = new self; - null !== $email_verified && $obj->email_verified = $email_verified; - null !== $identity_verified && $obj->identity_verified = $identity_verified; - null !== $is_paying_customer && $obj->is_paying_customer = $is_paying_customer; - null !== $phone_verified && $obj->phone_verified = $phone_verified; + null !== $email_verified && $obj['email_verified'] = $email_verified; + null !== $identity_verified && $obj['identity_verified'] = $identity_verified; + null !== $is_paying_customer && $obj['is_paying_customer'] = $is_paying_customer; + null !== $phone_verified && $obj['phone_verified'] = $phone_verified; return $obj; } @@ -79,7 +79,7 @@ public static function with( public function withEmailVerified(?bool $emailVerified): self { $obj = clone $this; - $obj->email_verified = $emailVerified; + $obj['email_verified'] = $emailVerified; return $obj; } @@ -90,7 +90,7 @@ public function withEmailVerified(?bool $emailVerified): self public function withIdentityVerified(?bool $identityVerified): self { $obj = clone $this; - $obj->identity_verified = $identityVerified; + $obj['identity_verified'] = $identityVerified; return $obj; } @@ -101,7 +101,7 @@ public function withIdentityVerified(?bool $identityVerified): self public function withIsPayingCustomer(?bool $isPayingCustomer): self { $obj = clone $this; - $obj->is_paying_customer = $isPayingCustomer; + $obj['is_paying_customer'] = $isPayingCustomer; return $obj; } @@ -112,7 +112,7 @@ public function withIsPayingCustomer(?bool $isPayingCustomer): self public function withPhoneVerified(?bool $phoneVerified): self { $obj = clone $this; - $obj->phone_verified = $phoneVerified; + $obj['phone_verified'] = $phoneVerified; return $obj; } diff --git a/src/Authors/AuthorGetResponse/Metrics.php b/src/Authors/AuthorGetResponse/Metrics.php index 5c326cd..ec443d1 100644 --- a/src/Authors/AuthorGetResponse/Metrics.php +++ b/src/Authors/AuthorGetResponse/Metrics.php @@ -67,10 +67,10 @@ public static function with( ): self { $obj = new self; - $obj->flagged_content = $flagged_content; - $obj->total_content = $total_content; + $obj['flagged_content'] = $flagged_content; + $obj['total_content'] = $total_content; - null !== $average_sentiment && $obj->average_sentiment = $average_sentiment; + null !== $average_sentiment && $obj['average_sentiment'] = $average_sentiment; return $obj; } @@ -81,7 +81,7 @@ public static function with( public function withFlaggedContent(float $flaggedContent): self { $obj = clone $this; - $obj->flagged_content = $flaggedContent; + $obj['flagged_content'] = $flaggedContent; return $obj; } @@ -92,7 +92,7 @@ public function withFlaggedContent(float $flaggedContent): self public function withTotalContent(float $totalContent): self { $obj = clone $this; - $obj->total_content = $totalContent; + $obj['total_content'] = $totalContent; return $obj; } @@ -103,7 +103,7 @@ public function withTotalContent(float $totalContent): self public function withAverageSentiment(?float $averageSentiment): self { $obj = clone $this; - $obj->average_sentiment = $averageSentiment; + $obj['average_sentiment'] = $averageSentiment; return $obj; } diff --git a/src/Authors/AuthorGetResponse/RiskEvaluation.php b/src/Authors/AuthorGetResponse/RiskEvaluation.php index d17cb0f..8bb2b90 100644 --- a/src/Authors/AuthorGetResponse/RiskEvaluation.php +++ b/src/Authors/AuthorGetResponse/RiskEvaluation.php @@ -38,7 +38,7 @@ public static function with(?float $risk_level = null): self { $obj = new self; - null !== $risk_level && $obj->risk_level = $risk_level; + null !== $risk_level && $obj['risk_level'] = $risk_level; return $obj; } @@ -49,7 +49,7 @@ public static function with(?float $risk_level = null): self public function withRiskLevel(?float $riskLevel): self { $obj = clone $this; - $obj->risk_level = $riskLevel; + $obj['risk_level'] = $riskLevel; return $obj; } diff --git a/src/Authors/AuthorGetResponse/TrustLevel.php b/src/Authors/AuthorGetResponse/TrustLevel.php index 1c430ec..d4768d8 100644 --- a/src/Authors/AuthorGetResponse/TrustLevel.php +++ b/src/Authors/AuthorGetResponse/TrustLevel.php @@ -56,8 +56,8 @@ public static function with(float $level, bool $manual): self { $obj = new self; - $obj->level = $level; - $obj->manual = $manual; + $obj['level'] = $level; + $obj['manual'] = $manual; return $obj; } @@ -68,7 +68,7 @@ public static function with(float $level, bool $manual): self public function withLevel(float $level): self { $obj = clone $this; - $obj->level = $level; + $obj['level'] = $level; return $obj; } @@ -79,7 +79,7 @@ public function withLevel(float $level): self public function withManual(bool $manual): self { $obj = clone $this; - $obj->manual = $manual; + $obj['manual'] = $manual; return $obj; } diff --git a/src/Authors/AuthorListParams.php b/src/Authors/AuthorListParams.php index c776ca9..1d88c10 100644 --- a/src/Authors/AuthorListParams.php +++ b/src/Authors/AuthorListParams.php @@ -89,11 +89,11 @@ public static function with( ): self { $obj = new self; - null !== $contentTypes && $obj->contentTypes = $contentTypes; - null !== $lastActiveDate && $obj->lastActiveDate = $lastActiveDate; - null !== $memberSinceDate && $obj->memberSinceDate = $memberSinceDate; - null !== $pageNumber && $obj->pageNumber = $pageNumber; - null !== $pageSize && $obj->pageSize = $pageSize; + null !== $contentTypes && $obj['contentTypes'] = $contentTypes; + null !== $lastActiveDate && $obj['lastActiveDate'] = $lastActiveDate; + null !== $memberSinceDate && $obj['memberSinceDate'] = $memberSinceDate; + null !== $pageNumber && $obj['pageNumber'] = $pageNumber; + null !== $pageSize && $obj['pageSize'] = $pageSize; null !== $sortBy && $obj['sortBy'] = $sortBy; null !== $sortDirection && $obj['sortDirection'] = $sortDirection; @@ -103,7 +103,7 @@ public static function with( public function withContentTypes(string $contentTypes): self { $obj = clone $this; - $obj->contentTypes = $contentTypes; + $obj['contentTypes'] = $contentTypes; return $obj; } @@ -111,7 +111,7 @@ public function withContentTypes(string $contentTypes): self public function withLastActiveDate(string $lastActiveDate): self { $obj = clone $this; - $obj->lastActiveDate = $lastActiveDate; + $obj['lastActiveDate'] = $lastActiveDate; return $obj; } @@ -119,7 +119,7 @@ public function withLastActiveDate(string $lastActiveDate): self public function withMemberSinceDate(string $memberSinceDate): self { $obj = clone $this; - $obj->memberSinceDate = $memberSinceDate; + $obj['memberSinceDate'] = $memberSinceDate; return $obj; } @@ -130,7 +130,7 @@ public function withMemberSinceDate(string $memberSinceDate): self public function withPageNumber(float $pageNumber): self { $obj = clone $this; - $obj->pageNumber = $pageNumber; + $obj['pageNumber'] = $pageNumber; return $obj; } @@ -141,7 +141,7 @@ public function withPageNumber(float $pageNumber): self public function withPageSize(float $pageSize): self { $obj = clone $this; - $obj->pageSize = $pageSize; + $obj['pageSize'] = $pageSize; return $obj; } diff --git a/src/Authors/AuthorListResponse.php b/src/Authors/AuthorListResponse.php index 4267fad..37df57f 100644 --- a/src/Authors/AuthorListResponse.php +++ b/src/Authors/AuthorListResponse.php @@ -5,6 +5,12 @@ namespace ModerationAPI\Authors; use ModerationAPI\Authors\AuthorListResponse\Author; +use ModerationAPI\Authors\AuthorListResponse\Author\Block; +use ModerationAPI\Authors\AuthorListResponse\Author\Metadata; +use ModerationAPI\Authors\AuthorListResponse\Author\Metrics; +use ModerationAPI\Authors\AuthorListResponse\Author\RiskEvaluation; +use ModerationAPI\Authors\AuthorListResponse\Author\Status; +use ModerationAPI\Authors\AuthorListResponse\Author\TrustLevel; use ModerationAPI\Authors\AuthorListResponse\Pagination; use ModerationAPI\Core\Attributes\Api; use ModerationAPI\Core\Concerns\SdkModel; @@ -55,33 +61,83 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $authors + * @param list, + * trust_level: TrustLevel, + * email?: string|null, + * external_id?: string|null, + * external_link?: string|null, + * last_incident?: float|null, + * name?: string|null, + * profile_picture?: string|null, + * }> $authors + * @param Pagination|array{ + * hasNextPage: bool, + * hasPreviousPage: bool, + * pageNumber: float, + * pageSize: float, + * total: float, + * } $pagination */ - public static function with(array $authors, Pagination $pagination): self - { + public static function with( + array $authors, + Pagination|array $pagination + ): self { $obj = new self; - $obj->authors = $authors; - $obj->pagination = $pagination; + $obj['authors'] = $authors; + $obj['pagination'] = $pagination; return $obj; } /** - * @param list $authors + * @param list, + * trust_level: TrustLevel, + * email?: string|null, + * external_id?: string|null, + * external_link?: string|null, + * last_incident?: float|null, + * name?: string|null, + * profile_picture?: string|null, + * }> $authors */ public function withAuthors(array $authors): self { $obj = clone $this; - $obj->authors = $authors; + $obj['authors'] = $authors; return $obj; } - public function withPagination(Pagination $pagination): self + /** + * @param Pagination|array{ + * hasNextPage: bool, + * hasPreviousPage: bool, + * pageNumber: float, + * pageSize: float, + * total: float, + * } $pagination + */ + public function withPagination(Pagination|array $pagination): self { $obj = clone $this; - $obj->pagination = $pagination; + $obj['pagination'] = $pagination; return $obj; } diff --git a/src/Authors/AuthorListResponse/Author.php b/src/Authors/AuthorListResponse/Author.php index b264193..9589485 100644 --- a/src/Authors/AuthorListResponse/Author.php +++ b/src/Authors/AuthorListResponse/Author.php @@ -167,18 +167,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param Block|array{reason?: string|null, until?: float|null}|null $block + * @param Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * } $metadata + * @param Metrics|array{ + * flagged_content: float, total_content: float, average_sentiment?: float|null + * } $metrics + * @param RiskEvaluation|array{risk_level?: float|null}|null $risk_evaluation * @param Status|value-of $status + * @param TrustLevel|array{level: float, manual: bool} $trust_level */ public static function with( string $id, - ?Block $block, + Block|array|null $block, float $first_seen, float $last_seen, - Metadata $metadata, - Metrics $metrics, - ?RiskEvaluation $risk_evaluation, + Metadata|array $metadata, + Metrics|array $metrics, + RiskEvaluation|array|null $risk_evaluation, Status|string $status, - TrustLevel $trust_level, + TrustLevel|array $trust_level, ?string $email = null, ?string $external_id = null, ?string $external_link = null, @@ -188,22 +200,22 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->block = $block; - $obj->first_seen = $first_seen; - $obj->last_seen = $last_seen; - $obj->metadata = $metadata; - $obj->metrics = $metrics; - $obj->risk_evaluation = $risk_evaluation; + $obj['id'] = $id; + $obj['block'] = $block; + $obj['first_seen'] = $first_seen; + $obj['last_seen'] = $last_seen; + $obj['metadata'] = $metadata; + $obj['metrics'] = $metrics; + $obj['risk_evaluation'] = $risk_evaluation; $obj['status'] = $status; - $obj->trust_level = $trust_level; + $obj['trust_level'] = $trust_level; - null !== $email && $obj->email = $email; - null !== $external_id && $obj->external_id = $external_id; - null !== $external_link && $obj->external_link = $external_link; - null !== $last_incident && $obj->last_incident = $last_incident; - null !== $name && $obj->name = $name; - null !== $profile_picture && $obj->profile_picture = $profile_picture; + null !== $email && $obj['email'] = $email; + null !== $external_id && $obj['external_id'] = $external_id; + null !== $external_link && $obj['external_link'] = $external_link; + null !== $last_incident && $obj['last_incident'] = $last_incident; + null !== $name && $obj['name'] = $name; + null !== $profile_picture && $obj['profile_picture'] = $profile_picture; return $obj; } @@ -214,18 +226,20 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } /** * Block or suspension details, if applicable. Null if the author is enabled. + * + * @param Block|array{reason?: string|null, until?: float|null}|null $block */ - public function withBlock(?Block $block): self + public function withBlock(Block|array|null $block): self { $obj = clone $this; - $obj->block = $block; + $obj['block'] = $block; return $obj; } @@ -236,7 +250,7 @@ public function withBlock(?Block $block): self public function withFirstSeen(float $firstSeen): self { $obj = clone $this; - $obj->first_seen = $firstSeen; + $obj['first_seen'] = $firstSeen; return $obj; } @@ -247,37 +261,52 @@ public function withFirstSeen(float $firstSeen): self public function withLastSeen(float $lastSeen): self { $obj = clone $this; - $obj->last_seen = $lastSeen; + $obj['last_seen'] = $lastSeen; return $obj; } /** * Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + * + * @param Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * } $metadata */ - public function withMetadata(Metadata $metadata): self + public function withMetadata(Metadata|array $metadata): self { $obj = clone $this; - $obj->metadata = $metadata; + $obj['metadata'] = $metadata; return $obj; } - public function withMetrics(Metrics $metrics): self + /** + * @param Metrics|array{ + * flagged_content: float, total_content: float, average_sentiment?: float|null + * } $metrics + */ + public function withMetrics(Metrics|array $metrics): self { $obj = clone $this; - $obj->metrics = $metrics; + $obj['metrics'] = $metrics; return $obj; } /** * Risk assessment details, if available. + * + * @param RiskEvaluation|array{risk_level?: float|null}|null $riskEvaluation */ - public function withRiskEvaluation(?RiskEvaluation $riskEvaluation): self - { + public function withRiskEvaluation( + RiskEvaluation|array|null $riskEvaluation + ): self { $obj = clone $this; - $obj->risk_evaluation = $riskEvaluation; + $obj['risk_evaluation'] = $riskEvaluation; return $obj; } @@ -295,10 +324,13 @@ public function withStatus(Status|string $status): self return $obj; } - public function withTrustLevel(TrustLevel $trustLevel): self + /** + * @param TrustLevel|array{level: float, manual: bool} $trustLevel + */ + public function withTrustLevel(TrustLevel|array $trustLevel): self { $obj = clone $this; - $obj->trust_level = $trustLevel; + $obj['trust_level'] = $trustLevel; return $obj; } @@ -309,7 +341,7 @@ public function withTrustLevel(TrustLevel $trustLevel): self public function withEmail(?string $email): self { $obj = clone $this; - $obj->email = $email; + $obj['email'] = $email; return $obj; } @@ -320,7 +352,7 @@ public function withEmail(?string $email): self public function withExternalID(?string $externalID): self { $obj = clone $this; - $obj->external_id = $externalID; + $obj['external_id'] = $externalID; return $obj; } @@ -331,7 +363,7 @@ public function withExternalID(?string $externalID): self public function withExternalLink(?string $externalLink): self { $obj = clone $this; - $obj->external_link = $externalLink; + $obj['external_link'] = $externalLink; return $obj; } @@ -342,7 +374,7 @@ public function withExternalLink(?string $externalLink): self public function withLastIncident(?float $lastIncident): self { $obj = clone $this; - $obj->last_incident = $lastIncident; + $obj['last_incident'] = $lastIncident; return $obj; } @@ -353,7 +385,7 @@ public function withLastIncident(?float $lastIncident): self public function withName(?string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -364,7 +396,7 @@ public function withName(?string $name): self public function withProfilePicture(?string $profilePicture): self { $obj = clone $this; - $obj->profile_picture = $profilePicture; + $obj['profile_picture'] = $profilePicture; return $obj; } diff --git a/src/Authors/AuthorListResponse/Author/Block.php b/src/Authors/AuthorListResponse/Author/Block.php index c81690d..c746429 100644 --- a/src/Authors/AuthorListResponse/Author/Block.php +++ b/src/Authors/AuthorListResponse/Author/Block.php @@ -46,8 +46,8 @@ public static function with( ): self { $obj = new self; - null !== $reason && $obj->reason = $reason; - null !== $until && $obj->until = $until; + null !== $reason && $obj['reason'] = $reason; + null !== $until && $obj['until'] = $until; return $obj; } @@ -58,7 +58,7 @@ public static function with( public function withReason(?string $reason): self { $obj = clone $this; - $obj->reason = $reason; + $obj['reason'] = $reason; return $obj; } @@ -69,7 +69,7 @@ public function withReason(?string $reason): self public function withUntil(?float $until): self { $obj = clone $this; - $obj->until = $until; + $obj['until'] = $until; return $obj; } diff --git a/src/Authors/AuthorListResponse/Author/Metadata.php b/src/Authors/AuthorListResponse/Author/Metadata.php index 35a3c2c..1d88096 100644 --- a/src/Authors/AuthorListResponse/Author/Metadata.php +++ b/src/Authors/AuthorListResponse/Author/Metadata.php @@ -65,10 +65,10 @@ public static function with( ): self { $obj = new self; - null !== $email_verified && $obj->email_verified = $email_verified; - null !== $identity_verified && $obj->identity_verified = $identity_verified; - null !== $is_paying_customer && $obj->is_paying_customer = $is_paying_customer; - null !== $phone_verified && $obj->phone_verified = $phone_verified; + null !== $email_verified && $obj['email_verified'] = $email_verified; + null !== $identity_verified && $obj['identity_verified'] = $identity_verified; + null !== $is_paying_customer && $obj['is_paying_customer'] = $is_paying_customer; + null !== $phone_verified && $obj['phone_verified'] = $phone_verified; return $obj; } @@ -79,7 +79,7 @@ public static function with( public function withEmailVerified(?bool $emailVerified): self { $obj = clone $this; - $obj->email_verified = $emailVerified; + $obj['email_verified'] = $emailVerified; return $obj; } @@ -90,7 +90,7 @@ public function withEmailVerified(?bool $emailVerified): self public function withIdentityVerified(?bool $identityVerified): self { $obj = clone $this; - $obj->identity_verified = $identityVerified; + $obj['identity_verified'] = $identityVerified; return $obj; } @@ -101,7 +101,7 @@ public function withIdentityVerified(?bool $identityVerified): self public function withIsPayingCustomer(?bool $isPayingCustomer): self { $obj = clone $this; - $obj->is_paying_customer = $isPayingCustomer; + $obj['is_paying_customer'] = $isPayingCustomer; return $obj; } @@ -112,7 +112,7 @@ public function withIsPayingCustomer(?bool $isPayingCustomer): self public function withPhoneVerified(?bool $phoneVerified): self { $obj = clone $this; - $obj->phone_verified = $phoneVerified; + $obj['phone_verified'] = $phoneVerified; return $obj; } diff --git a/src/Authors/AuthorListResponse/Author/Metrics.php b/src/Authors/AuthorListResponse/Author/Metrics.php index e9b8b71..64aa202 100644 --- a/src/Authors/AuthorListResponse/Author/Metrics.php +++ b/src/Authors/AuthorListResponse/Author/Metrics.php @@ -67,10 +67,10 @@ public static function with( ): self { $obj = new self; - $obj->flagged_content = $flagged_content; - $obj->total_content = $total_content; + $obj['flagged_content'] = $flagged_content; + $obj['total_content'] = $total_content; - null !== $average_sentiment && $obj->average_sentiment = $average_sentiment; + null !== $average_sentiment && $obj['average_sentiment'] = $average_sentiment; return $obj; } @@ -81,7 +81,7 @@ public static function with( public function withFlaggedContent(float $flaggedContent): self { $obj = clone $this; - $obj->flagged_content = $flaggedContent; + $obj['flagged_content'] = $flaggedContent; return $obj; } @@ -92,7 +92,7 @@ public function withFlaggedContent(float $flaggedContent): self public function withTotalContent(float $totalContent): self { $obj = clone $this; - $obj->total_content = $totalContent; + $obj['total_content'] = $totalContent; return $obj; } @@ -103,7 +103,7 @@ public function withTotalContent(float $totalContent): self public function withAverageSentiment(?float $averageSentiment): self { $obj = clone $this; - $obj->average_sentiment = $averageSentiment; + $obj['average_sentiment'] = $averageSentiment; return $obj; } diff --git a/src/Authors/AuthorListResponse/Author/RiskEvaluation.php b/src/Authors/AuthorListResponse/Author/RiskEvaluation.php index 199c3c1..584cad0 100644 --- a/src/Authors/AuthorListResponse/Author/RiskEvaluation.php +++ b/src/Authors/AuthorListResponse/Author/RiskEvaluation.php @@ -38,7 +38,7 @@ public static function with(?float $risk_level = null): self { $obj = new self; - null !== $risk_level && $obj->risk_level = $risk_level; + null !== $risk_level && $obj['risk_level'] = $risk_level; return $obj; } @@ -49,7 +49,7 @@ public static function with(?float $risk_level = null): self public function withRiskLevel(?float $riskLevel): self { $obj = clone $this; - $obj->risk_level = $riskLevel; + $obj['risk_level'] = $riskLevel; return $obj; } diff --git a/src/Authors/AuthorListResponse/Author/TrustLevel.php b/src/Authors/AuthorListResponse/Author/TrustLevel.php index 070d477..3008faf 100644 --- a/src/Authors/AuthorListResponse/Author/TrustLevel.php +++ b/src/Authors/AuthorListResponse/Author/TrustLevel.php @@ -56,8 +56,8 @@ public static function with(float $level, bool $manual): self { $obj = new self; - $obj->level = $level; - $obj->manual = $manual; + $obj['level'] = $level; + $obj['manual'] = $manual; return $obj; } @@ -68,7 +68,7 @@ public static function with(float $level, bool $manual): self public function withLevel(float $level): self { $obj = clone $this; - $obj->level = $level; + $obj['level'] = $level; return $obj; } @@ -79,7 +79,7 @@ public function withLevel(float $level): self public function withManual(bool $manual): self { $obj = clone $this; - $obj->manual = $manual; + $obj['manual'] = $manual; return $obj; } diff --git a/src/Authors/AuthorListResponse/Pagination.php b/src/Authors/AuthorListResponse/Pagination.php index 0f8d466..cbf132d 100644 --- a/src/Authors/AuthorListResponse/Pagination.php +++ b/src/Authors/AuthorListResponse/Pagination.php @@ -81,11 +81,11 @@ public static function with( ): self { $obj = new self; - $obj->hasNextPage = $hasNextPage; - $obj->hasPreviousPage = $hasPreviousPage; - $obj->pageNumber = $pageNumber; - $obj->pageSize = $pageSize; - $obj->total = $total; + $obj['hasNextPage'] = $hasNextPage; + $obj['hasPreviousPage'] = $hasPreviousPage; + $obj['pageNumber'] = $pageNumber; + $obj['pageSize'] = $pageSize; + $obj['total'] = $total; return $obj; } @@ -93,7 +93,7 @@ public static function with( public function withHasNextPage(bool $hasNextPage): self { $obj = clone $this; - $obj->hasNextPage = $hasNextPage; + $obj['hasNextPage'] = $hasNextPage; return $obj; } @@ -101,7 +101,7 @@ public function withHasNextPage(bool $hasNextPage): self public function withHasPreviousPage(bool $hasPreviousPage): self { $obj = clone $this; - $obj->hasPreviousPage = $hasPreviousPage; + $obj['hasPreviousPage'] = $hasPreviousPage; return $obj; } @@ -109,7 +109,7 @@ public function withHasPreviousPage(bool $hasPreviousPage): self public function withPageNumber(float $pageNumber): self { $obj = clone $this; - $obj->pageNumber = $pageNumber; + $obj['pageNumber'] = $pageNumber; return $obj; } @@ -117,7 +117,7 @@ public function withPageNumber(float $pageNumber): self public function withPageSize(float $pageSize): self { $obj = clone $this; - $obj->pageSize = $pageSize; + $obj['pageSize'] = $pageSize; return $obj; } @@ -125,7 +125,7 @@ public function withPageSize(float $pageSize): self public function withTotal(float $total): self { $obj = clone $this; - $obj->total = $total; + $obj['total'] = $total; return $obj; } diff --git a/src/Authors/AuthorNewResponse.php b/src/Authors/AuthorNewResponse.php index 56cefd5..d481a18 100644 --- a/src/Authors/AuthorNewResponse.php +++ b/src/Authors/AuthorNewResponse.php @@ -171,18 +171,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param Block|array{reason?: string|null, until?: float|null}|null $block + * @param Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * } $metadata + * @param Metrics|array{ + * flagged_content: float, total_content: float, average_sentiment?: float|null + * } $metrics + * @param RiskEvaluation|array{risk_level?: float|null}|null $risk_evaluation * @param Status|value-of $status + * @param TrustLevel|array{level: float, manual: bool} $trust_level */ public static function with( string $id, - ?Block $block, + Block|array|null $block, float $first_seen, float $last_seen, - Metadata $metadata, - Metrics $metrics, - ?RiskEvaluation $risk_evaluation, + Metadata|array $metadata, + Metrics|array $metrics, + RiskEvaluation|array|null $risk_evaluation, Status|string $status, - TrustLevel $trust_level, + TrustLevel|array $trust_level, ?string $email = null, ?string $external_id = null, ?string $external_link = null, @@ -192,22 +204,22 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->block = $block; - $obj->first_seen = $first_seen; - $obj->last_seen = $last_seen; - $obj->metadata = $metadata; - $obj->metrics = $metrics; - $obj->risk_evaluation = $risk_evaluation; + $obj['id'] = $id; + $obj['block'] = $block; + $obj['first_seen'] = $first_seen; + $obj['last_seen'] = $last_seen; + $obj['metadata'] = $metadata; + $obj['metrics'] = $metrics; + $obj['risk_evaluation'] = $risk_evaluation; $obj['status'] = $status; - $obj->trust_level = $trust_level; + $obj['trust_level'] = $trust_level; - null !== $email && $obj->email = $email; - null !== $external_id && $obj->external_id = $external_id; - null !== $external_link && $obj->external_link = $external_link; - null !== $last_incident && $obj->last_incident = $last_incident; - null !== $name && $obj->name = $name; - null !== $profile_picture && $obj->profile_picture = $profile_picture; + null !== $email && $obj['email'] = $email; + null !== $external_id && $obj['external_id'] = $external_id; + null !== $external_link && $obj['external_link'] = $external_link; + null !== $last_incident && $obj['last_incident'] = $last_incident; + null !== $name && $obj['name'] = $name; + null !== $profile_picture && $obj['profile_picture'] = $profile_picture; return $obj; } @@ -218,18 +230,20 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } /** * Block or suspension details, if applicable. Null if the author is enabled. + * + * @param Block|array{reason?: string|null, until?: float|null}|null $block */ - public function withBlock(?Block $block): self + public function withBlock(Block|array|null $block): self { $obj = clone $this; - $obj->block = $block; + $obj['block'] = $block; return $obj; } @@ -240,7 +254,7 @@ public function withBlock(?Block $block): self public function withFirstSeen(float $firstSeen): self { $obj = clone $this; - $obj->first_seen = $firstSeen; + $obj['first_seen'] = $firstSeen; return $obj; } @@ -251,37 +265,52 @@ public function withFirstSeen(float $firstSeen): self public function withLastSeen(float $lastSeen): self { $obj = clone $this; - $obj->last_seen = $lastSeen; + $obj['last_seen'] = $lastSeen; return $obj; } /** * Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + * + * @param Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * } $metadata */ - public function withMetadata(Metadata $metadata): self + public function withMetadata(Metadata|array $metadata): self { $obj = clone $this; - $obj->metadata = $metadata; + $obj['metadata'] = $metadata; return $obj; } - public function withMetrics(Metrics $metrics): self + /** + * @param Metrics|array{ + * flagged_content: float, total_content: float, average_sentiment?: float|null + * } $metrics + */ + public function withMetrics(Metrics|array $metrics): self { $obj = clone $this; - $obj->metrics = $metrics; + $obj['metrics'] = $metrics; return $obj; } /** * Risk assessment details, if available. + * + * @param RiskEvaluation|array{risk_level?: float|null}|null $riskEvaluation */ - public function withRiskEvaluation(?RiskEvaluation $riskEvaluation): self - { + public function withRiskEvaluation( + RiskEvaluation|array|null $riskEvaluation + ): self { $obj = clone $this; - $obj->risk_evaluation = $riskEvaluation; + $obj['risk_evaluation'] = $riskEvaluation; return $obj; } @@ -299,10 +328,13 @@ public function withStatus(Status|string $status): self return $obj; } - public function withTrustLevel(TrustLevel $trustLevel): self + /** + * @param TrustLevel|array{level: float, manual: bool} $trustLevel + */ + public function withTrustLevel(TrustLevel|array $trustLevel): self { $obj = clone $this; - $obj->trust_level = $trustLevel; + $obj['trust_level'] = $trustLevel; return $obj; } @@ -313,7 +345,7 @@ public function withTrustLevel(TrustLevel $trustLevel): self public function withEmail(?string $email): self { $obj = clone $this; - $obj->email = $email; + $obj['email'] = $email; return $obj; } @@ -324,7 +356,7 @@ public function withEmail(?string $email): self public function withExternalID(?string $externalID): self { $obj = clone $this; - $obj->external_id = $externalID; + $obj['external_id'] = $externalID; return $obj; } @@ -335,7 +367,7 @@ public function withExternalID(?string $externalID): self public function withExternalLink(?string $externalLink): self { $obj = clone $this; - $obj->external_link = $externalLink; + $obj['external_link'] = $externalLink; return $obj; } @@ -346,7 +378,7 @@ public function withExternalLink(?string $externalLink): self public function withLastIncident(?float $lastIncident): self { $obj = clone $this; - $obj->last_incident = $lastIncident; + $obj['last_incident'] = $lastIncident; return $obj; } @@ -357,7 +389,7 @@ public function withLastIncident(?float $lastIncident): self public function withName(?string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -368,7 +400,7 @@ public function withName(?string $name): self public function withProfilePicture(?string $profilePicture): self { $obj = clone $this; - $obj->profile_picture = $profilePicture; + $obj['profile_picture'] = $profilePicture; return $obj; } diff --git a/src/Authors/AuthorNewResponse/Block.php b/src/Authors/AuthorNewResponse/Block.php index e695de7..bbf2650 100644 --- a/src/Authors/AuthorNewResponse/Block.php +++ b/src/Authors/AuthorNewResponse/Block.php @@ -46,8 +46,8 @@ public static function with( ): self { $obj = new self; - null !== $reason && $obj->reason = $reason; - null !== $until && $obj->until = $until; + null !== $reason && $obj['reason'] = $reason; + null !== $until && $obj['until'] = $until; return $obj; } @@ -58,7 +58,7 @@ public static function with( public function withReason(?string $reason): self { $obj = clone $this; - $obj->reason = $reason; + $obj['reason'] = $reason; return $obj; } @@ -69,7 +69,7 @@ public function withReason(?string $reason): self public function withUntil(?float $until): self { $obj = clone $this; - $obj->until = $until; + $obj['until'] = $until; return $obj; } diff --git a/src/Authors/AuthorNewResponse/Metadata.php b/src/Authors/AuthorNewResponse/Metadata.php index 2bfeae1..a134946 100644 --- a/src/Authors/AuthorNewResponse/Metadata.php +++ b/src/Authors/AuthorNewResponse/Metadata.php @@ -65,10 +65,10 @@ public static function with( ): self { $obj = new self; - null !== $email_verified && $obj->email_verified = $email_verified; - null !== $identity_verified && $obj->identity_verified = $identity_verified; - null !== $is_paying_customer && $obj->is_paying_customer = $is_paying_customer; - null !== $phone_verified && $obj->phone_verified = $phone_verified; + null !== $email_verified && $obj['email_verified'] = $email_verified; + null !== $identity_verified && $obj['identity_verified'] = $identity_verified; + null !== $is_paying_customer && $obj['is_paying_customer'] = $is_paying_customer; + null !== $phone_verified && $obj['phone_verified'] = $phone_verified; return $obj; } @@ -79,7 +79,7 @@ public static function with( public function withEmailVerified(?bool $emailVerified): self { $obj = clone $this; - $obj->email_verified = $emailVerified; + $obj['email_verified'] = $emailVerified; return $obj; } @@ -90,7 +90,7 @@ public function withEmailVerified(?bool $emailVerified): self public function withIdentityVerified(?bool $identityVerified): self { $obj = clone $this; - $obj->identity_verified = $identityVerified; + $obj['identity_verified'] = $identityVerified; return $obj; } @@ -101,7 +101,7 @@ public function withIdentityVerified(?bool $identityVerified): self public function withIsPayingCustomer(?bool $isPayingCustomer): self { $obj = clone $this; - $obj->is_paying_customer = $isPayingCustomer; + $obj['is_paying_customer'] = $isPayingCustomer; return $obj; } @@ -112,7 +112,7 @@ public function withIsPayingCustomer(?bool $isPayingCustomer): self public function withPhoneVerified(?bool $phoneVerified): self { $obj = clone $this; - $obj->phone_verified = $phoneVerified; + $obj['phone_verified'] = $phoneVerified; return $obj; } diff --git a/src/Authors/AuthorNewResponse/Metrics.php b/src/Authors/AuthorNewResponse/Metrics.php index 96b101c..a7e927a 100644 --- a/src/Authors/AuthorNewResponse/Metrics.php +++ b/src/Authors/AuthorNewResponse/Metrics.php @@ -67,10 +67,10 @@ public static function with( ): self { $obj = new self; - $obj->flagged_content = $flagged_content; - $obj->total_content = $total_content; + $obj['flagged_content'] = $flagged_content; + $obj['total_content'] = $total_content; - null !== $average_sentiment && $obj->average_sentiment = $average_sentiment; + null !== $average_sentiment && $obj['average_sentiment'] = $average_sentiment; return $obj; } @@ -81,7 +81,7 @@ public static function with( public function withFlaggedContent(float $flaggedContent): self { $obj = clone $this; - $obj->flagged_content = $flaggedContent; + $obj['flagged_content'] = $flaggedContent; return $obj; } @@ -92,7 +92,7 @@ public function withFlaggedContent(float $flaggedContent): self public function withTotalContent(float $totalContent): self { $obj = clone $this; - $obj->total_content = $totalContent; + $obj['total_content'] = $totalContent; return $obj; } @@ -103,7 +103,7 @@ public function withTotalContent(float $totalContent): self public function withAverageSentiment(?float $averageSentiment): self { $obj = clone $this; - $obj->average_sentiment = $averageSentiment; + $obj['average_sentiment'] = $averageSentiment; return $obj; } diff --git a/src/Authors/AuthorNewResponse/RiskEvaluation.php b/src/Authors/AuthorNewResponse/RiskEvaluation.php index 1db1584..553ad7f 100644 --- a/src/Authors/AuthorNewResponse/RiskEvaluation.php +++ b/src/Authors/AuthorNewResponse/RiskEvaluation.php @@ -38,7 +38,7 @@ public static function with(?float $risk_level = null): self { $obj = new self; - null !== $risk_level && $obj->risk_level = $risk_level; + null !== $risk_level && $obj['risk_level'] = $risk_level; return $obj; } @@ -49,7 +49,7 @@ public static function with(?float $risk_level = null): self public function withRiskLevel(?float $riskLevel): self { $obj = clone $this; - $obj->risk_level = $riskLevel; + $obj['risk_level'] = $riskLevel; return $obj; } diff --git a/src/Authors/AuthorNewResponse/TrustLevel.php b/src/Authors/AuthorNewResponse/TrustLevel.php index 31cc8c6..a9f65ee 100644 --- a/src/Authors/AuthorNewResponse/TrustLevel.php +++ b/src/Authors/AuthorNewResponse/TrustLevel.php @@ -56,8 +56,8 @@ public static function with(float $level, bool $manual): self { $obj = new self; - $obj->level = $level; - $obj->manual = $manual; + $obj['level'] = $level; + $obj['manual'] = $manual; return $obj; } @@ -68,7 +68,7 @@ public static function with(float $level, bool $manual): self public function withLevel(float $level): self { $obj = clone $this; - $obj->level = $level; + $obj['level'] = $level; return $obj; } @@ -79,7 +79,7 @@ public function withLevel(float $level): self public function withManual(bool $manual): self { $obj = clone $this; - $obj->manual = $manual; + $obj['manual'] = $manual; return $obj; } diff --git a/src/Authors/AuthorUpdateParams.php b/src/Authors/AuthorUpdateParams.php index fac67af..d2571cf 100644 --- a/src/Authors/AuthorUpdateParams.php +++ b/src/Authors/AuthorUpdateParams.php @@ -21,7 +21,12 @@ * first_seen?: float, * last_seen?: float, * manual_trust_level?: float|null, - * metadata?: Metadata, + * metadata?: Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * }, * name?: string|null, * profile_picture?: string|null, * } @@ -86,6 +91,13 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * } $metadata */ public static function with( ?string $email = null, @@ -93,20 +105,20 @@ public static function with( ?float $first_seen = null, ?float $last_seen = null, ?float $manual_trust_level = null, - ?Metadata $metadata = null, + Metadata|array|null $metadata = null, ?string $name = null, ?string $profile_picture = null, ): self { $obj = new self; - null !== $email && $obj->email = $email; - null !== $external_link && $obj->external_link = $external_link; - null !== $first_seen && $obj->first_seen = $first_seen; - null !== $last_seen && $obj->last_seen = $last_seen; - null !== $manual_trust_level && $obj->manual_trust_level = $manual_trust_level; - null !== $metadata && $obj->metadata = $metadata; - null !== $name && $obj->name = $name; - null !== $profile_picture && $obj->profile_picture = $profile_picture; + null !== $email && $obj['email'] = $email; + null !== $external_link && $obj['external_link'] = $external_link; + null !== $first_seen && $obj['first_seen'] = $first_seen; + null !== $last_seen && $obj['last_seen'] = $last_seen; + null !== $manual_trust_level && $obj['manual_trust_level'] = $manual_trust_level; + null !== $metadata && $obj['metadata'] = $metadata; + null !== $name && $obj['name'] = $name; + null !== $profile_picture && $obj['profile_picture'] = $profile_picture; return $obj; } @@ -117,7 +129,7 @@ public static function with( public function withEmail(?string $email): self { $obj = clone $this; - $obj->email = $email; + $obj['email'] = $email; return $obj; } @@ -128,7 +140,7 @@ public function withEmail(?string $email): self public function withExternalLink(?string $externalLink): self { $obj = clone $this; - $obj->external_link = $externalLink; + $obj['external_link'] = $externalLink; return $obj; } @@ -139,7 +151,7 @@ public function withExternalLink(?string $externalLink): self public function withFirstSeen(float $firstSeen): self { $obj = clone $this; - $obj->first_seen = $firstSeen; + $obj['first_seen'] = $firstSeen; return $obj; } @@ -150,7 +162,7 @@ public function withFirstSeen(float $firstSeen): self public function withLastSeen(float $lastSeen): self { $obj = clone $this; - $obj->last_seen = $lastSeen; + $obj['last_seen'] = $lastSeen; return $obj; } @@ -158,18 +170,25 @@ public function withLastSeen(float $lastSeen): self public function withManualTrustLevel(?float $manualTrustLevel): self { $obj = clone $this; - $obj->manual_trust_level = $manualTrustLevel; + $obj['manual_trust_level'] = $manualTrustLevel; return $obj; } /** * Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + * + * @param Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * } $metadata */ - public function withMetadata(Metadata $metadata): self + public function withMetadata(Metadata|array $metadata): self { $obj = clone $this; - $obj->metadata = $metadata; + $obj['metadata'] = $metadata; return $obj; } @@ -180,7 +199,7 @@ public function withMetadata(Metadata $metadata): self public function withName(?string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -191,7 +210,7 @@ public function withName(?string $name): self public function withProfilePicture(?string $profilePicture): self { $obj = clone $this; - $obj->profile_picture = $profilePicture; + $obj['profile_picture'] = $profilePicture; return $obj; } diff --git a/src/Authors/AuthorUpdateParams/Metadata.php b/src/Authors/AuthorUpdateParams/Metadata.php index 8e1ed93..07c20c7 100644 --- a/src/Authors/AuthorUpdateParams/Metadata.php +++ b/src/Authors/AuthorUpdateParams/Metadata.php @@ -65,10 +65,10 @@ public static function with( ): self { $obj = new self; - null !== $email_verified && $obj->email_verified = $email_verified; - null !== $identity_verified && $obj->identity_verified = $identity_verified; - null !== $is_paying_customer && $obj->is_paying_customer = $is_paying_customer; - null !== $phone_verified && $obj->phone_verified = $phone_verified; + null !== $email_verified && $obj['email_verified'] = $email_verified; + null !== $identity_verified && $obj['identity_verified'] = $identity_verified; + null !== $is_paying_customer && $obj['is_paying_customer'] = $is_paying_customer; + null !== $phone_verified && $obj['phone_verified'] = $phone_verified; return $obj; } @@ -79,7 +79,7 @@ public static function with( public function withEmailVerified(?bool $emailVerified): self { $obj = clone $this; - $obj->email_verified = $emailVerified; + $obj['email_verified'] = $emailVerified; return $obj; } @@ -90,7 +90,7 @@ public function withEmailVerified(?bool $emailVerified): self public function withIdentityVerified(?bool $identityVerified): self { $obj = clone $this; - $obj->identity_verified = $identityVerified; + $obj['identity_verified'] = $identityVerified; return $obj; } @@ -101,7 +101,7 @@ public function withIdentityVerified(?bool $identityVerified): self public function withIsPayingCustomer(?bool $isPayingCustomer): self { $obj = clone $this; - $obj->is_paying_customer = $isPayingCustomer; + $obj['is_paying_customer'] = $isPayingCustomer; return $obj; } @@ -112,7 +112,7 @@ public function withIsPayingCustomer(?bool $isPayingCustomer): self public function withPhoneVerified(?bool $phoneVerified): self { $obj = clone $this; - $obj->phone_verified = $phoneVerified; + $obj['phone_verified'] = $phoneVerified; return $obj; } diff --git a/src/Authors/AuthorUpdateResponse.php b/src/Authors/AuthorUpdateResponse.php index 49dc989..e323eab 100644 --- a/src/Authors/AuthorUpdateResponse.php +++ b/src/Authors/AuthorUpdateResponse.php @@ -171,18 +171,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param Block|array{reason?: string|null, until?: float|null}|null $block + * @param Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * } $metadata + * @param Metrics|array{ + * flagged_content: float, total_content: float, average_sentiment?: float|null + * } $metrics + * @param RiskEvaluation|array{risk_level?: float|null}|null $risk_evaluation * @param Status|value-of $status + * @param TrustLevel|array{level: float, manual: bool} $trust_level */ public static function with( string $id, - ?Block $block, + Block|array|null $block, float $first_seen, float $last_seen, - Metadata $metadata, - Metrics $metrics, - ?RiskEvaluation $risk_evaluation, + Metadata|array $metadata, + Metrics|array $metrics, + RiskEvaluation|array|null $risk_evaluation, Status|string $status, - TrustLevel $trust_level, + TrustLevel|array $trust_level, ?string $email = null, ?string $external_id = null, ?string $external_link = null, @@ -192,22 +204,22 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->block = $block; - $obj->first_seen = $first_seen; - $obj->last_seen = $last_seen; - $obj->metadata = $metadata; - $obj->metrics = $metrics; - $obj->risk_evaluation = $risk_evaluation; + $obj['id'] = $id; + $obj['block'] = $block; + $obj['first_seen'] = $first_seen; + $obj['last_seen'] = $last_seen; + $obj['metadata'] = $metadata; + $obj['metrics'] = $metrics; + $obj['risk_evaluation'] = $risk_evaluation; $obj['status'] = $status; - $obj->trust_level = $trust_level; + $obj['trust_level'] = $trust_level; - null !== $email && $obj->email = $email; - null !== $external_id && $obj->external_id = $external_id; - null !== $external_link && $obj->external_link = $external_link; - null !== $last_incident && $obj->last_incident = $last_incident; - null !== $name && $obj->name = $name; - null !== $profile_picture && $obj->profile_picture = $profile_picture; + null !== $email && $obj['email'] = $email; + null !== $external_id && $obj['external_id'] = $external_id; + null !== $external_link && $obj['external_link'] = $external_link; + null !== $last_incident && $obj['last_incident'] = $last_incident; + null !== $name && $obj['name'] = $name; + null !== $profile_picture && $obj['profile_picture'] = $profile_picture; return $obj; } @@ -218,18 +230,20 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } /** * Block or suspension details, if applicable. Null if the author is enabled. + * + * @param Block|array{reason?: string|null, until?: float|null}|null $block */ - public function withBlock(?Block $block): self + public function withBlock(Block|array|null $block): self { $obj = clone $this; - $obj->block = $block; + $obj['block'] = $block; return $obj; } @@ -240,7 +254,7 @@ public function withBlock(?Block $block): self public function withFirstSeen(float $firstSeen): self { $obj = clone $this; - $obj->first_seen = $firstSeen; + $obj['first_seen'] = $firstSeen; return $obj; } @@ -251,37 +265,52 @@ public function withFirstSeen(float $firstSeen): self public function withLastSeen(float $lastSeen): self { $obj = clone $this; - $obj->last_seen = $lastSeen; + $obj['last_seen'] = $lastSeen; return $obj; } /** * Additional metadata provided by your system. We recommend including any relevant information that may assist in the moderation process. + * + * @param Metadata|array{ + * email_verified?: bool|null, + * identity_verified?: bool|null, + * is_paying_customer?: bool|null, + * phone_verified?: bool|null, + * } $metadata */ - public function withMetadata(Metadata $metadata): self + public function withMetadata(Metadata|array $metadata): self { $obj = clone $this; - $obj->metadata = $metadata; + $obj['metadata'] = $metadata; return $obj; } - public function withMetrics(Metrics $metrics): self + /** + * @param Metrics|array{ + * flagged_content: float, total_content: float, average_sentiment?: float|null + * } $metrics + */ + public function withMetrics(Metrics|array $metrics): self { $obj = clone $this; - $obj->metrics = $metrics; + $obj['metrics'] = $metrics; return $obj; } /** * Risk assessment details, if available. + * + * @param RiskEvaluation|array{risk_level?: float|null}|null $riskEvaluation */ - public function withRiskEvaluation(?RiskEvaluation $riskEvaluation): self - { + public function withRiskEvaluation( + RiskEvaluation|array|null $riskEvaluation + ): self { $obj = clone $this; - $obj->risk_evaluation = $riskEvaluation; + $obj['risk_evaluation'] = $riskEvaluation; return $obj; } @@ -299,10 +328,13 @@ public function withStatus(Status|string $status): self return $obj; } - public function withTrustLevel(TrustLevel $trustLevel): self + /** + * @param TrustLevel|array{level: float, manual: bool} $trustLevel + */ + public function withTrustLevel(TrustLevel|array $trustLevel): self { $obj = clone $this; - $obj->trust_level = $trustLevel; + $obj['trust_level'] = $trustLevel; return $obj; } @@ -313,7 +345,7 @@ public function withTrustLevel(TrustLevel $trustLevel): self public function withEmail(?string $email): self { $obj = clone $this; - $obj->email = $email; + $obj['email'] = $email; return $obj; } @@ -324,7 +356,7 @@ public function withEmail(?string $email): self public function withExternalID(?string $externalID): self { $obj = clone $this; - $obj->external_id = $externalID; + $obj['external_id'] = $externalID; return $obj; } @@ -335,7 +367,7 @@ public function withExternalID(?string $externalID): self public function withExternalLink(?string $externalLink): self { $obj = clone $this; - $obj->external_link = $externalLink; + $obj['external_link'] = $externalLink; return $obj; } @@ -346,7 +378,7 @@ public function withExternalLink(?string $externalLink): self public function withLastIncident(?float $lastIncident): self { $obj = clone $this; - $obj->last_incident = $lastIncident; + $obj['last_incident'] = $lastIncident; return $obj; } @@ -357,7 +389,7 @@ public function withLastIncident(?float $lastIncident): self public function withName(?string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -368,7 +400,7 @@ public function withName(?string $name): self public function withProfilePicture(?string $profilePicture): self { $obj = clone $this; - $obj->profile_picture = $profilePicture; + $obj['profile_picture'] = $profilePicture; return $obj; } diff --git a/src/Authors/AuthorUpdateResponse/Block.php b/src/Authors/AuthorUpdateResponse/Block.php index 66937ed..0793dd0 100644 --- a/src/Authors/AuthorUpdateResponse/Block.php +++ b/src/Authors/AuthorUpdateResponse/Block.php @@ -46,8 +46,8 @@ public static function with( ): self { $obj = new self; - null !== $reason && $obj->reason = $reason; - null !== $until && $obj->until = $until; + null !== $reason && $obj['reason'] = $reason; + null !== $until && $obj['until'] = $until; return $obj; } @@ -58,7 +58,7 @@ public static function with( public function withReason(?string $reason): self { $obj = clone $this; - $obj->reason = $reason; + $obj['reason'] = $reason; return $obj; } @@ -69,7 +69,7 @@ public function withReason(?string $reason): self public function withUntil(?float $until): self { $obj = clone $this; - $obj->until = $until; + $obj['until'] = $until; return $obj; } diff --git a/src/Authors/AuthorUpdateResponse/Metadata.php b/src/Authors/AuthorUpdateResponse/Metadata.php index 0ec0245..bab1ab8 100644 --- a/src/Authors/AuthorUpdateResponse/Metadata.php +++ b/src/Authors/AuthorUpdateResponse/Metadata.php @@ -65,10 +65,10 @@ public static function with( ): self { $obj = new self; - null !== $email_verified && $obj->email_verified = $email_verified; - null !== $identity_verified && $obj->identity_verified = $identity_verified; - null !== $is_paying_customer && $obj->is_paying_customer = $is_paying_customer; - null !== $phone_verified && $obj->phone_verified = $phone_verified; + null !== $email_verified && $obj['email_verified'] = $email_verified; + null !== $identity_verified && $obj['identity_verified'] = $identity_verified; + null !== $is_paying_customer && $obj['is_paying_customer'] = $is_paying_customer; + null !== $phone_verified && $obj['phone_verified'] = $phone_verified; return $obj; } @@ -79,7 +79,7 @@ public static function with( public function withEmailVerified(?bool $emailVerified): self { $obj = clone $this; - $obj->email_verified = $emailVerified; + $obj['email_verified'] = $emailVerified; return $obj; } @@ -90,7 +90,7 @@ public function withEmailVerified(?bool $emailVerified): self public function withIdentityVerified(?bool $identityVerified): self { $obj = clone $this; - $obj->identity_verified = $identityVerified; + $obj['identity_verified'] = $identityVerified; return $obj; } @@ -101,7 +101,7 @@ public function withIdentityVerified(?bool $identityVerified): self public function withIsPayingCustomer(?bool $isPayingCustomer): self { $obj = clone $this; - $obj->is_paying_customer = $isPayingCustomer; + $obj['is_paying_customer'] = $isPayingCustomer; return $obj; } @@ -112,7 +112,7 @@ public function withIsPayingCustomer(?bool $isPayingCustomer): self public function withPhoneVerified(?bool $phoneVerified): self { $obj = clone $this; - $obj->phone_verified = $phoneVerified; + $obj['phone_verified'] = $phoneVerified; return $obj; } diff --git a/src/Authors/AuthorUpdateResponse/Metrics.php b/src/Authors/AuthorUpdateResponse/Metrics.php index 3350936..28c650c 100644 --- a/src/Authors/AuthorUpdateResponse/Metrics.php +++ b/src/Authors/AuthorUpdateResponse/Metrics.php @@ -67,10 +67,10 @@ public static function with( ): self { $obj = new self; - $obj->flagged_content = $flagged_content; - $obj->total_content = $total_content; + $obj['flagged_content'] = $flagged_content; + $obj['total_content'] = $total_content; - null !== $average_sentiment && $obj->average_sentiment = $average_sentiment; + null !== $average_sentiment && $obj['average_sentiment'] = $average_sentiment; return $obj; } @@ -81,7 +81,7 @@ public static function with( public function withFlaggedContent(float $flaggedContent): self { $obj = clone $this; - $obj->flagged_content = $flaggedContent; + $obj['flagged_content'] = $flaggedContent; return $obj; } @@ -92,7 +92,7 @@ public function withFlaggedContent(float $flaggedContent): self public function withTotalContent(float $totalContent): self { $obj = clone $this; - $obj->total_content = $totalContent; + $obj['total_content'] = $totalContent; return $obj; } @@ -103,7 +103,7 @@ public function withTotalContent(float $totalContent): self public function withAverageSentiment(?float $averageSentiment): self { $obj = clone $this; - $obj->average_sentiment = $averageSentiment; + $obj['average_sentiment'] = $averageSentiment; return $obj; } diff --git a/src/Authors/AuthorUpdateResponse/RiskEvaluation.php b/src/Authors/AuthorUpdateResponse/RiskEvaluation.php index 6ea6a82..d9907fc 100644 --- a/src/Authors/AuthorUpdateResponse/RiskEvaluation.php +++ b/src/Authors/AuthorUpdateResponse/RiskEvaluation.php @@ -38,7 +38,7 @@ public static function with(?float $risk_level = null): self { $obj = new self; - null !== $risk_level && $obj->risk_level = $risk_level; + null !== $risk_level && $obj['risk_level'] = $risk_level; return $obj; } @@ -49,7 +49,7 @@ public static function with(?float $risk_level = null): self public function withRiskLevel(?float $riskLevel): self { $obj = clone $this; - $obj->risk_level = $riskLevel; + $obj['risk_level'] = $riskLevel; return $obj; } diff --git a/src/Authors/AuthorUpdateResponse/TrustLevel.php b/src/Authors/AuthorUpdateResponse/TrustLevel.php index d780dc1..e7f473b 100644 --- a/src/Authors/AuthorUpdateResponse/TrustLevel.php +++ b/src/Authors/AuthorUpdateResponse/TrustLevel.php @@ -56,8 +56,8 @@ public static function with(float $level, bool $manual): self { $obj = new self; - $obj->level = $level; - $obj->manual = $manual; + $obj['level'] = $level; + $obj['manual'] = $manual; return $obj; } @@ -68,7 +68,7 @@ public static function with(float $level, bool $manual): self public function withLevel(float $level): self { $obj = clone $this; - $obj->level = $level; + $obj['level'] = $level; return $obj; } @@ -79,7 +79,7 @@ public function withLevel(float $level): self public function withManual(bool $manual): self { $obj = clone $this; - $obj->manual = $manual; + $obj['manual'] = $manual; return $obj; } diff --git a/src/Client.php b/src/Client.php index 210f77f..2b68ac4 100644 --- a/src/Client.php +++ b/src/Client.php @@ -74,9 +74,9 @@ public function __construct(?string $secretKey = null, ?string $baseUrl = null) headers: [ 'Content-Type' => 'application/json', 'Accept' => 'application/json', - 'User-Agent' => sprintf('moderation-api/PHP %s', '0.1.1'), + 'User-Agent' => sprintf('moderation-api/PHP %s', '0.2.0'), 'X-Stainless-Lang' => 'php', - 'X-Stainless-Package-Version' => '0.1.1', + 'X-Stainless-Package-Version' => '0.2.0', 'X-Stainless-OS' => $this->getNormalizedOS(), 'X-Stainless-Arch' => $this->getNormalizedArchitecture(), 'X-Stainless-Runtime' => 'php', diff --git a/src/Content/ContentSubmitParams.php b/src/Content/ContentSubmitParams.php index c00ea56..f816dc9 100644 --- a/src/Content/ContentSubmitParams.php +++ b/src/Content/ContentSubmitParams.php @@ -23,6 +23,7 @@ use ModerationAPI\Content\ContentSubmitParams\Policy\IllicitTobacco; use ModerationAPI\Content\ContentSubmitParams\Policy\PersonalInformation; use ModerationAPI\Content\ContentSubmitParams\Policy\PiiMasking; +use ModerationAPI\Content\ContentSubmitParams\Policy\PiiMasking\Entity; use ModerationAPI\Content\ContentSubmitParams\Policy\Political; use ModerationAPI\Content\ContentSubmitParams\Policy\Profanity; use ModerationAPI\Content\ContentSubmitParams\Policy\Religion; @@ -43,7 +44,14 @@ * @see ModerationAPI\Services\ContentService::submit() * * @phpstan-type ContentSubmitParamsShape = array{ - * content: Text|Image|Video|Audio|Object1, + * content: Text|array{text: string, type: 'text'}|Image|array{ + * type: 'image', url: string + * }|Video|array{type: 'video', url: string}|Audio|array{ + * type: 'audio', url: string + * }|Object1|array{ + * data: array, + * type: 'object', + * }, * authorId?: string, * channel?: string, * contentId?: string, @@ -51,7 +59,38 @@ * doNotStore?: bool, * metadata?: array, * metaType?: MetaType|value-of, - * policies?: list, + * policies?: list + * }|URLMasking|array{ + * id: 'url', + * entities: array, + * }|Guideline|array{ + * id: 'guideline', flag: bool, guidelineKey: string, instructions: string + * }>, * } */ final class ContentSubmitParams implements BaseModel @@ -144,12 +183,47 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param Text|array{text: string, type: 'text'}|Image|array{ + * type: 'image', url: string + * }|Video|array{type: 'video', url: string}|Audio|array{ + * type: 'audio', url: string + * }|Object1|array{ + * data: array, + * type: 'object', + * } $content * @param array $metadata * @param MetaType|value-of $metaType - * @param list $policies + * @param list}|URLMasking|array{ + * id: 'url', + * entities: array, + * }|Guideline|array{ + * id: 'guideline', flag: bool, guidelineKey: string, instructions: string + * }> $policies */ public static function with( - Text|Image|Video|Audio|Object1 $content, + Text|array|Image|Video|Audio|Object1 $content, ?string $authorId = null, ?string $channel = null, ?string $contentId = null, @@ -161,27 +235,37 @@ public static function with( ): self { $obj = new self; - $obj->content = $content; + $obj['content'] = $content; - null !== $authorId && $obj->authorId = $authorId; - null !== $channel && $obj->channel = $channel; - null !== $contentId && $obj->contentId = $contentId; - null !== $conversationId && $obj->conversationId = $conversationId; - null !== $doNotStore && $obj->doNotStore = $doNotStore; - null !== $metadata && $obj->metadata = $metadata; + null !== $authorId && $obj['authorId'] = $authorId; + null !== $channel && $obj['channel'] = $channel; + null !== $contentId && $obj['contentId'] = $contentId; + null !== $conversationId && $obj['conversationId'] = $conversationId; + null !== $doNotStore && $obj['doNotStore'] = $doNotStore; + null !== $metadata && $obj['metadata'] = $metadata; null !== $metaType && $obj['metaType'] = $metaType; - null !== $policies && $obj->policies = $policies; + null !== $policies && $obj['policies'] = $policies; return $obj; } /** * The content sent for moderation. + * + * @param Text|array{text: string, type: 'text'}|Image|array{ + * type: 'image', url: string + * }|Video|array{type: 'video', url: string}|Audio|array{ + * type: 'audio', url: string + * }|Object1|array{ + * data: array, + * type: 'object', + * } $content */ - public function withContent(Text|Image|Video|Audio|Object1 $content): self - { + public function withContent( + Text|array|Image|Video|Audio|Object1 $content + ): self { $obj = clone $this; - $obj->content = $content; + $obj['content'] = $content; return $obj; } @@ -192,7 +276,7 @@ public function withContent(Text|Image|Video|Audio|Object1 $content): self public function withAuthorID(string $authorID): self { $obj = clone $this; - $obj->authorId = $authorID; + $obj['authorId'] = $authorID; return $obj; } @@ -203,7 +287,7 @@ public function withAuthorID(string $authorID): self public function withChannel(string $channel): self { $obj = clone $this; - $obj->channel = $channel; + $obj['channel'] = $channel; return $obj; } @@ -214,7 +298,7 @@ public function withChannel(string $channel): self public function withContentID(string $contentID): self { $obj = clone $this; - $obj->contentId = $contentID; + $obj['contentId'] = $contentID; return $obj; } @@ -225,7 +309,7 @@ public function withContentID(string $contentID): self public function withConversationID(string $conversationID): self { $obj = clone $this; - $obj->conversationId = $conversationID; + $obj['conversationId'] = $conversationID; return $obj; } @@ -236,7 +320,7 @@ public function withConversationID(string $conversationID): self public function withDoNotStore(bool $doNotStore): self { $obj = clone $this; - $obj->doNotStore = $doNotStore; + $obj['doNotStore'] = $doNotStore; return $obj; } @@ -249,7 +333,7 @@ public function withDoNotStore(bool $doNotStore): self public function withMetadata(array $metadata): self { $obj = clone $this; - $obj->metadata = $metadata; + $obj['metadata'] = $metadata; return $obj; } @@ -270,12 +354,39 @@ public function withMetaType(MetaType|string $metaType): self /** * (Enterprise) override the channel policies for this moderation request only. * - * @param list $policies + * @param list}|URLMasking|array{ + * id: 'url', + * entities: array, + * }|Guideline|array{ + * id: 'guideline', flag: bool, guidelineKey: string, instructions: string + * }> $policies */ public function withPolicies(array $policies): self { $obj = clone $this; - $obj->policies = $policies; + $obj['policies'] = $policies; return $obj; } diff --git a/src/Content/ContentSubmitParams/Content/Audio.php b/src/Content/ContentSubmitParams/Content/Audio.php index fa14a83..be8e61a 100644 --- a/src/Content/ContentSubmitParams/Content/Audio.php +++ b/src/Content/ContentSubmitParams/Content/Audio.php @@ -56,7 +56,7 @@ public static function with(string $url): self { $obj = new self; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $url): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Content/ContentSubmitParams/Content/Image.php b/src/Content/ContentSubmitParams/Content/Image.php index 0261663..e44cb4e 100644 --- a/src/Content/ContentSubmitParams/Content/Image.php +++ b/src/Content/ContentSubmitParams/Content/Image.php @@ -56,7 +56,7 @@ public static function with(string $url): self { $obj = new self; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $url): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Content/ContentSubmitParams/Content/Object1.php b/src/Content/ContentSubmitParams/Content/Object1.php index 389b47e..b78f19d 100644 --- a/src/Content/ContentSubmitParams/Content/Object1.php +++ b/src/Content/ContentSubmitParams/Content/Object1.php @@ -62,13 +62,21 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $data + * @param array $data */ public static function with(array $data): self { $obj = new self; - $obj->data = $data; + $obj['data'] = $data; return $obj; } @@ -76,12 +84,20 @@ public static function with(array $data): self /** * Values in the object. Can be mixed content types. * - * @param array $data + * @param array $data */ public function withData(array $data): self { $obj = clone $this; - $obj->data = $data; + $obj['data'] = $data; return $obj; } diff --git a/src/Content/ContentSubmitParams/Content/Object1/Data/Audio.php b/src/Content/ContentSubmitParams/Content/Object1/Data/Audio.php index 5f1a073..e62a625 100644 --- a/src/Content/ContentSubmitParams/Content/Object1/Data/Audio.php +++ b/src/Content/ContentSubmitParams/Content/Object1/Data/Audio.php @@ -56,7 +56,7 @@ public static function with(string $url): self { $obj = new self; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $url): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Content/ContentSubmitParams/Content/Object1/Data/Image.php b/src/Content/ContentSubmitParams/Content/Object1/Data/Image.php index 04b9cdf..dfe5718 100644 --- a/src/Content/ContentSubmitParams/Content/Object1/Data/Image.php +++ b/src/Content/ContentSubmitParams/Content/Object1/Data/Image.php @@ -56,7 +56,7 @@ public static function with(string $url): self { $obj = new self; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $url): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Content/ContentSubmitParams/Content/Object1/Data/Text.php b/src/Content/ContentSubmitParams/Content/Object1/Data/Text.php index 68038fb..f145390 100644 --- a/src/Content/ContentSubmitParams/Content/Object1/Data/Text.php +++ b/src/Content/ContentSubmitParams/Content/Object1/Data/Text.php @@ -56,7 +56,7 @@ public static function with(string $text): self { $obj = new self; - $obj->text = $text; + $obj['text'] = $text; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $text): self public function withText(string $text): self { $obj = clone $this; - $obj->text = $text; + $obj['text'] = $text; return $obj; } diff --git a/src/Content/ContentSubmitParams/Content/Object1/Data/Video.php b/src/Content/ContentSubmitParams/Content/Object1/Data/Video.php index 4f1c890..b9fa6e3 100644 --- a/src/Content/ContentSubmitParams/Content/Object1/Data/Video.php +++ b/src/Content/ContentSubmitParams/Content/Object1/Data/Video.php @@ -56,7 +56,7 @@ public static function with(string $url): self { $obj = new self; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $url): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Content/ContentSubmitParams/Content/Text.php b/src/Content/ContentSubmitParams/Content/Text.php index 3483411..0c404ca 100644 --- a/src/Content/ContentSubmitParams/Content/Text.php +++ b/src/Content/ContentSubmitParams/Content/Text.php @@ -56,7 +56,7 @@ public static function with(string $text): self { $obj = new self; - $obj->text = $text; + $obj['text'] = $text; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $text): self public function withText(string $text): self { $obj = clone $this; - $obj->text = $text; + $obj['text'] = $text; return $obj; } diff --git a/src/Content/ContentSubmitParams/Content/Video.php b/src/Content/ContentSubmitParams/Content/Video.php index c4808d1..08b86ea 100644 --- a/src/Content/ContentSubmitParams/Content/Video.php +++ b/src/Content/ContentSubmitParams/Content/Video.php @@ -56,7 +56,7 @@ public static function with(string $url): self { $obj = new self; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $url): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/CodeAbuse.php b/src/Content/ContentSubmitParams/Policy/CodeAbuse.php index 395b0d9..47a2f7d 100644 --- a/src/Content/ContentSubmitParams/Policy/CodeAbuse.php +++ b/src/Content/ContentSubmitParams/Policy/CodeAbuse.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/Flirtation.php b/src/Content/ContentSubmitParams/Policy/Flirtation.php index 732751c..190dda8 100644 --- a/src/Content/ContentSubmitParams/Policy/Flirtation.php +++ b/src/Content/ContentSubmitParams/Policy/Flirtation.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/Guideline.php b/src/Content/ContentSubmitParams/Policy/Guideline.php index 4d97961..e209e79 100644 --- a/src/Content/ContentSubmitParams/Policy/Guideline.php +++ b/src/Content/ContentSubmitParams/Policy/Guideline.php @@ -62,9 +62,9 @@ public static function with( ): self { $obj = new self; - $obj->flag = $flag; - $obj->guidelineKey = $guidelineKey; - $obj->instructions = $instructions; + $obj['flag'] = $flag; + $obj['guidelineKey'] = $guidelineKey; + $obj['instructions'] = $instructions; return $obj; } @@ -72,7 +72,7 @@ public static function with( public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -80,7 +80,7 @@ public function withFlag(bool $flag): self public function withGuidelineKey(string $guidelineKey): self { $obj = clone $this; - $obj->guidelineKey = $guidelineKey; + $obj['guidelineKey'] = $guidelineKey; return $obj; } @@ -88,7 +88,7 @@ public function withGuidelineKey(string $guidelineKey): self public function withInstructions(string $instructions): self { $obj = clone $this; - $obj->instructions = $instructions; + $obj['instructions'] = $instructions; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/Hate.php b/src/Content/ContentSubmitParams/Policy/Hate.php index 07efb1b..d78951b 100644 --- a/src/Content/ContentSubmitParams/Policy/Hate.php +++ b/src/Content/ContentSubmitParams/Policy/Hate.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/Illicit.php b/src/Content/ContentSubmitParams/Policy/Illicit.php index 3644651..86f5b0e 100644 --- a/src/Content/ContentSubmitParams/Policy/Illicit.php +++ b/src/Content/ContentSubmitParams/Policy/Illicit.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/IllicitAlcohol.php b/src/Content/ContentSubmitParams/Policy/IllicitAlcohol.php index dc1e0cd..24e4f73 100644 --- a/src/Content/ContentSubmitParams/Policy/IllicitAlcohol.php +++ b/src/Content/ContentSubmitParams/Policy/IllicitAlcohol.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/IllicitDrugs.php b/src/Content/ContentSubmitParams/Policy/IllicitDrugs.php index fc54657..80eaa7e 100644 --- a/src/Content/ContentSubmitParams/Policy/IllicitDrugs.php +++ b/src/Content/ContentSubmitParams/Policy/IllicitDrugs.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/IllicitFirearms.php b/src/Content/ContentSubmitParams/Policy/IllicitFirearms.php index 6a28aef..f9c1923 100644 --- a/src/Content/ContentSubmitParams/Policy/IllicitFirearms.php +++ b/src/Content/ContentSubmitParams/Policy/IllicitFirearms.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/IllicitGambling.php b/src/Content/ContentSubmitParams/Policy/IllicitGambling.php index b231e7f..c661d2b 100644 --- a/src/Content/ContentSubmitParams/Policy/IllicitGambling.php +++ b/src/Content/ContentSubmitParams/Policy/IllicitGambling.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/IllicitTobacco.php b/src/Content/ContentSubmitParams/Policy/IllicitTobacco.php index 7c9e87b..9924510 100644 --- a/src/Content/ContentSubmitParams/Policy/IllicitTobacco.php +++ b/src/Content/ContentSubmitParams/Policy/IllicitTobacco.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/PersonalInformation.php b/src/Content/ContentSubmitParams/Policy/PersonalInformation.php index 43a1433..0210782 100644 --- a/src/Content/ContentSubmitParams/Policy/PersonalInformation.php +++ b/src/Content/ContentSubmitParams/Policy/PersonalInformation.php @@ -53,7 +53,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -61,7 +61,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/PiiMasking.php b/src/Content/ContentSubmitParams/Policy/PiiMasking.php index 6e5efeb..ac49b6d 100644 --- a/src/Content/ContentSubmitParams/Policy/PiiMasking.php +++ b/src/Content/ContentSubmitParams/Policy/PiiMasking.php @@ -5,6 +5,7 @@ namespace ModerationAPI\Content\ContentSubmitParams\Policy; use ModerationAPI\Content\ContentSubmitParams\Policy\PiiMasking\Entity; +use ModerationAPI\Content\ContentSubmitParams\Policy\PiiMasking\Entity\ID; use ModerationAPI\Core\Attributes\Api; use ModerationAPI\Core\Concerns\SdkModel; use ModerationAPI\Core\Contracts\BaseModel; @@ -49,24 +50,36 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $entities + * @param array, + * enable: bool, + * flag: bool, + * shouldMask: bool, + * mask?: string|null, + * }> $entities */ public static function with(array $entities): self { $obj = new self; - $obj->entities = $entities; + $obj['entities'] = $entities; return $obj; } /** - * @param array $entities + * @param array, + * enable: bool, + * flag: bool, + * shouldMask: bool, + * mask?: string|null, + * }> $entities */ public function withEntities(array $entities): self { $obj = clone $this; - $obj->entities = $entities; + $obj['entities'] = $entities; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/PiiMasking/Entity.php b/src/Content/ContentSubmitParams/Policy/PiiMasking/Entity.php index f12ba7d..183578f 100644 --- a/src/Content/ContentSubmitParams/Policy/PiiMasking/Entity.php +++ b/src/Content/ContentSubmitParams/Policy/PiiMasking/Entity.php @@ -75,11 +75,11 @@ public static function with( $obj = new self; $obj['id'] = $id; - $obj->enable = $enable; - $obj->flag = $flag; - $obj->shouldMask = $shouldMask; + $obj['enable'] = $enable; + $obj['flag'] = $flag; + $obj['shouldMask'] = $shouldMask; - null !== $mask && $obj->mask = $mask; + null !== $mask && $obj['mask'] = $mask; return $obj; } @@ -98,7 +98,7 @@ public function withID(ID|string $id): self public function withEnable(bool $enable): self { $obj = clone $this; - $obj->enable = $enable; + $obj['enable'] = $enable; return $obj; } @@ -106,7 +106,7 @@ public function withEnable(bool $enable): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -114,7 +114,7 @@ public function withFlag(bool $flag): self public function withShouldMask(bool $shouldMask): self { $obj = clone $this; - $obj->shouldMask = $shouldMask; + $obj['shouldMask'] = $shouldMask; return $obj; } @@ -122,7 +122,7 @@ public function withShouldMask(bool $shouldMask): self public function withMask(string $mask): self { $obj = clone $this; - $obj->mask = $mask; + $obj['mask'] = $mask; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/Political.php b/src/Content/ContentSubmitParams/Policy/Political.php index 5acf689..bf61891 100644 --- a/src/Content/ContentSubmitParams/Policy/Political.php +++ b/src/Content/ContentSubmitParams/Policy/Political.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/Profanity.php b/src/Content/ContentSubmitParams/Policy/Profanity.php index e317184..5cb4fca 100644 --- a/src/Content/ContentSubmitParams/Policy/Profanity.php +++ b/src/Content/ContentSubmitParams/Policy/Profanity.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/Religion.php b/src/Content/ContentSubmitParams/Policy/Religion.php index 280e459..0f809b2 100644 --- a/src/Content/ContentSubmitParams/Policy/Religion.php +++ b/src/Content/ContentSubmitParams/Policy/Religion.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/SelfHarm.php b/src/Content/ContentSubmitParams/Policy/SelfHarm.php index e4c975d..cdc37ac 100644 --- a/src/Content/ContentSubmitParams/Policy/SelfHarm.php +++ b/src/Content/ContentSubmitParams/Policy/SelfHarm.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/SelfPromotion.php b/src/Content/ContentSubmitParams/Policy/SelfPromotion.php index 2d27910..5f4bc35 100644 --- a/src/Content/ContentSubmitParams/Policy/SelfPromotion.php +++ b/src/Content/ContentSubmitParams/Policy/SelfPromotion.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/Sexual.php b/src/Content/ContentSubmitParams/Policy/Sexual.php index 63907dc..623a3b4 100644 --- a/src/Content/ContentSubmitParams/Policy/Sexual.php +++ b/src/Content/ContentSubmitParams/Policy/Sexual.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/Spam.php b/src/Content/ContentSubmitParams/Policy/Spam.php index 58559c7..5a2c62d 100644 --- a/src/Content/ContentSubmitParams/Policy/Spam.php +++ b/src/Content/ContentSubmitParams/Policy/Spam.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/Toxicity.php b/src/Content/ContentSubmitParams/Policy/Toxicity.php index cbdced7..6b1788f 100644 --- a/src/Content/ContentSubmitParams/Policy/Toxicity.php +++ b/src/Content/ContentSubmitParams/Policy/Toxicity.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/ToxicitySevere.php b/src/Content/ContentSubmitParams/Policy/ToxicitySevere.php index df6702c..7f84835 100644 --- a/src/Content/ContentSubmitParams/Policy/ToxicitySevere.php +++ b/src/Content/ContentSubmitParams/Policy/ToxicitySevere.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/URLMasking.php b/src/Content/ContentSubmitParams/Policy/URLMasking.php index 9631172..23ff1f7 100644 --- a/src/Content/ContentSubmitParams/Policy/URLMasking.php +++ b/src/Content/ContentSubmitParams/Policy/URLMasking.php @@ -5,6 +5,7 @@ namespace ModerationAPI\Content\ContentSubmitParams\Policy; use ModerationAPI\Content\ContentSubmitParams\Policy\URLMasking\Entity; +use ModerationAPI\Content\ContentSubmitParams\Policy\URLMasking\Entity\ID; use ModerationAPI\Core\Attributes\Api; use ModerationAPI\Core\Concerns\SdkModel; use ModerationAPI\Core\Contracts\BaseModel; @@ -49,24 +50,36 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $entities + * @param array, + * enable: bool, + * flag: bool, + * shouldMask: bool, + * mask?: string|null, + * }> $entities */ public static function with(array $entities): self { $obj = new self; - $obj->entities = $entities; + $obj['entities'] = $entities; return $obj; } /** - * @param array $entities + * @param array, + * enable: bool, + * flag: bool, + * shouldMask: bool, + * mask?: string|null, + * }> $entities */ public function withEntities(array $entities): self { $obj = clone $this; - $obj->entities = $entities; + $obj['entities'] = $entities; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/URLMasking/Entity.php b/src/Content/ContentSubmitParams/Policy/URLMasking/Entity.php index 67c0ac8..3bb4c4e 100644 --- a/src/Content/ContentSubmitParams/Policy/URLMasking/Entity.php +++ b/src/Content/ContentSubmitParams/Policy/URLMasking/Entity.php @@ -75,11 +75,11 @@ public static function with( $obj = new self; $obj['id'] = $id; - $obj->enable = $enable; - $obj->flag = $flag; - $obj->shouldMask = $shouldMask; + $obj['enable'] = $enable; + $obj['flag'] = $flag; + $obj['shouldMask'] = $shouldMask; - null !== $mask && $obj->mask = $mask; + null !== $mask && $obj['mask'] = $mask; return $obj; } @@ -98,7 +98,7 @@ public function withID(ID|string $id): self public function withEnable(bool $enable): self { $obj = clone $this; - $obj->enable = $enable; + $obj['enable'] = $enable; return $obj; } @@ -106,7 +106,7 @@ public function withEnable(bool $enable): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -114,7 +114,7 @@ public function withFlag(bool $flag): self public function withShouldMask(bool $shouldMask): self { $obj = clone $this; - $obj->shouldMask = $shouldMask; + $obj['shouldMask'] = $shouldMask; return $obj; } @@ -122,7 +122,7 @@ public function withShouldMask(bool $shouldMask): self public function withMask(string $mask): self { $obj = clone $this; - $obj->mask = $mask; + $obj['mask'] = $mask; return $obj; } diff --git a/src/Content/ContentSubmitParams/Policy/Violence.php b/src/Content/ContentSubmitParams/Policy/Violence.php index 39e4d5a..f12b48f 100644 --- a/src/Content/ContentSubmitParams/Policy/Violence.php +++ b/src/Content/ContentSubmitParams/Policy/Violence.php @@ -51,7 +51,7 @@ public static function with(bool $flag): self { $obj = new self; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } @@ -59,7 +59,7 @@ public static function with(bool $flag): self public function withFlag(bool $flag): self { $obj = clone $this; - $obj->flag = $flag; + $obj['flag'] = $flag; return $obj; } diff --git a/src/Content/ContentSubmitResponse.php b/src/Content/ContentSubmitResponse.php index 2be55ac..da666e2 100644 --- a/src/Content/ContentSubmitResponse.php +++ b/src/Content/ContentSubmitResponse.php @@ -5,17 +5,29 @@ namespace ModerationAPI\Content; use ModerationAPI\Content\ContentSubmitResponse\Author; +use ModerationAPI\Content\ContentSubmitResponse\Author\Block; +use ModerationAPI\Content\ContentSubmitResponse\Author\Status; +use ModerationAPI\Content\ContentSubmitResponse\Author\TrustLevel; use ModerationAPI\Content\ContentSubmitResponse\Content; +use ModerationAPI\Content\ContentSubmitResponse\Content\Modified\ModifiedNestedObjectContent\Audio; +use ModerationAPI\Content\ContentSubmitResponse\Content\Modified\ModifiedNestedObjectContent\Image; +use ModerationAPI\Content\ContentSubmitResponse\Content\Modified\ModifiedNestedObjectContent\Text; +use ModerationAPI\Content\ContentSubmitResponse\Content\Modified\ModifiedNestedObjectContent\Video; use ModerationAPI\Content\ContentSubmitResponse\Error; use ModerationAPI\Content\ContentSubmitResponse\Evaluation; use ModerationAPI\Content\ContentSubmitResponse\Insight; use ModerationAPI\Content\ContentSubmitResponse\Insight\LanguageInsight; use ModerationAPI\Content\ContentSubmitResponse\Insight\SentimentInsight; +use ModerationAPI\Content\ContentSubmitResponse\Insight\SentimentInsight\Value; use ModerationAPI\Content\ContentSubmitResponse\Meta; use ModerationAPI\Content\ContentSubmitResponse\Policy; use ModerationAPI\Content\ContentSubmitResponse\Policy\ClassifierOutput; +use ModerationAPI\Content\ContentSubmitResponse\Policy\ClassifierOutput\Label; use ModerationAPI\Content\ContentSubmitResponse\Policy\EntityMatcherOutput; +use ModerationAPI\Content\ContentSubmitResponse\Policy\EntityMatcherOutput\Match1; use ModerationAPI\Content\ContentSubmitResponse\Recommendation; +use ModerationAPI\Content\ContentSubmitResponse\Recommendation\Action; +use ModerationAPI\Content\ContentSubmitResponse\Recommendation\ReasonCode; use ModerationAPI\Core\Attributes\Api; use ModerationAPI\Core\Concerns\SdkModel; use ModerationAPI\Core\Concerns\SdkResponse; @@ -134,64 +146,134 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $insights - * @param list $policies - * @param list $errors + * @param Author|array{ + * id: string, + * block: Block|null, + * status: value-of, + * trust_level: TrustLevel, + * external_id?: string|null, + * }|null $author + * @param Content|array{ + * id: string, + * masked: bool, + * modified: string|array|array|null, + * } $content + * @param Evaluation|array{ + * flag_probability: float, + * flagged: bool, + * severity_score: float, + * unicode_spoofed?: bool|null, + * } $evaluation + * @param list|null, + * }|LanguageInsight|array{ + * id: 'language', probability: float, type: 'insight', value: string|null + * }> $insights + * @param Meta|array{ + * channel_key: string, + * status: value-of, + * timestamp: float, + * usage: float, + * processing_time?: string|null, + * } $meta + * @param list|null, + * labels?: list