From 7a8d9988b92b01af486657c1ccf7223b8225325e Mon Sep 17 00:00:00 2001 From: OneSignal Date: Tue, 23 Jun 2026 17:40:06 +0000 Subject: [PATCH] feat: add v5.7.0 package updates --- docs/Api/DefaultApi.md | 6 +- .../CreateNotificationSuccessResponse.md | 2 +- docs/Model/NotificationSlice.md | 2 + lib/api/DefaultApi.php | 548 +++++++++++++++--- lib/helpers/NotificationHelpers.php | 35 ++ .../CreateNotificationSuccessResponse.php | 2 +- lib/model/NotificationSlice.php | 60 ++ 7 files changed, 560 insertions(+), 95 deletions(-) diff --git a/docs/Api/DefaultApi.md b/docs/Api/DefaultApi.md index bb59f60..63f4eba 100644 --- a/docs/Api/DefaultApi.md +++ b/docs/Api/DefaultApi.md @@ -2023,7 +2023,7 @@ Name | Type | Description | Notes ## `getNotifications()` ```php -getNotifications($app_id, $limit, $offset, $kind): \onesignal\client\model\NotificationSlice +getNotifications($app_id, $limit, $offset, $kind, $time_offset): \onesignal\client\model\NotificationSlice ``` View notifications @@ -2054,9 +2054,10 @@ $app_id = '00000000-0000-0000-0000-000000000000'; // string | The app ID that yo $limit = 10; // int | How many notifications to return. Max is 50. Default is 50. $offset = 0; // int | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. $kind = 0; // int | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only +$time_offset = '2025-01-01T00:00:00.000Z'; // string | Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned. try { - $result = $apiInstance->getNotifications($app_id, $limit, $offset, $kind); + $result = $apiInstance->getNotifications($app_id, $limit, $offset, $kind, $time_offset); print_r($result); } catch (\onesignal\client\ApiException $e) { echo 'Exception when calling DefaultApi->getNotifications: ', $e->getMessage(), PHP_EOL; @@ -2078,6 +2079,7 @@ Name | Type | Description | Notes **limit** | **int**| How many notifications to return. Max is 50. Default is 50. | [optional] **offset** | **int**| Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | [optional] **kind** | **int**| Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | [optional] + **time_offset** | **string**| Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned. | [optional] ### Return type diff --git a/docs/Model/CreateNotificationSuccessResponse.md b/docs/Model/CreateNotificationSuccessResponse.md index c130cf7..3167525 100644 --- a/docs/Model/CreateNotificationSuccessResponse.md +++ b/docs/Model/CreateNotificationSuccessResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Notification identifier when the request created a notification. An empty string means no notification was created; read `errors` for details (HTTP may still be 200). | [optional] +**id** | **string** | Notification identifier when the request created a notification. An empty string means no notification was created; read `errors` for details (HTTP may still be 200). All OneSignal server SDKs expose message-sent / message-not-sent narrowing helpers (named idiomatically per language — e.g. `isMessageSent`, `is_message_sent`, `message_sent?`); prefer them over comparing `id` directly. | [optional] **external_id** | **string** | Optional correlation / idempotency-related value from the API response. This is not the end-user External ID used for targeting recipients (that lives under `include_aliases.external_id`). | [optional] **errors** | **mixed** | Polymorphic field: may be an array of human-readable strings and/or an object (for example with `invalid_aliases`, `invalid_external_user_ids`, or `invalid_player_ids`) depending on the API response; HTTP may still be 200 with partial success. Typed SDKs model this loosely so both shapes deserialize. | [optional] diff --git a/docs/Model/NotificationSlice.md b/docs/Model/NotificationSlice.md index 58410ed..bdba4ff 100644 --- a/docs/Model/NotificationSlice.md +++ b/docs/Model/NotificationSlice.md @@ -7,6 +7,8 @@ Name | Type | Description | Notes **total_count** | **int** | | [optional] **offset** | **int** | | [optional] **limit** | **int** | | [optional] +**time_offset** | **string** | The time_offset cursor specified in the request, if any. | [optional] +**next_time_offset** | **string** | An opaque Base64 cursor token representing the next page of messages to fetch. Present when time_offset was provided in the request. Pass this value as time_offset on the next request to continue paginating. | [optional] **notifications** | [**\onesignal\client\model\NotificationWithMeta[]**](NotificationWithMeta.md) | | [optional] [[Back to API list]](https://github.com/OneSignal/onesignal-php-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-php-api) diff --git a/lib/api/DefaultApi.php b/lib/api/DefaultApi.php index 4084006..59902c7 100644 --- a/lib/api/DefaultApi.php +++ b/lib/api/DefaultApi.php @@ -126,7 +126,7 @@ public function getConfig() * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function cancelNotification($app_id, $notification_id) { @@ -144,7 +144,7 @@ public function cancelNotification($app_id, $notification_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function cancelNotificationWithHttpInfo($app_id, $notification_id) { @@ -298,6 +298,14 @@ public function cancelNotificationWithHttpInfo($app_id, $notification_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -502,7 +510,7 @@ public function cancelNotificationRequest($app_id, $notification_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError + * @return \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ public function copyTemplateToApp($template_id, $app_id, $copy_template_request) { @@ -521,7 +529,7 @@ public function copyTemplateToApp($template_id, $app_id, $copy_template_request) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function copyTemplateToAppWithHttpInfo($template_id, $app_id, $copy_template_request) { @@ -629,6 +637,14 @@ public function copyTemplateToAppWithHttpInfo($template_id, $app_id, $copy_templ ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -847,7 +863,7 @@ public function copyTemplateToAppRequest($template_id, $app_id, $copy_template_r * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function createAlias($app_id, $alias_label, $alias_id, $user_identity_body) { @@ -865,7 +881,7 @@ public function createAlias($app_id, $alias_label, $alias_id, $user_identity_bod * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function createAliasWithHttpInfo($app_id, $alias_label, $alias_id, $user_identity_body) { @@ -1042,6 +1058,14 @@ public function createAliasWithHttpInfo($app_id, $alias_label, $alias_id, $user_ ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -1271,7 +1295,7 @@ public function createAliasRequest($app_id, $alias_label, $alias_id, $user_ident * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function createAliasBySubscription($app_id, $subscription_id, $user_identity_body) { @@ -1288,7 +1312,7 @@ public function createAliasBySubscription($app_id, $subscription_id, $user_ident * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function createAliasBySubscriptionWithHttpInfo($app_id, $subscription_id, $user_identity_body) { @@ -1465,6 +1489,14 @@ public function createAliasBySubscriptionWithHttpInfo($app_id, $subscription_id, ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -1678,7 +1710,7 @@ public function createAliasBySubscriptionRequest($app_id, $subscription_id, $use * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\CreateApiKeyResponse|\onesignal\client\model\GenericError + * @return \onesignal\client\model\CreateApiKeyResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ public function createApiKey($app_id, $create_api_key_request) { @@ -1696,7 +1728,7 @@ public function createApiKey($app_id, $create_api_key_request) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\CreateApiKeyResponse|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\CreateApiKeyResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function createApiKeyWithHttpInfo($app_id, $create_api_key_request) { @@ -1804,6 +1836,14 @@ public function createApiKeyWithHttpInfo($app_id, $create_api_key_request) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -2003,7 +2043,7 @@ public function createApiKeyRequest($app_id, $create_api_key_request) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function createApp($app) { @@ -2020,7 +2060,7 @@ public function createApp($app) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function createAppWithHttpInfo($app) { @@ -2151,6 +2191,14 @@ public function createAppWithHttpInfo($app) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -2334,7 +2382,7 @@ public function createAppRequest($app) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function createCustomEvents($app_id, $custom_events_request) { @@ -2352,7 +2400,7 @@ public function createCustomEvents($app_id, $custom_events_request) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function createCustomEventsWithHttpInfo($app_id, $custom_events_request) { @@ -2506,6 +2554,14 @@ public function createCustomEventsWithHttpInfo($app_id, $custom_events_request) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -2705,7 +2761,7 @@ public function createCustomEventsRequest($app_id, $custom_events_request) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\CreateNotificationSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\CreateNotificationSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function createNotification($notification) { @@ -2722,7 +2778,7 @@ public function createNotification($notification) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\CreateNotificationSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\CreateNotificationSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function createNotificationWithHttpInfo($notification) { @@ -2853,6 +2909,14 @@ public function createNotificationWithHttpInfo($notification) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -3036,7 +3100,7 @@ public function createNotificationRequest($notification) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\CreateSegmentSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\CreateSegmentConflictResponse|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\CreateSegmentSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\CreateSegmentConflictResponse|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function createSegment($app_id, $segment = null) { @@ -3054,7 +3118,7 @@ public function createSegment($app_id, $segment = null) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\CreateSegmentSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\CreateSegmentConflictResponse|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\CreateSegmentSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\CreateSegmentConflictResponse|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function createSegmentWithHttpInfo($app_id, $segment = null) { @@ -3208,6 +3272,14 @@ public function createSegmentWithHttpInfo($app_id, $segment = null) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -3402,7 +3474,7 @@ public function createSegmentRequest($app_id, $segment = null) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\SubscriptionBody|\onesignal\client\model\SubscriptionBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\SubscriptionBody|\onesignal\client\model\SubscriptionBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function createSubscription($app_id, $alias_label, $alias_id, $subscription_body) { @@ -3420,7 +3492,7 @@ public function createSubscription($app_id, $alias_label, $alias_id, $subscripti * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\SubscriptionBody|\onesignal\client\model\SubscriptionBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\SubscriptionBody|\onesignal\client\model\SubscriptionBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, $subscription_body) { @@ -3620,6 +3692,14 @@ public function createSubscriptionWithHttpInfo($app_id, $alias_label, $alias_id, ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -3849,7 +3929,7 @@ public function createSubscriptionRequest($app_id, $alias_label, $alias_id, $sub * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError + * @return \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ public function createTemplate($create_template_request) { @@ -3866,7 +3946,7 @@ public function createTemplate($create_template_request) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function createTemplateWithHttpInfo($create_template_request) { @@ -3997,6 +4077,14 @@ public function createTemplateWithHttpInfo($create_template_request) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -4178,7 +4266,7 @@ public function createTemplateRequest($create_template_request) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\CreateUserConflictResponse|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\CreateUserConflictResponse|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function createUser($app_id, $user) { @@ -4194,7 +4282,7 @@ public function createUser($app_id, $user) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\CreateUserConflictResponse|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\CreateUserConflictResponse|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function createUserWithHttpInfo($app_id, $user) { @@ -4394,6 +4482,14 @@ public function createUserWithHttpInfo($app_id, $user) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -4590,7 +4686,7 @@ public function createUserRequest($app_id, $user) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function deleteAlias($app_id, $alias_label, $alias_id, $alias_label_to_delete) { @@ -4608,7 +4704,7 @@ public function deleteAlias($app_id, $alias_label, $alias_id, $alias_label_to_de * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function deleteAliasWithHttpInfo($app_id, $alias_label, $alias_id, $alias_label_to_delete) { @@ -4785,6 +4881,14 @@ public function deleteAliasWithHttpInfo($app_id, $alias_label, $alias_id, $alias ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -5017,7 +5121,7 @@ public function deleteAliasRequest($app_id, $alias_label, $alias_id, $alias_labe * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object|\onesignal\client\model\GenericError + * @return object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ public function deleteApiKey($app_id, $token_id) { @@ -5035,7 +5139,7 @@ public function deleteApiKey($app_id, $token_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function deleteApiKeyWithHttpInfo($app_id, $token_id) { @@ -5143,6 +5247,14 @@ public function deleteApiKeyWithHttpInfo($app_id, $token_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -5345,7 +5457,7 @@ public function deleteApiKeyRequest($app_id, $token_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function deleteSegment($app_id, $segment_id) { @@ -5363,7 +5475,7 @@ public function deleteSegment($app_id, $segment_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function deleteSegmentWithHttpInfo($app_id, $segment_id) { @@ -5517,6 +5629,14 @@ public function deleteSegmentWithHttpInfo($app_id, $segment_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -5809,6 +5929,14 @@ public function deleteSubscriptionWithHttpInfo($app_id, $subscription_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -5994,7 +6122,7 @@ public function deleteSubscriptionRequest($app_id, $subscription_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError + * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ public function deleteTemplate($template_id, $app_id) { @@ -6012,7 +6140,7 @@ public function deleteTemplate($template_id, $app_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function deleteTemplateWithHttpInfo($template_id, $app_id) { @@ -6143,6 +6271,14 @@ public function deleteTemplateWithHttpInfo($template_id, $app_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -6430,6 +6566,14 @@ public function deleteUserWithHttpInfo($app_id, $alias_label, $alias_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -6632,7 +6776,7 @@ public function deleteUserRequest($app_id, $alias_label, $alias_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\ExportEventsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\ExportEventsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function exportEvents($notification_id, $app_id) { @@ -6650,7 +6794,7 @@ public function exportEvents($notification_id, $app_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\ExportEventsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\ExportEventsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function exportEventsWithHttpInfo($notification_id, $app_id) { @@ -6804,6 +6948,14 @@ public function exportEventsWithHttpInfo($notification_id, $app_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -7007,7 +7159,7 @@ public function exportEventsRequest($notification_id, $app_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\ExportSubscriptionsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\ExportSubscriptionsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function exportSubscriptions($app_id, $export_subscriptions_request_body = null) { @@ -7025,7 +7177,7 @@ public function exportSubscriptions($app_id, $export_subscriptions_request_body * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\ExportSubscriptionsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\ExportSubscriptionsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function exportSubscriptionsWithHttpInfo($app_id, $export_subscriptions_request_body = null) { @@ -7156,6 +7308,14 @@ public function exportSubscriptionsWithHttpInfo($app_id, $export_subscriptions_r ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -7349,7 +7509,7 @@ public function exportSubscriptionsRequest($app_id, $export_subscriptions_reques * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function getAliases($app_id, $alias_label, $alias_id) { @@ -7366,7 +7526,7 @@ public function getAliases($app_id, $alias_label, $alias_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function getAliasesWithHttpInfo($app_id, $alias_label, $alias_id) { @@ -7520,6 +7680,14 @@ public function getAliasesWithHttpInfo($app_id, $alias_label, $alias_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -7733,7 +7901,7 @@ public function getAliasesRequest($app_id, $alias_label, $alias_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError + * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ public function getAliasesBySubscription($app_id, $subscription_id) { @@ -7749,7 +7917,7 @@ public function getAliasesBySubscription($app_id, $subscription_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function getAliasesBySubscriptionWithHttpInfo($app_id, $subscription_id) { @@ -7880,6 +8048,14 @@ public function getAliasesBySubscriptionWithHttpInfo($app_id, $subscription_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -8077,7 +8253,7 @@ public function getAliasesBySubscriptionRequest($app_id, $subscription_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function getApp($app_id) { @@ -8094,7 +8270,7 @@ public function getApp($app_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function getAppWithHttpInfo($app_id) { @@ -8225,6 +8401,14 @@ public function getAppWithHttpInfo($app_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -8408,7 +8592,7 @@ public function getAppRequest($app_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\App[]|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\App[]|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function getApps() { @@ -8424,7 +8608,7 @@ public function getApps() * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\App[]|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\App[]|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function getAppsWithHttpInfo() { @@ -8555,6 +8739,14 @@ public function getAppsWithHttpInfo() ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -8723,7 +8915,7 @@ public function getAppsRequest() * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\NotificationWithMeta|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\NotificationWithMeta|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function getNotification($app_id, $notification_id) { @@ -8741,7 +8933,7 @@ public function getNotification($app_id, $notification_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\NotificationWithMeta|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\NotificationWithMeta|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function getNotificationWithHttpInfo($app_id, $notification_id) { @@ -8895,6 +9087,14 @@ public function getNotificationWithHttpInfo($app_id, $notification_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -9098,7 +9298,7 @@ public function getNotificationRequest($app_id, $notification_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\NotificationHistorySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\NotificationHistorySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function getNotificationHistory($notification_id, $get_notification_history_request_body) { @@ -9116,7 +9316,7 @@ public function getNotificationHistory($notification_id, $get_notification_histo * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\NotificationHistorySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\NotificationHistorySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function getNotificationHistoryWithHttpInfo($notification_id, $get_notification_history_request_body) { @@ -9270,6 +9470,14 @@ public function getNotificationHistoryWithHttpInfo($notification_id, $get_notifi ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -9469,14 +9677,15 @@ public function getNotificationHistoryRequest($notification_id, $get_notificatio * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) * @param int $offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) * @param int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + * @param string $time_offset Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned. (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\NotificationSlice|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\NotificationSlice|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ - public function getNotifications($app_id, $limit = null, $offset = null, $kind = null) + public function getNotifications($app_id, $limit = null, $offset = null, $kind = null, $time_offset = null) { - list($response) = $this->getNotificationsWithHttpInfo($app_id, $limit, $offset, $kind); + list($response) = $this->getNotificationsWithHttpInfo($app_id, $limit, $offset, $kind, $time_offset); return $response; } @@ -9489,14 +9698,15 @@ public function getNotifications($app_id, $limit = null, $offset = null, $kind = * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) * @param int $offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) * @param int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + * @param string $time_offset Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned. (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\NotificationSlice|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\NotificationSlice|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ - public function getNotificationsWithHttpInfo($app_id, $limit = null, $offset = null, $kind = null) + public function getNotificationsWithHttpInfo($app_id, $limit = null, $offset = null, $kind = null, $time_offset = null) { - $request = $this->getNotificationsRequest($app_id, $limit, $offset, $kind); + $request = $this->getNotificationsRequest($app_id, $limit, $offset, $kind, $time_offset); try { $options = $this->createHttpClientOption(); @@ -9623,6 +9833,14 @@ public function getNotificationsWithHttpInfo($app_id, $limit = null, $offset = n ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -9637,13 +9855,14 @@ public function getNotificationsWithHttpInfo($app_id, $limit = null, $offset = n * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) * @param int $offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) * @param int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + * @param string $time_offset Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getNotificationsAsync($app_id, $limit = null, $offset = null, $kind = null) + public function getNotificationsAsync($app_id, $limit = null, $offset = null, $kind = null, $time_offset = null) { - return $this->getNotificationsAsyncWithHttpInfo($app_id, $limit, $offset, $kind) + return $this->getNotificationsAsyncWithHttpInfo($app_id, $limit, $offset, $kind, $time_offset) ->then( function ($response) { return $response[0]; @@ -9660,14 +9879,15 @@ function ($response) { * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) * @param int $offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) * @param int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + * @param string $time_offset Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getNotificationsAsyncWithHttpInfo($app_id, $limit = null, $offset = null, $kind = null) + public function getNotificationsAsyncWithHttpInfo($app_id, $limit = null, $offset = null, $kind = null, $time_offset = null) { $returnType = '\onesignal\client\model\NotificationSlice'; - $request = $this->getNotificationsRequest($app_id, $limit, $offset, $kind); + $request = $this->getNotificationsRequest($app_id, $limit, $offset, $kind, $time_offset); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -9712,11 +9932,12 @@ function ($exception) { * @param int $limit How many notifications to return. Max is 50. Default is 50. (optional) * @param int $offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. (optional) * @param int $kind Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only (optional) + * @param string $time_offset Time-offset pagination cursor for sequential pulls of all messages. Accepts either an ISO 8601 formatted timestamp (e.g. `2025-01-01T00:00:00.000Z`) or the opaque Base64 cursor token returned as `next_time_offset` in a prior response. When set, results are sorted ascending by send_after and the standard `offset` parameter cannot be used. Repeat the request with each `next_time_offset` until an empty notifications array is returned. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getNotificationsRequest($app_id, $limit = null, $offset = null, $kind = null) + public function getNotificationsRequest($app_id, $limit = null, $offset = null, $kind = null, $time_offset = null) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { @@ -9768,6 +9989,15 @@ public function getNotificationsRequest($app_id, $limit = null, $offset = null, true, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $time_offset, + 'time_offset', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -9849,7 +10079,7 @@ public function getNotificationsRequest($app_id, $limit = null, $offset = null, * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\OutcomesData|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\OutcomesData|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function getOutcomes($app_id, $outcome_names, $outcome_names2 = null, $outcome_time_range = null, $outcome_platforms = null, $outcome_attribution = null) { @@ -9871,7 +10101,7 @@ public function getOutcomes($app_id, $outcome_names, $outcome_names2 = null, $ou * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\OutcomesData|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\OutcomesData|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function getOutcomesWithHttpInfo($app_id, $outcome_names, $outcome_names2 = null, $outcome_time_range = null, $outcome_platforms = null, $outcome_attribution = null) { @@ -10002,6 +10232,14 @@ public function getOutcomesWithHttpInfo($app_id, $outcome_names, $outcome_names2 ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -10254,7 +10492,7 @@ public function getOutcomesRequest($app_id, $outcome_names, $outcome_names2 = nu * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\GetSegmentsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\GetSegmentsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function getSegments($app_id, $offset = null, $limit = null) { @@ -10273,7 +10511,7 @@ public function getSegments($app_id, $offset = null, $limit = null) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\GetSegmentsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\GetSegmentsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function getSegmentsWithHttpInfo($app_id, $offset = null, $limit = null) { @@ -10404,6 +10642,14 @@ public function getSegmentsWithHttpInfo($app_id, $offset = null, $limit = null) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -10612,7 +10858,7 @@ public function getSegmentsRequest($app_id, $offset = null, $limit = null) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function getUser($app_id, $alias_label, $alias_id) { @@ -10629,7 +10875,7 @@ public function getUser($app_id, $alias_label, $alias_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function getUserWithHttpInfo($app_id, $alias_label, $alias_id) { @@ -10783,6 +11029,14 @@ public function getUserWithHttpInfo($app_id, $alias_label, $alias_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -10998,7 +11252,7 @@ public function getUserRequest($app_id, $alias_label, $alias_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\CreateApiKeyResponse|\onesignal\client\model\GenericError + * @return \onesignal\client\model\CreateApiKeyResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ public function rotateApiKey($app_id, $token_id) { @@ -11016,7 +11270,7 @@ public function rotateApiKey($app_id, $token_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\CreateApiKeyResponse|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\CreateApiKeyResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function rotateApiKeyWithHttpInfo($app_id, $token_id) { @@ -11124,6 +11378,14 @@ public function rotateApiKeyWithHttpInfo($app_id, $token_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -11327,7 +11589,7 @@ public function rotateApiKeyRequest($app_id, $token_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\StartLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\StartLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function startLiveActivity($app_id, $activity_type, $start_live_activity_request) { @@ -11346,7 +11608,7 @@ public function startLiveActivity($app_id, $activity_type, $start_live_activity_ * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\StartLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\StartLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function startLiveActivityWithHttpInfo($app_id, $activity_type, $start_live_activity_request) { @@ -11477,6 +11739,14 @@ public function startLiveActivityWithHttpInfo($app_id, $activity_type, $start_li ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -11693,7 +11963,7 @@ public function startLiveActivityRequest($app_id, $activity_type, $start_live_ac * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function transferSubscription($app_id, $subscription_id, $transfer_subscription_request_body) { @@ -11710,7 +11980,7 @@ public function transferSubscription($app_id, $subscription_id, $transfer_subscr * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UserIdentityBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body) { @@ -11887,6 +12157,14 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -12101,7 +12379,7 @@ public function transferSubscriptionRequest($app_id, $subscription_id, $transfer * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function unsubscribeEmailWithToken($app_id, $notification_id, $token) { @@ -12120,7 +12398,7 @@ public function unsubscribeEmailWithToken($app_id, $notification_id, $token) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, $token) { @@ -12251,6 +12529,14 @@ public function unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -12472,7 +12758,7 @@ public function unsubscribeEmailWithTokenRequest($app_id, $notification_id, $tok * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object|\onesignal\client\model\GenericError + * @return object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ public function updateApiKey($app_id, $token_id, $update_api_key_request) { @@ -12491,7 +12777,7 @@ public function updateApiKey($app_id, $token_id, $update_api_key_request) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function updateApiKeyWithHttpInfo($app_id, $token_id, $update_api_key_request) { @@ -12599,6 +12885,14 @@ public function updateApiKeyWithHttpInfo($app_id, $token_id, $update_api_key_req ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -12816,7 +13110,7 @@ public function updateApiKeyRequest($app_id, $token_id, $update_api_key_request) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function updateApp($app_id, $app) { @@ -12834,7 +13128,7 @@ public function updateApp($app_id, $app) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function updateAppWithHttpInfo($app_id, $app) { @@ -12965,6 +13259,14 @@ public function updateAppWithHttpInfo($app_id, $app) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -13166,7 +13468,7 @@ public function updateAppRequest($app_id, $app) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UpdateLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\UpdateLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function updateLiveActivity($app_id, $activity_id, $update_live_activity_request) { @@ -13185,7 +13487,7 @@ public function updateLiveActivity($app_id, $activity_id, $update_live_activity_ * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\UpdateLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UpdateLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_live_activity_request) { @@ -13316,6 +13618,14 @@ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_li ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -13625,6 +13935,14 @@ public function updateSubscriptionWithHttpInfo($app_id, $subscription_id, $subsc ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -13827,7 +14145,7 @@ public function updateSubscriptionRequest($app_id, $subscription_id, $subscripti * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError + * @return object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ public function updateSubscriptionByToken($app_id, $token_type, $token, $subscription_body) { @@ -13847,7 +14165,7 @@ public function updateSubscriptionByToken($app_id, $token_type, $token, $subscri * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function updateSubscriptionByTokenWithHttpInfo($app_id, $token_type, $token, $subscription_body) { @@ -13978,6 +14296,14 @@ public function updateSubscriptionByTokenWithHttpInfo($app_id, $token_type, $tok ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -14213,7 +14539,7 @@ public function updateSubscriptionByTokenRequest($app_id, $token_type, $token, $ * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError + * @return \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ public function updateTemplate($template_id, $app_id, $update_template_request) { @@ -14232,7 +14558,7 @@ public function updateTemplate($template_id, $app_id, $update_template_request) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function updateTemplateWithHttpInfo($template_id, $app_id, $update_template_request) { @@ -14340,6 +14666,14 @@ public function updateTemplateWithHttpInfo($template_id, $app_id, $update_templa ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -14558,7 +14892,7 @@ public function updateTemplateRequest($template_id, $app_id, $update_template_re * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\PropertiesBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\PropertiesBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function updateUser($app_id, $alias_label, $alias_id, $update_user_request) { @@ -14576,7 +14910,7 @@ public function updateUser($app_id, $alias_label, $alias_id, $update_user_reques * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\PropertiesBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\PropertiesBody|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function updateUserWithHttpInfo($app_id, $alias_label, $alias_id, $update_user_request) { @@ -14730,6 +15064,14 @@ public function updateUserWithHttpInfo($app_id, $alias_label, $alias_id, $update ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -14959,7 +15301,7 @@ public function updateUserRequest($app_id, $alias_label, $alias_id, $update_user * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\ApiKeyTokensListResponse|\onesignal\client\model\GenericError + * @return \onesignal\client\model\ApiKeyTokensListResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ public function viewApiKeys($app_id) { @@ -14976,7 +15318,7 @@ public function viewApiKeys($app_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\ApiKeyTokensListResponse|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\ApiKeyTokensListResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function viewApiKeysWithHttpInfo($app_id) { @@ -15084,6 +15426,14 @@ public function viewApiKeysWithHttpInfo($app_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -15269,7 +15619,7 @@ public function viewApiKeysRequest($app_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError + * @return \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ public function viewTemplate($template_id, $app_id) { @@ -15287,7 +15637,7 @@ public function viewTemplate($template_id, $app_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\TemplateResource|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function viewTemplateWithHttpInfo($template_id, $app_id) { @@ -15418,6 +15768,14 @@ public function viewTemplateWithHttpInfo($template_id, $app_id) ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } @@ -15623,7 +15981,7 @@ public function viewTemplateRequest($template_id, $app_id) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\TemplatesListResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError + * @return \onesignal\client\model\TemplatesListResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ public function viewTemplates($app_id, $limit = 50, $offset = 0, $channel = null) { @@ -15643,7 +16001,7 @@ public function viewTemplates($app_id, $limit = 50, $offset = 0, $channel = null * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\TemplatesListResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\TemplatesListResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) */ public function viewTemplatesWithHttpInfo($app_id, $limit = 50, $offset = 0, $channel = null) { @@ -15774,6 +16132,14 @@ public function viewTemplatesWithHttpInfo($app_id, $limit = 50, $offset = 0, $ch ); $e->setResponseObject($data); break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; } throw $e; } diff --git a/lib/helpers/NotificationHelpers.php b/lib/helpers/NotificationHelpers.php index d17345c..d21029f 100644 --- a/lib/helpers/NotificationHelpers.php +++ b/lib/helpers/NotificationHelpers.php @@ -74,6 +74,41 @@ public static function createNotificationWithRetry($api, $notification, $maxRetr } } + /** + * Whether a POST /notifications 200 response is the "message sent" branch. + * + * POST /notifications returns 200 in two cases that share the + * CreateNotificationSuccessResponse shape: a notification was created + * (non-empty id), or none was (empty id, with errors carrying the reason). + * Prefer this guard over inspecting id directly. + * + * @param \onesignal\client\model\CreateNotificationSuccessResponse $response + * + * @return bool true when a notification was created + */ + public static function isMessageSent($response) + { + if ($response === null) { + return false; + } + $id = $response->getId(); + return is_string($id) && $id !== ''; + } + + /** + * Whether a POST /notifications 200 response is the "message not sent" + * branch -- no notification was created (id absent or empty); inspect + * errors for why. + * + * @param \onesignal\client\model\CreateNotificationSuccessResponse $response + * + * @return bool true when no notification was created + */ + public static function isMessageNotSent($response) + { + return !self::isMessageSent($response); + } + private static function headerValue($headers, $name) { if (!is_array($headers)) { diff --git a/lib/model/CreateNotificationSuccessResponse.php b/lib/model/CreateNotificationSuccessResponse.php index 3ca89af..1d55a9d 100644 --- a/lib/model/CreateNotificationSuccessResponse.php +++ b/lib/model/CreateNotificationSuccessResponse.php @@ -231,7 +231,7 @@ public function getId() /** * Sets id * - * @param string|null $id Notification identifier when the request created a notification. An empty string means no notification was created; read `errors` for details (HTTP may still be 200). + * @param string|null $id Notification identifier when the request created a notification. An empty string means no notification was created; read `errors` for details (HTTP may still be 200). All OneSignal server SDKs expose message-sent / message-not-sent narrowing helpers (named idiomatically per language — e.g. `isMessageSent`, `is_message_sent`, `message_sent?`); prefer them over comparing `id` directly. * * @return self */ diff --git a/lib/model/NotificationSlice.php b/lib/model/NotificationSlice.php index c700502..6fe12de 100644 --- a/lib/model/NotificationSlice.php +++ b/lib/model/NotificationSlice.php @@ -63,6 +63,8 @@ class NotificationSlice implements ModelInterface, ArrayAccess, \JsonSerializabl 'total_count' => 'int', 'offset' => 'int', 'limit' => 'int', + 'time_offset' => 'string', + 'next_time_offset' => 'string', 'notifications' => '\onesignal\client\model\NotificationWithMeta[]' ]; @@ -77,6 +79,8 @@ class NotificationSlice implements ModelInterface, ArrayAccess, \JsonSerializabl 'total_count' => null, 'offset' => null, 'limit' => null, + 'time_offset' => null, + 'next_time_offset' => null, 'notifications' => null ]; @@ -110,6 +114,8 @@ public static function openAPIFormats() 'total_count' => 'total_count', 'offset' => 'offset', 'limit' => 'limit', + 'time_offset' => 'time_offset', + 'next_time_offset' => 'next_time_offset', 'notifications' => 'notifications' ]; @@ -122,6 +128,8 @@ public static function openAPIFormats() 'total_count' => 'setTotalCount', 'offset' => 'setOffset', 'limit' => 'setLimit', + 'time_offset' => 'setTimeOffset', + 'next_time_offset' => 'setNextTimeOffset', 'notifications' => 'setNotifications' ]; @@ -134,6 +142,8 @@ public static function openAPIFormats() 'total_count' => 'getTotalCount', 'offset' => 'getOffset', 'limit' => 'getLimit', + 'time_offset' => 'getTimeOffset', + 'next_time_offset' => 'getNextTimeOffset', 'notifications' => 'getNotifications' ]; @@ -197,6 +207,8 @@ public function __construct(?array $data = null) $this->container['total_count'] = $data['total_count'] ?? null; $this->container['offset'] = $data['offset'] ?? null; $this->container['limit'] = $data['limit'] ?? null; + $this->container['time_offset'] = $data['time_offset'] ?? null; + $this->container['next_time_offset'] = $data['next_time_offset'] ?? null; $this->container['notifications'] = $data['notifications'] ?? null; } @@ -296,6 +308,54 @@ public function setLimit($limit) return $this; } + /** + * Gets time_offset + * + * @return string|null + */ + public function getTimeOffset() + { + return $this->container['time_offset']; + } + + /** + * Sets time_offset + * + * @param string|null $time_offset The time_offset cursor specified in the request, if any. + * + * @return self + */ + public function setTimeOffset($time_offset) + { + $this->container['time_offset'] = $time_offset; + + return $this; + } + + /** + * Gets next_time_offset + * + * @return string|null + */ + public function getNextTimeOffset() + { + return $this->container['next_time_offset']; + } + + /** + * Sets next_time_offset + * + * @param string|null $next_time_offset An opaque Base64 cursor token representing the next page of messages to fetch. Present when time_offset was provided in the request. Pass this value as time_offset on the next request to continue paginating. + * + * @return self + */ + public function setNextTimeOffset($next_time_offset) + { + $this->container['next_time_offset'] = $next_time_offset; + + return $this; + } + /** * Gets notifications *