From b68941775d88936f5cbb6e68acc5098105706d7d Mon Sep 17 00:00:00 2001 From: activitysmith-bot Date: Tue, 15 Sep 2026 12:49:09 +0000 Subject: [PATCH 01/11] chore: regenerate SDK --- generated/Api/AppIconBadgesApi.php | 51 +- generated/Api/PublicApi.php | 791 ++++++++++++++++++ .../Model/AppIconBadgeCountUpdateError.php | 748 +++++++++++++++++ .../Model/AppIconBadgeCountUpdateResponse.php | 88 +- generated/Model/ChangelogEntry.php | 729 ++++++++++++++++ generated/Model/ChangelogItem.php | 572 +++++++++++++ generated/Model/ChangelogListResponse.php | 412 +++++++++ generated/Model/HealthCheck.php | 563 +++++++++++++ generated/Model/HealthResponse.php | 523 ++++++++++++ generated/Model/LiveActivityEndRequest.php | 84 ++ generated/Model/LiveActivityLimitError.php | 82 +- generated/Model/LiveActivityStartRequest.php | 42 + .../Model/LiveActivityStreamDeleteRequest.php | 76 ++ generated/Model/LiveActivityStreamRequest.php | 42 + generated/Model/LiveActivityUpdateRequest.php | 84 ++ generated/Model/MetadataValue.php | 381 +++++++++ generated/Model/PushNotificationAction.php | 2 +- generated/Model/PushNotificationRequest.php | 60 +- .../Model/SendPushNotification429Response.php | 82 +- .../UpdateAppIconBadgeCount422Response.php | 748 +++++++++++++++++ generated/ObjectSerializer.php | 3 +- generated/openapi-source.json | 6 + 22 files changed, 6131 insertions(+), 38 deletions(-) create mode 100644 generated/Api/PublicApi.php create mode 100644 generated/Model/AppIconBadgeCountUpdateError.php create mode 100644 generated/Model/ChangelogEntry.php create mode 100644 generated/Model/ChangelogItem.php create mode 100644 generated/Model/ChangelogListResponse.php create mode 100644 generated/Model/HealthCheck.php create mode 100644 generated/Model/HealthResponse.php create mode 100644 generated/Model/MetadataValue.php create mode 100644 generated/Model/UpdateAppIconBadgeCount422Response.php create mode 100644 generated/openapi-source.json 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/Api/PublicApi.php b/generated/Api/PublicApi.php new file mode 100644 index 0000000..fceea3d --- /dev/null +++ b/generated/Api/PublicApi.php @@ -0,0 +1,791 @@ + [ + 'application/json', + ], + 'listPublicChangelogEntries' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ClientInterface $client = null, + Configuration $config = null, + HeaderSelector $selector = null, + $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getApiHealth + * + * Get API Health + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiHealth'] to see the possible values for this operation + * + * @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\HealthResponse|\ActivitySmith\Generated\Model\HealthResponse + */ + public function getApiHealth(string $contentType = self::contentTypes['getApiHealth'][0]) + { + list($response) = $this->getApiHealthWithHttpInfo($contentType); + return $response; + } + + /** + * Operation getApiHealthWithHttpInfo + * + * Get API Health + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiHealth'] to see the possible values for this operation + * + * @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\HealthResponse|\ActivitySmith\Generated\Model\HealthResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function getApiHealthWithHttpInfo(string $contentType = self::contentTypes['getApiHealth'][0]) + { + $request = $this->getApiHealthRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\ActivitySmith\Generated\Model\HealthResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\ActivitySmith\Generated\Model\HealthResponse' !== '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\HealthResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 503: + if ('\ActivitySmith\Generated\Model\HealthResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\ActivitySmith\Generated\Model\HealthResponse' !== '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\HealthResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\ActivitySmith\Generated\Model\HealthResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== '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, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\ActivitySmith\Generated\Model\HealthResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 503: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\ActivitySmith\Generated\Model\HealthResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation getApiHealthAsync + * + * Get API Health + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiHealth'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getApiHealthAsync(string $contentType = self::contentTypes['getApiHealth'][0]) + { + return $this->getApiHealthAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getApiHealthAsyncWithHttpInfo + * + * Get API Health + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiHealth'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getApiHealthAsyncWithHttpInfo(string $contentType = self::contentTypes['getApiHealth'][0]) + { + $returnType = '\ActivitySmith\Generated\Model\HealthResponse'; + $request = $this->getApiHealthRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getApiHealth' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiHealth'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getApiHealthRequest(string $contentType = self::contentTypes['getApiHealth'][0]) + { + + + $resourcePath = '/health'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation listPublicChangelogEntries + * + * List Public Changelog Entries + * + * @param string $platform Platform whose published changelog entries should be returned. (optional, default to 'ios') + * @param int $limit Maximum number of entries to return. (optional, default to 10) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPublicChangelogEntries'] to see the possible values for this operation + * + * @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\ChangelogListResponse + */ + public function listPublicChangelogEntries($platform = 'ios', $limit = 10, string $contentType = self::contentTypes['listPublicChangelogEntries'][0]) + { + list($response) = $this->listPublicChangelogEntriesWithHttpInfo($platform, $limit, $contentType); + return $response; + } + + /** + * Operation listPublicChangelogEntriesWithHttpInfo + * + * List Public Changelog Entries + * + * @param string $platform Platform whose published changelog entries should be returned. (optional, default to 'ios') + * @param int $limit Maximum number of entries to return. (optional, default to 10) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPublicChangelogEntries'] to see the possible values for this operation + * + * @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\ChangelogListResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function listPublicChangelogEntriesWithHttpInfo($platform = 'ios', $limit = 10, string $contentType = self::contentTypes['listPublicChangelogEntries'][0]) + { + $request = $this->listPublicChangelogEntriesRequest($platform, $limit, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + switch($statusCode) { + case 200: + if ('\ActivitySmith\Generated\Model\ChangelogListResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\ActivitySmith\Generated\Model\ChangelogListResponse' !== '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\ChangelogListResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\ActivitySmith\Generated\Model\ChangelogListResponse'; + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== '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, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\ActivitySmith\Generated\Model\ChangelogListResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation listPublicChangelogEntriesAsync + * + * List Public Changelog Entries + * + * @param string $platform Platform whose published changelog entries should be returned. (optional, default to 'ios') + * @param int $limit Maximum number of entries to return. (optional, default to 10) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPublicChangelogEntries'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listPublicChangelogEntriesAsync($platform = 'ios', $limit = 10, string $contentType = self::contentTypes['listPublicChangelogEntries'][0]) + { + return $this->listPublicChangelogEntriesAsyncWithHttpInfo($platform, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation listPublicChangelogEntriesAsyncWithHttpInfo + * + * List Public Changelog Entries + * + * @param string $platform Platform whose published changelog entries should be returned. (optional, default to 'ios') + * @param int $limit Maximum number of entries to return. (optional, default to 10) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPublicChangelogEntries'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function listPublicChangelogEntriesAsyncWithHttpInfo($platform = 'ios', $limit = 10, string $contentType = self::contentTypes['listPublicChangelogEntries'][0]) + { + $returnType = '\ActivitySmith\Generated\Model\ChangelogListResponse'; + $request = $this->listPublicChangelogEntriesRequest($platform, $limit, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'listPublicChangelogEntries' + * + * @param string $platform Platform whose published changelog entries should be returned. (optional, default to 'ios') + * @param int $limit Maximum number of entries to return. (optional, default to 10) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPublicChangelogEntries'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function listPublicChangelogEntriesRequest($platform = 'ios', $limit = 10, string $contentType = self::contentTypes['listPublicChangelogEntries'][0]) + { + + + if ($limit !== null && $limit > 20) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling PublicApi.listPublicChangelogEntries, must be smaller than or equal to 20.'); + } + if ($limit !== null && $limit < 1) { + throw new \InvalidArgumentException('invalid value for "$limit" when calling PublicApi.listPublicChangelogEntries, must be bigger than or equal to 1.'); + } + + + $resourcePath = '/changelog'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $platform, + 'platform', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} 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/ChangelogEntry.php b/generated/Model/ChangelogEntry.php new file mode 100644 index 0000000..cf769bf --- /dev/null +++ b/generated/Model/ChangelogEntry.php @@ -0,0 +1,729 @@ + + */ +class ChangelogEntry implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ChangelogEntry'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'platform' => 'string', + 'version' => 'string', + 'title' => 'string', + 'subtitle' => 'string', + 'heroImageUrl' => 'string', + 'ctaTitle' => 'string', + 'publishedAt' => '\DateTime', + 'items' => '\ActivitySmith\Generated\Model\ChangelogItem[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'platform' => null, + 'version' => null, + 'title' => null, + 'subtitle' => null, + 'heroImageUrl' => 'uri', + 'ctaTitle' => null, + 'publishedAt' => 'date-time', + 'items' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'platform' => false, + 'version' => false, + 'title' => false, + 'subtitle' => true, + 'heroImageUrl' => true, + 'ctaTitle' => false, + 'publishedAt' => true, + 'items' => 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 = [ + 'id' => 'id', + 'platform' => 'platform', + 'version' => 'version', + 'title' => 'title', + 'subtitle' => 'subtitle', + 'heroImageUrl' => 'hero_image_url', + 'ctaTitle' => 'cta_title', + 'publishedAt' => 'published_at', + 'items' => 'items' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'platform' => 'setPlatform', + 'version' => 'setVersion', + 'title' => 'setTitle', + 'subtitle' => 'setSubtitle', + 'heroImageUrl' => 'setHeroImageUrl', + 'ctaTitle' => 'setCtaTitle', + 'publishedAt' => 'setPublishedAt', + 'items' => 'setItems' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'platform' => 'getPlatform', + 'version' => 'getVersion', + 'title' => 'getTitle', + 'subtitle' => 'getSubtitle', + 'heroImageUrl' => 'getHeroImageUrl', + 'ctaTitle' => 'getCtaTitle', + 'publishedAt' => 'getPublishedAt', + 'items' => 'getItems' + ]; + + /** + * 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[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('platform', $data ?? [], null); + $this->setIfExists('version', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('subtitle', $data ?? [], null); + $this->setIfExists('heroImageUrl', $data ?? [], null); + $this->setIfExists('ctaTitle', $data ?? [], null); + $this->setIfExists('publishedAt', $data ?? [], null); + $this->setIfExists('items', $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['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['platform'] === null) { + $invalidProperties[] = "'platform' can't be null"; + } + if ($this->container['version'] === null) { + $invalidProperties[] = "'version' can't be null"; + } + if ($this->container['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['subtitle'] === null) { + $invalidProperties[] = "'subtitle' can't be null"; + } + if ($this->container['heroImageUrl'] === null) { + $invalidProperties[] = "'heroImageUrl' can't be null"; + } + if ($this->container['ctaTitle'] === null) { + $invalidProperties[] = "'ctaTitle' can't be null"; + } + if ($this->container['publishedAt'] === null) { + $invalidProperties[] = "'publishedAt' can't be null"; + } + if ($this->container['items'] === null) { + $invalidProperties[] = "'items' 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 id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets platform + * + * @return string + */ + public function getPlatform() + { + return $this->container['platform']; + } + + /** + * Sets platform + * + * @param string $platform platform + * + * @return self + */ + public function setPlatform($platform) + { + if (is_null($platform)) { + throw new \InvalidArgumentException('non-nullable platform cannot be null'); + } + $this->container['platform'] = $platform; + + return $this; + } + + /** + * Gets version + * + * @return string + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param string $version version + * + * @return self + */ + public function setVersion($version) + { + if (is_null($version)) { + throw new \InvalidArgumentException('non-nullable version cannot be null'); + } + $this->container['version'] = $version; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets subtitle + * + * @return string + */ + public function getSubtitle() + { + return $this->container['subtitle']; + } + + /** + * Sets subtitle + * + * @param string $subtitle subtitle + * + * @return self + */ + public function setSubtitle($subtitle) + { + if (is_null($subtitle)) { + array_push($this->openAPINullablesSetToNull, 'subtitle'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subtitle', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['subtitle'] = $subtitle; + + return $this; + } + + /** + * Gets heroImageUrl + * + * @return string + */ + public function getHeroImageUrl() + { + return $this->container['heroImageUrl']; + } + + /** + * Sets heroImageUrl + * + * @param string $heroImageUrl heroImageUrl + * + * @return self + */ + public function setHeroImageUrl($heroImageUrl) + { + if (is_null($heroImageUrl)) { + array_push($this->openAPINullablesSetToNull, 'heroImageUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('heroImageUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['heroImageUrl'] = $heroImageUrl; + + return $this; + } + + /** + * Gets ctaTitle + * + * @return string + */ + public function getCtaTitle() + { + return $this->container['ctaTitle']; + } + + /** + * Sets ctaTitle + * + * @param string $ctaTitle ctaTitle + * + * @return self + */ + public function setCtaTitle($ctaTitle) + { + if (is_null($ctaTitle)) { + throw new \InvalidArgumentException('non-nullable ctaTitle cannot be null'); + } + $this->container['ctaTitle'] = $ctaTitle; + + return $this; + } + + /** + * Gets publishedAt + * + * @return \DateTime + */ + public function getPublishedAt() + { + return $this->container['publishedAt']; + } + + /** + * Sets publishedAt + * + * @param \DateTime $publishedAt publishedAt + * + * @return self + */ + public function setPublishedAt($publishedAt) + { + if (is_null($publishedAt)) { + array_push($this->openAPINullablesSetToNull, 'publishedAt'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('publishedAt', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['publishedAt'] = $publishedAt; + + return $this; + } + + /** + * Gets items + * + * @return \ActivitySmith\Generated\Model\ChangelogItem[] + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \ActivitySmith\Generated\Model\ChangelogItem[] $items items + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + throw new \InvalidArgumentException('non-nullable items cannot be null'); + } + $this->container['items'] = $items; + + 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/ChangelogItem.php b/generated/Model/ChangelogItem.php new file mode 100644 index 0000000..7bc28c3 --- /dev/null +++ b/generated/Model/ChangelogItem.php @@ -0,0 +1,572 @@ + + */ +class ChangelogItem implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ChangelogItem'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'icon' => 'string', + 'title' => 'string', + 'body' => 'string', + 'imageUrl' => 'string', + 'accentColor' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'icon' => null, + 'title' => null, + 'body' => null, + 'imageUrl' => 'uri', + 'accentColor' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'icon' => true, + 'title' => false, + 'body' => false, + 'imageUrl' => true, + 'accentColor' => true + ]; + + /** + * 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 = [ + 'icon' => 'icon', + 'title' => 'title', + 'body' => 'body', + 'imageUrl' => 'image_url', + 'accentColor' => 'accent_color' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'icon' => 'setIcon', + 'title' => 'setTitle', + 'body' => 'setBody', + 'imageUrl' => 'setImageUrl', + 'accentColor' => 'setAccentColor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'icon' => 'getIcon', + 'title' => 'getTitle', + 'body' => 'getBody', + 'imageUrl' => 'getImageUrl', + 'accentColor' => 'getAccentColor' + ]; + + /** + * 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[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('icon', $data ?? [], null); + $this->setIfExists('title', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + $this->setIfExists('imageUrl', $data ?? [], null); + $this->setIfExists('accentColor', $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['title'] === null) { + $invalidProperties[] = "'title' can't be null"; + } + if ($this->container['body'] === null) { + $invalidProperties[] = "'body' 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 icon + * + * @return string|null + */ + public function getIcon() + { + return $this->container['icon']; + } + + /** + * Sets icon + * + * @param string|null $icon icon + * + * @return self + */ + public function setIcon($icon) + { + if (is_null($icon)) { + array_push($this->openAPINullablesSetToNull, 'icon'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('icon', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['icon'] = $icon; + + return $this; + } + + /** + * Gets title + * + * @return string + */ + public function getTitle() + { + return $this->container['title']; + } + + /** + * Sets title + * + * @param string $title title + * + * @return self + */ + public function setTitle($title) + { + if (is_null($title)) { + throw new \InvalidArgumentException('non-nullable title cannot be null'); + } + $this->container['title'] = $title; + + return $this; + } + + /** + * Gets body + * + * @return string + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * + * @param string $body body + * + * @return self + */ + public function setBody($body) + { + if (is_null($body)) { + throw new \InvalidArgumentException('non-nullable body cannot be null'); + } + $this->container['body'] = $body; + + return $this; + } + + /** + * Gets imageUrl + * + * @return string|null + */ + public function getImageUrl() + { + return $this->container['imageUrl']; + } + + /** + * Sets imageUrl + * + * @param string|null $imageUrl imageUrl + * + * @return self + */ + public function setImageUrl($imageUrl) + { + if (is_null($imageUrl)) { + array_push($this->openAPINullablesSetToNull, 'imageUrl'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('imageUrl', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['imageUrl'] = $imageUrl; + + return $this; + } + + /** + * Gets accentColor + * + * @return string|null + */ + public function getAccentColor() + { + return $this->container['accentColor']; + } + + /** + * Sets accentColor + * + * @param string|null $accentColor accentColor + * + * @return self + */ + public function setAccentColor($accentColor) + { + if (is_null($accentColor)) { + array_push($this->openAPINullablesSetToNull, 'accentColor'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('accentColor', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['accentColor'] = $accentColor; + + 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/ChangelogListResponse.php b/generated/Model/ChangelogListResponse.php new file mode 100644 index 0000000..a5613b8 --- /dev/null +++ b/generated/Model/ChangelogListResponse.php @@ -0,0 +1,412 @@ + + */ +class ChangelogListResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ChangelogListResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'changelogs' => '\ActivitySmith\Generated\Model\ChangelogEntry[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'changelogs' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'changelogs' => 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 = [ + 'changelogs' => 'changelogs' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'changelogs' => 'setChangelogs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'changelogs' => 'getChangelogs' + ]; + + /** + * 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[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('changelogs', $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['changelogs'] === null) { + $invalidProperties[] = "'changelogs' 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 changelogs + * + * @return \ActivitySmith\Generated\Model\ChangelogEntry[] + */ + public function getChangelogs() + { + return $this->container['changelogs']; + } + + /** + * Sets changelogs + * + * @param \ActivitySmith\Generated\Model\ChangelogEntry[] $changelogs changelogs + * + * @return self + */ + public function setChangelogs($changelogs) + { + if (is_null($changelogs)) { + throw new \InvalidArgumentException('non-nullable changelogs cannot be null'); + } + $this->container['changelogs'] = $changelogs; + + 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/HealthCheck.php b/generated/Model/HealthCheck.php new file mode 100644 index 0000000..a5def26 --- /dev/null +++ b/generated/Model/HealthCheck.php @@ -0,0 +1,563 @@ + + */ +class HealthCheck implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'HealthCheck'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'status' => 'string', + 'durationMs' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'status' => null, + 'durationMs' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'status' => false, + 'durationMs' => 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 = [ + 'name' => 'name', + 'status' => 'status', + 'durationMs' => 'duration_ms' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'status' => 'setStatus', + 'durationMs' => 'setDurationMs' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'status' => 'getStatus', + 'durationMs' => 'getDurationMs' + ]; + + /** + * 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 NAME_DATABASE = 'database'; + public const NAME_REDIS = 'redis'; + public const STATUS_OK = 'ok'; + public const STATUS_FAILED = 'failed'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getNameAllowableValues() + { + return [ + self::NAME_DATABASE, + self::NAME_REDIS, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getStatusAllowableValues() + { + return [ + self::STATUS_OK, + self::STATUS_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('name', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('durationMs', $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['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + $allowedValues = $this->getNameAllowableValues(); + if (!is_null($this->container['name']) && !in_array($this->container['name'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'name', must be one of '%s'", + $this->container['name'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } + $allowedValues = $this->getStatusAllowableValues(); + if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'status', must be one of '%s'", + $this->container['status'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['durationMs'] === null) { + $invalidProperties[] = "'durationMs' can't be null"; + } + if (($this->container['durationMs'] < 0)) { + $invalidProperties[] = "invalid value for 'durationMs', must be bigger than or equal to 0."; + } + + 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 name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $allowedValues = $this->getNameAllowableValues(); + if (!in_array($name, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'name', must be one of '%s'", + $name, + implode("', '", $allowedValues) + ) + ); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets status + * + * @return string + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); + } + $allowedValues = $this->getStatusAllowableValues(); + if (!in_array($status, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'status', must be one of '%s'", + $status, + implode("', '", $allowedValues) + ) + ); + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets durationMs + * + * @return int + */ + public function getDurationMs() + { + return $this->container['durationMs']; + } + + /** + * Sets durationMs + * + * @param int $durationMs durationMs + * + * @return self + */ + public function setDurationMs($durationMs) + { + if (is_null($durationMs)) { + throw new \InvalidArgumentException('non-nullable durationMs cannot be null'); + } + + if (($durationMs < 0)) { + throw new \InvalidArgumentException('invalid value for $durationMs when calling HealthCheck., must be bigger than or equal to 0.'); + } + + $this->container['durationMs'] = $durationMs; + + 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/HealthResponse.php b/generated/Model/HealthResponse.php new file mode 100644 index 0000000..6020b5f --- /dev/null +++ b/generated/Model/HealthResponse.php @@ -0,0 +1,523 @@ + + */ +class HealthResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'HealthResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'ok' => 'bool', + 'service' => 'string', + 'timestamp' => '\DateTime', + 'checks' => '\ActivitySmith\Generated\Model\HealthCheck[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'ok' => null, + 'service' => null, + 'timestamp' => 'date-time', + 'checks' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'ok' => false, + 'service' => false, + 'timestamp' => false, + 'checks' => 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 = [ + 'ok' => 'ok', + 'service' => 'service', + 'timestamp' => 'timestamp', + 'checks' => 'checks' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'ok' => 'setOk', + 'service' => 'setService', + 'timestamp' => 'setTimestamp', + 'checks' => 'setChecks' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'ok' => 'getOk', + 'service' => 'getService', + 'timestamp' => 'getTimestamp', + 'checks' => 'getChecks' + ]; + + /** + * 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[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->setIfExists('ok', $data ?? [], null); + $this->setIfExists('service', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('checks', $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['ok'] === null) { + $invalidProperties[] = "'ok' can't be null"; + } + if ($this->container['service'] === null) { + $invalidProperties[] = "'service' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['checks'] === null) { + $invalidProperties[] = "'checks' 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 ok + * + * @return bool + */ + public function getOk() + { + return $this->container['ok']; + } + + /** + * Sets ok + * + * @param bool $ok ok + * + * @return self + */ + public function setOk($ok) + { + if (is_null($ok)) { + throw new \InvalidArgumentException('non-nullable ok cannot be null'); + } + $this->container['ok'] = $ok; + + return $this; + } + + /** + * Gets service + * + * @return string + */ + public function getService() + { + return $this->container['service']; + } + + /** + * Sets service + * + * @param string $service service + * + * @return self + */ + public function setService($service) + { + if (is_null($service)) { + throw new \InvalidArgumentException('non-nullable service cannot be null'); + } + $this->container['service'] = $service; + + return $this; + } + + /** + * Gets timestamp + * + * @return \DateTime + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param \DateTime $timestamp timestamp + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets checks + * + * @return \ActivitySmith\Generated\Model\HealthCheck[] + */ + public function getChecks() + { + return $this->container['checks']; + } + + /** + * Sets checks + * + * @param \ActivitySmith\Generated\Model\HealthCheck[] $checks checks + * + * @return self + */ + public function setChecks($checks) + { + if (is_null($checks)) { + throw new \InvalidArgumentException('non-nullable checks cannot be null'); + } + $this->container['checks'] = $checks; + + 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/LiveActivityEndRequest.php b/generated/Model/LiveActivityEndRequest.php index 217a9df..6adb132 100644 --- a/generated/Model/LiveActivityEndRequest.php +++ b/generated/Model/LiveActivityEndRequest.php @@ -58,7 +58,9 @@ class LiveActivityEndRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ + 'metadata' => 'array', 'activityId' => 'string', + 'tags' => 'string[]', 'contentState' => '\ActivitySmith\Generated\Model\ContentStateEnd', 'action' => '\ActivitySmith\Generated\Model\LiveActivityAction', 'secondaryAction' => '\ActivitySmith\Generated\Model\LiveActivityAction' @@ -72,7 +74,9 @@ class LiveActivityEndRequest implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ + 'metadata' => null, 'activityId' => null, + 'tags' => null, 'contentState' => null, 'action' => null, 'secondaryAction' => null @@ -84,7 +88,9 @@ class LiveActivityEndRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ + 'metadata' => false, 'activityId' => false, + 'tags' => false, 'contentState' => false, 'action' => false, 'secondaryAction' => false @@ -176,7 +182,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'metadata' => 'metadata', 'activityId' => 'activity_id', + 'tags' => 'tags', 'contentState' => 'content_state', 'action' => 'action', 'secondaryAction' => 'secondary_action' @@ -188,7 +196,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'metadata' => 'setMetadata', 'activityId' => 'setActivityId', + 'tags' => 'setTags', 'contentState' => 'setContentState', 'action' => 'setAction', 'secondaryAction' => 'setSecondaryAction' @@ -200,7 +210,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'metadata' => 'getMetadata', 'activityId' => 'getActivityId', + 'tags' => 'getTags', 'contentState' => 'getContentState', 'action' => 'getAction', 'secondaryAction' => 'getSecondaryAction' @@ -263,7 +275,9 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('activityId', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); $this->setIfExists('contentState', $data ?? [], null); $this->setIfExists('action', $data ?? [], null); $this->setIfExists('secondaryAction', $data ?? [], null); @@ -296,9 +310,17 @@ public function listInvalidProperties() { $invalidProperties = []; + if (!is_null($this->container['metadata']) && (count($this->container['metadata']) > 50)) { + $invalidProperties[] = "invalid value for 'metadata', number of items must be less than or equal to 50."; + } + if ($this->container['activityId'] === null) { $invalidProperties[] = "'activityId' can't be null"; } + if (!is_null($this->container['tags']) && (count($this->container['tags']) > 20)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be less than or equal to 20."; + } + if ($this->container['contentState'] === null) { $invalidProperties[] = "'contentState' can't be null"; } @@ -317,6 +339,37 @@ public function valid() } + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + + if ((count($metadata) > 50)) { + throw new \InvalidArgumentException('invalid value for $metadata when calling LiveActivityEndRequest., number of items must be less than or equal to 50.'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + /** * Gets activityId * @@ -344,6 +397,37 @@ public function setActivityId($activityId) return $this; } + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags Tags for notification history. Omit to keep existing Tags, supply an array to replace them, or send an empty array to clear them. + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } + + if ((count($tags) > 20)) { + throw new \InvalidArgumentException('invalid value for $tags when calling LiveActivityEndRequest., number of items must be less than or equal to 20.'); + } + $this->container['tags'] = $tags; + + return $this; + } + /** * Gets contentState * 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/LiveActivityStartRequest.php b/generated/Model/LiveActivityStartRequest.php index ee43938..445118c 100644 --- a/generated/Model/LiveActivityStartRequest.php +++ b/generated/Model/LiveActivityStartRequest.php @@ -58,6 +58,7 @@ class LiveActivityStartRequest implements ModelInterface, ArrayAccess, \JsonSeri * @var string[] */ protected static $openAPITypes = [ + 'metadata' => 'array', 'contentState' => '\ActivitySmith\Generated\Model\ContentStateStart', 'action' => '\ActivitySmith\Generated\Model\LiveActivityAction', 'secondaryAction' => '\ActivitySmith\Generated\Model\LiveActivityAction', @@ -74,6 +75,7 @@ class LiveActivityStartRequest implements ModelInterface, ArrayAccess, \JsonSeri * @psalm-var array */ protected static $openAPIFormats = [ + 'metadata' => null, 'contentState' => null, 'action' => null, 'secondaryAction' => null, @@ -88,6 +90,7 @@ class LiveActivityStartRequest implements ModelInterface, ArrayAccess, \JsonSeri * @var boolean[] */ protected static array $openAPINullables = [ + 'metadata' => false, 'contentState' => false, 'action' => false, 'secondaryAction' => false, @@ -182,6 +185,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'metadata' => 'metadata', 'contentState' => 'content_state', 'action' => 'action', 'secondaryAction' => 'secondary_action', @@ -196,6 +200,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'metadata' => 'setMetadata', 'contentState' => 'setContentState', 'action' => 'setAction', 'secondaryAction' => 'setSecondaryAction', @@ -210,6 +215,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'metadata' => 'getMetadata', 'contentState' => 'getContentState', 'action' => 'getAction', 'secondaryAction' => 'getSecondaryAction', @@ -275,6 +281,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('contentState', $data ?? [], null); $this->setIfExists('action', $data ?? [], null); $this->setIfExists('secondaryAction', $data ?? [], null); @@ -310,6 +317,10 @@ public function listInvalidProperties() { $invalidProperties = []; + if (!is_null($this->container['metadata']) && (count($this->container['metadata']) > 50)) { + $invalidProperties[] = "invalid value for 'metadata', number of items must be less than or equal to 50."; + } + if ($this->container['contentState'] === null) { $invalidProperties[] = "'contentState' can't be null"; } @@ -328,6 +339,37 @@ public function valid() } + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + + if ((count($metadata) > 50)) { + throw new \InvalidArgumentException('invalid value for $metadata when calling LiveActivityStartRequest., number of items must be less than or equal to 50.'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + /** * Gets contentState * diff --git a/generated/Model/LiveActivityStreamDeleteRequest.php b/generated/Model/LiveActivityStreamDeleteRequest.php index 39b7c85..3491a9f 100644 --- a/generated/Model/LiveActivityStreamDeleteRequest.php +++ b/generated/Model/LiveActivityStreamDeleteRequest.php @@ -58,6 +58,8 @@ class LiveActivityStreamDeleteRequest implements ModelInterface, ArrayAccess, \J * @var string[] */ protected static $openAPITypes = [ + 'metadata' => 'array', + 'tags' => 'string[]', 'contentState' => '\ActivitySmith\Generated\Model\StreamContentState', 'action' => '\ActivitySmith\Generated\Model\LiveActivityAction', 'secondaryAction' => '\ActivitySmith\Generated\Model\LiveActivityAction', @@ -72,6 +74,8 @@ class LiveActivityStreamDeleteRequest implements ModelInterface, ArrayAccess, \J * @psalm-var array */ protected static $openAPIFormats = [ + 'metadata' => null, + 'tags' => null, 'contentState' => null, 'action' => null, 'secondaryAction' => null, @@ -84,6 +88,8 @@ class LiveActivityStreamDeleteRequest implements ModelInterface, ArrayAccess, \J * @var boolean[] */ protected static array $openAPINullables = [ + 'metadata' => false, + 'tags' => false, 'contentState' => false, 'action' => false, 'secondaryAction' => false, @@ -176,6 +182,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'metadata' => 'metadata', + 'tags' => 'tags', 'contentState' => 'content_state', 'action' => 'action', 'secondaryAction' => 'secondary_action', @@ -188,6 +196,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'metadata' => 'setMetadata', + 'tags' => 'setTags', 'contentState' => 'setContentState', 'action' => 'setAction', 'secondaryAction' => 'setSecondaryAction', @@ -200,6 +210,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'metadata' => 'getMetadata', + 'tags' => 'getTags', 'contentState' => 'getContentState', 'action' => 'getAction', 'secondaryAction' => 'getSecondaryAction', @@ -263,6 +275,8 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('metadata', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); $this->setIfExists('contentState', $data ?? [], null); $this->setIfExists('action', $data ?? [], null); $this->setIfExists('secondaryAction', $data ?? [], null); @@ -296,6 +310,10 @@ public function listInvalidProperties() { $invalidProperties = []; + if (!is_null($this->container['metadata']) && (count($this->container['metadata']) > 50)) { + $invalidProperties[] = "invalid value for 'metadata', number of items must be less than or equal to 50."; + } + return $invalidProperties; } @@ -311,6 +329,64 @@ public function valid() } + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + + if ((count($metadata) > 50)) { + throw new \InvalidArgumentException('invalid value for $metadata when calling LiveActivityStreamDeleteRequest., number of items must be less than or equal to 50.'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags Optional tags to organize and filter notification history. + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } + $this->container['tags'] = $tags; + + return $this; + } + /** * Gets contentState * diff --git a/generated/Model/LiveActivityStreamRequest.php b/generated/Model/LiveActivityStreamRequest.php index d31ca9d..9e7ac2d 100644 --- a/generated/Model/LiveActivityStreamRequest.php +++ b/generated/Model/LiveActivityStreamRequest.php @@ -58,6 +58,7 @@ class LiveActivityStreamRequest implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ + 'metadata' => 'array', 'contentState' => '\ActivitySmith\Generated\Model\StreamContentState', 'action' => '\ActivitySmith\Generated\Model\LiveActivityAction', 'secondaryAction' => '\ActivitySmith\Generated\Model\LiveActivityAction', @@ -75,6 +76,7 @@ class LiveActivityStreamRequest implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ + 'metadata' => null, 'contentState' => null, 'action' => null, 'secondaryAction' => null, @@ -90,6 +92,7 @@ class LiveActivityStreamRequest implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ + 'metadata' => false, 'contentState' => false, 'action' => false, 'secondaryAction' => false, @@ -185,6 +188,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'metadata' => 'metadata', 'contentState' => 'content_state', 'action' => 'action', 'secondaryAction' => 'secondary_action', @@ -200,6 +204,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'metadata' => 'setMetadata', 'contentState' => 'setContentState', 'action' => 'setAction', 'secondaryAction' => 'setSecondaryAction', @@ -215,6 +220,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'metadata' => 'getMetadata', 'contentState' => 'getContentState', 'action' => 'getAction', 'secondaryAction' => 'getSecondaryAction', @@ -281,6 +287,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('contentState', $data ?? [], null); $this->setIfExists('action', $data ?? [], null); $this->setIfExists('secondaryAction', $data ?? [], null); @@ -317,6 +324,10 @@ public function listInvalidProperties() { $invalidProperties = []; + if (!is_null($this->container['metadata']) && (count($this->container['metadata']) > 50)) { + $invalidProperties[] = "invalid value for 'metadata', number of items must be less than or equal to 50."; + } + if ($this->container['contentState'] === null) { $invalidProperties[] = "'contentState' can't be null"; } @@ -339,6 +350,37 @@ public function valid() } + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + + if ((count($metadata) > 50)) { + throw new \InvalidArgumentException('invalid value for $metadata when calling LiveActivityStreamRequest., number of items must be less than or equal to 50.'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + /** * Gets contentState * diff --git a/generated/Model/LiveActivityUpdateRequest.php b/generated/Model/LiveActivityUpdateRequest.php index b3bfc02..3dc121d 100644 --- a/generated/Model/LiveActivityUpdateRequest.php +++ b/generated/Model/LiveActivityUpdateRequest.php @@ -58,7 +58,9 @@ class LiveActivityUpdateRequest implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ + 'metadata' => 'array', 'activityId' => 'string', + 'tags' => 'string[]', 'contentState' => '\ActivitySmith\Generated\Model\ContentStateUpdate', 'action' => '\ActivitySmith\Generated\Model\LiveActivityAction', 'secondaryAction' => '\ActivitySmith\Generated\Model\LiveActivityAction' @@ -72,7 +74,9 @@ class LiveActivityUpdateRequest implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ + 'metadata' => null, 'activityId' => null, + 'tags' => null, 'contentState' => null, 'action' => null, 'secondaryAction' => null @@ -84,7 +88,9 @@ class LiveActivityUpdateRequest implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ + 'metadata' => false, 'activityId' => false, + 'tags' => false, 'contentState' => false, 'action' => false, 'secondaryAction' => false @@ -176,7 +182,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'metadata' => 'metadata', 'activityId' => 'activity_id', + 'tags' => 'tags', 'contentState' => 'content_state', 'action' => 'action', 'secondaryAction' => 'secondary_action' @@ -188,7 +196,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'metadata' => 'setMetadata', 'activityId' => 'setActivityId', + 'tags' => 'setTags', 'contentState' => 'setContentState', 'action' => 'setAction', 'secondaryAction' => 'setSecondaryAction' @@ -200,7 +210,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'metadata' => 'getMetadata', 'activityId' => 'getActivityId', + 'tags' => 'getTags', 'contentState' => 'getContentState', 'action' => 'getAction', 'secondaryAction' => 'getSecondaryAction' @@ -263,7 +275,9 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('activityId', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); $this->setIfExists('contentState', $data ?? [], null); $this->setIfExists('action', $data ?? [], null); $this->setIfExists('secondaryAction', $data ?? [], null); @@ -296,9 +310,17 @@ public function listInvalidProperties() { $invalidProperties = []; + if (!is_null($this->container['metadata']) && (count($this->container['metadata']) > 50)) { + $invalidProperties[] = "invalid value for 'metadata', number of items must be less than or equal to 50."; + } + if ($this->container['activityId'] === null) { $invalidProperties[] = "'activityId' can't be null"; } + if (!is_null($this->container['tags']) && (count($this->container['tags']) > 20)) { + $invalidProperties[] = "invalid value for 'tags', number of items must be less than or equal to 20."; + } + if ($this->container['contentState'] === null) { $invalidProperties[] = "'contentState' can't be null"; } @@ -317,6 +339,37 @@ public function valid() } + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + + if ((count($metadata) > 50)) { + throw new \InvalidArgumentException('invalid value for $metadata when calling LiveActivityUpdateRequest., number of items must be less than or equal to 50.'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + /** * Gets activityId * @@ -344,6 +397,37 @@ public function setActivityId($activityId) return $this; } + /** + * Gets tags + * + * @return string[]|null + */ + public function getTags() + { + return $this->container['tags']; + } + + /** + * Sets tags + * + * @param string[]|null $tags Tags for notification history. Omit to keep existing Tags, supply an array to replace them, or send an empty array to clear them. + * + * @return self + */ + public function setTags($tags) + { + if (is_null($tags)) { + throw new \InvalidArgumentException('non-nullable tags cannot be null'); + } + + if ((count($tags) > 20)) { + throw new \InvalidArgumentException('invalid value for $tags when calling LiveActivityUpdateRequest., number of items must be less than or equal to 20.'); + } + $this->container['tags'] = $tags; + + return $this; + } + /** * Gets contentState * diff --git a/generated/Model/MetadataValue.php b/generated/Model/MetadataValue.php new file mode 100644 index 0000000..8905c94 --- /dev/null +++ b/generated/Model/MetadataValue.php @@ -0,0 +1,381 @@ + + */ +class MetadataValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'Metadata_value'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + + ]; + + /** + * 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 = [ + + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + + ]; + + /** + * 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[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $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 = []; + + 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; + } + + /** + * 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/PushNotificationAction.php b/generated/Model/PushNotificationAction.php index 6b00712..0ee4f01 100644 --- a/generated/Model/PushNotificationAction.php +++ b/generated/Model/PushNotificationAction.php @@ -393,7 +393,7 @@ public function getUrl() /** * Sets url * - * @param string $url Action URL. For open_url, use an HTTP or HTTPS URL or a shortcuts://run-shortcut?name=... URL that runs a specific iPhone Shortcut. For webhook, use an HTTPS URL called by the ActivitySmith backend. + * @param string $url Action URL. For open_url, use HTTP, HTTPS, Shortcuts, or an installed app’s custom URL scheme, such as spotify:// or spotify:track:123. Custom app schemes require iOS 1.13.4 build 2 or later; no web fallback is provided. Internal and executable schemes are blocked. For webhook, use an HTTPS URL called by the ActivitySmith backend. * * @return self */ diff --git a/generated/Model/PushNotificationRequest.php b/generated/Model/PushNotificationRequest.php index c1b401e..95801e9 100644 --- a/generated/Model/PushNotificationRequest.php +++ b/generated/Model/PushNotificationRequest.php @@ -57,6 +57,7 @@ class PushNotificationRequest implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ + 'metadata' => 'array', 'title' => 'string', 'message' => 'string', 'subtitle' => 'string', @@ -78,6 +79,7 @@ class PushNotificationRequest implements ModelInterface, ArrayAccess, \JsonSeria * @psalm-var array */ protected static $openAPIFormats = [ + 'metadata' => null, 'title' => null, 'message' => null, 'subtitle' => null, @@ -97,6 +99,7 @@ class PushNotificationRequest implements ModelInterface, ArrayAccess, \JsonSeria * @var boolean[] */ protected static array $openAPINullables = [ + 'metadata' => false, 'title' => false, 'message' => false, 'subtitle' => false, @@ -196,6 +199,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'metadata' => 'metadata', 'title' => 'title', 'message' => 'message', 'subtitle' => 'subtitle', @@ -215,6 +219,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'metadata' => 'setMetadata', 'title' => 'setTitle', 'message' => 'setMessage', 'subtitle' => 'setSubtitle', @@ -234,6 +239,7 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'metadata' => 'getMetadata', 'title' => 'getTitle', 'message' => 'getMessage', 'subtitle' => 'getSubtitle', @@ -304,6 +310,7 @@ public function getModelName() */ public function __construct(array $data = null) { + $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('title', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); $this->setIfExists('subtitle', $data ?? [], null); @@ -344,6 +351,10 @@ public function listInvalidProperties() { $invalidProperties = []; + if (!is_null($this->container['metadata']) && (count($this->container['metadata']) > 50)) { + $invalidProperties[] = "invalid value for 'metadata', number of items must be less than or equal to 50."; + } + if ($this->container['title'] === null) { $invalidProperties[] = "'title' can't be null"; } @@ -351,8 +362,12 @@ public function listInvalidProperties() $invalidProperties[] = "invalid value for 'media', must be conform to the pattern /^https:\/\//."; } - if (!is_null($this->container['redirection']) && !preg_match("/^(http|https|shortcuts):\/\//", $this->container['redirection'])) { - $invalidProperties[] = "invalid value for 'redirection', must be conform to the pattern /^(http|https|shortcuts):\/\//."; + if (!is_null($this->container['redirection']) && (mb_strlen($this->container['redirection']) > 2048)) { + $invalidProperties[] = "invalid value for 'redirection', the character length must be smaller than or equal to 2048."; + } + + if (!is_null($this->container['redirection']) && !preg_match("/^[A-Za-z][A-Za-z0-9+.-]*:/", $this->container['redirection'])) { + $invalidProperties[] = "invalid value for 'redirection', must be conform to the pattern /^[A-Za-z][A-Za-z0-9+.-]*:/."; } if (!is_null($this->container['actions']) && (count($this->container['actions']) > 4)) { @@ -374,6 +389,37 @@ public function valid() } + /** + * Gets metadata + * + * @return array|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param array|null $metadata Additional information shown in notification and Live Activity details in ActivitySmith. Not displayed in the Push Notification or Live Activity on the device. Values must be strings, finite numbers, or booleans. At most 50 entries and 16 KB of serialized UTF-8 JSON. Omit on updates to preserve existing Metadata; send {} to clear it. + * + * @return self + */ + public function setMetadata($metadata) + { + if (is_null($metadata)) { + throw new \InvalidArgumentException('non-nullable metadata cannot be null'); + } + + if ((count($metadata) > 50)) { + throw new \InvalidArgumentException('invalid value for $metadata when calling PushNotificationRequest., number of items must be less than or equal to 50.'); + } + $this->container['metadata'] = $metadata; + + return $this; + } + /** * Gets title * @@ -500,7 +546,7 @@ public function getRedirection() /** * Sets redirection * - * @param string|null $redirection Optional HTTP URL, HTTPS URL, or shortcuts://run-shortcut?name=... URL opened when the user taps the notification body. Use shortcuts://run-shortcut?name=... to run a specific iPhone Shortcut that already exists on the user's device. Overrides the default tap target from `media` when both are provided. + * @param string|null $redirection Optional HTTP, HTTPS, Shortcuts, or installed app URL opened when the user taps the notification body. Custom schemes such as spotify:// and spotify:track:123 require iOS 1.13.4 build 2 or later and an installed handler; no web fallback is provided. Internal and executable schemes are blocked. Overrides the default tap target from media. * * @return self */ @@ -509,9 +555,11 @@ public function setRedirection($redirection) if (is_null($redirection)) { throw new \InvalidArgumentException('non-nullable redirection cannot be null'); } - - if ((!preg_match("/^(http|https|shortcuts):\/\//", ObjectSerializer::toString($redirection)))) { - throw new \InvalidArgumentException("invalid value for \$redirection when calling PushNotificationRequest., must conform to the pattern /^(http|https|shortcuts):\/\//."); + if ((mb_strlen($redirection) > 2048)) { + throw new \InvalidArgumentException('invalid length for $redirection when calling PushNotificationRequest., must be smaller than or equal to 2048.'); + } + if ((!preg_match("/^[A-Za-z][A-Za-z0-9+.-]*:/", ObjectSerializer::toString($redirection)))) { + throw new \InvalidArgumentException("invalid value for \$redirection when calling PushNotificationRequest., must conform to the pattern /^[A-Za-z][A-Za-z0-9+.-]*:/."); } $this->container['redirection'] = $redirection; 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)); + } +} + + diff --git a/generated/ObjectSerializer.php b/generated/ObjectSerializer.php index ac74510..35ceda4 100644 --- a/generated/ObjectSerializer.php +++ b/generated/ObjectSerializer.php @@ -77,7 +77,8 @@ public static function sanitizeForSerialization($data, $type = null, $format = n foreach ($data as $property => $value) { $data[$property] = self::sanitizeForSerialization($value); } - return $data; + // OpenAPI string-keyed maps must serialize as JSON objects, including {}. + return str_starts_with($type ?? '', 'array Date: Tue, 15 Sep 2026 19:55:07 +0700 Subject: [PATCH 02/11] feat: prepare php SDK metadata and documentation updates Preserve native metadata values and clearing semantics, extend legacy and stream-end history fields, and align the README with the pending SDK documentation. Package versions remain unchanged; release requires separate approval. Verification: local SDK tests passed against the regenerated contract; README code-fence preservation check passed. Initiated-by: user Implemented-by: codex --- CHANGELOG.md | 8 + README.md | 427 ++++++++++++++++++---------------------- src/LiveActivities.php | 42 ++-- src/Metadata.php | 23 +++ src/Notifications.php | 12 +- tests/ResourcesTest.php | 68 +++++++ 6 files changed, 333 insertions(+), 247 deletions(-) create mode 100644 src/Metadata.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 0118f44..c8e3d1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## Unreleased + +- Support Push Notification app deep links and final Tags/Metadata when ending a managed Live Activity stream. + +- Add Metadata to Push Notifications and Live Activity start, update, end, and stream requests, including empty-object clearing. + +- Add Tags replacement and empty-array clearing to legacy Live Activity update and end. + ## 1.10.0 ### New Features diff --git a/README.md b/README.md index d14098a..6a60f2f 100644 --- a/README.md +++ b/README.md @@ -1,37 +1,19 @@ # ActivitySmith PHP SDK -The ActivitySmith PHP SDK provides convenient access to the ActivitySmith API from PHP applications. - -## Documentation - -See [API reference](https://activitysmith.com/docs/api-reference/introduction). - -## Table of Contents - -- [Installation](#installation) -- [Setup](#setup) -- [Push Notifications](#push-notifications) - - [Send a Push Notification](#send-a-push-notification) - - [Rich Push Notifications with Media](#rich-push-notifications-with-media) - - [Actionable Push Notifications](#actionable-push-notifications) -- [Live Activities](#live-activities) - - [Start & Update Live Activity](#start--update-live-activity) - - [End Live Activity](#end-live-activity) - - [Live Activity Action](#live-activity-action) - - [Icons and Badges](#icons-and-badges) - - [Live Activity Colors](#live-activity-colors) -- [Widgets](#widgets) -- [App Icon Badge Count](#app-icon-badge-count) -- [Channels](#channels) -- [Tags](#tags) +[Documentation](https://activitysmith.com/docs/sdks/php) ## Installation -```sh +Install the ActivitySmith PHP SDK with Composer: + +```bash composer require activitysmith/activitysmith ``` -## Setup +## Quickstart + +1. [Create an API key](https://activitysmith.com/app/keys) +2. Set `ACTIVITYSMITH_API_KEY` or pass it directly to `ActivitySmith`. ```php - Push notification example -

+Send an immediate notification for a completed task or event. + +![Push Notification example for a new subscription event](https://cdn.activitysmith.com/features/new-subscription-push-notification.png) ```php $activitysmith->notifications->send( @@ -67,24 +49,19 @@ $activitysmith->notifications->send( ### Rich Push Notifications with Media -

- Rich push notification with image -

+![Rich Push Notification with image](https://cdn.activitysmith.com/features/rich-push-notification-with-image.png) ```php $activitysmith->notifications->send( title: 'Homepage ready', message: 'Your agent finished the redesign.', media: 'https://cdn.example.com/output/homepage-v2.png', - redirection: 'https://github.com/acme/web/pull/482', ); ``` -Send images, videos, or audio with your push notifications, press and hold to preview media directly from the notification, then tap through to open the linked content. +Attach images, videos, or audio to your Push Notifications. Press and hold the notification to preview the media. -

- Rich push notification with audio -

+![Rich Push Notification with audio](https://cdn.activitysmith.com/features/rich-push-notification-with-audio.png) What will work: @@ -93,23 +70,33 @@ What will work: - direct video file URL: `.mp4`, `.mov`, etc. - URL that responds with a proper media `Content-Type`, even if the path has no extension +`media` cannot be combined with `actions`. + +### Push Notifications with Redirection + +Open a web page, an iPhone Shortcut, or an installed app when someone taps the notification. Set `redirection` to an HTTP, HTTPS, or Shortcuts URL, or an app deep link such as `spotify:track:123`. + +```php +$activitysmith->notifications->send( + title: 'Homepage ready', + message: 'Your agent finished the redesign.', + redirection: 'https://github.com/acme/web/pull/482', +); +``` + ### Actionable Push Notifications -

- Actionable push notification example -

+![Actionable Push Notification with redirection and actions](https://cdn.activitysmith.com/features/actionable-push-notifications-2.png) -Push notification `redirection` and `actions` are optional. Use them to open HTTPS URLs, run a specific iPhone Shortcut with `shortcuts://run-shortcut?name=...`, or trigger backend webhook workflows. -Webhooks are executed by the ActivitySmith backend. +For expanded notification actions, `open_url` supports HTTP, HTTPS, Shortcuts, and installed app deep links. Webhooks are executed by the ActivitySmith backend and must use HTTPS. Custom app links require iOS 1.13.4 build 2 or later and an installed app that handles the URL. ```php $activitysmith->notifications->send( title: 'New subscription 💸', message: 'Customer upgraded to Pro plan', - redirection: 'https://crm.example.com/customers/cus_9f3a1d', // Optional - actions: [ // Optional (max 4) + actions: [ PushAction::make( - title: 'Open CRM Profile', + title: 'Open CRM', type: 'open_url', url: 'https://crm.example.com/customers/cus_9f3a1d', ), @@ -134,14 +121,19 @@ $activitysmith->notifications->send( ## Live Activities -There are six types of Live Activities: +Choose the Live Activity type that matches what you want to show: + +- ![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) **Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion. + +- ![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) **Metrics**: Track two related values with segmented bars, such as CPU and memory. -- `stats`: best for showing business numbers side by side, such as revenue, sales, new users, conversion, refunds, or any other value you want visible at a glance -- `metrics`: best for live percentage values that change often, like server CPU, memory usage, disk usage, or error rate -- `segmented_progress`: best for anything that moves through clear stages, like deployments, onboarding flows, backups, ETL pipelines, migrations, and AI agent runs -- `progress`: best for tracking real-time progress with percentage, like tasks, backups, migrations, syncs, or uploads -- `alert`: best for status updates, such as feature adoption, reactivation, onboarding blockers, incidents, escalations, and other operational states -- `timer`: best for countdowns and elapsed runtime, like benchmark runs, uploads, backups, transcodes, and long-running jobs +- ![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) **Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify. + +- ![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) **Progress**: Show percentage progress for jobs that move continuously toward completion. + +- ![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint. + +- ![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) **Timer**: Count down from a duration, or count up from 00:00 while a job runs. ### Start & Update Live Activity @@ -149,13 +141,7 @@ Use a stable `streamKey` to identify the metric, job, deployment, or system you #### Stats -

- Stats Live Activity stream example -

+![Stats Live Activity stream example](https://cdn.activitysmith.com/features/stats-live-activity.png) ```php $activitysmith->liveActivities->stream( @@ -178,13 +164,7 @@ $activitysmith->liveActivities->stream( #### Metrics -

- Metrics Live Activity stream example -

+![Metrics Live Activity stream example](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) ```php $activitysmith->liveActivities->stream( @@ -203,13 +183,7 @@ $activitysmith->liveActivities->stream( #### Segmented Progress -

- Segmented Progress Live Activity stream example -

+![Segmented Progress Live Activity stream example](https://cdn.activitysmith.com/features/update-live-activity.png) ```php $activitysmith->liveActivities->stream( @@ -226,13 +200,7 @@ $activitysmith->liveActivities->stream( #### Progress -

- Progress Live Activity stream example -

+![Progress Live Activity stream example](https://cdn.activitysmith.com/features/progress-live-activity.png) ```php $activitysmith->liveActivities->stream( @@ -248,13 +216,7 @@ $activitysmith->liveActivities->stream( #### Alert -

- Alert Live Activity stream example -

+![Alert Live Activity stream example](https://cdn.activitysmith.com/features/alert-live-activity.png) ```php $activitysmith->liveActivities->stream( @@ -271,13 +233,7 @@ $activitysmith->liveActivities->stream( #### Timer -

- Timer Live Activity showing a benchmark run countdown -

+![Timer Live Activity stream example](https://cdn.activitysmith.com/features/timer-live-activity.png) ```php $activitysmith->liveActivities->stream( @@ -292,13 +248,13 @@ $activitysmith->liveActivities->stream( ); ``` -For a countdown, send `duration_seconds`. You can update `title`, `subtitle`, `color`, or any other visible field as the work changes. Leave `duration_seconds` out unless you want to change the timer. +For a countdown, send `durationSeconds`. You can update `title`, `subtitle`, `color`, or any other visible field as the work changes. Leave `durationSeconds` out unless you want to change the timer. -To start at 00:00 and count up, set `counts_down: false` and leave out `duration_seconds`. +To start at 00:00 and count up, set `countsDown` to `false` and leave out `durationSeconds`. ### End Live Activity -Call `endStream(...)` with the same `streamKey` to dismiss the Live Activity. You can include final values before it is removed. By default, iOS removes the Live Activity after two minutes. Set `autoDismissMinutes` to choose a different dismissal time, including `0` for immediate dismissal. +Call `endStream(...)` with the same `streamKey` to dismiss the Live Activity. You can include final values before it is removed. Set `autoDismissSeconds` to dismiss it after a delay in seconds, or `autoDismissMinutes` for minutes. Use `0` for immediate dismissal. Seconds take precedence if both are set. ```php $activitysmith->liveActivities->endStream( @@ -311,27 +267,78 @@ $activitysmith->liveActivities->endStream( LiveActivityMetric::make(label: 'CPU', value: 7, unit: '%'), LiveActivityMetric::make(label: 'MEM', value: 38, unit: '%'), ], - autoDismissMinutes: 2, + autoDismissSeconds: 30, + ), +); +``` + +### Icons and Badges + +Add more context to Live Activities with icons and badges. + +#### Icon + +Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`. + +![Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen](https://cdn.activitysmith.com/features/metrics-live-activity-with-icon.png) + +```php +$activitysmith->liveActivities->stream( + 'prod-web-1', + contentState: LiveActivityContentState::make( + title: 'Server Health', + subtitle: 'prod-web-1', + type: LiveActivities::TYPE_METRICS, + icon: LiveActivityAlertIcon::make(symbol: 'server.rack', color: 'blue'), + metrics: [ + LiveActivityMetric::make(label: 'CPU', value: 18, unit: '%'), + LiveActivityMetric::make(label: 'MEM', value: 42, unit: '%'), + ], + ), +); +``` + +The `icon` symbol value is an Apple SF Symbol name. Browse the catalog with one of these tools: + +- [ActivitySmith app](https://apps.apple.com/us/app/activitysmith/id6752254835) - Open Settings -> SF Symbols to browse 45 hand-picked icons ready to use +- [SF Symbols](https://developer.apple.com/sf-symbols/) - Apple's official macOS app +- [Interactful](https://apps.apple.com/app/interactful/id1528095640) - free third-party iOS app listing all SF Symbols under Foundations -> Iconography + +#### Badge + +Badges are supported by `alert`, `progress`, and `segmented_progress` Live Activities. + +![Progress Live Activity with a badge on the iPhone Lock Screen](https://cdn.activitysmith.com/features/progress-live-activity-with-badge.png) + +```php +$activitysmith->liveActivities->stream( + 'nightly-database-backup', + contentState: LiveActivityContentState::make( + title: 'Nightly Database Backup', + subtitle: 'verify restore', + type: LiveActivities::TYPE_PROGRESS, + badge: LiveActivityAlertBadge::make(title: 'S3', color: 'cyan'), + percentage: 62, ), ); ``` +### Live Activity Colors + +Choose from these colors for the Live Activity accent, including progress bars and action buttons, or apply them to an individual icon or badge: + +`lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`, `gray` + ### Live Activity Action +![Metrics Live Activity with action](https://cdn.activitysmith.com/features/metrics-live-activity-action.png) + Live Activities can include an action button. -- `open_url`: open an HTTPS URL. -- `open_url` with a `shortcuts://` URL: run an Apple Shortcut, for example to open an app. +- `open_url`: open an HTTP or HTTPS URL. +- `open_url` with a `shortcuts://run-shortcut?name=...` URL: run a specific iPhone Shortcut, for example to open an app. - `webhook`: trigger a backend GET/POST workflow. -

- Live Activity with action button -

- #### Open URL action ```php @@ -349,7 +356,7 @@ $activitysmith->liveActivities->stream( action: LiveActivityAction::make( title: 'Dashboard', type: 'open_url', - url: 'https://ops.example.com/servers/prod-web-1', + url: 'https://status.example.com/servers/prod-web-1', ), ); ``` @@ -358,13 +365,15 @@ $activitysmith->liveActivities->stream( ```php $activitysmith->liveActivities->stream( - 'deploy-payments-api', + 'prod-web-1', contentState: LiveActivityContentState::make( - title: 'Deploying payments-api', - subtitle: 'Running database migrations', - type: 'segmented_progress', - numberOfSteps: 5, - currentStep: 3, + title: 'Server Health', + subtitle: 'prod-web-1', + type: 'metrics', + metrics: [ + LiveActivityMetric::make(label: 'CPU', value: 76, unit: '%'), + LiveActivityMetric::make(label: 'MEM', value: 52, unit: '%'), + ], ), action: LiveActivityAction::make( title: 'Chat with Jarvis', @@ -401,15 +410,9 @@ $activitysmith->liveActivities->stream( #### Secondary action -

- Alert Live Activity with primary and secondary action buttons -

+![Alert Live Activity with primary and secondary action buttons](https://cdn.activitysmith.com/features/live-activity-secondary-action.png) -Use `secondaryAction` when you want a second button beside the primary `action`. +Use `secondary_action` when you want a second button beside the primary `action`. The secondary action button is supported for `alert`, `progress`, and `segmented_progress` Live Activities. Both buttons use the same `open_url`, `webhook`, and Apple Shortcut payload shapes. @@ -447,177 +450,137 @@ $activitysmith->liveActivities->stream( ); ``` -### Icons and Badges +## Lock Screen Widgets -Add more context to Live Activities with icons and badges. +![Lock screen widgets](https://cdn.activitysmith.com/features/lock-screen-widgets.png) -#### Icon +ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track. Create a metric in the [web app](https://activitysmith.com/app/widgets), then update the metric value using our API, add a widget to your lock screen and it will fetch the latest update automatically. -Supported Live Activity types: `stats`, `metrics`, `progress`, `segmented_progress`, `alert`, and `timer`. +![Create widget metric](https://cdn.activitysmith.com/features/create-widget-metric.png) -

- Metrics Live Activity with an SF Symbol icon on the iPhone Lock Screen -

+Use the metric key to update its value. ```php -$activitysmith->liveActivities->stream( - 'prod-web-1', - contentState: LiveActivityContentState::make( - title: 'Server Health', - subtitle: 'prod-web-1', - type: LiveActivities::TYPE_METRICS, - icon: LiveActivityAlertIcon::make(symbol: 'server.rack', color: 'blue'), - metrics: [ - LiveActivityMetric::make(label: 'CPU', value: 18, unit: '%'), - LiveActivityMetric::make(label: 'MEM', value: 42, unit: '%'), - ], - ), -); +$activitysmith->metrics->update('deploy.success_rate', 99.9); ``` -The `icon` symbol value is an Apple SF Symbol name. Browse the catalog with one of these tools: - -- [ActivitySmith app](https://apps.apple.com/us/app/activitysmith/id6752254835) - Open Settings -> SF Symbols to browse 45 hand-picked icons ready to use -- [SF Symbols](https://developer.apple.com/sf-symbols/) - Apple's official macOS app -- [Interactful](https://apps.apple.com/app/interactful/id1528095640) - free third-party iOS app listing all SF Symbols under Foundations -> Iconography - -#### Badge - -Badges are supported by `alert`, `progress`, and `segmented_progress` Live Activities. - -

- Progress Live Activity with a badge on the iPhone Lock Screen -

+String metric values work too. ```php -$activitysmith->liveActivities->stream( - 'nightly-database-backup', - contentState: LiveActivityContentState::make( - title: 'Nightly Database Backup', - subtitle: 'verify restore', - type: LiveActivities::TYPE_PROGRESS, - badge: LiveActivityAlertBadge::make(title: 'S3', color: 'cyan'), - percentage: 62, - ), -); +$activitysmith->metrics->update('prod.status', 'healthy'); ``` -### Live Activity Colors - -Choose from these colors for the Live Activity accent, including progress bars and action buttons, or apply them to an individual icon or badge: - -`lime`, `green`, `cyan`, `blue`, `purple`, `magenta`, `red`, `orange`, `yellow`, `gray` - -## Widgets +## App Icon Badge Count -

- Lock screen widgets -

+![ActivitySmith app icon with an App Icon Badge Count](https://cdn.activitysmith.com/features/badge-count.png) -ActivitySmith lets you display any value on your Lock Screen with widgets - SaaS metrics, revenue, signups, uptime, habits, or anything else you want to track. Create a metric in the web app, then update the metric value using our API, add a widget to your lock screen and it will fetch the latest update automatically. +Show the number you care about on your ActivitySmith app icon. Track MRR, a customer count, a stock price, or any other value you want to keep in view. -

- Create widget metric -

+### Set or update the badge value ```php -$activitysmith->metrics->update('deploy.success_rate', 99.9); +$activitysmith->badgeCount(8333); ``` -String metric values work too. +### Clear the badge + +Pass `0` to clear the badge. ```php -$activitysmith->metrics->update('prod.status', 'healthy'); +$activitysmith->badgeCount(0); ``` -## App Icon Badge Count - -

- ActivitySmith app icon with an App Icon Badge Count -

- -Show the number you care about on your ActivitySmith app icon. Track MRR, a customer count, a stock price, or any other value you want to keep in view. +## Tags -Set or update the badge value. +Use `tags` to organize and filter your Push Notification and Live Activity history. Tags are created automatically when you first use them. ```php -$activitysmith->badgeCount(8333); +$activitysmith->notifications->send([ + 'title' => 'New subscription 💸', + 'message' => 'Customer upgraded to Pro plan', + 'tags' => ['user:382', 'billing'], +]); ``` -To clear the badge, set its value to 0. +On Live Activity stream updates and legacy `update` or `end` calls, omit `tags` to keep existing Tags, supply a list to replace them, or pass `tags: []` to clear them. ```php -$activitysmith->badgeCount(0); +$activitysmith->liveActivities->update( + activityId: 'YOUR_ACTIVITY_ID', + title: 'Customer Import', + percentage: 60, + tags: [], +); ``` -## Channels +`endStream` also accepts final Tags and Metadata. Omit them to preserve existing values, or supply empty collections to clear them. -Use `channels` to target specific team members or devices +## Metadata -### Push Notifications +Metadata adds information to Push Notification and Live Activity details in ActivitySmith. It does not appear in the notification or Live Activity on your device. ```php $activitysmith->notifications->send( title: 'New subscription 💸', - message: 'Customer upgraded to Pro plan', - channels: ['sales', 'customer-success'], + metadata: ['customer_id' => '382', 'plan' => 'Pro', 'amount' => 29, 'trial' => false], ); -``` - -### Live Activities -```php -$activitysmith->liveActivities->start( - title: 'Nightly Database Backup', - subtitle: 'verify restore', +$activitysmith->liveActivities->stream( + 'customer-import', + title: 'Customer Import', type: 'progress', - percentage: 62, - channels: ['sales', 'customer-success'], + percentage: 60, + metadata: ['job_id' => 'import-382', 'records' => 1200], ); ``` -### App Icon Badge Count +Supported on Push Notifications, Live Activity streams (including stream ending), and legacy `start`, `update`, and `end` calls. On updates or end calls, omit `metadata` to keep it, supply an object to replace it, or pass `metadata: []` (serialized as `{}`) to clear it. -```php -$activitysmith->badgeCount(3, channels: ['sales', 'customer-success']); -``` +Values can be strings, numbers, or booleans. Metadata supports up to 50 entries and 16 KB of JSON, with keys up to 100 characters and strings up to 4,000 characters. Nested objects, arrays, and null values are not supported. -## Tags +## Channels -Use `tags` to organize and filter your Push Notification and Live Activity history. Tags are created automatically when you first use them. +Use `channels` to target specific team members or devices when sending Push Notifications, Live Activities, or App Icon Badge Count updates. Omit it for account-wide delivery. ```php $activitysmith->notifications->send( title: 'New subscription 💸', message: 'Customer upgraded to Pro plan', - tags: ['user:382', 'billing'], + channels: ['sales', 'customer-success'], +); + +$activitysmith->liveActivities->stream( + 'nightly-backup', + contentState: LiveActivityContentState::make( + title: 'Nightly database backup', + type: 'segmented_progress', + numberOfSteps: 3, + currentStep: 1, + ), + channels: ['ios-builds'], ); + +$activitysmith->badgeCount(3, channels: ['sales', 'customer-success']); ``` ## Error Handling +Wrap SDK calls with `try/catch`: + ```php try { - $activitysmith->notifications->send( - title: 'New subscription 💸', - ); -} catch (Throwable $err) { - echo 'Request failed: ' . $err->getMessage() . PHP_EOL; + $activitysmith->notifications->send(title: 'Hello'); +} catch (\Throwable $error) { + echo $error->getMessage(); } ``` -## Requirements +## Additional Resources + +### [Packagist](https://packagist.org/packages/activitysmith/activitysmith) -- PHP 8.1+ +Install the ActivitySmith PHP SDK from Packagist -## License +### [Source Code](https://github.com/ActivitySmithHQ/activitysmith-php) -MIT +View the PHP SDK source on GitHub diff --git a/src/LiveActivities.php b/src/LiveActivities.php index dde166f..47874fd 100644 --- a/src/LiveActivities.php +++ b/src/LiveActivities.php @@ -43,7 +43,8 @@ public function start( mixed $durationSeconds = null, mixed $countsDown = null, mixed $secondaryAction = null, - mixed $tags = null + mixed $tags = null, + array|\stdClass|null $metadata = null ): mixed { $request = $this->buildRequest($request, $contentState, [ @@ -70,8 +71,10 @@ public function start( 'target' => $target, 'channels' => $channels, 'tags' => $tags, + 'metadata' => $metadata, ]); + $request = Metadata::normalizeRequest($request); return $this->api->startLiveActivity($this->normalizeTargetChannels($request)); } @@ -96,7 +99,9 @@ public function update( mixed $action = null, mixed $durationSeconds = null, mixed $countsDown = null, - mixed $secondaryAction = null + mixed $secondaryAction = null, + ?array $tags = null, + array|\stdClass|null $metadata = null ): mixed { $request = $this->buildRequest($request, $contentState, [ @@ -118,10 +123,13 @@ public function update( 'step_color' => $stepColor, ], [ 'activity_id' => $activityId, + 'tags' => $tags, + 'metadata' => $metadata, 'action' => $action, 'secondary_action' => $secondaryAction, ]); + $request = Metadata::normalizeRequest($request); return $this->api->updateLiveActivity($request); } @@ -147,7 +155,9 @@ public function end( mixed $action = null, mixed $durationSeconds = null, mixed $countsDown = null, - mixed $secondaryAction = null + mixed $secondaryAction = null, + ?array $tags = null, + array|\stdClass|null $metadata = null ): mixed { $request = $this->buildRequest($request, $contentState, [ @@ -170,10 +180,13 @@ public function end( 'auto_dismiss_minutes' => $autoDismissMinutes, ], [ 'activity_id' => $activityId, + 'tags' => $tags, + 'metadata' => $metadata, 'action' => $action, 'secondary_action' => $secondaryAction, ]); + $request = Metadata::normalizeRequest($request); return $this->api->endLiveActivity($request); } @@ -202,7 +215,8 @@ public function stream( mixed $durationSeconds = null, mixed $countsDown = null, mixed $secondaryAction = null, - mixed $tags = null + mixed $tags = null, + array|\stdClass|null $metadata = null ): mixed { $request = $this->buildRequest($request, $contentState, [ @@ -229,8 +243,10 @@ public function stream( 'target' => $target, 'channels' => $channels, 'tags' => $tags, + 'metadata' => $metadata, ]); + $request = Metadata::normalizeRequest($request); return $this->api->reconcileLiveActivityStream( $streamKey, $this->normalizeTargetChannels($request) @@ -260,7 +276,9 @@ public function endStream( mixed $alert = null, mixed $durationSeconds = null, mixed $countsDown = null, - mixed $secondaryAction = null + mixed $secondaryAction = null, + ?array $tags = null, + array|\stdClass|null $metadata = null ): mixed { $request = $this->buildRequest($request, $contentState, [ @@ -285,9 +303,11 @@ public function endStream( 'action' => $action, 'secondary_action' => $secondaryAction, 'alert' => $alert, + 'tags' => $tags, + 'metadata' => $metadata, ]); - return $this->api->endLiveActivityStream($streamKey, $request); + return $this->api->endLiveActivityStream($streamKey, Metadata::normalizeRequest($request)); } // Backward-compatible aliases. @@ -296,7 +316,7 @@ public function startLiveActivity( string $contentType = LiveActivitiesApi::contentTypes['startLiveActivity'][0] ): mixed { return $this->api->startLiveActivity( - $this->normalizeTargetChannels($liveActivityStartRequest), + Metadata::normalizeRequest($this->normalizeTargetChannels($liveActivityStartRequest)), $contentType ); } @@ -305,14 +325,14 @@ public function updateLiveActivity( mixed $liveActivityUpdateRequest, string $contentType = LiveActivitiesApi::contentTypes['updateLiveActivity'][0] ): mixed { - return $this->api->updateLiveActivity($liveActivityUpdateRequest, $contentType); + return $this->api->updateLiveActivity(Metadata::normalizeRequest($liveActivityUpdateRequest), $contentType); } public function endLiveActivity( mixed $liveActivityEndRequest, string $contentType = LiveActivitiesApi::contentTypes['endLiveActivity'][0] ): mixed { - return $this->api->endLiveActivity($liveActivityEndRequest, $contentType); + return $this->api->endLiveActivity(Metadata::normalizeRequest($liveActivityEndRequest), $contentType); } public function reconcileLiveActivityStream( @@ -322,7 +342,7 @@ public function reconcileLiveActivityStream( ): mixed { return $this->api->reconcileLiveActivityStream( $streamKey, - $this->normalizeTargetChannels($liveActivityStreamRequest), + Metadata::normalizeRequest($this->normalizeTargetChannels($liveActivityStreamRequest)), $contentType ); } @@ -334,7 +354,7 @@ public function endLiveActivityStream( ): mixed { return $this->api->endLiveActivityStream( $streamKey, - $liveActivityStreamDeleteRequest, + Metadata::normalizeRequest($liveActivityStreamDeleteRequest), $contentType ); } diff --git a/src/Metadata.php b/src/Metadata.php new file mode 100644 index 0000000..a98bf93 --- /dev/null +++ b/src/Metadata.php @@ -0,0 +1,23 @@ +buildRequest( @@ -44,9 +45,10 @@ public function send( 'target' => $target, 'channels' => $channels, 'tags' => $tags, + 'metadata' => $metadata, ] ); - $normalized = $this->normalizeTargetChannels($request); + $normalized = Metadata::normalizeRequest($this->normalizeTargetChannels($request)); $this->assertValidMediaActionsCombination($normalized); return $this->api->sendPushNotification($normalized); @@ -64,7 +66,8 @@ public function sendPushNotification( ?array $actions = null, ?array $target = null, array|string|null $channels = null, - ?array $tags = null + ?array $tags = null, + array|\stdClass|null $metadata = null ): mixed { $pushNotificationRequest = $this->buildRequest( $pushNotificationRequest, @@ -78,9 +81,10 @@ public function sendPushNotification( 'target' => $target, 'channels' => $channels, 'tags' => $tags, + 'metadata' => $metadata, ] ); - $normalized = $this->normalizeTargetChannels($pushNotificationRequest); + $normalized = Metadata::normalizeRequest($this->normalizeTargetChannels($pushNotificationRequest)); $this->assertValidMediaActionsCombination($normalized); return $this->api->sendPushNotification( diff --git a/tests/ResourcesTest.php b/tests/ResourcesTest.php index 34a5dad..611d979 100644 --- a/tests/ResourcesTest.php +++ b/tests/ResourcesTest.php @@ -27,6 +27,74 @@ final class ResourcesTest extends TestCase { + public function testExternalPushURLsAndStreamEndFields(): void + { + foreach (['http://example.com', 'https://example.com', 'shortcuts://run-shortcut?name=Test', 'spotify://', 'spotify:track:123'] as $url) { + $request = new GeneratedPushNotificationRequest(['title' => 'Job', 'redirection' => $url]); + $body = json_decode(json_encode(\ActivitySmith\Generated\ObjectSerializer::sanitizeForSerialization($request)), true); + $this->assertSame($url, $body['redirection']); + } + foreach ([null, [], ['finished']] as $tags) { + $api = $this->getMockBuilder(LiveActivitiesApi::class)->disableOriginalConstructor()->onlyMethods(['endLiveActivityStream'])->getMock(); + $api->expects($this->once())->method('endLiveActivityStream')->willReturnCallback(function ($key, $request) use ($tags) { + $body = json_decode(json_encode(\ActivitySmith\Generated\ObjectSerializer::sanitizeForSerialization($request)), true); + $this->assertSame($tags !== null, array_key_exists('tags', $body)); + if ($tags !== null) $this->assertSame($tags, $body['tags']); + return (object) ['success' => true]; + }); + (new LiveActivities($api))->endStream('job', tags: $tags, metadata: []); + } + } + + public function testMetadataPreservesScalarsAndEmptyObjects(): void + { + foreach (['send' => 'sendPushNotification', 'start' => 'startLiveActivity', 'update' => 'updateLiveActivity', 'end' => 'endLiveActivity', 'stream' => 'reconcileLiveActivityStream', 'endStream' => 'endLiveActivityStream'] as $method => $apiMethod) { + $class = $method === 'send' ? PushNotificationsApi::class : LiveActivitiesApi::class; + $api = $this->getMockBuilder($class)->disableOriginalConstructor()->onlyMethods([$apiMethod])->getMock(); + $captured = []; + $api->method($apiMethod)->willReturnCallback(function (...$args) use (&$captured, $method) { + $request = $args[in_array($method, ['stream', 'endStream']) ? 1 : 0]; + $captured[] = json_decode(json_encode(\ActivitySmith\Generated\ObjectSerializer::sanitizeForSerialization($request))); + return (object) ['success' => true]; + }); + $resource = $method === 'send' ? new Notifications($api) : new LiveActivities($api); + foreach ([null, [], ['order' => '382', 'ready' => false, 'count' => 0, 'empty' => '', 'ratio' => 1.25]] as $metadata) { + if (in_array($method, ['stream', 'endStream'])) $resource->$method('job', title: 'Job', metadata: $metadata); + else $resource->$method(title: 'Job', metadata: $metadata); + $body = end($captured); + $this->assertSame($metadata !== null, property_exists($body, 'metadata')); + if ($metadata !== null) $this->assertEquals((object) $metadata, $body->metadata); + } + } + $model = new \ActivitySmith\Generated\Model\LiveActivityUpdateRequest(['activityId' => 'a', 'metadata' => [], 'contentState' => ['title' => 'Job']]); + $body = json_decode(json_encode(\ActivitySmith\Generated\ObjectSerializer::sanitizeForSerialization($model))); + $this->assertInstanceOf(\stdClass::class, $body->metadata); + } + + public function testLegacyTagsSerializeEmptyArraysAndOmitNull(): void + { + foreach (['update' => 'updateLiveActivity', 'end' => 'endLiveActivity'] as $method => $apiMethod) { + $api = $this->getMockBuilder(LiveActivitiesApi::class)->disableOriginalConstructor()->onlyMethods([$apiMethod])->getMock(); + $captured = []; + $api->method($apiMethod)->willReturnCallback(function ($request) use (&$captured) { + $captured[] = json_decode(json_encode(\ActivitySmith\Generated\ObjectSerializer::sanitizeForSerialization($request)), true); + return (object) ['success' => true]; + }); + $resource = new LiveActivities($api); + foreach ([null, ['billing'], []] as $tags) { + $resource->$method(activityId: 'activity-1', title: 'Job', tags: $tags); + $body = end($captured); + $this->assertSame($tags !== null, array_key_exists('tags', $body)); + if ($tags !== null) $this->assertSame($tags, $body['tags']); + $class = $method === 'update' ? \ActivitySmith\Generated\Model\LiveActivityUpdateRequest::class : \ActivitySmith\Generated\Model\LiveActivityEndRequest::class; + $model = new $class($body); + $serialized = json_decode(json_encode(\ActivitySmith\Generated\ObjectSerializer::sanitizeForSerialization($model)), true); + $this->assertSame($tags !== null, array_key_exists('tags', $serialized)); + if ($tags !== null) $this->assertSame($tags, $serialized['tags']); + } + } + } + public function testBadgeCountClearsAndTargetsChannels(): void { $client = new ActivitySmith('test'); From a29e7d212ec405bc728249db9987ac9ba0f80e26 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 20:12:52 +0700 Subject: [PATCH 03/11] fix: remove internal operations from the generated client Use the generated output from canonical backend 49ad7b083b50f53bc3d81edb77ca6597845160a2. Health checks and app changelog are first-party operations, not part of the developer API. Preserve the existing wrapper and README preparation. Verification: SDK tests passed; generated source scanned for removed operations/models; provenance matches the deployed public contract. Initiated-by: user Implemented-by: codex --- generated/Api/PublicApi.php | 791 ---------------------- generated/Model/ChangelogEntry.php | 729 -------------------- generated/Model/ChangelogItem.php | 572 ---------------- generated/Model/ChangelogListResponse.php | 412 ----------- generated/Model/HealthCheck.php | 563 --------------- generated/Model/HealthResponse.php | 523 -------------- generated/openapi-source.json | 4 +- 7 files changed, 2 insertions(+), 3592 deletions(-) delete mode 100644 generated/Api/PublicApi.php delete mode 100644 generated/Model/ChangelogEntry.php delete mode 100644 generated/Model/ChangelogItem.php delete mode 100644 generated/Model/ChangelogListResponse.php delete mode 100644 generated/Model/HealthCheck.php delete mode 100644 generated/Model/HealthResponse.php diff --git a/generated/Api/PublicApi.php b/generated/Api/PublicApi.php deleted file mode 100644 index fceea3d..0000000 --- a/generated/Api/PublicApi.php +++ /dev/null @@ -1,791 +0,0 @@ - [ - 'application/json', - ], - 'listPublicChangelogEntries' => [ - 'application/json', - ], - ]; - - /** - * @param ClientInterface $client - * @param Configuration $config - * @param HeaderSelector $selector - * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec - */ - public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 - ) { - $this->client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); - $this->headerSelector = $selector ?: new HeaderSelector(); - $this->hostIndex = $hostIndex; - } - - /** - * Set the host index - * - * @param int $hostIndex Host index (required) - */ - public function setHostIndex($hostIndex): void - { - $this->hostIndex = $hostIndex; - } - - /** - * Get the host index - * - * @return int Host index - */ - public function getHostIndex() - { - return $this->hostIndex; - } - - /** - * @return Configuration - */ - public function getConfig() - { - return $this->config; - } - - /** - * Operation getApiHealth - * - * Get API Health - * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiHealth'] to see the possible values for this operation - * - * @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\HealthResponse|\ActivitySmith\Generated\Model\HealthResponse - */ - public function getApiHealth(string $contentType = self::contentTypes['getApiHealth'][0]) - { - list($response) = $this->getApiHealthWithHttpInfo($contentType); - return $response; - } - - /** - * Operation getApiHealthWithHttpInfo - * - * Get API Health - * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiHealth'] to see the possible values for this operation - * - * @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\HealthResponse|\ActivitySmith\Generated\Model\HealthResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function getApiHealthWithHttpInfo(string $contentType = self::contentTypes['getApiHealth'][0]) - { - $request = $this->getApiHealthRequest($contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch($statusCode) { - case 200: - if ('\ActivitySmith\Generated\Model\HealthResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\ActivitySmith\Generated\Model\HealthResponse' !== '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\HealthResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 503: - if ('\ActivitySmith\Generated\Model\HealthResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\ActivitySmith\Generated\Model\HealthResponse' !== '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\HealthResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\ActivitySmith\Generated\Model\HealthResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== '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, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\ActivitySmith\Generated\Model\HealthResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 503: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\ActivitySmith\Generated\Model\HealthResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getApiHealthAsync - * - * Get API Health - * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiHealth'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getApiHealthAsync(string $contentType = self::contentTypes['getApiHealth'][0]) - { - return $this->getApiHealthAsyncWithHttpInfo($contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getApiHealthAsyncWithHttpInfo - * - * Get API Health - * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiHealth'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getApiHealthAsyncWithHttpInfo(string $contentType = self::contentTypes['getApiHealth'][0]) - { - $returnType = '\ActivitySmith\Generated\Model\HealthResponse'; - $request = $this->getApiHealthRequest($contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'getApiHealth' - * - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getApiHealth'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function getApiHealthRequest(string $contentType = self::contentTypes['getApiHealth'][0]) - { - - - $resourcePath = '/health'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - - - - - $headers = $this->headerSelector->selectHeaders( - ['application/json', ], - $contentType, - $multipart - ); - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'GET', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Operation listPublicChangelogEntries - * - * List Public Changelog Entries - * - * @param string $platform Platform whose published changelog entries should be returned. (optional, default to 'ios') - * @param int $limit Maximum number of entries to return. (optional, default to 10) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPublicChangelogEntries'] to see the possible values for this operation - * - * @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\ChangelogListResponse - */ - public function listPublicChangelogEntries($platform = 'ios', $limit = 10, string $contentType = self::contentTypes['listPublicChangelogEntries'][0]) - { - list($response) = $this->listPublicChangelogEntriesWithHttpInfo($platform, $limit, $contentType); - return $response; - } - - /** - * Operation listPublicChangelogEntriesWithHttpInfo - * - * List Public Changelog Entries - * - * @param string $platform Platform whose published changelog entries should be returned. (optional, default to 'ios') - * @param int $limit Maximum number of entries to return. (optional, default to 10) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPublicChangelogEntries'] to see the possible values for this operation - * - * @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\ChangelogListResponse, HTTP status code, HTTP response headers (array of strings) - */ - public function listPublicChangelogEntriesWithHttpInfo($platform = 'ios', $limit = 10, string $contentType = self::contentTypes['listPublicChangelogEntries'][0]) - { - $request = $this->listPublicChangelogEntriesRequest($platform, $limit, $contentType); - - try { - $options = $this->createHttpClientOption(); - try { - $response = $this->client->send($request, $options); - } catch (RequestException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - $e->getResponse() ? $e->getResponse()->getHeaders() : null, - $e->getResponse() ? (string) $e->getResponse()->getBody() : null - ); - } catch (ConnectException $e) { - throw new ApiException( - "[{$e->getCode()}] {$e->getMessage()}", - (int) $e->getCode(), - null, - null - ); - } - - $statusCode = $response->getStatusCode(); - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - switch($statusCode) { - case 200: - if ('\ActivitySmith\Generated\Model\ChangelogListResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\ActivitySmith\Generated\Model\ChangelogListResponse' !== '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\ChangelogListResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - $returnType = '\ActivitySmith\Generated\Model\ChangelogListResponse'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== '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, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\ActivitySmith\Generated\Model\ChangelogListResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation listPublicChangelogEntriesAsync - * - * List Public Changelog Entries - * - * @param string $platform Platform whose published changelog entries should be returned. (optional, default to 'ios') - * @param int $limit Maximum number of entries to return. (optional, default to 10) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPublicChangelogEntries'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function listPublicChangelogEntriesAsync($platform = 'ios', $limit = 10, string $contentType = self::contentTypes['listPublicChangelogEntries'][0]) - { - return $this->listPublicChangelogEntriesAsyncWithHttpInfo($platform, $limit, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation listPublicChangelogEntriesAsyncWithHttpInfo - * - * List Public Changelog Entries - * - * @param string $platform Platform whose published changelog entries should be returned. (optional, default to 'ios') - * @param int $limit Maximum number of entries to return. (optional, default to 10) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPublicChangelogEntries'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function listPublicChangelogEntriesAsyncWithHttpInfo($platform = 'ios', $limit = 10, string $contentType = self::contentTypes['listPublicChangelogEntries'][0]) - { - $returnType = '\ActivitySmith\Generated\Model\ChangelogListResponse'; - $request = $this->listPublicChangelogEntriesRequest($platform, $limit, $contentType); - - return $this->client - ->sendAsync($request, $this->createHttpClientOption()) - ->then( - function ($response) use ($returnType) { - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - }, - function ($exception) { - $response = $exception->getResponse(); - $statusCode = $response->getStatusCode(); - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - $exception->getRequest()->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - ); - } - - /** - * Create request for operation 'listPublicChangelogEntries' - * - * @param string $platform Platform whose published changelog entries should be returned. (optional, default to 'ios') - * @param int $limit Maximum number of entries to return. (optional, default to 10) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['listPublicChangelogEntries'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function listPublicChangelogEntriesRequest($platform = 'ios', $limit = 10, string $contentType = self::contentTypes['listPublicChangelogEntries'][0]) - { - - - if ($limit !== null && $limit > 20) { - throw new \InvalidArgumentException('invalid value for "$limit" when calling PublicApi.listPublicChangelogEntries, must be smaller than or equal to 20.'); - } - if ($limit !== null && $limit < 1) { - throw new \InvalidArgumentException('invalid value for "$limit" when calling PublicApi.listPublicChangelogEntries, must be bigger than or equal to 1.'); - } - - - $resourcePath = '/changelog'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $platform, - 'platform', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - - - - - $headers = $this->headerSelector->selectHeaders( - ['application/json', ], - $contentType, - $multipart - ); - - // for model (json/xml) - if (count($formParams) > 0) { - if ($multipart) { - $multipartContents = []; - foreach ($formParams as $formParamName => $formParamValue) { - $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; - foreach ($formParamValueItems as $formParamValueItem) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValueItem - ]; - } - } - // for HTTP post (form) - $httpBody = new MultipartStream($multipartContents); - - } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the form parameters - $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); - } else { - // for HTTP post (form) - $httpBody = ObjectSerializer::buildQuery($formParams); - } - } - - - $defaultHeaders = []; - if ($this->config->getUserAgent()) { - $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); - } - - $headers = array_merge( - $defaultHeaders, - $headerParams, - $headers - ); - - $operationHost = $this->config->getHost(); - $query = ObjectSerializer::buildQuery($queryParams); - return new Request( - 'GET', - $operationHost . $resourcePath . ($query ? "?{$query}" : ''), - $headers, - $httpBody - ); - } - - /** - * Create http client option - * - * @throws \RuntimeException on file opening failure - * @return array of http client options - */ - protected function createHttpClientOption() - { - $options = []; - if ($this->config->getDebug()) { - $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); - if (!$options[RequestOptions::DEBUG]) { - throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); - } - } - - return $options; - } -} diff --git a/generated/Model/ChangelogEntry.php b/generated/Model/ChangelogEntry.php deleted file mode 100644 index cf769bf..0000000 --- a/generated/Model/ChangelogEntry.php +++ /dev/null @@ -1,729 +0,0 @@ - - */ -class ChangelogEntry implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ChangelogEntry'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'id' => 'string', - 'platform' => 'string', - 'version' => 'string', - 'title' => 'string', - 'subtitle' => 'string', - 'heroImageUrl' => 'string', - 'ctaTitle' => 'string', - 'publishedAt' => '\DateTime', - 'items' => '\ActivitySmith\Generated\Model\ChangelogItem[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'id' => null, - 'platform' => null, - 'version' => null, - 'title' => null, - 'subtitle' => null, - 'heroImageUrl' => 'uri', - 'ctaTitle' => null, - 'publishedAt' => 'date-time', - 'items' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'id' => false, - 'platform' => false, - 'version' => false, - 'title' => false, - 'subtitle' => true, - 'heroImageUrl' => true, - 'ctaTitle' => false, - 'publishedAt' => true, - 'items' => 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 = [ - 'id' => 'id', - 'platform' => 'platform', - 'version' => 'version', - 'title' => 'title', - 'subtitle' => 'subtitle', - 'heroImageUrl' => 'hero_image_url', - 'ctaTitle' => 'cta_title', - 'publishedAt' => 'published_at', - 'items' => 'items' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'id' => 'setId', - 'platform' => 'setPlatform', - 'version' => 'setVersion', - 'title' => 'setTitle', - 'subtitle' => 'setSubtitle', - 'heroImageUrl' => 'setHeroImageUrl', - 'ctaTitle' => 'setCtaTitle', - 'publishedAt' => 'setPublishedAt', - 'items' => 'setItems' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'id' => 'getId', - 'platform' => 'getPlatform', - 'version' => 'getVersion', - 'title' => 'getTitle', - 'subtitle' => 'getSubtitle', - 'heroImageUrl' => 'getHeroImageUrl', - 'ctaTitle' => 'getCtaTitle', - 'publishedAt' => 'getPublishedAt', - 'items' => 'getItems' - ]; - - /** - * 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[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('platform', $data ?? [], null); - $this->setIfExists('version', $data ?? [], null); - $this->setIfExists('title', $data ?? [], null); - $this->setIfExists('subtitle', $data ?? [], null); - $this->setIfExists('heroImageUrl', $data ?? [], null); - $this->setIfExists('ctaTitle', $data ?? [], null); - $this->setIfExists('publishedAt', $data ?? [], null); - $this->setIfExists('items', $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['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } - if ($this->container['platform'] === null) { - $invalidProperties[] = "'platform' can't be null"; - } - if ($this->container['version'] === null) { - $invalidProperties[] = "'version' can't be null"; - } - if ($this->container['title'] === null) { - $invalidProperties[] = "'title' can't be null"; - } - if ($this->container['subtitle'] === null) { - $invalidProperties[] = "'subtitle' can't be null"; - } - if ($this->container['heroImageUrl'] === null) { - $invalidProperties[] = "'heroImageUrl' can't be null"; - } - if ($this->container['ctaTitle'] === null) { - $invalidProperties[] = "'ctaTitle' can't be null"; - } - if ($this->container['publishedAt'] === null) { - $invalidProperties[] = "'publishedAt' can't be null"; - } - if ($this->container['items'] === null) { - $invalidProperties[] = "'items' 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 id - * - * @return string - */ - public function getId() - { - return $this->container['id']; - } - - /** - * Sets id - * - * @param string $id id - * - * @return self - */ - public function setId($id) - { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); - } - $this->container['id'] = $id; - - return $this; - } - - /** - * Gets platform - * - * @return string - */ - public function getPlatform() - { - return $this->container['platform']; - } - - /** - * Sets platform - * - * @param string $platform platform - * - * @return self - */ - public function setPlatform($platform) - { - if (is_null($platform)) { - throw new \InvalidArgumentException('non-nullable platform cannot be null'); - } - $this->container['platform'] = $platform; - - return $this; - } - - /** - * Gets version - * - * @return string - */ - public function getVersion() - { - return $this->container['version']; - } - - /** - * Sets version - * - * @param string $version version - * - * @return self - */ - public function setVersion($version) - { - if (is_null($version)) { - throw new \InvalidArgumentException('non-nullable version cannot be null'); - } - $this->container['version'] = $version; - - return $this; - } - - /** - * Gets title - * - * @return string - */ - public function getTitle() - { - return $this->container['title']; - } - - /** - * Sets title - * - * @param string $title title - * - * @return self - */ - public function setTitle($title) - { - if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); - } - $this->container['title'] = $title; - - return $this; - } - - /** - * Gets subtitle - * - * @return string - */ - public function getSubtitle() - { - return $this->container['subtitle']; - } - - /** - * Sets subtitle - * - * @param string $subtitle subtitle - * - * @return self - */ - public function setSubtitle($subtitle) - { - if (is_null($subtitle)) { - array_push($this->openAPINullablesSetToNull, 'subtitle'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('subtitle', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['subtitle'] = $subtitle; - - return $this; - } - - /** - * Gets heroImageUrl - * - * @return string - */ - public function getHeroImageUrl() - { - return $this->container['heroImageUrl']; - } - - /** - * Sets heroImageUrl - * - * @param string $heroImageUrl heroImageUrl - * - * @return self - */ - public function setHeroImageUrl($heroImageUrl) - { - if (is_null($heroImageUrl)) { - array_push($this->openAPINullablesSetToNull, 'heroImageUrl'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('heroImageUrl', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['heroImageUrl'] = $heroImageUrl; - - return $this; - } - - /** - * Gets ctaTitle - * - * @return string - */ - public function getCtaTitle() - { - return $this->container['ctaTitle']; - } - - /** - * Sets ctaTitle - * - * @param string $ctaTitle ctaTitle - * - * @return self - */ - public function setCtaTitle($ctaTitle) - { - if (is_null($ctaTitle)) { - throw new \InvalidArgumentException('non-nullable ctaTitle cannot be null'); - } - $this->container['ctaTitle'] = $ctaTitle; - - return $this; - } - - /** - * Gets publishedAt - * - * @return \DateTime - */ - public function getPublishedAt() - { - return $this->container['publishedAt']; - } - - /** - * Sets publishedAt - * - * @param \DateTime $publishedAt publishedAt - * - * @return self - */ - public function setPublishedAt($publishedAt) - { - if (is_null($publishedAt)) { - array_push($this->openAPINullablesSetToNull, 'publishedAt'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('publishedAt', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['publishedAt'] = $publishedAt; - - return $this; - } - - /** - * Gets items - * - * @return \ActivitySmith\Generated\Model\ChangelogItem[] - */ - public function getItems() - { - return $this->container['items']; - } - - /** - * Sets items - * - * @param \ActivitySmith\Generated\Model\ChangelogItem[] $items items - * - * @return self - */ - public function setItems($items) - { - if (is_null($items)) { - throw new \InvalidArgumentException('non-nullable items cannot be null'); - } - $this->container['items'] = $items; - - 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/ChangelogItem.php b/generated/Model/ChangelogItem.php deleted file mode 100644 index 7bc28c3..0000000 --- a/generated/Model/ChangelogItem.php +++ /dev/null @@ -1,572 +0,0 @@ - - */ -class ChangelogItem implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ChangelogItem'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'icon' => 'string', - 'title' => 'string', - 'body' => 'string', - 'imageUrl' => 'string', - 'accentColor' => 'string' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'icon' => null, - 'title' => null, - 'body' => null, - 'imageUrl' => 'uri', - 'accentColor' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'icon' => true, - 'title' => false, - 'body' => false, - 'imageUrl' => true, - 'accentColor' => true - ]; - - /** - * 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 = [ - 'icon' => 'icon', - 'title' => 'title', - 'body' => 'body', - 'imageUrl' => 'image_url', - 'accentColor' => 'accent_color' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'icon' => 'setIcon', - 'title' => 'setTitle', - 'body' => 'setBody', - 'imageUrl' => 'setImageUrl', - 'accentColor' => 'setAccentColor' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'icon' => 'getIcon', - 'title' => 'getTitle', - 'body' => 'getBody', - 'imageUrl' => 'getImageUrl', - 'accentColor' => 'getAccentColor' - ]; - - /** - * 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[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('icon', $data ?? [], null); - $this->setIfExists('title', $data ?? [], null); - $this->setIfExists('body', $data ?? [], null); - $this->setIfExists('imageUrl', $data ?? [], null); - $this->setIfExists('accentColor', $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['title'] === null) { - $invalidProperties[] = "'title' can't be null"; - } - if ($this->container['body'] === null) { - $invalidProperties[] = "'body' 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 icon - * - * @return string|null - */ - public function getIcon() - { - return $this->container['icon']; - } - - /** - * Sets icon - * - * @param string|null $icon icon - * - * @return self - */ - public function setIcon($icon) - { - if (is_null($icon)) { - array_push($this->openAPINullablesSetToNull, 'icon'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('icon', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['icon'] = $icon; - - return $this; - } - - /** - * Gets title - * - * @return string - */ - public function getTitle() - { - return $this->container['title']; - } - - /** - * Sets title - * - * @param string $title title - * - * @return self - */ - public function setTitle($title) - { - if (is_null($title)) { - throw new \InvalidArgumentException('non-nullable title cannot be null'); - } - $this->container['title'] = $title; - - return $this; - } - - /** - * Gets body - * - * @return string - */ - public function getBody() - { - return $this->container['body']; - } - - /** - * Sets body - * - * @param string $body body - * - * @return self - */ - public function setBody($body) - { - if (is_null($body)) { - throw new \InvalidArgumentException('non-nullable body cannot be null'); - } - $this->container['body'] = $body; - - return $this; - } - - /** - * Gets imageUrl - * - * @return string|null - */ - public function getImageUrl() - { - return $this->container['imageUrl']; - } - - /** - * Sets imageUrl - * - * @param string|null $imageUrl imageUrl - * - * @return self - */ - public function setImageUrl($imageUrl) - { - if (is_null($imageUrl)) { - array_push($this->openAPINullablesSetToNull, 'imageUrl'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('imageUrl', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['imageUrl'] = $imageUrl; - - return $this; - } - - /** - * Gets accentColor - * - * @return string|null - */ - public function getAccentColor() - { - return $this->container['accentColor']; - } - - /** - * Sets accentColor - * - * @param string|null $accentColor accentColor - * - * @return self - */ - public function setAccentColor($accentColor) - { - if (is_null($accentColor)) { - array_push($this->openAPINullablesSetToNull, 'accentColor'); - } else { - $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); - $index = array_search('accentColor', $nullablesSetToNull); - if ($index !== FALSE) { - unset($nullablesSetToNull[$index]); - $this->setOpenAPINullablesSetToNull($nullablesSetToNull); - } - } - $this->container['accentColor'] = $accentColor; - - 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/ChangelogListResponse.php b/generated/Model/ChangelogListResponse.php deleted file mode 100644 index a5613b8..0000000 --- a/generated/Model/ChangelogListResponse.php +++ /dev/null @@ -1,412 +0,0 @@ - - */ -class ChangelogListResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'ChangelogListResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'changelogs' => '\ActivitySmith\Generated\Model\ChangelogEntry[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'changelogs' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'changelogs' => 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 = [ - 'changelogs' => 'changelogs' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'changelogs' => 'setChangelogs' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'changelogs' => 'getChangelogs' - ]; - - /** - * 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[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('changelogs', $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['changelogs'] === null) { - $invalidProperties[] = "'changelogs' 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 changelogs - * - * @return \ActivitySmith\Generated\Model\ChangelogEntry[] - */ - public function getChangelogs() - { - return $this->container['changelogs']; - } - - /** - * Sets changelogs - * - * @param \ActivitySmith\Generated\Model\ChangelogEntry[] $changelogs changelogs - * - * @return self - */ - public function setChangelogs($changelogs) - { - if (is_null($changelogs)) { - throw new \InvalidArgumentException('non-nullable changelogs cannot be null'); - } - $this->container['changelogs'] = $changelogs; - - 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/HealthCheck.php b/generated/Model/HealthCheck.php deleted file mode 100644 index a5def26..0000000 --- a/generated/Model/HealthCheck.php +++ /dev/null @@ -1,563 +0,0 @@ - - */ -class HealthCheck implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'HealthCheck'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'name' => 'string', - 'status' => 'string', - 'durationMs' => 'int' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'name' => null, - 'status' => null, - 'durationMs' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'name' => false, - 'status' => false, - 'durationMs' => 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 = [ - 'name' => 'name', - 'status' => 'status', - 'durationMs' => 'duration_ms' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'name' => 'setName', - 'status' => 'setStatus', - 'durationMs' => 'setDurationMs' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'name' => 'getName', - 'status' => 'getStatus', - 'durationMs' => 'getDurationMs' - ]; - - /** - * 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 NAME_DATABASE = 'database'; - public const NAME_REDIS = 'redis'; - public const STATUS_OK = 'ok'; - public const STATUS_FAILED = 'failed'; - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getNameAllowableValues() - { - return [ - self::NAME_DATABASE, - self::NAME_REDIS, - ]; - } - - /** - * Gets allowable values of the enum - * - * @return string[] - */ - public function getStatusAllowableValues() - { - return [ - self::STATUS_OK, - self::STATUS_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('name', $data ?? [], null); - $this->setIfExists('status', $data ?? [], null); - $this->setIfExists('durationMs', $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['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - $allowedValues = $this->getNameAllowableValues(); - if (!is_null($this->container['name']) && !in_array($this->container['name'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'name', must be one of '%s'", - $this->container['name'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['status'] === null) { - $invalidProperties[] = "'status' can't be null"; - } - $allowedValues = $this->getStatusAllowableValues(); - if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { - $invalidProperties[] = sprintf( - "invalid value '%s' for 'status', must be one of '%s'", - $this->container['status'], - implode("', '", $allowedValues) - ); - } - - if ($this->container['durationMs'] === null) { - $invalidProperties[] = "'durationMs' can't be null"; - } - if (($this->container['durationMs'] < 0)) { - $invalidProperties[] = "invalid value for 'durationMs', must be bigger than or equal to 0."; - } - - 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 name - * - * @return string - */ - public function getName() - { - return $this->container['name']; - } - - /** - * Sets name - * - * @param string $name name - * - * @return self - */ - public function setName($name) - { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); - } - $allowedValues = $this->getNameAllowableValues(); - if (!in_array($name, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'name', must be one of '%s'", - $name, - implode("', '", $allowedValues) - ) - ); - } - $this->container['name'] = $name; - - return $this; - } - - /** - * Gets status - * - * @return string - */ - public function getStatus() - { - return $this->container['status']; - } - - /** - * Sets status - * - * @param string $status status - * - * @return self - */ - public function setStatus($status) - { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); - } - $allowedValues = $this->getStatusAllowableValues(); - if (!in_array($status, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'status', must be one of '%s'", - $status, - implode("', '", $allowedValues) - ) - ); - } - $this->container['status'] = $status; - - return $this; - } - - /** - * Gets durationMs - * - * @return int - */ - public function getDurationMs() - { - return $this->container['durationMs']; - } - - /** - * Sets durationMs - * - * @param int $durationMs durationMs - * - * @return self - */ - public function setDurationMs($durationMs) - { - if (is_null($durationMs)) { - throw new \InvalidArgumentException('non-nullable durationMs cannot be null'); - } - - if (($durationMs < 0)) { - throw new \InvalidArgumentException('invalid value for $durationMs when calling HealthCheck., must be bigger than or equal to 0.'); - } - - $this->container['durationMs'] = $durationMs; - - 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/HealthResponse.php b/generated/Model/HealthResponse.php deleted file mode 100644 index 6020b5f..0000000 --- a/generated/Model/HealthResponse.php +++ /dev/null @@ -1,523 +0,0 @@ - - */ -class HealthResponse implements ModelInterface, ArrayAccess, \JsonSerializable -{ - public const DISCRIMINATOR = null; - - /** - * The original name of the model. - * - * @var string - */ - protected static $openAPIModelName = 'HealthResponse'; - - /** - * Array of property to type mappings. Used for (de)serialization - * - * @var string[] - */ - protected static $openAPITypes = [ - 'ok' => 'bool', - 'service' => 'string', - 'timestamp' => '\DateTime', - 'checks' => '\ActivitySmith\Generated\Model\HealthCheck[]' - ]; - - /** - * Array of property to format mappings. Used for (de)serialization - * - * @var string[] - * @phpstan-var array - * @psalm-var array - */ - protected static $openAPIFormats = [ - 'ok' => null, - 'service' => null, - 'timestamp' => 'date-time', - 'checks' => null - ]; - - /** - * Array of nullable properties. Used for (de)serialization - * - * @var boolean[] - */ - protected static array $openAPINullables = [ - 'ok' => false, - 'service' => false, - 'timestamp' => false, - 'checks' => 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 = [ - 'ok' => 'ok', - 'service' => 'service', - 'timestamp' => 'timestamp', - 'checks' => 'checks' - ]; - - /** - * Array of attributes to setter functions (for deserialization of responses) - * - * @var string[] - */ - protected static $setters = [ - 'ok' => 'setOk', - 'service' => 'setService', - 'timestamp' => 'setTimestamp', - 'checks' => 'setChecks' - ]; - - /** - * Array of attributes to getter functions (for serialization of requests) - * - * @var string[] - */ - protected static $getters = [ - 'ok' => 'getOk', - 'service' => 'getService', - 'timestamp' => 'getTimestamp', - 'checks' => 'getChecks' - ]; - - /** - * 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[] $data Associated array of property values - * initializing the model - */ - public function __construct(array $data = null) - { - $this->setIfExists('ok', $data ?? [], null); - $this->setIfExists('service', $data ?? [], null); - $this->setIfExists('timestamp', $data ?? [], null); - $this->setIfExists('checks', $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['ok'] === null) { - $invalidProperties[] = "'ok' can't be null"; - } - if ($this->container['service'] === null) { - $invalidProperties[] = "'service' can't be null"; - } - if ($this->container['timestamp'] === null) { - $invalidProperties[] = "'timestamp' can't be null"; - } - if ($this->container['checks'] === null) { - $invalidProperties[] = "'checks' 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 ok - * - * @return bool - */ - public function getOk() - { - return $this->container['ok']; - } - - /** - * Sets ok - * - * @param bool $ok ok - * - * @return self - */ - public function setOk($ok) - { - if (is_null($ok)) { - throw new \InvalidArgumentException('non-nullable ok cannot be null'); - } - $this->container['ok'] = $ok; - - return $this; - } - - /** - * Gets service - * - * @return string - */ - public function getService() - { - return $this->container['service']; - } - - /** - * Sets service - * - * @param string $service service - * - * @return self - */ - public function setService($service) - { - if (is_null($service)) { - throw new \InvalidArgumentException('non-nullable service cannot be null'); - } - $this->container['service'] = $service; - - return $this; - } - - /** - * Gets timestamp - * - * @return \DateTime - */ - public function getTimestamp() - { - return $this->container['timestamp']; - } - - /** - * Sets timestamp - * - * @param \DateTime $timestamp timestamp - * - * @return self - */ - public function setTimestamp($timestamp) - { - if (is_null($timestamp)) { - throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); - } - $this->container['timestamp'] = $timestamp; - - return $this; - } - - /** - * Gets checks - * - * @return \ActivitySmith\Generated\Model\HealthCheck[] - */ - public function getChecks() - { - return $this->container['checks']; - } - - /** - * Sets checks - * - * @param \ActivitySmith\Generated\Model\HealthCheck[] $checks checks - * - * @return self - */ - public function setChecks($checks) - { - if (is_null($checks)) { - throw new \InvalidArgumentException('non-nullable checks cannot be null'); - } - $this->container['checks'] = $checks; - - 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/openapi-source.json b/generated/openapi-source.json index 5a616d3..dc05717 100644 --- a/generated/openapi-source.json +++ b/generated/openapi-source.json @@ -1,6 +1,6 @@ { "repository": "ActivitySmithHQ/activitysmith-backend", - "commit": "3cd1df5f1296777bacfad731eac9f91d27d01c6e", + "commit": "49ad7b083b50f53bc3d81edb77ca6597845160a2", "path": "openapi.json", - "sha256": "e112ddb9a069dc0ad87a123d0be1286ff0a671da505fabfdf4bb94ff6bcb444f" + "sha256": "b7e33cd485df8ddc5d7fb7b57b61106fd6f8ff3ffa7cc7bef4ac1ccbbb0cede7" } From 996171a11fa0d66cae5396a532ac3e4f5918cf76 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 20:42:50 +0700 Subject: [PATCH 04/11] docs: align README link examples with SDK documentation Repeat supported destinations within each relevant section, use iOS Shortcut terminology, and remove app-version notes. Live Activity action support remains unchanged. Verification: README sync check passed; code fences unchanged; Markdown links and whitespace checked. Initiated-by: user Implemented-by: codex --- README.md | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 6a60f2f..420b395 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,15 @@ What will work: ### Push Notifications with Redirection -Open a web page, an iPhone Shortcut, or an installed app when someone taps the notification. Set `redirection` to an HTTP, HTTPS, or Shortcuts URL, or an app deep link such as `spotify:track:123`. +Open a web page, run an iOS Shortcut, or open an app when someone taps the notification. `redirection` supports: + +- **HTTP/HTTPS:** Web pages, e.g. `https://example.com` +- **Shortcuts:** Run Jarvis with `shortcuts://run-shortcut?name=Jarvis` +- **App deep links:** Installed apps or specific content within them + - **Spotify:** A track, e.g. `spotify:track:6rqhFgbbKwnb9MLmUQDhG6` + - **Termius:** `termius://` to open the app + - **Claude:** `claude://code` to open the Code tab + - **ChatGPT:** `chatgpt://` to open the app ```php $activitysmith->notifications->send( @@ -88,7 +96,17 @@ $activitysmith->notifications->send( ![Actionable Push Notification with redirection and actions](https://cdn.activitysmith.com/features/actionable-push-notifications-2.png) -For expanded notification actions, `open_url` supports HTTP, HTTPS, Shortcuts, and installed app deep links. Webhooks are executed by the ActivitySmith backend and must use HTTPS. Custom app links require iOS 1.13.4 build 2 or later and an installed app that handles the URL. +`open_url` actions open a web page, run an iOS Shortcut, or open an app when someone taps the button. Supported links: + +- **HTTP/HTTPS:** Web pages, e.g. `https://example.com` +- **Shortcuts:** Run Jarvis with `shortcuts://run-shortcut?name=Jarvis` +- **App deep links:** Installed apps or specific content within them + - **Spotify:** A track, e.g. `spotify:track:6rqhFgbbKwnb9MLmUQDhG6` + - **Termius:** `termius://` to open the app + - **Claude:** `claude://code` to open the Code tab + - **ChatGPT:** `chatgpt://` to open the app + +Webhooks are executed by the ActivitySmith backend and must use HTTPS. ```php $activitysmith->notifications->send( @@ -335,12 +353,16 @@ Choose from these colors for the Live Activity accent, including progress bars a Live Activities can include an action button. -- `open_url`: open an HTTP or HTTPS URL. -- `open_url` with a `shortcuts://run-shortcut?name=...` URL: run a specific iPhone Shortcut, for example to open an app. -- `webhook`: trigger a backend GET/POST workflow. +- `open_url`: Open a web page or run an iOS Shortcut +- `webhook`: Trigger a backend GET/POST workflow #### Open URL action +Open a web page or run an iOS Shortcut when someone taps the button. Supported links: + +- **HTTP/HTTPS:** Web pages, e.g. `https://example.com` +- **Shortcuts:** Run Jarvis with `shortcuts://run-shortcut?name=Jarvis` + ```php $activitysmith->liveActivities->stream( 'prod-web-1', From 0e1aeff6f6cc5e068f9e4ab6b7bfaadd47e54e93 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 20:48:05 +0700 Subject: [PATCH 05/11] docs: omit redundant repository resources from SDK READMEs Keep Source Code resources in website docs only. Preserve package links and omit the empty Go resource section. Verification: README converter test and six-repository sync check passed; scoped diffs checked. Initiated-by: user Implemented-by: codex --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 420b395..6f2e1ca 100644 --- a/README.md +++ b/README.md @@ -602,7 +602,3 @@ try { ### [Packagist](https://packagist.org/packages/activitysmith/activitysmith) Install the ActivitySmith PHP SDK from Packagist - -### [Source Code](https://github.com/ActivitySmithHQ/activitysmith-php) - -View the PHP SDK source on GitHub From bcd8d332f4efc36f3d9c1e828ccd1380bdd8e3c2 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 20:56:17 +0700 Subject: [PATCH 06/11] docs: render Live Activity previews without list bullets Use standalone preview images and captions in SDK READMEs; retain the website grid source. Verification: converter test and six-repository sync check passed; all preview images and code fences preserved. Initiated-by: user Implemented-by: codex --- README.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6f2e1ca..0457ba4 100644 --- a/README.md +++ b/README.md @@ -141,17 +141,29 @@ $activitysmith->notifications->send( Choose the Live Activity type that matches what you want to show: -- ![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) **Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion. +![Stats Live Activity with six labeled sales metrics](https://cdn.activitysmith.com/features/stats-live-activity.png) -- ![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) **Metrics**: Track two related values with segmented bars, such as CPU and memory. +**Stats**: Show up to 8 labeled values on your Lock Screen, from revenue and orders to uptime and conversion. -- ![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) **Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify. +![Metrics Live Activity with CPU and memory values](https://cdn.activitysmith.com/features/metrics-live-activity-start.png) -- ![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) **Progress**: Show percentage progress for jobs that move continuously toward completion. +**Metrics**: Track two related values with segmented bars, such as CPU and memory. -- ![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) **Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint. +![Segmented Progress Live Activity showing a workflow step](https://cdn.activitysmith.com/features/update-live-activity.png) -- ![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) **Timer**: Count down from a duration, or count up from 00:00 while a job runs. +**Segmented Progress**: Show progress through a known set of steps, like build, test, deploy, and verify. + +![Progress Live Activity showing percentage completion](https://cdn.activitysmith.com/features/progress-live-activity.png) + +**Progress**: Show percentage progress for jobs that move continuously toward completion. + +![Alert Live Activity showing a customer reactivation update](https://cdn.activitysmith.com/features/alert-live-activity.png) + +**Alert**: Show status updates with a clear message, badge, and icon. When you add an action button, `color` controls the button tint. + +![Timer Live Activity showing a benchmark run countdown](https://cdn.activitysmith.com/features/timer-live-activity.png) + +**Timer**: Count down from a duration, or count up from 00:00 while a job runs. ### Start & Update Live Activity From 187ef0fb9adac7ef4b9db6f1d664cab34e694c72 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 20:58:24 +0700 Subject: [PATCH 07/11] docs: order Metadata before Tags and Channels Match the SDK documentation feature priority. Section content and code examples are unchanged. Verification: section contents compared before and after; README sync and whitespace checks passed. Initiated-by: user Implemented-by: codex --- README.md | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 0457ba4..2b33360 100644 --- a/README.md +++ b/README.md @@ -524,6 +524,29 @@ Pass `0` to clear the badge. $activitysmith->badgeCount(0); ``` +## Metadata + +Metadata adds information to Push Notification and Live Activity details in ActivitySmith. It does not appear in the notification or Live Activity on your device. + +```php +$activitysmith->notifications->send( + title: 'New subscription 💸', + metadata: ['customer_id' => '382', 'plan' => 'Pro', 'amount' => 29, 'trial' => false], +); + +$activitysmith->liveActivities->stream( + 'customer-import', + title: 'Customer Import', + type: 'progress', + percentage: 60, + metadata: ['job_id' => 'import-382', 'records' => 1200], +); +``` + +Supported on Push Notifications, Live Activity streams (including stream ending), and legacy `start`, `update`, and `end` calls. On updates or end calls, omit `metadata` to keep it, supply an object to replace it, or pass `metadata: []` (serialized as `{}`) to clear it. + +Values can be strings, numbers, or booleans. Metadata supports up to 50 entries and 16 KB of JSON, with keys up to 100 characters and strings up to 4,000 characters. Nested objects, arrays, and null values are not supported. + ## Tags Use `tags` to organize and filter your Push Notification and Live Activity history. Tags are created automatically when you first use them. @@ -549,29 +572,6 @@ $activitysmith->liveActivities->update( `endStream` also accepts final Tags and Metadata. Omit them to preserve existing values, or supply empty collections to clear them. -## Metadata - -Metadata adds information to Push Notification and Live Activity details in ActivitySmith. It does not appear in the notification or Live Activity on your device. - -```php -$activitysmith->notifications->send( - title: 'New subscription 💸', - metadata: ['customer_id' => '382', 'plan' => 'Pro', 'amount' => 29, 'trial' => false], -); - -$activitysmith->liveActivities->stream( - 'customer-import', - title: 'Customer Import', - type: 'progress', - percentage: 60, - metadata: ['job_id' => 'import-382', 'records' => 1200], -); -``` - -Supported on Push Notifications, Live Activity streams (including stream ending), and legacy `start`, `update`, and `end` calls. On updates or end calls, omit `metadata` to keep it, supply an object to replace it, or pass `metadata: []` (serialized as `{}`) to clear it. - -Values can be strings, numbers, or booleans. Metadata supports up to 50 entries and 16 KB of JSON, with keys up to 100 characters and strings up to 4,000 characters. Nested objects, arrays, and null values are not supported. - ## Channels Use `channels` to target specific team members or devices when sending Push Notifications, Live Activities, or App Icon Badge Count updates. Omit it for account-wide delivery. From e3356ba14b57f09caf6d03e638d8394f7ae83a1c Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 21:01:20 +0700 Subject: [PATCH 08/11] docs: simplify Metadata description Describe metadata as extra information and remove the paragraph about supported operations and replacement behavior, matching the reviewed SDK docs. Verification: README sync check passed; code examples and other sections unchanged. Initiated-by: user Implemented-by: codex --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 2b33360..bfdf77f 100644 --- a/README.md +++ b/README.md @@ -526,7 +526,7 @@ $activitysmith->badgeCount(0); ## Metadata -Metadata adds information to Push Notification and Live Activity details in ActivitySmith. It does not appear in the notification or Live Activity on your device. +Metadata adds extra information to Push Notification and Live Activity details in ActivitySmith. It does not appear in the notification or Live Activity on your device. ```php $activitysmith->notifications->send( @@ -543,8 +543,6 @@ $activitysmith->liveActivities->stream( ); ``` -Supported on Push Notifications, Live Activity streams (including stream ending), and legacy `start`, `update`, and `end` calls. On updates or end calls, omit `metadata` to keep it, supply an object to replace it, or pass `metadata: []` (serialized as `{}`) to clear it. - Values can be strings, numbers, or booleans. Metadata supports up to 50 entries and 16 KB of JSON, with keys up to 100 characters and strings up to 4,000 characters. Nested objects, arrays, and null values are not supported. ## Tags From 7fafa5363a594eb33947eb305dcbdeab35fd6633 Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 21:02:27 +0700 Subject: [PATCH 09/11] docs: refine Metadata example and remove redundant end-stream note Include the notification message in Metadata examples and remove the final Tags and Metadata paragraph as requested. Verification: README sync and whitespace checks passed; inspected changes limited to the requested example and paragraph. Initiated-by: user Implemented-by: codex --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index bfdf77f..8679ed1 100644 --- a/README.md +++ b/README.md @@ -531,6 +531,7 @@ Metadata adds extra information to Push Notification and Live Activity details i ```php $activitysmith->notifications->send( title: 'New subscription 💸', + message: 'Customer upgraded to Pro plan', metadata: ['customer_id' => '382', 'plan' => 'Pro', 'amount' => 29, 'trial' => false], ); @@ -568,8 +569,6 @@ $activitysmith->liveActivities->update( ); ``` -`endStream` also accepts final Tags and Metadata. Omit them to preserve existing values, or supply empty collections to clear them. - ## Channels Use `channels` to target specific team members or devices when sending Push Notifications, Live Activities, or App Icon Badge Count updates. Omit it for account-wide delivery. From 87e9dba809db6b4640c2f0c0bd03b9b5c75d40ff Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 21:03:58 +0700 Subject: [PATCH 10/11] docs: format Metadata examples across multiple lines Expand metadata and content-state objects to one field per line for readability. Verification: sync check passed; example tokens and CLI JSON values preserved; Python example syntax checked. Initiated-by: user Implemented-by: codex --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8679ed1..205fccc 100644 --- a/README.md +++ b/README.md @@ -532,7 +532,12 @@ Metadata adds extra information to Push Notification and Live Activity details i $activitysmith->notifications->send( title: 'New subscription 💸', message: 'Customer upgraded to Pro plan', - metadata: ['customer_id' => '382', 'plan' => 'Pro', 'amount' => 29, 'trial' => false], + metadata: [ + 'customer_id' => '382', + 'plan' => 'Pro', + 'amount' => 29, + 'trial' => false, + ], ); $activitysmith->liveActivities->stream( @@ -540,7 +545,10 @@ $activitysmith->liveActivities->stream( title: 'Customer Import', type: 'progress', percentage: 60, - metadata: ['job_id' => 'import-382', 'records' => 1200], + metadata: [ + 'job_id' => 'import-382', + 'records' => 1200, + ], ); ``` From 45c78bce8a0d35ca099de7bdbc7fc1e844d5df8a Mon Sep 17 00:00:00 2001 From: bardonadam Date: Tue, 15 Sep 2026 21:19:18 +0700 Subject: [PATCH 11/11] chore: prepare SDK 1.11.0 feature release Bump package and SDK identification versions to 1.11.0. Keep the release summary focused on Metadata, Tags, and iOS deep links. Generated package version metadata was regenerated from the unchanged API contract. Verification: package test suite passed; version metadata and scoped diffs checked. No release tags or package publishing. Initiated-by: user Implemented-by: codex --- CHANGELOG.md | 8 ++------ generated/Configuration.php | 4 ++-- src/Version.php | 2 +- tests/SmokeTest.php | 2 +- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8e3d1b..d6bf11e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,6 @@ -## Unreleased +## 1.11.0 -- Support Push Notification app deep links and final Tags/Metadata when ending a managed Live Activity stream. - -- Add Metadata to Push Notifications and Live Activity start, update, end, and stream requests, including empty-object clearing. - -- Add Tags replacement and empty-array clearing to legacy Live Activity update and end. +This version adds support for Metadata and iOS deep links, and expands Tags support when updating or ending Live Activities. ## 1.10.0 diff --git a/generated/Configuration.php b/generated/Configuration.php index 281c43c..9d36f48 100644 --- a/generated/Configuration.php +++ b/generated/Configuration.php @@ -100,7 +100,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/1.10.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/1.11.0/PHP'; /** * Debug switch (default set to false) @@ -433,7 +433,7 @@ public static function toDebugReport() $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; $report .= ' The version of the OpenAPI document: 1.0.0' . PHP_EOL; - $report .= ' SDK Package Version: 1.10.0' . PHP_EOL; + $report .= ' SDK Package Version: 1.11.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/src/Version.php b/src/Version.php index d06131d..f85dda6 100644 --- a/src/Version.php +++ b/src/Version.php @@ -6,7 +6,7 @@ final class Version { - public const VERSION = '1.10.0'; + public const VERSION = '1.11.0'; private function __construct() { diff --git a/tests/SmokeTest.php b/tests/SmokeTest.php index f8cf7af..0e691d2 100644 --- a/tests/SmokeTest.php +++ b/tests/SmokeTest.php @@ -28,6 +28,6 @@ public function testClientConstructsWhenGeneratedCodeIsPresent(): void $this->assertTrue(method_exists($client->liveActivities, 'endStream')); $this->assertNotNull($client->metrics); $this->assertTrue(method_exists($client->metrics, 'update')); - $this->assertSame('1.10.0', Version::VERSION); + $this->assertSame('1.11.0', Version::VERSION); } }