From 21aefa3a5b1b78e9af4d716a38faedf7bd43bab4 Mon Sep 17 00:00:00 2001 From: winrid Date: Thu, 8 Jan 2026 18:44:16 -0800 Subject: [PATCH] Bump version to 1.2.0 --- .openapi-generator/FILES | 12 - README.md | 4 - docs/Api/DefaultApi.md | 8 +- docs/Model/CreateVote200Response.md | 16 - docs/Model/CreateVoteResponse.md | 9 - docs/Model/DeleteVote200Response.md | 16 - docs/Model/DeleteVoteResponse.md | 9 - lib/Api/DefaultApi.php | 32 +- lib/Model/CreateVote200Response.php | 657 ----------------------- lib/Model/CreateVoteResponse.php | 413 -------------- lib/Model/DeleteVote200Response.php | 657 ----------------------- lib/Model/DeleteVoteResponse.php | 413 -------------- openapi.json | 28 +- test/Model/CreateVote200ResponseTest.php | 154 ------ test/Model/CreateVoteResponseTest.php | 91 ---- test/Model/DeleteVote200ResponseTest.php | 154 ------ test/Model/DeleteVoteResponseTest.php | 91 ---- 17 files changed, 22 insertions(+), 2742 deletions(-) delete mode 100644 docs/Model/CreateVote200Response.md delete mode 100644 docs/Model/CreateVoteResponse.md delete mode 100644 docs/Model/DeleteVote200Response.md delete mode 100644 docs/Model/DeleteVoteResponse.md delete mode 100644 lib/Model/CreateVote200Response.php delete mode 100644 lib/Model/CreateVoteResponse.php delete mode 100644 lib/Model/DeleteVote200Response.php delete mode 100644 lib/Model/DeleteVoteResponse.php delete mode 100644 test/Model/CreateVote200ResponseTest.php delete mode 100644 test/Model/CreateVoteResponseTest.php delete mode 100644 test/Model/DeleteVote200ResponseTest.php delete mode 100644 test/Model/DeleteVoteResponseTest.php diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 2b7fc7a..795feac 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -108,8 +108,6 @@ docs/Model/CreateTenantUserBody.md docs/Model/CreateTenantUserResponse.md docs/Model/CreateUserBadge200Response.md docs/Model/CreateUserBadgeParams.md -docs/Model/CreateVote200Response.md -docs/Model/CreateVoteResponse.md docs/Model/CustomConfigParameters.md docs/Model/CustomEmailTemplate.md docs/Model/DeleteComment200Response.md @@ -124,8 +122,6 @@ docs/Model/DeleteHashTagRequest.md docs/Model/DeletePageAPIResponse.md docs/Model/DeleteSSOUserAPIResponse.md docs/Model/DeleteSubscriptionAPIResponse.md -docs/Model/DeleteVote200Response.md -docs/Model/DeleteVoteResponse.md docs/Model/DeletedCommentResultComment.md docs/Model/DigestEmailFrequency.md docs/Model/EmailTemplateDefinition.md @@ -455,8 +451,6 @@ lib/Model/CreateTenantUserBody.php lib/Model/CreateTenantUserResponse.php lib/Model/CreateUserBadge200Response.php lib/Model/CreateUserBadgeParams.php -lib/Model/CreateVote200Response.php -lib/Model/CreateVoteResponse.php lib/Model/CustomConfigParameters.php lib/Model/CustomEmailTemplate.php lib/Model/DeleteComment200Response.php @@ -471,8 +465,6 @@ lib/Model/DeleteHashTagRequest.php lib/Model/DeletePageAPIResponse.php lib/Model/DeleteSSOUserAPIResponse.php lib/Model/DeleteSubscriptionAPIResponse.php -lib/Model/DeleteVote200Response.php -lib/Model/DeleteVoteResponse.php lib/Model/DeletedCommentResultComment.php lib/Model/DigestEmailFrequency.php lib/Model/EmailTemplateDefinition.php @@ -801,8 +793,6 @@ test/Model/CreateTenantUserBodyTest.php test/Model/CreateTenantUserResponseTest.php test/Model/CreateUserBadge200ResponseTest.php test/Model/CreateUserBadgeParamsTest.php -test/Model/CreateVote200ResponseTest.php -test/Model/CreateVoteResponseTest.php test/Model/CustomConfigParametersTest.php test/Model/CustomEmailTemplateTest.php test/Model/DeleteComment200ResponseTest.php @@ -817,8 +807,6 @@ test/Model/DeleteHashTagRequestTest.php test/Model/DeletePageAPIResponseTest.php test/Model/DeleteSSOUserAPIResponseTest.php test/Model/DeleteSubscriptionAPIResponseTest.php -test/Model/DeleteVote200ResponseTest.php -test/Model/DeleteVoteResponseTest.php test/Model/DeletedCommentResultCommentTest.php test/Model/DigestEmailFrequencyTest.php test/Model/EmailTemplateDefinitionTest.php diff --git a/README.md b/README.md index fedc46d..94bc24c 100644 --- a/README.md +++ b/README.md @@ -329,8 +329,6 @@ Class | Method | HTTP request | Description - [CreateTenantUserResponse](docs/Model/CreateTenantUserResponse.md) - [CreateUserBadge200Response](docs/Model/CreateUserBadge200Response.md) - [CreateUserBadgeParams](docs/Model/CreateUserBadgeParams.md) -- [CreateVote200Response](docs/Model/CreateVote200Response.md) -- [CreateVoteResponse](docs/Model/CreateVoteResponse.md) - [CustomConfigParameters](docs/Model/CustomConfigParameters.md) - [CustomEmailTemplate](docs/Model/CustomEmailTemplate.md) - [DeleteComment200Response](docs/Model/DeleteComment200Response.md) @@ -345,8 +343,6 @@ Class | Method | HTTP request | Description - [DeletePageAPIResponse](docs/Model/DeletePageAPIResponse.md) - [DeleteSSOUserAPIResponse](docs/Model/DeleteSSOUserAPIResponse.md) - [DeleteSubscriptionAPIResponse](docs/Model/DeleteSubscriptionAPIResponse.md) -- [DeleteVote200Response](docs/Model/DeleteVote200Response.md) -- [DeleteVoteResponse](docs/Model/DeleteVoteResponse.md) - [DeletedCommentResultComment](docs/Model/DeletedCommentResultComment.md) - [DigestEmailFrequency](docs/Model/DigestEmailFrequency.md) - [EmailTemplateDefinition](docs/Model/EmailTemplateDefinition.md) diff --git a/docs/Api/DefaultApi.md b/docs/Api/DefaultApi.md index ea167b8..f687fe2 100644 --- a/docs/Api/DefaultApi.md +++ b/docs/Api/DefaultApi.md @@ -1406,7 +1406,7 @@ try { ## `createVote()` ```php -createVote($tenant_id, $comment_id, $direction, $user_id, $anon_user_id): \FastComments\Client\Model\CreateVote200Response +createVote($tenant_id, $comment_id, $direction, $user_id, $anon_user_id): \FastComments\Client\Model\VoteComment200Response ``` @@ -1456,7 +1456,7 @@ try { ### Return type -[**\FastComments\Client\Model\CreateVote200Response**](../Model/CreateVote200Response.md) +[**\FastComments\Client\Model\VoteComment200Response**](../Model/VoteComment200Response.md) ### Authorization @@ -2550,7 +2550,7 @@ try { ## `deleteVote()` ```php -deleteVote($tenant_id, $id, $edit_key): \FastComments\Client\Model\DeleteVote200Response +deleteVote($tenant_id, $id, $edit_key): \FastComments\Client\Model\DeleteCommentVote200Response ``` @@ -2596,7 +2596,7 @@ try { ### Return type -[**\FastComments\Client\Model\DeleteVote200Response**](../Model/DeleteVote200Response.md) +[**\FastComments\Client\Model\DeleteCommentVote200Response**](../Model/DeleteCommentVote200Response.md) ### Authorization diff --git a/docs/Model/CreateVote200Response.md b/docs/Model/CreateVote200Response.md deleted file mode 100644 index 96f5bc9..0000000 --- a/docs/Model/CreateVote200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# # CreateVote200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/CreateVoteResponse.md b/docs/Model/CreateVoteResponse.md deleted file mode 100644 index d8ab6f5..0000000 --- a/docs/Model/CreateVoteResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # CreateVoteResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteVote200Response.md b/docs/Model/DeleteVote200Response.md deleted file mode 100644 index c2f27c1..0000000 --- a/docs/Model/DeleteVote200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# # DeleteVote200Response - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | -**reason** | **string** | | -**code** | **string** | | -**secondary_code** | **string** | | [optional] -**banned_until** | **int** | | [optional] -**max_character_length** | **int** | | [optional] -**translated_error** | **string** | | [optional] -**custom_config** | [**\FastComments\Client\Model\CustomConfigParameters**](CustomConfigParameters.md) | | [optional] - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/DeleteVoteResponse.md b/docs/Model/DeleteVoteResponse.md deleted file mode 100644 index 36cf43b..0000000 --- a/docs/Model/DeleteVoteResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# # DeleteVoteResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | [**\FastComments\Client\Model\APIStatus**](APIStatus.md) | | - -[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/DefaultApi.php b/lib/Api/DefaultApi.php index 5111a46..a5e86d1 100644 --- a/lib/Api/DefaultApi.php +++ b/lib/Api/DefaultApi.php @@ -7424,7 +7424,7 @@ public function createUserBadgeRequest($tenant_id, $create_user_badge_params, st * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\CreateVote200Response + * @return \FastComments\Client\Model\VoteComment200Response */ public function createVote($tenant_id, $comment_id, $direction, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['createVote'][0]) { @@ -7446,7 +7446,7 @@ public function createVote($tenant_id, $comment_id, $direction, $user_id = null, * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\CreateVote200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\VoteComment200Response, HTTP status code, HTTP response headers (array of strings) */ public function createVoteWithHttpInfo($tenant_id, $comment_id, $direction, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['createVote'][0]) { @@ -7477,11 +7477,11 @@ public function createVoteWithHttpInfo($tenant_id, $comment_id, $direction, $use switch($statusCode) { case 200: - if ('\FastComments\Client\Model\CreateVote200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\VoteComment200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\CreateVote200Response' !== 'string') { + if ('\FastComments\Client\Model\VoteComment200Response' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -7499,7 +7499,7 @@ public function createVoteWithHttpInfo($tenant_id, $comment_id, $direction, $use } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\CreateVote200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\VoteComment200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -7518,7 +7518,7 @@ public function createVoteWithHttpInfo($tenant_id, $comment_id, $direction, $use ); } - $returnType = '\FastComments\Client\Model\CreateVote200Response'; + $returnType = '\FastComments\Client\Model\VoteComment200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -7551,7 +7551,7 @@ public function createVoteWithHttpInfo($tenant_id, $comment_id, $direction, $use case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\CreateVote200Response', + '\FastComments\Client\Model\VoteComment200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -7603,7 +7603,7 @@ function ($response) { */ public function createVoteAsyncWithHttpInfo($tenant_id, $comment_id, $direction, $user_id = null, $anon_user_id = null, string $contentType = self::contentTypes['createVote'][0]) { - $returnType = '\FastComments\Client\Model\CreateVote200Response'; + $returnType = '\FastComments\Client\Model\VoteComment200Response'; $request = $this->createVoteRequest($tenant_id, $comment_id, $direction, $user_id, $anon_user_id, $contentType); return $this->client @@ -13648,7 +13648,7 @@ public function deleteUserBadgeRequest($tenant_id, $id, string $contentType = se * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \FastComments\Client\Model\DeleteVote200Response + * @return \FastComments\Client\Model\DeleteCommentVote200Response */ public function deleteVote($tenant_id, $id, $edit_key = null, string $contentType = self::contentTypes['deleteVote'][0]) { @@ -13668,7 +13668,7 @@ public function deleteVote($tenant_id, $id, $edit_key = null, string $contentTyp * * @throws \FastComments\Client\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \FastComments\Client\Model\DeleteVote200Response, HTTP status code, HTTP response headers (array of strings) + * @return array of \FastComments\Client\Model\DeleteCommentVote200Response, HTTP status code, HTTP response headers (array of strings) */ public function deleteVoteWithHttpInfo($tenant_id, $id, $edit_key = null, string $contentType = self::contentTypes['deleteVote'][0]) { @@ -13699,11 +13699,11 @@ public function deleteVoteWithHttpInfo($tenant_id, $id, $edit_key = null, string switch($statusCode) { case 200: - if ('\FastComments\Client\Model\DeleteVote200Response' === '\SplFileObject') { + if ('\FastComments\Client\Model\DeleteCommentVote200Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\FastComments\Client\Model\DeleteVote200Response' !== 'string') { + if ('\FastComments\Client\Model\DeleteCommentVote200Response' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -13721,7 +13721,7 @@ public function deleteVoteWithHttpInfo($tenant_id, $id, $edit_key = null, string } return [ - ObjectSerializer::deserialize($content, '\FastComments\Client\Model\DeleteVote200Response', []), + ObjectSerializer::deserialize($content, '\FastComments\Client\Model\DeleteCommentVote200Response', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -13740,7 +13740,7 @@ public function deleteVoteWithHttpInfo($tenant_id, $id, $edit_key = null, string ); } - $returnType = '\FastComments\Client\Model\DeleteVote200Response'; + $returnType = '\FastComments\Client\Model\DeleteCommentVote200Response'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -13773,7 +13773,7 @@ public function deleteVoteWithHttpInfo($tenant_id, $id, $edit_key = null, string case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\FastComments\Client\Model\DeleteVote200Response', + '\FastComments\Client\Model\DeleteCommentVote200Response', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13821,7 +13821,7 @@ function ($response) { */ public function deleteVoteAsyncWithHttpInfo($tenant_id, $id, $edit_key = null, string $contentType = self::contentTypes['deleteVote'][0]) { - $returnType = '\FastComments\Client\Model\DeleteVote200Response'; + $returnType = '\FastComments\Client\Model\DeleteCommentVote200Response'; $request = $this->deleteVoteRequest($tenant_id, $id, $edit_key, $contentType); return $this->client diff --git a/lib/Model/CreateVote200Response.php b/lib/Model/CreateVote200Response.php deleted file mode 100644 index 4be99f9..0000000 --- a/lib/Model/CreateVote200Response.php +++ /dev/null @@ -1,657 +0,0 @@ - - */ -class CreateVote200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateVote_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/CreateVoteResponse.php b/lib/Model/CreateVoteResponse.php deleted file mode 100644 index 08f5431..0000000 --- a/lib/Model/CreateVoteResponse.php +++ /dev/null @@ -1,413 +0,0 @@ - - */ -class CreateVoteResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'CreateVoteResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/DeleteVote200Response.php b/lib/Model/DeleteVote200Response.php deleted file mode 100644 index ffc913b..0000000 --- a/lib/Model/DeleteVote200Response.php +++ /dev/null @@ -1,657 +0,0 @@ - - */ -class DeleteVote200Response implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'DeleteVote_200_response'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus', - 'reason' => 'string', - 'code' => 'string', - 'secondary_code' => 'string', - 'banned_until' => 'int', - 'max_character_length' => 'int', - 'translated_error' => 'string', - 'custom_config' => '\FastComments\Client\Model\CustomConfigParameters' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null, - 'reason' => null, - 'code' => null, - 'secondary_code' => null, - 'banned_until' => 'int64', - 'max_character_length' => 'int32', - 'translated_error' => null, - 'custom_config' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false, - 'reason' => false, - 'code' => false, - 'secondary_code' => false, - 'banned_until' => false, - 'max_character_length' => false, - 'translated_error' => false, - 'custom_config' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status', - 'reason' => 'reason', - 'code' => 'code', - 'secondary_code' => 'secondaryCode', - 'banned_until' => 'bannedUntil', - 'max_character_length' => 'maxCharacterLength', - 'translated_error' => 'translatedError', - 'custom_config' => 'customConfig' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus', - 'reason' => 'setReason', - 'code' => 'setCode', - 'secondary_code' => 'setSecondaryCode', - 'banned_until' => 'setBannedUntil', - 'max_character_length' => 'setMaxCharacterLength', - 'translated_error' => 'setTranslatedError', - 'custom_config' => 'setCustomConfig' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus', - 'reason' => 'getReason', - 'code' => 'getCode', - 'secondary_code' => 'getSecondaryCode', - 'banned_until' => 'getBannedUntil', - 'max_character_length' => 'getMaxCharacterLength', - 'translated_error' => 'getTranslatedError', - 'custom_config' => 'getCustomConfig' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('reason', $data ?? [], null); - $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('secondary_code', $data ?? [], null); - $this->setIfExists('banned_until', $data ?? [], null); - $this->setIfExists('max_character_length', $data ?? [], null); - $this->setIfExists('translated_error', $data ?? [], null); - $this->setIfExists('custom_config', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - if ($this->container['reason'] === null) { - $invalidProperties[] = "'reason' can't be null"; - } - if ($this->container['code'] === null) { - $invalidProperties[] = "'code' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets reason - * - * @return string - */ - public function getReason() - { - return $this->container['reason']; - } - - /** - * Sets reason - * - * @param string $reason reason - * - * @return self - */ - public function setReason($reason) - { - if (is_null($reason)) { - throw new \InvalidArgumentException('non-nullable reason cannot be null'); - } - $this->container['reason'] = $reason; - - return $this; - } - - /** - * Gets code - * - * @return string - */ - public function getCode() - { - return $this->container['code']; - } - - /** - * Sets code - * - * @param string $code code - * - * @return self - */ - public function setCode($code) - { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); - } - $this->container['code'] = $code; - - return $this; - } - - /** - * Gets secondary_code - * - * @return string|null - */ - public function getSecondaryCode() - { - return $this->container['secondary_code']; - } - - /** - * Sets secondary_code - * - * @param string|null $secondary_code secondary_code - * - * @return self - */ - public function setSecondaryCode($secondary_code) - { - if (is_null($secondary_code)) { - throw new \InvalidArgumentException('non-nullable secondary_code cannot be null'); - } - $this->container['secondary_code'] = $secondary_code; - - return $this; - } - - /** - * Gets banned_until - * - * @return int|null - */ - public function getBannedUntil() - { - return $this->container['banned_until']; - } - - /** - * Sets banned_until - * - * @param int|null $banned_until banned_until - * - * @return self - */ - public function setBannedUntil($banned_until) - { - if (is_null($banned_until)) { - throw new \InvalidArgumentException('non-nullable banned_until cannot be null'); - } - $this->container['banned_until'] = $banned_until; - - return $this; - } - - /** - * Gets max_character_length - * - * @return int|null - */ - public function getMaxCharacterLength() - { - return $this->container['max_character_length']; - } - - /** - * Sets max_character_length - * - * @param int|null $max_character_length max_character_length - * - * @return self - */ - public function setMaxCharacterLength($max_character_length) - { - if (is_null($max_character_length)) { - throw new \InvalidArgumentException('non-nullable max_character_length cannot be null'); - } - $this->container['max_character_length'] = $max_character_length; - - return $this; - } - - /** - * Gets translated_error - * - * @return string|null - */ - public function getTranslatedError() - { - return $this->container['translated_error']; - } - - /** - * Sets translated_error - * - * @param string|null $translated_error translated_error - * - * @return self - */ - public function setTranslatedError($translated_error) - { - if (is_null($translated_error)) { - throw new \InvalidArgumentException('non-nullable translated_error cannot be null'); - } - $this->container['translated_error'] = $translated_error; - - return $this; - } - - /** - * Gets custom_config - * - * @return \FastComments\Client\Model\CustomConfigParameters|null - */ - public function getCustomConfig() - { - return $this->container['custom_config']; - } - - /** - * Sets custom_config - * - * @param \FastComments\Client\Model\CustomConfigParameters|null $custom_config custom_config - * - * @return self - */ - public function setCustomConfig($custom_config) - { - if (is_null($custom_config)) { - throw new \InvalidArgumentException('non-nullable custom_config cannot be null'); - } - $this->container['custom_config'] = $custom_config; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/lib/Model/DeleteVoteResponse.php b/lib/Model/DeleteVoteResponse.php deleted file mode 100644 index efc8d96..0000000 --- a/lib/Model/DeleteVoteResponse.php +++ /dev/null @@ -1,413 +0,0 @@ - - */ -class DeleteVoteResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'DeleteVoteResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'status' => '\FastComments\Client\Model\APIStatus' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'status' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'status' => false - ]; - - /** - * If a nullable field gets set to null, insert it here - * - * @var boolean[] - */ - protected array $openAPINullablesSetToNull = []; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPITypes() - { - return self::$openAPITypes; - } - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @return array - */ - public static function openAPIFormats() - { - return self::$openAPIFormats; - } - - /** - * Array of nullable properties - * - * @return array - */ - protected static function openAPINullables(): array - { - return self::$openAPINullables; - } - - /** - * Array of nullable field names deliberately set to null - * - * @return boolean[] - */ - private function getOpenAPINullablesSetToNull(): array - { - return $this->openAPINullablesSetToNull; - } - - /** - * Setter - Array of nullable field names deliberately set to null - * - * @param boolean[] $openAPINullablesSetToNull - */ - private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void - { - $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; - } - - /** - * Checks if a property is nullable - * - * @param string $property - * @return bool - */ - public static function isNullable(string $property): bool - { - return self::openAPINullables()[$property] ?? false; - } - - /** - * Checks if a nullable property is set to null. - * - * @param string $property - * @return bool - */ - public function isNullableSetToNull(string $property): bool - { - return in_array($property, $this->getOpenAPINullablesSetToNull(), true); - } - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @var string[] - */ - protected static $attributeMap = [ - 'status' => 'status' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'status' => 'setStatus' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'status' => 'getStatus' - ]; - - /** - * Array of attributes where the key is the local name, - * and the value is the original name - * - * @return array - */ - public static function attributeMap() - { - return self::$attributeMap; - } - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @return array - */ - public static function setters() - { - return self::$setters; - } - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @return array - */ - public static function getters() - { - return self::$getters; - } - - /** - * The original name of the model. - * - * @return string - */ - public function getModelName() - { - return self::$openAPIModelName; - } - - - /** - * Associative array for storing property values - * - * @var mixed[] - */ - protected $container = []; - - /** - * Constructor - * - * @param mixed[]|null $data Associated array of property values - * initializing the model - */ - public function __construct(?array $data = null) - { - $this->setIfExists('status', $data ?? [], null); - } - - /** - * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName - * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the - * $this->openAPINullablesSetToNull array - * - * @param string $variableName - * @param array $fields - * @param mixed $defaultValue - */ - private function setIfExists(string $variableName, array $fields, $defaultValue): void - { - if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { - $this->openAPINullablesSetToNull[] = $variableName; - } - - $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; - } - - /** - * Show all the invalid properties with reasons. - * - * @return array invalid properties with reasons - */ - public function listInvalidProperties() - { - $invalidProperties = []; - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - return $invalidProperties; - } - - /** - * Validate all the properties in the model - * return true if all passed - * - * @return bool True if all properties are valid - */ - public function valid() - { - return count($this->listInvalidProperties()) === 0; - } - - - /** - * Gets status - * - * @return \FastComments\Client\Model\APIStatus - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param \FastComments\Client\Model\APIStatus $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $this->container['status'] = $status; - - return $this; - } - /** - * Returns true if offset exists. False otherwise. - * - * @param integer $offset Offset - * - * @return boolean - */ - public function offsetExists($offset): bool - { - return isset($this->container[$offset]); - } - - /** - * Gets offset. - * - * @param integer $offset Offset - * - * @return mixed|null - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) - { - return $this->container[$offset] ?? null; - } - - /** - * Sets value based on offset. - * - * @param int|null $offset Offset - * @param mixed $value Value to be set - * - * @return void - */ - public function offsetSet($offset, $value): void - { - if (is_null($offset)) { - $this->container[] = $value; - } else { - $this->container[$offset] = $value; - } - } - - /** - * Unsets offset. - * - * @param integer $offset Offset - * - * @return void - */ - public function offsetUnset($offset): void - { - unset($this->container[$offset]); - } - - /** - * Serializes the object to a value that can be serialized natively by json_encode(). - * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed Returns data which can be serialized by json_encode(), which is a value - * of any type other than a resource. - */ - #[\ReturnTypeWillChange] - public function jsonSerialize() - { - return ObjectSerializer::sanitizeForSerialization($this); - } - - /** - * Gets the string presentation of the object - * - * @return string - */ - public function __toString() - { - return json_encode( - ObjectSerializer::sanitizeForSerialization($this), - JSON_PRETTY_PRINT - ); - } - - /** - * Gets a header-safe presentation of the object - * - * @return string - */ - public function toHeaderValue() - { - return json_encode(ObjectSerializer::sanitizeForSerialization($this)); - } -} - - diff --git a/openapi.json b/openapi.json index 16d5bf6..d56ce6c 100644 --- a/openapi.json +++ b/openapi.json @@ -3521,30 +3521,6 @@ "type": "object", "additionalProperties": false }, - "CreateVoteResponse": { - "properties": { - "status": { - "$ref": "#/components/schemas/APIStatus" - } - }, - "required": [ - "status" - ], - "type": "object", - "additionalProperties": {} - }, - "DeleteVoteResponse": { - "properties": { - "status": { - "$ref": "#/components/schemas/APIStatus" - } - }, - "required": [ - "status" - ], - "type": "object", - "additionalProperties": {} - }, "DigestEmailFrequency": { "enum": [ -1, @@ -12399,7 +12375,7 @@ "schema": { "anyOf": [ { - "$ref": "#/components/schemas/CreateVoteResponse" + "$ref": "#/components/schemas/VoteResponse" }, { "$ref": "#/components/schemas/APIError" @@ -12537,7 +12513,7 @@ "schema": { "anyOf": [ { - "$ref": "#/components/schemas/DeleteVoteResponse" + "$ref": "#/components/schemas/VoteDeleteResponse" }, { "$ref": "#/components/schemas/APIError" diff --git a/test/Model/CreateVote200ResponseTest.php b/test/Model/CreateVote200ResponseTest.php deleted file mode 100644 index f475e14..0000000 --- a/test/Model/CreateVote200ResponseTest.php +++ /dev/null @@ -1,154 +0,0 @@ -