From 0fe0198f806d7da6cfee89d51eec19184ec4cd85 Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Tue, 18 Aug 2026 20:19:10 +0000 Subject: [PATCH] chore: regenerate SDK --- generated/Api/AppIconBadgesApi.php | 51 +- .../Model/AppIconBadgeCountUpdateError.php | 748 ++++++++++++++++++ .../Model/AppIconBadgeCountUpdateResponse.php | 88 ++- generated/Model/LiveActivityLimitError.php | 82 +- .../Model/SendPushNotification429Response.php | 82 +- .../UpdateAppIconBadgeCount422Response.php | 748 ++++++++++++++++++ 6 files changed, 1769 insertions(+), 30 deletions(-) create mode 100644 generated/Model/AppIconBadgeCountUpdateError.php create mode 100644 generated/Model/UpdateAppIconBadgeCount422Response.php diff --git a/generated/Api/AppIconBadgesApi.php b/generated/Api/AppIconBadgesApi.php index 2260dd3..b49ac20 100644 --- a/generated/Api/AppIconBadgesApi.php +++ b/generated/Api/AppIconBadgesApi.php @@ -132,7 +132,7 @@ public function getConfig() * * @throws \ActivitySmith\Generated\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \ActivitySmith\Generated\Model\AppIconBadgeCountUpdateResponse|\ActivitySmith\Generated\Model\BadRequestError|\ActivitySmith\Generated\Model\ForbiddenError|\ActivitySmith\Generated\Model\NoRecipientsError|\ActivitySmith\Generated\Model\RateLimitError + * @return \ActivitySmith\Generated\Model\AppIconBadgeCountUpdateResponse|\ActivitySmith\Generated\Model\BadRequestError|\ActivitySmith\Generated\Model\ForbiddenError|\ActivitySmith\Generated\Model\UpdateAppIconBadgeCount422Response|\ActivitySmith\Generated\Model\AppIconBadgeCountUpdateError|\ActivitySmith\Generated\Model\RateLimitError */ public function updateAppIconBadgeCount($appIconBadgeCountUpdateRequest, string $contentType = self::contentTypes['updateAppIconBadgeCount'][0]) { @@ -150,7 +150,7 @@ public function updateAppIconBadgeCount($appIconBadgeCountUpdateRequest, string * * @throws \ActivitySmith\Generated\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \ActivitySmith\Generated\Model\AppIconBadgeCountUpdateResponse|\ActivitySmith\Generated\Model\BadRequestError|\ActivitySmith\Generated\Model\ForbiddenError|\ActivitySmith\Generated\Model\NoRecipientsError|\ActivitySmith\Generated\Model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \ActivitySmith\Generated\Model\AppIconBadgeCountUpdateResponse|\ActivitySmith\Generated\Model\BadRequestError|\ActivitySmith\Generated\Model\ForbiddenError|\ActivitySmith\Generated\Model\UpdateAppIconBadgeCount422Response|\ActivitySmith\Generated\Model\AppIconBadgeCountUpdateError|\ActivitySmith\Generated\Model\RateLimitError, HTTP status code, HTTP response headers (array of strings) */ public function updateAppIconBadgeCountWithHttpInfo($appIconBadgeCountUpdateRequest, string $contentType = self::contentTypes['updateAppIconBadgeCount'][0]) { @@ -273,12 +273,12 @@ public function updateAppIconBadgeCountWithHttpInfo($appIconBadgeCountUpdateRequ $response->getStatusCode(), $response->getHeaders() ]; - case 404: - if ('\ActivitySmith\Generated\Model\NoRecipientsError' === '\SplFileObject') { + case 422: + if ('\ActivitySmith\Generated\Model\UpdateAppIconBadgeCount422Response' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\ActivitySmith\Generated\Model\NoRecipientsError' !== 'string') { + if ('\ActivitySmith\Generated\Model\UpdateAppIconBadgeCount422Response' !== 'string') { try { $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); } catch (\JsonException $exception) { @@ -296,7 +296,34 @@ public function updateAppIconBadgeCountWithHttpInfo($appIconBadgeCountUpdateRequ } return [ - ObjectSerializer::deserialize($content, '\ActivitySmith\Generated\Model\NoRecipientsError', []), + ObjectSerializer::deserialize($content, '\ActivitySmith\Generated\Model\UpdateAppIconBadgeCount422Response', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 502: + if ('\ActivitySmith\Generated\Model\AppIconBadgeCountUpdateError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\ActivitySmith\Generated\Model\AppIconBadgeCountUpdateError' !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, '\ActivitySmith\Generated\Model\AppIconBadgeCountUpdateError', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -383,10 +410,18 @@ public function updateAppIconBadgeCountWithHttpInfo($appIconBadgeCountUpdateRequ ); $e->setResponseObject($data); break; - case 404: + case 422: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\ActivitySmith\Generated\Model\UpdateAppIconBadgeCount422Response', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 502: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\ActivitySmith\Generated\Model\NoRecipientsError', + '\ActivitySmith\Generated\Model\AppIconBadgeCountUpdateError', $e->getResponseHeaders() ); $e->setResponseObject($data); diff --git a/generated/Model/AppIconBadgeCountUpdateError.php b/generated/Model/AppIconBadgeCountUpdateError.php new file mode 100644 index 0000000..f88711a --- /dev/null +++ b/generated/Model/AppIconBadgeCountUpdateError.php @@ -0,0 +1,748 @@ + + */ +class AppIconBadgeCountUpdateError implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AppIconBadgeCountUpdateError'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error' => 'string', + 'code' => 'string', + 'message' => 'string', + 'badge' => 'int', + 'devicesTargeted' => 'int', + 'devicesUpdated' => 'int', + 'usersUpdated' => 'int', + 'devicesNotified' => 'int', + 'effectiveChannelSlugs' => 'string[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error' => null, + 'code' => null, + 'message' => null, + 'badge' => null, + 'devicesTargeted' => null, + 'devicesUpdated' => null, + 'usersUpdated' => null, + 'devicesNotified' => null, + 'effectiveChannelSlugs' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'error' => false, + 'code' => false, + 'message' => false, + 'badge' => false, + 'devicesTargeted' => false, + 'devicesUpdated' => false, + 'usersUpdated' => false, + 'devicesNotified' => false, + 'effectiveChannelSlugs' => 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 = [ + 'error' => 'error', + 'code' => 'code', + 'message' => 'message', + 'badge' => 'badge', + 'devicesTargeted' => 'devices_targeted', + 'devicesUpdated' => 'devices_updated', + 'usersUpdated' => 'users_updated', + 'devicesNotified' => 'devices_notified', + 'effectiveChannelSlugs' => 'effective_channel_slugs' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error' => 'setError', + 'code' => 'setCode', + 'message' => 'setMessage', + 'badge' => 'setBadge', + 'devicesTargeted' => 'setDevicesTargeted', + 'devicesUpdated' => 'setDevicesUpdated', + 'usersUpdated' => 'setUsersUpdated', + 'devicesNotified' => 'setDevicesNotified', + 'effectiveChannelSlugs' => 'setEffectiveChannelSlugs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error' => 'getError', + 'code' => 'getCode', + 'message' => 'getMessage', + 'badge' => 'getBadge', + 'devicesTargeted' => 'getDevicesTargeted', + 'devicesUpdated' => 'getDevicesUpdated', + 'usersUpdated' => 'getUsersUpdated', + 'devicesNotified' => 'getDevicesNotified', + 'effectiveChannelSlugs' => 'getEffectiveChannelSlugs' + ]; + + /** + * 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; + } + + public const CODE_DEVICE_DISCONNECTED = 'badge_device_disconnected'; + public const CODE_UPDATE_FAILED = 'badge_update_failed'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCodeAllowableValues() + { + return [ + self::CODE_DEVICE_DISCONNECTED, + self::CODE_UPDATE_FAILED, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('error', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('badge', $data ?? [], null); + $this->setIfExists('devicesTargeted', $data ?? [], null); + $this->setIfExists('devicesUpdated', $data ?? [], null); + $this->setIfExists('usersUpdated', $data ?? [], null); + $this->setIfExists('devicesNotified', $data ?? [], null); + $this->setIfExists('effectiveChannelSlugs', $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['error'] === null) { + $invalidProperties[] = "'error' can't be null"; + } + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'code', must be one of '%s'", + $this->container['code'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if ($this->container['badge'] === null) { + $invalidProperties[] = "'badge' can't be null"; + } + if (($this->container['badge'] > 2147483647)) { + $invalidProperties[] = "invalid value for 'badge', must be smaller than or equal to 2147483647."; + } + + if (($this->container['badge'] < 0)) { + $invalidProperties[] = "invalid value for 'badge', must be bigger than or equal to 0."; + } + + if ($this->container['devicesUpdated'] === null) { + $invalidProperties[] = "'devicesUpdated' 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 error + * + * @return string + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string $error error + * + * @return self + */ + public function setError($error) + { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; + + 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'); + } + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'code', must be one of '%s'", + $code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets badge + * + * @return int + */ + public function getBadge() + { + return $this->container['badge']; + } + + /** + * Sets badge + * + * @param int $badge badge + * + * @return self + */ + public function setBadge($badge) + { + if (is_null($badge)) { + throw new \InvalidArgumentException('non-nullable badge cannot be null'); + } + + if (($badge > 2147483647)) { + throw new \InvalidArgumentException('invalid value for $badge when calling AppIconBadgeCountUpdateError., must be smaller than or equal to 2147483647.'); + } + if (($badge < 0)) { + throw new \InvalidArgumentException('invalid value for $badge when calling AppIconBadgeCountUpdateError., must be bigger than or equal to 0.'); + } + + $this->container['badge'] = $badge; + + return $this; + } + + /** + * Gets devicesTargeted + * + * @return int|null + */ + public function getDevicesTargeted() + { + return $this->container['devicesTargeted']; + } + + /** + * Sets devicesTargeted + * + * @param int|null $devicesTargeted devicesTargeted + * + * @return self + */ + public function setDevicesTargeted($devicesTargeted) + { + if (is_null($devicesTargeted)) { + throw new \InvalidArgumentException('non-nullable devicesTargeted cannot be null'); + } + $this->container['devicesTargeted'] = $devicesTargeted; + + return $this; + } + + /** + * Gets devicesUpdated + * + * @return int + */ + public function getDevicesUpdated() + { + return $this->container['devicesUpdated']; + } + + /** + * Sets devicesUpdated + * + * @param int $devicesUpdated devicesUpdated + * + * @return self + */ + public function setDevicesUpdated($devicesUpdated) + { + if (is_null($devicesUpdated)) { + throw new \InvalidArgumentException('non-nullable devicesUpdated cannot be null'); + } + $this->container['devicesUpdated'] = $devicesUpdated; + + return $this; + } + + /** + * Gets usersUpdated + * + * @return int|null + */ + public function getUsersUpdated() + { + return $this->container['usersUpdated']; + } + + /** + * Sets usersUpdated + * + * @param int|null $usersUpdated usersUpdated + * + * @return self + */ + public function setUsersUpdated($usersUpdated) + { + if (is_null($usersUpdated)) { + throw new \InvalidArgumentException('non-nullable usersUpdated cannot be null'); + } + $this->container['usersUpdated'] = $usersUpdated; + + return $this; + } + + /** + * Gets devicesNotified + * + * @return int|null + * @deprecated + */ + public function getDevicesNotified() + { + return $this->container['devicesNotified']; + } + + /** + * Sets devicesNotified + * + * @param int|null $devicesNotified Deprecated compatibility alias for devices_updated. + * + * @return self + * @deprecated + */ + public function setDevicesNotified($devicesNotified) + { + if (is_null($devicesNotified)) { + throw new \InvalidArgumentException('non-nullable devicesNotified cannot be null'); + } + $this->container['devicesNotified'] = $devicesNotified; + + return $this; + } + + /** + * Gets effectiveChannelSlugs + * + * @return string[]|null + */ + public function getEffectiveChannelSlugs() + { + return $this->container['effectiveChannelSlugs']; + } + + /** + * Sets effectiveChannelSlugs + * + * @param string[]|null $effectiveChannelSlugs effectiveChannelSlugs + * + * @return self + */ + public function setEffectiveChannelSlugs($effectiveChannelSlugs) + { + if (is_null($effectiveChannelSlugs)) { + throw new \InvalidArgumentException('non-nullable effectiveChannelSlugs cannot be null'); + } + $this->container['effectiveChannelSlugs'] = $effectiveChannelSlugs; + + 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/generated/Model/AppIconBadgeCountUpdateResponse.php b/generated/Model/AppIconBadgeCountUpdateResponse.php index 96a06e4..2a526ac 100644 --- a/generated/Model/AppIconBadgeCountUpdateResponse.php +++ b/generated/Model/AppIconBadgeCountUpdateResponse.php @@ -59,6 +59,8 @@ class AppIconBadgeCountUpdateResponse implements ModelInterface, ArrayAccess, \J protected static $openAPITypes = [ 'success' => 'bool', 'badge' => 'int', + 'devicesUpdated' => 'int', + 'usersUpdated' => 'int', 'devicesNotified' => 'int', 'usersNotified' => 'int', 'effectiveChannelSlugs' => 'string[]', @@ -75,6 +77,8 @@ class AppIconBadgeCountUpdateResponse implements ModelInterface, ArrayAccess, \J protected static $openAPIFormats = [ 'success' => null, 'badge' => null, + 'devicesUpdated' => null, + 'usersUpdated' => null, 'devicesNotified' => null, 'usersNotified' => null, 'effectiveChannelSlugs' => null, @@ -89,6 +93,8 @@ class AppIconBadgeCountUpdateResponse implements ModelInterface, ArrayAccess, \J protected static array $openAPINullables = [ 'success' => false, 'badge' => false, + 'devicesUpdated' => false, + 'usersUpdated' => false, 'devicesNotified' => false, 'usersNotified' => false, 'effectiveChannelSlugs' => false, @@ -183,6 +189,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'success' => 'success', 'badge' => 'badge', + 'devicesUpdated' => 'devices_updated', + 'usersUpdated' => 'users_updated', 'devicesNotified' => 'devices_notified', 'usersNotified' => 'users_notified', 'effectiveChannelSlugs' => 'effective_channel_slugs', @@ -197,6 +205,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'success' => 'setSuccess', 'badge' => 'setBadge', + 'devicesUpdated' => 'setDevicesUpdated', + 'usersUpdated' => 'setUsersUpdated', 'devicesNotified' => 'setDevicesNotified', 'usersNotified' => 'setUsersNotified', 'effectiveChannelSlugs' => 'setEffectiveChannelSlugs', @@ -211,6 +221,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'success' => 'getSuccess', 'badge' => 'getBadge', + 'devicesUpdated' => 'getDevicesUpdated', + 'usersUpdated' => 'getUsersUpdated', 'devicesNotified' => 'getDevicesNotified', 'usersNotified' => 'getUsersNotified', 'effectiveChannelSlugs' => 'getEffectiveChannelSlugs', @@ -276,6 +288,8 @@ public function __construct(array $data = null) { $this->setIfExists('success', $data ?? [], null); $this->setIfExists('badge', $data ?? [], null); + $this->setIfExists('devicesUpdated', $data ?? [], null); + $this->setIfExists('usersUpdated', $data ?? [], null); $this->setIfExists('devicesNotified', $data ?? [], null); $this->setIfExists('usersNotified', $data ?? [], null); $this->setIfExists('effectiveChannelSlugs', $data ?? [], null); @@ -323,11 +337,11 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'badge', must be bigger than or equal to 0."; } - if ($this->container['devicesNotified'] === null) { - $invalidProperties[] = "'devicesNotified' can't be null"; + if ($this->container['devicesUpdated'] === null) { + $invalidProperties[] = "'devicesUpdated' can't be null"; } - if ($this->container['usersNotified'] === null) { - $invalidProperties[] = "'usersNotified' can't be null"; + if ($this->container['usersUpdated'] === null) { + $invalidProperties[] = "'usersUpdated' can't be null"; } if ($this->container['effectiveChannelSlugs'] === null) { $invalidProperties[] = "'effectiveChannelSlugs' can't be null"; @@ -413,10 +427,65 @@ public function setBadge($badge) } /** - * Gets devicesNotified + * Gets devicesUpdated + * + * @return int + */ + public function getDevicesUpdated() + { + return $this->container['devicesUpdated']; + } + + /** + * Sets devicesUpdated + * + * @param int $devicesUpdated Number of devices whose App Icon Badge Count was updated. + * + * @return self + */ + public function setDevicesUpdated($devicesUpdated) + { + if (is_null($devicesUpdated)) { + throw new \InvalidArgumentException('non-nullable devicesUpdated cannot be null'); + } + $this->container['devicesUpdated'] = $devicesUpdated; + + return $this; + } + + /** + * Gets usersUpdated * * @return int */ + public function getUsersUpdated() + { + return $this->container['usersUpdated']; + } + + /** + * Sets usersUpdated + * + * @param int $usersUpdated Number of account users with at least one updated device. + * + * @return self + */ + public function setUsersUpdated($usersUpdated) + { + if (is_null($usersUpdated)) { + throw new \InvalidArgumentException('non-nullable usersUpdated cannot be null'); + } + $this->container['usersUpdated'] = $usersUpdated; + + return $this; + } + + /** + * Gets devicesNotified + * + * @return int|null + * @deprecated + */ public function getDevicesNotified() { return $this->container['devicesNotified']; @@ -425,9 +494,10 @@ public function getDevicesNotified() /** * Sets devicesNotified * - * @param int $devicesNotified devicesNotified + * @param int|null $devicesNotified Deprecated compatibility alias for devices_updated. * * @return self + * @deprecated */ public function setDevicesNotified($devicesNotified) { @@ -442,7 +512,8 @@ public function setDevicesNotified($devicesNotified) /** * Gets usersNotified * - * @return int + * @return int|null + * @deprecated */ public function getUsersNotified() { @@ -452,9 +523,10 @@ public function getUsersNotified() /** * Sets usersNotified * - * @param int $usersNotified usersNotified + * @param int|null $usersNotified Deprecated compatibility alias for users_updated. * * @return self + * @deprecated */ public function setUsersNotified($usersNotified) { diff --git a/generated/Model/LiveActivityLimitError.php b/generated/Model/LiveActivityLimitError.php index 724cbb3..4e6855e 100644 --- a/generated/Model/LiveActivityLimitError.php +++ b/generated/Model/LiveActivityLimitError.php @@ -60,7 +60,9 @@ class LiveActivityLimitError implements ModelInterface, ArrayAccess, \JsonSerial 'error' => 'string', 'message' => 'string', 'limit' => 'int', - 'active' => 'int' + 'active' => 'int', + 'blockedDevices' => 'int', + 'targetedDevices' => 'int' ]; /** @@ -74,7 +76,9 @@ class LiveActivityLimitError implements ModelInterface, ArrayAccess, \JsonSerial 'error' => null, 'message' => null, 'limit' => null, - 'active' => null + 'active' => null, + 'blockedDevices' => null, + 'targetedDevices' => null ]; /** @@ -86,7 +90,9 @@ class LiveActivityLimitError implements ModelInterface, ArrayAccess, \JsonSerial 'error' => false, 'message' => false, 'limit' => false, - 'active' => false + 'active' => false, + 'blockedDevices' => false, + 'targetedDevices' => false ]; /** @@ -178,7 +184,9 @@ public function isNullableSetToNull(string $property): bool 'error' => 'error', 'message' => 'message', 'limit' => 'limit', - 'active' => 'active' + 'active' => 'active', + 'blockedDevices' => 'blocked_devices', + 'targetedDevices' => 'targeted_devices' ]; /** @@ -190,7 +198,9 @@ public function isNullableSetToNull(string $property): bool 'error' => 'setError', 'message' => 'setMessage', 'limit' => 'setLimit', - 'active' => 'setActive' + 'active' => 'setActive', + 'blockedDevices' => 'setBlockedDevices', + 'targetedDevices' => 'setTargetedDevices' ]; /** @@ -202,7 +212,9 @@ public function isNullableSetToNull(string $property): bool 'error' => 'getError', 'message' => 'getMessage', 'limit' => 'getLimit', - 'active' => 'getActive' + 'active' => 'getActive', + 'blockedDevices' => 'getBlockedDevices', + 'targetedDevices' => 'getTargetedDevices' ]; /** @@ -266,6 +278,8 @@ public function __construct(array $data = null) $this->setIfExists('message', $data ?? [], null); $this->setIfExists('limit', $data ?? [], null); $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('blockedDevices', $data ?? [], null); + $this->setIfExists('targetedDevices', $data ?? [], null); } /** @@ -416,7 +430,7 @@ public function getActive() /** * Sets active * - * @param int $active Current number of active Live Activities. + * @param int $active Highest number of active Live Activities among the targeted devices. * * @return self */ @@ -429,6 +443,60 @@ public function setActive($active) return $this; } + + /** + * Gets blockedDevices + * + * @return int|null + */ + public function getBlockedDevices() + { + return $this->container['blockedDevices']; + } + + /** + * Sets blockedDevices + * + * @param int|null $blockedDevices Number of targeted devices that have reached the enforced iOS Live Activity concurrency threshold. Included only when targeted devices have mixed capacity. + * + * @return self + */ + public function setBlockedDevices($blockedDevices) + { + if (is_null($blockedDevices)) { + throw new \InvalidArgumentException('non-nullable blockedDevices cannot be null'); + } + $this->container['blockedDevices'] = $blockedDevices; + + return $this; + } + + /** + * Gets targetedDevices + * + * @return int|null + */ + public function getTargetedDevices() + { + return $this->container['targetedDevices']; + } + + /** + * Sets targetedDevices + * + * @param int|null $targetedDevices Total number of targeted devices. Included only when targeted devices have mixed capacity. + * + * @return self + */ + public function setTargetedDevices($targetedDevices) + { + if (is_null($targetedDevices)) { + throw new \InvalidArgumentException('non-nullable targetedDevices cannot be null'); + } + $this->container['targetedDevices'] = $targetedDevices; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/generated/Model/SendPushNotification429Response.php b/generated/Model/SendPushNotification429Response.php index e9299ca..699a703 100644 --- a/generated/Model/SendPushNotification429Response.php +++ b/generated/Model/SendPushNotification429Response.php @@ -60,7 +60,9 @@ class SendPushNotification429Response implements ModelInterface, ArrayAccess, \J 'error' => 'string', 'message' => 'string', 'limit' => 'int', - 'active' => 'int' + 'active' => 'int', + 'blockedDevices' => 'int', + 'targetedDevices' => 'int' ]; /** @@ -74,7 +76,9 @@ class SendPushNotification429Response implements ModelInterface, ArrayAccess, \J 'error' => null, 'message' => null, 'limit' => null, - 'active' => null + 'active' => null, + 'blockedDevices' => null, + 'targetedDevices' => null ]; /** @@ -86,7 +90,9 @@ class SendPushNotification429Response implements ModelInterface, ArrayAccess, \J 'error' => false, 'message' => false, 'limit' => false, - 'active' => false + 'active' => false, + 'blockedDevices' => false, + 'targetedDevices' => false ]; /** @@ -178,7 +184,9 @@ public function isNullableSetToNull(string $property): bool 'error' => 'error', 'message' => 'message', 'limit' => 'limit', - 'active' => 'active' + 'active' => 'active', + 'blockedDevices' => 'blocked_devices', + 'targetedDevices' => 'targeted_devices' ]; /** @@ -190,7 +198,9 @@ public function isNullableSetToNull(string $property): bool 'error' => 'setError', 'message' => 'setMessage', 'limit' => 'setLimit', - 'active' => 'setActive' + 'active' => 'setActive', + 'blockedDevices' => 'setBlockedDevices', + 'targetedDevices' => 'setTargetedDevices' ]; /** @@ -202,7 +212,9 @@ public function isNullableSetToNull(string $property): bool 'error' => 'getError', 'message' => 'getMessage', 'limit' => 'getLimit', - 'active' => 'getActive' + 'active' => 'getActive', + 'blockedDevices' => 'getBlockedDevices', + 'targetedDevices' => 'getTargetedDevices' ]; /** @@ -266,6 +278,8 @@ public function __construct(array $data = null) $this->setIfExists('message', $data ?? [], null); $this->setIfExists('limit', $data ?? [], null); $this->setIfExists('active', $data ?? [], null); + $this->setIfExists('blockedDevices', $data ?? [], null); + $this->setIfExists('targetedDevices', $data ?? [], null); } /** @@ -416,7 +430,7 @@ public function getActive() /** * Sets active * - * @param int $active Current number of active Live Activities. + * @param int $active Highest number of active Live Activities among the targeted devices. * * @return self */ @@ -429,6 +443,60 @@ public function setActive($active) return $this; } + + /** + * Gets blockedDevices + * + * @return int|null + */ + public function getBlockedDevices() + { + return $this->container['blockedDevices']; + } + + /** + * Sets blockedDevices + * + * @param int|null $blockedDevices Number of targeted devices that have reached the enforced iOS Live Activity concurrency threshold. Included only when targeted devices have mixed capacity. + * + * @return self + */ + public function setBlockedDevices($blockedDevices) + { + if (is_null($blockedDevices)) { + throw new \InvalidArgumentException('non-nullable blockedDevices cannot be null'); + } + $this->container['blockedDevices'] = $blockedDevices; + + return $this; + } + + /** + * Gets targetedDevices + * + * @return int|null + */ + public function getTargetedDevices() + { + return $this->container['targetedDevices']; + } + + /** + * Sets targetedDevices + * + * @param int|null $targetedDevices Total number of targeted devices. Included only when targeted devices have mixed capacity. + * + * @return self + */ + public function setTargetedDevices($targetedDevices) + { + if (is_null($targetedDevices)) { + throw new \InvalidArgumentException('non-nullable targetedDevices cannot be null'); + } + $this->container['targetedDevices'] = $targetedDevices; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/generated/Model/UpdateAppIconBadgeCount422Response.php b/generated/Model/UpdateAppIconBadgeCount422Response.php new file mode 100644 index 0000000..9b314f0 --- /dev/null +++ b/generated/Model/UpdateAppIconBadgeCount422Response.php @@ -0,0 +1,748 @@ + + */ +class UpdateAppIconBadgeCount422Response implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'updateAppIconBadgeCount_422_response'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'error' => 'string', + 'message' => 'string', + 'effectiveChannelSlugs' => 'string[]', + 'code' => 'string', + 'badge' => 'int', + 'devicesTargeted' => 'int', + 'devicesUpdated' => 'int', + 'usersUpdated' => 'int', + 'devicesNotified' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'error' => null, + 'message' => null, + 'effectiveChannelSlugs' => null, + 'code' => null, + 'badge' => null, + 'devicesTargeted' => null, + 'devicesUpdated' => null, + 'usersUpdated' => null, + 'devicesNotified' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'error' => false, + 'message' => false, + 'effectiveChannelSlugs' => false, + 'code' => false, + 'badge' => false, + 'devicesTargeted' => false, + 'devicesUpdated' => false, + 'usersUpdated' => false, + 'devicesNotified' => 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 = [ + 'error' => 'error', + 'message' => 'message', + 'effectiveChannelSlugs' => 'effective_channel_slugs', + 'code' => 'code', + 'badge' => 'badge', + 'devicesTargeted' => 'devices_targeted', + 'devicesUpdated' => 'devices_updated', + 'usersUpdated' => 'users_updated', + 'devicesNotified' => 'devices_notified' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'error' => 'setError', + 'message' => 'setMessage', + 'effectiveChannelSlugs' => 'setEffectiveChannelSlugs', + 'code' => 'setCode', + 'badge' => 'setBadge', + 'devicesTargeted' => 'setDevicesTargeted', + 'devicesUpdated' => 'setDevicesUpdated', + 'usersUpdated' => 'setUsersUpdated', + 'devicesNotified' => 'setDevicesNotified' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'error' => 'getError', + 'message' => 'getMessage', + 'effectiveChannelSlugs' => 'getEffectiveChannelSlugs', + 'code' => 'getCode', + 'badge' => 'getBadge', + 'devicesTargeted' => 'getDevicesTargeted', + 'devicesUpdated' => 'getDevicesUpdated', + 'usersUpdated' => 'getUsersUpdated', + 'devicesNotified' => 'getDevicesNotified' + ]; + + /** + * 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; + } + + public const CODE_DEVICE_DISCONNECTED = 'badge_device_disconnected'; + public const CODE_UPDATE_FAILED = 'badge_update_failed'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getCodeAllowableValues() + { + return [ + self::CODE_DEVICE_DISCONNECTED, + self::CODE_UPDATE_FAILED, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('error', $data ?? [], null); + $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('effectiveChannelSlugs', $data ?? [], null); + $this->setIfExists('code', $data ?? [], null); + $this->setIfExists('badge', $data ?? [], null); + $this->setIfExists('devicesTargeted', $data ?? [], null); + $this->setIfExists('devicesUpdated', $data ?? [], null); + $this->setIfExists('usersUpdated', $data ?? [], null); + $this->setIfExists('devicesNotified', $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['error'] === null) { + $invalidProperties[] = "'error' can't be null"; + } + if ($this->container['message'] === null) { + $invalidProperties[] = "'message' can't be null"; + } + if ($this->container['code'] === null) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'code', must be one of '%s'", + $this->container['code'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['badge'] === null) { + $invalidProperties[] = "'badge' can't be null"; + } + if (($this->container['badge'] > 2147483647)) { + $invalidProperties[] = "invalid value for 'badge', must be smaller than or equal to 2147483647."; + } + + if (($this->container['badge'] < 0)) { + $invalidProperties[] = "invalid value for 'badge', must be bigger than or equal to 0."; + } + + if ($this->container['devicesUpdated'] === null) { + $invalidProperties[] = "'devicesUpdated' 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 error + * + * @return string + */ + public function getError() + { + return $this->container['error']; + } + + /** + * Sets error + * + * @param string $error error + * + * @return self + */ + public function setError($error) + { + if (is_null($error)) { + throw new \InvalidArgumentException('non-nullable error cannot be null'); + } + $this->container['error'] = $error; + + return $this; + } + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return self + */ + public function setMessage($message) + { + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); + } + $this->container['message'] = $message; + + return $this; + } + + /** + * Gets effectiveChannelSlugs + * + * @return string[]|null + */ + public function getEffectiveChannelSlugs() + { + return $this->container['effectiveChannelSlugs']; + } + + /** + * Sets effectiveChannelSlugs + * + * @param string[]|null $effectiveChannelSlugs effectiveChannelSlugs + * + * @return self + */ + public function setEffectiveChannelSlugs($effectiveChannelSlugs) + { + if (is_null($effectiveChannelSlugs)) { + throw new \InvalidArgumentException('non-nullable effectiveChannelSlugs cannot be null'); + } + $this->container['effectiveChannelSlugs'] = $effectiveChannelSlugs; + + 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'); + } + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'code', must be one of '%s'", + $code, + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets badge + * + * @return int + */ + public function getBadge() + { + return $this->container['badge']; + } + + /** + * Sets badge + * + * @param int $badge badge + * + * @return self + */ + public function setBadge($badge) + { + if (is_null($badge)) { + throw new \InvalidArgumentException('non-nullable badge cannot be null'); + } + + if (($badge > 2147483647)) { + throw new \InvalidArgumentException('invalid value for $badge when calling UpdateAppIconBadgeCount422Response., must be smaller than or equal to 2147483647.'); + } + if (($badge < 0)) { + throw new \InvalidArgumentException('invalid value for $badge when calling UpdateAppIconBadgeCount422Response., must be bigger than or equal to 0.'); + } + + $this->container['badge'] = $badge; + + return $this; + } + + /** + * Gets devicesTargeted + * + * @return int|null + */ + public function getDevicesTargeted() + { + return $this->container['devicesTargeted']; + } + + /** + * Sets devicesTargeted + * + * @param int|null $devicesTargeted devicesTargeted + * + * @return self + */ + public function setDevicesTargeted($devicesTargeted) + { + if (is_null($devicesTargeted)) { + throw new \InvalidArgumentException('non-nullable devicesTargeted cannot be null'); + } + $this->container['devicesTargeted'] = $devicesTargeted; + + return $this; + } + + /** + * Gets devicesUpdated + * + * @return int + */ + public function getDevicesUpdated() + { + return $this->container['devicesUpdated']; + } + + /** + * Sets devicesUpdated + * + * @param int $devicesUpdated devicesUpdated + * + * @return self + */ + public function setDevicesUpdated($devicesUpdated) + { + if (is_null($devicesUpdated)) { + throw new \InvalidArgumentException('non-nullable devicesUpdated cannot be null'); + } + $this->container['devicesUpdated'] = $devicesUpdated; + + return $this; + } + + /** + * Gets usersUpdated + * + * @return int|null + */ + public function getUsersUpdated() + { + return $this->container['usersUpdated']; + } + + /** + * Sets usersUpdated + * + * @param int|null $usersUpdated usersUpdated + * + * @return self + */ + public function setUsersUpdated($usersUpdated) + { + if (is_null($usersUpdated)) { + throw new \InvalidArgumentException('non-nullable usersUpdated cannot be null'); + } + $this->container['usersUpdated'] = $usersUpdated; + + return $this; + } + + /** + * Gets devicesNotified + * + * @return int|null + * @deprecated + */ + public function getDevicesNotified() + { + return $this->container['devicesNotified']; + } + + /** + * Sets devicesNotified + * + * @param int|null $devicesNotified Deprecated compatibility alias for devices_updated. + * + * @return self + * @deprecated + */ + public function setDevicesNotified($devicesNotified) + { + if (is_null($devicesNotified)) { + throw new \InvalidArgumentException('non-nullable devicesNotified cannot be null'); + } + $this->container['devicesNotified'] = $devicesNotified; + + 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)); + } +} + +