diff --git a/README.md b/README.md index c963fed..ed8cafa 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ A powerful way to send personalized messages at scale and build effective custom For more information, please visit [https://onesignal.com](https://onesignal.com). -- API version: 5.10.0 -- Package version: 5.10.0 +- API version: 5.11.0 +- Package version: 5.11.0 ## Requirements diff --git a/composer.json b/composer.json index 39df64c..e98f087 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "onesignal/onesignal-php-api", - "version": "5.10.0", + "version": "5.11.0", "description": "A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com", "keywords": [ "onesignal", diff --git a/docs/Api/DefaultApi.md b/docs/Api/DefaultApi.md index 44dd1db..246cd60 100644 --- a/docs/Api/DefaultApi.md +++ b/docs/Api/DefaultApi.md @@ -32,8 +32,10 @@ Method | HTTP request | Description [**getNotificationHistory()**](DefaultApi.md#getNotificationHistory) | **POST** /notifications/{notification_id}/history | Notification History [**getNotifications()**](DefaultApi.md#getNotifications) | **GET** /notifications | View notifications [**getOutcomes()**](DefaultApi.md#getOutcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes +[**getSegment()**](DefaultApi.md#getSegment) | **GET** /apps/{app_id}/segments/{segment_id} | View Segment [**getSegments()**](DefaultApi.md#getSegments) | **GET** /apps/{app_id}/segments | Get Segments [**getUser()**](DefaultApi.md#getUser) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +[**listAuditLogs()**](DefaultApi.md#listAuditLogs) | **GET** /organizations/{organization_id}/audit_logs | List audit logs [**rotateApiKey()**](DefaultApi.md#rotateApiKey) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key [**startLiveActivity()**](DefaultApi.md#startLiveActivity) | **POST** /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity [**transferSubscription()**](DefaultApi.md#transferSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | @@ -41,6 +43,7 @@ Method | HTTP request | Description [**updateApiKey()**](DefaultApi.md#updateApiKey) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key [**updateApp()**](DefaultApi.md#updateApp) | **PUT** /apps/{app_id} | Update an app [**updateLiveActivity()**](DefaultApi.md#updateLiveActivity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push +[**updateSegment()**](DefaultApi.md#updateSegment) | **PATCH** /apps/{app_id}/segments/{segment_id} | Update Segment [**updateSubscription()**](DefaultApi.md#updateSubscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | [**updateSubscriptionByToken()**](DefaultApi.md#updateSubscriptionByToken) | **PATCH** /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token [**updateTemplate()**](DefaultApi.md#updateTemplate) | **PATCH** /templates/{template_id} | Update template @@ -2182,6 +2185,79 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-php-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-php-api) +## `getSegment()` + +```php +getSegment($app_id, $segment_id, $include_segment_detail): \onesignal\client\model\GetSegmentSuccessResponse +``` + +View Segment + +Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters. + +### Example + +```php +setRestApiKeyToken('YOUR_REST_API_KEY') + ->setOrganizationApiKeyToken('YOUR_ORGANIZATION_API_KEY'); + + + +$apiInstance = new onesignal\client\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$app_id = 'YOUR_APP_ID'; // string | The OneSignal App ID for your app. Available in Keys & IDs. +$segment_id = 'd6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e'; // string | The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. +$include_segment_detail = true; // bool | Set to true to include segment metadata and filters in the response. + +try { + $result = $apiInstance->getSegment($app_id, $segment_id, $include_segment_detail); + print_r($result); +} catch (\onesignal\client\ApiException $e) { + echo 'Exception when calling DefaultApi->getSegment: ', $e->getMessage(), PHP_EOL; + echo 'Status Code: ', $e->getCode(), PHP_EOL; + // getErrorMessages() flattens any error-envelope shape to a string[]; + // the raw body remains on getResponseBody(). + echo 'Error Messages: ', implode(', ', $e->getErrorMessages()), PHP_EOL; + echo 'Response Body: ', $e->getResponseBody(), PHP_EOL; +} catch (\Exception $e) { + echo 'Exception when calling DefaultApi->getSegment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **string**| The OneSignal App ID for your app. Available in Keys & IDs. | + **segment_id** | **string**| The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. | + **include_segment_detail** | **bool**| Set to true to include segment metadata and filters in the response. | [optional] + +### Return type + +[**\onesignal\client\model\GetSegmentSuccessResponse**](../Model/GetSegmentSuccessResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-php-api#configuration) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-php-api#full-api-reference) +[[Back to README]](https://github.com/OneSignal/onesignal-php-api) + ## `getSegments()` ```php @@ -2328,6 +2404,97 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-php-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-php-api) +## `listAuditLogs()` + +```php +listAuditLogs($organization_id, $start_time, $end_time, $cursor, $limit, $app_ids, $actions, $actor_ids, $actor_emails, $target_types, $target_ids, $ip_addresses): \onesignal\client\model\ListAuditLogsSuccessResponse +``` + +List audit logs + +Retrieve a paginated, time-scoped list of audit log events for an organization. Requires an Enterprise plan with the audit logs entitlement enabled. + +### Example + +```php +setRestApiKeyToken('YOUR_REST_API_KEY') + ->setOrganizationApiKeyToken('YOUR_ORGANIZATION_API_KEY'); + + + +$apiInstance = new onesignal\client\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$organization_id = 'YOUR_ORG_ID'; // string | The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. +$start_time = 'start_time_example'; // string | Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. +$end_time = 'end_time_example'; // string | End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. +$cursor = 'cursor_example'; // string | Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. +$limit = 56; // int | Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. +$app_ids = array('app_ids_example'); // string[] | Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. +$actions = array('actions_example'); // string[] | Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. +$actor_ids = array('actor_ids_example'); // string[] | Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. +$actor_emails = array('actor_emails_example'); // string[] | Filter by actor email address. Accepts up to 10 values. +$target_types = array('target_types_example'); // string[] | Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. +$target_ids = array('target_ids_example'); // string[] | Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. +$ip_addresses = array('ip_addresses_example'); // string[] | Filter by the IP address the action originated from. Accepts up to 10 values. + +try { + $result = $apiInstance->listAuditLogs($organization_id, $start_time, $end_time, $cursor, $limit, $app_ids, $actions, $actor_ids, $actor_emails, $target_types, $target_ids, $ip_addresses); + print_r($result); +} catch (\onesignal\client\ApiException $e) { + echo 'Exception when calling DefaultApi->listAuditLogs: ', $e->getMessage(), PHP_EOL; + echo 'Status Code: ', $e->getCode(), PHP_EOL; + // getErrorMessages() flattens any error-envelope shape to a string[]; + // the raw body remains on getResponseBody(). + echo 'Error Messages: ', implode(', ', $e->getErrorMessages()), PHP_EOL; + echo 'Response Body: ', $e->getResponseBody(), PHP_EOL; +} catch (\Exception $e) { + echo 'Exception when calling DefaultApi->listAuditLogs: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **organization_id** | **string**| The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. | + **start_time** | **string**| Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. | [optional] + **end_time** | **string**| End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. | [optional] + **cursor** | **string**| Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. | [optional] + **limit** | **int**| Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. | [optional] + **app_ids** | [**string[]**](../Model/string.md)| Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. | [optional] + **actions** | [**string[]**](../Model/string.md)| Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. | [optional] + **actor_ids** | [**string[]**](../Model/string.md)| Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. | [optional] + **actor_emails** | [**string[]**](../Model/string.md)| Filter by actor email address. Accepts up to 10 values. | [optional] + **target_types** | [**string[]**](../Model/string.md)| Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. | [optional] + **target_ids** | [**string[]**](../Model/string.md)| Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. | [optional] + **ip_addresses** | [**string[]**](../Model/string.md)| Filter by the IP address the action originated from. Accepts up to 10 values. | [optional] + +### Return type + +[**\onesignal\client\model\ListAuditLogsSuccessResponse**](../Model/ListAuditLogsSuccessResponse.md) + +### Authorization + +[organization_api_key](https://github.com/OneSignal/onesignal-php-api#configuration) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-php-api#full-api-reference) +[[Back to README]](https://github.com/OneSignal/onesignal-php-api) + ## `rotateApiKey()` ```php @@ -2835,6 +3002,79 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-php-api#full-api-reference) [[Back to README]](https://github.com/OneSignal/onesignal-php-api) +## `updateSegment()` + +```php +updateSegment($app_id, $segment_id, $update_segment_request): \onesignal\client\model\UpdateSegmentSuccessResponse +``` + +Update Segment + +Update an existing segment's name and/or filters. The name parameter is always required. When filters are provided, all existing filters are replaced with the new ones. + +### Example + +```php +setRestApiKeyToken('YOUR_REST_API_KEY') + ->setOrganizationApiKeyToken('YOUR_ORGANIZATION_API_KEY'); + + + +$apiInstance = new onesignal\client\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$app_id = 'YOUR_APP_ID'; // string | The OneSignal App ID for your app. Available in Keys & IDs. +$segment_id = 'd6c5a3e1-9f17-44a1-9d10-7c0e4a2b1c8e'; // string | The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. +$update_segment_request = new \onesignal\client\model\UpdateSegmentRequest(); // \onesignal\client\model\UpdateSegmentRequest + +try { + $result = $apiInstance->updateSegment($app_id, $segment_id, $update_segment_request); + print_r($result); +} catch (\onesignal\client\ApiException $e) { + echo 'Exception when calling DefaultApi->updateSegment: ', $e->getMessage(), PHP_EOL; + echo 'Status Code: ', $e->getCode(), PHP_EOL; + // getErrorMessages() flattens any error-envelope shape to a string[]; + // the raw body remains on getResponseBody(). + echo 'Error Messages: ', implode(', ', $e->getErrorMessages()), PHP_EOL; + echo 'Response Body: ', $e->getResponseBody(), PHP_EOL; +} catch (\Exception $e) { + echo 'Exception when calling DefaultApi->updateSegment: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **app_id** | **string**| The OneSignal App ID for your app. Available in Keys & IDs. | + **segment_id** | **string**| The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. | + **update_segment_request** | [**\onesignal\client\model\UpdateSegmentRequest**](../Model/UpdateSegmentRequest.md)| | [optional] + +### Return type + +[**\onesignal\client\model\UpdateSegmentSuccessResponse**](../Model/UpdateSegmentSuccessResponse.md) + +### Authorization + +[rest_api_key](https://github.com/OneSignal/onesignal-php-api#configuration) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](https://github.com/OneSignal/onesignal-php-api#full-api-reference) +[[Back to README]](https://github.com/OneSignal/onesignal-php-api) + ## `updateSubscription()` ```php diff --git a/docs/Model/AuditLogActor.md b/docs/Model/AuditLogActor.md new file mode 100644 index 0000000..3dafdcd --- /dev/null +++ b/docs/Model/AuditLogActor.md @@ -0,0 +1,13 @@ +# # AuditLogActor + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **string** | Email address of the actor. Absent if unavailable. | [optional] +**id** | **string** | UUID of the actor. | [optional] +**metadata** | **object** | Additional actor-specific data. | [optional] +**name** | **string** | Display name of the actor. Absent if unavailable. | [optional] +**type** | **string** | Actor type (e.g. member, api_key, system). | [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/docs/Model/AuditLogContext.md b/docs/Model/AuditLogContext.md new file mode 100644 index 0000000..913a8ba --- /dev/null +++ b/docs/Model/AuditLogContext.md @@ -0,0 +1,12 @@ +# # AuditLogContext + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **string** | Country code derived from the request IP. | [optional] +**ip** | **string** | IP address the request originated from. | [optional] +**metadata** | **object** | Additional context-specific data. | [optional] +**user_agent** | **string** | User agent of the client that made the request. | [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/docs/Model/AuditLogEvent.md b/docs/Model/AuditLogEvent.md new file mode 100644 index 0000000..3c99405 --- /dev/null +++ b/docs/Model/AuditLogEvent.md @@ -0,0 +1,18 @@ +# # AuditLogEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**action** | **string** | The action that was performed (e.g. notification.sent, segment.created, member.invited). | [optional] +**actor** | [**\onesignal\client\model\AuditLogActor**](AuditLogActor.md) | | [optional] +**app_id** | **string** | UUID of the app the event is associated with. Absent for org-level events. | [optional] +**context** | [**\onesignal\client\model\AuditLogContext**](AuditLogContext.md) | | [optional] +**id** | **string** | UUID of the audit log event. | [optional] +**metadata** | **object** | Additional event-specific data that does not fit into the standard fields. | [optional] +**occurred_at** | **string** | RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z). | [optional] +**organization_id** | **string** | UUID of the organization the event belongs to. | [optional] +**targets** | [**\onesignal\client\model\AuditLogTarget[]**](AuditLogTarget.md) | The resources the action was performed on. May be empty for org-level events. | [optional] +**version** | **int** | Schema version of the event payload. | [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/docs/Model/AuditLogTarget.md b/docs/Model/AuditLogTarget.md new file mode 100644 index 0000000..7617b4f --- /dev/null +++ b/docs/Model/AuditLogTarget.md @@ -0,0 +1,12 @@ +# # AuditLogTarget + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | UUID of the resource. | [optional] +**metadata** | **object** | Additional resource-specific data. | [optional] +**name** | **string** | Display name of the resource. Absent if unavailable. | [optional] +**type** | **string** | Resource type (e.g. notification, segment, journey, app). | [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/docs/Model/GetSegmentSuccessResponse.md b/docs/Model/GetSegmentSuccessResponse.md new file mode 100644 index 0000000..d18e36e --- /dev/null +++ b/docs/Model/GetSegmentSuccessResponse.md @@ -0,0 +1,10 @@ +# # GetSegmentSuccessResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**subscriber_count** | **int** | The number of subscribers matching this segment. | [optional] +**payload** | [**\onesignal\client\model\SegmentDetails**](SegmentDetails.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/docs/Model/ListAuditLogsSuccessResponse.md b/docs/Model/ListAuditLogsSuccessResponse.md new file mode 100644 index 0000000..5380b77 --- /dev/null +++ b/docs/Model/ListAuditLogsSuccessResponse.md @@ -0,0 +1,11 @@ +# # ListAuditLogsSuccessResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**audit_logs** | [**\onesignal\client\model\AuditLogEvent[]**](AuditLogEvent.md) | Array of audit log events, ordered by occurred_at ascending. | [optional] +**has_more** | **bool** | True if additional events exist beyond this page. Use next_cursor to fetch the next page. | [optional] +**next_cursor** | **string** | Opaque cursor to pass as cursor in the next request. Only present when has_more is true. | [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/docs/Model/SegmentDetails.md b/docs/Model/SegmentDetails.md new file mode 100644 index 0000000..b1434f8 --- /dev/null +++ b/docs/Model/SegmentDetails.md @@ -0,0 +1,14 @@ +# # SegmentDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | The unique identifier for the segment (UUID v4). | [optional] +**name** | **string** | The segment name. | [optional] +**description** | **string** | Human-readable description for the segment. `null` when unset. Maximum 255 characters. | [optional] +**created_at** | **int** | Unix timestamp when the segment was created. | [optional] +**source** | **string** | The source of the segment. | [optional] +**filters** | [**\onesignal\client\model\FilterExpression[]**](FilterExpression.md) | Array of filter and operator objects defining the segment criteria. Uses the same format as the Create Segment API, so filters can be directly used to recreate or update the segment. | [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/docs/Model/UpdateSegmentRequest.md b/docs/Model/UpdateSegmentRequest.md new file mode 100644 index 0000000..86c7eef --- /dev/null +++ b/docs/Model/UpdateSegmentRequest.md @@ -0,0 +1,11 @@ +# # UpdateSegmentRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Required. The segment name. Maximum 128 characters. | +**description** | **string** | Optional human-readable description for the segment. Maximum 255 characters. Pass an empty string to clear; omit to leave unchanged. | [optional] +**filters** | [**\onesignal\client\model\FilterExpression[]**](FilterExpression.md) | Optional. When provided, replaces all existing filters. Filters define the segment based on user properties like tags, activity, or location using flexible AND/OR logic. Limited to 200 total entries, including fields and OR operators. | [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/docs/Model/UpdateSegmentSuccessResponse.md b/docs/Model/UpdateSegmentSuccessResponse.md new file mode 100644 index 0000000..d534d93 --- /dev/null +++ b/docs/Model/UpdateSegmentSuccessResponse.md @@ -0,0 +1,10 @@ +# # UpdateSegmentSuccessResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**success** | **bool** | true if the segment was updated successfully, false otherwise. | [optional] +**id** | **string** | UUID of the updated segment. | [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/ApiException.php b/lib/ApiException.php index 29f79dd..f0125f1 100644 --- a/lib/ApiException.php +++ b/lib/ApiException.php @@ -14,7 +14,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/Configuration.php b/lib/Configuration.php index dad56c4..2ab3a40 100644 --- a/lib/Configuration.php +++ b/lib/Configuration.php @@ -14,7 +14,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -99,7 +99,7 @@ class Configuration * * @var string */ - protected $userAgent = 'OpenAPI-Generator/5.10.0/PHP'; + protected $userAgent = 'OpenAPI-Generator/5.11.0/PHP'; /** * Debug switch (default set to false) @@ -430,8 +430,8 @@ public static function toDebugReport() $report = 'PHP SDK (onesignal\client) Debug Report:' . PHP_EOL; $report .= ' OS: ' . php_uname() . PHP_EOL; $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; - $report .= ' The version of the OpenAPI document: 5.10.0' . PHP_EOL; - $report .= ' SDK Package Version: 5.10.0' . PHP_EOL; + $report .= ' The version of the OpenAPI document: 5.11.0' . PHP_EOL; + $report .= ' SDK Package Version: 5.11.0' . PHP_EOL; $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; return $report; diff --git a/lib/HeaderSelector.php b/lib/HeaderSelector.php index ba8cc15..c1b7616 100644 --- a/lib/HeaderSelector.php +++ b/lib/HeaderSelector.php @@ -14,7 +14,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/ObjectSerializer.php b/lib/ObjectSerializer.php index a2027e6..154006c 100644 --- a/lib/ObjectSerializer.php +++ b/lib/ObjectSerializer.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/api/DefaultApi.php b/lib/api/DefaultApi.php index 1795a63..b154787 100644 --- a/lib/api/DefaultApi.php +++ b/lib/api/DefaultApi.php @@ -14,7 +14,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -482,7 +482,7 @@ public function cancelNotificationRequest($app_id, $notification_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -836,7 +836,7 @@ public function copyTemplateToAppRequest($template_id, $app_id, $copy_template_r } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -1269,7 +1269,7 @@ public function createAliasRequest($app_id, $alias_label, $alias_id, $user_ident } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -1683,7 +1683,7 @@ public function createAliasBySubscriptionRequest($app_id, $subscription_id, $use } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -2017,7 +2017,7 @@ public function createApiKeyRequest($app_id, $create_api_key_request) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -2355,7 +2355,7 @@ public function createAppRequest($app) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -2735,7 +2735,7 @@ public function createCustomEventsRequest($app_id, $custom_events_request) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -3073,7 +3073,7 @@ public function createNotificationRequest($notification) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -3447,7 +3447,7 @@ public function createSegmentRequest($app_id, $segment = null) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -3903,7 +3903,7 @@ public function createSubscriptionRequest($app_id, $alias_label, $alias_id, $sub } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -4241,7 +4241,7 @@ public function createTemplateRequest($create_template_request) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -4659,7 +4659,7 @@ public function createUserRequest($app_id, $user) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -5094,7 +5094,7 @@ public function deleteAliasRequest($app_id, $alias_label, $alias_id, $alias_labe } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -5430,7 +5430,7 @@ public function deleteApiKeyRequest($app_id, $token_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -5812,7 +5812,7 @@ public function deleteSegmentRequest($app_id, $segment_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -6095,7 +6095,7 @@ public function deleteSubscriptionRequest($app_id, $subscription_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -6455,7 +6455,7 @@ public function deleteTemplateRequest($template_id, $app_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -6749,7 +6749,7 @@ public function deleteUserRequest($app_id, $alias_label, $alias_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -7132,7 +7132,7 @@ public function exportEventsRequest($notification_id, $app_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -7483,7 +7483,7 @@ public function exportSubscriptionsRequest($app_id, $export_subscriptions_reques } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -7876,7 +7876,7 @@ public function getAliasesRequest($app_id, $alias_label, $alias_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -8227,7 +8227,7 @@ public function getAliasesBySubscriptionRequest($app_id, $subscription_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -8567,7 +8567,7 @@ public function getAppRequest($app_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -8888,7 +8888,7 @@ public function getAppsRequest() } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -9271,7 +9271,7 @@ public function getNotificationRequest($app_id, $notification_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -9651,7 +9651,7 @@ public function getNotificationHistoryRequest($notification_id, $get_notificatio } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -10048,7 +10048,7 @@ public function getNotificationsRequest($app_id, $limit = null, $offset = null, } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -10464,7 +10464,7 @@ public function getOutcomesRequest($app_id, $outcome_names, $outcome_names2 = nu } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -10482,40 +10482,40 @@ public function getOutcomesRequest($app_id, $outcome_names, $outcome_names2 = nu } /** - * Operation getSegments + * Operation getSegment * - * Get Segments + * View Segment * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) - * @param int $limit The amount of Segments in the response. Maximum 300. (optional) + * @param string $segment_id The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param bool $include_segment_detail Set to true to include segment metadata and filters in the response. (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\GetSegmentsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError + * @return \onesignal\client\model\GetSegmentSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ - public function getSegments($app_id, $offset = null, $limit = null) + public function getSegment($app_id, $segment_id, $include_segment_detail = null) { - list($response) = $this->getSegmentsWithHttpInfo($app_id, $offset, $limit); + list($response) = $this->getSegmentWithHttpInfo($app_id, $segment_id, $include_segment_detail); return $response; } /** - * Operation getSegmentsWithHttpInfo + * Operation getSegmentWithHttpInfo * - * Get Segments + * View Segment * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) - * @param int $limit The amount of Segments in the response. Maximum 300. (optional) + * @param string $segment_id The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param bool $include_segment_detail Set to true to include segment metadata and filters in the response. (optional) * * @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|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\GetSegmentSuccessResponse|\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 getSegmentsWithHttpInfo($app_id, $offset = null, $limit = null) + public function getSegmentWithHttpInfo($app_id, $segment_id, $include_segment_detail = null) { - $request = $this->getSegmentsRequest($app_id, $offset, $limit); + $request = $this->getSegmentRequest($app_id, $segment_id, $include_segment_detail); try { $options = $this->createHttpClientOption(); @@ -10553,18 +10553,18 @@ public function getSegmentsWithHttpInfo($app_id, $offset = null, $limit = null) } switch($statusCode) { - case 201: - if ('\onesignal\client\model\GetSegmentsSuccessResponse' === '\SplFileObject') { + case 200: + if ('\onesignal\client\model\GetSegmentSuccessResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\GetSegmentsSuccessResponse' !== 'string') { + if ('\onesignal\client\model\GetSegmentSuccessResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GetSegmentsSuccessResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\GetSegmentSuccessResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -10578,6 +10578,21 @@ public function getSegmentsWithHttpInfo($app_id, $offset = null, $limit = null) } } + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), @@ -10600,7 +10615,7 @@ public function getSegmentsWithHttpInfo($app_id, $offset = null, $limit = null) ]; } - $returnType = '\onesignal\client\model\GetSegmentsSuccessResponse'; + $returnType = '\onesignal\client\model\GetSegmentSuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -10618,10 +10633,10 @@ public function getSegmentsWithHttpInfo($app_id, $offset = null, $limit = null) } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\GetSegmentsSuccessResponse', + '\onesignal\client\model\GetSegmentSuccessResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -10634,6 +10649,14 @@ public function getSegmentsWithHttpInfo($app_id, $offset = null, $limit = null) ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -10656,20 +10679,20 @@ public function getSegmentsWithHttpInfo($app_id, $offset = null, $limit = null) } /** - * Operation getSegmentsAsync + * Operation getSegmentAsync * - * Get Segments + * View Segment * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) - * @param int $limit The amount of Segments in the response. Maximum 300. (optional) + * @param string $segment_id The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param bool $include_segment_detail Set to true to include segment metadata and filters in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentsAsync($app_id, $offset = null, $limit = null) + public function getSegmentAsync($app_id, $segment_id, $include_segment_detail = null) { - return $this->getSegmentsAsyncWithHttpInfo($app_id, $offset, $limit) + return $this->getSegmentAsyncWithHttpInfo($app_id, $segment_id, $include_segment_detail) ->then( function ($response) { return $response[0]; @@ -10678,21 +10701,21 @@ function ($response) { } /** - * Operation getSegmentsAsyncWithHttpInfo + * Operation getSegmentAsyncWithHttpInfo * - * Get Segments + * View Segment * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) - * @param int $limit The amount of Segments in the response. Maximum 300. (optional) + * @param string $segment_id The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param bool $include_segment_detail Set to true to include segment metadata and filters in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getSegmentsAsyncWithHttpInfo($app_id, $offset = null, $limit = null) + public function getSegmentAsyncWithHttpInfo($app_id, $segment_id, $include_segment_detail = null) { - $returnType = '\onesignal\client\model\GetSegmentsSuccessResponse'; - $request = $this->getSegmentsRequest($app_id, $offset, $limit); + $returnType = '\onesignal\client\model\GetSegmentSuccessResponse'; + $request = $this->getSegmentRequest($app_id, $segment_id, $include_segment_detail); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -10731,25 +10754,31 @@ function ($exception) { } /** - * Create request for operation 'getSegments' + * Create request for operation 'getSegment' * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) - * @param int $limit The amount of Segments in the response. Maximum 300. (optional) + * @param string $segment_id The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param bool $include_segment_detail Set to true to include segment metadata and filters in the response. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getSegmentsRequest($app_id, $offset = null, $limit = null) + public function getSegmentRequest($app_id, $segment_id, $include_segment_detail = null) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling getSegments' + 'Missing the required parameter $app_id when calling getSegment' + ); + } + // verify the required parameter 'segment_id' is set + if ($segment_id === null || (is_array($segment_id) && count($segment_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $segment_id when calling getSegment' ); } - $resourcePath = '/apps/{app_id}/segments'; + $resourcePath = '/apps/{app_id}/segments/{segment_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -10758,18 +10787,9 @@ public function getSegmentsRequest($app_id, $offset = null, $limit = null) // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $offset, - 'offset', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType + $include_segment_detail, + 'include-segment-detail', // param base name + 'boolean', // openApiType 'form', // style true, // explode false // required @@ -10784,6 +10804,14 @@ public function getSegmentsRequest($app_id, $offset = null, $limit = null) $resourcePath ); } + // path params + if ($segment_id !== null) { + $resourcePath = str_replace( + '{' . 'segment_id' . '}', + ObjectSerializer::toPathValue($segment_id), + $resourcePath + ); + } if ($multipart) { @@ -10832,7 +10860,7 @@ public function getSegmentsRequest($app_id, $offset = null, $limit = null) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -10850,36 +10878,40 @@ public function getSegmentsRequest($app_id, $offset = null, $limit = null) } /** - * Operation getUser + * Operation getSegments * - * @param string $app_id app_id (required) - * @param string $alias_label alias_label (required) - * @param string $alias_id alias_id (required) + * Get Segments + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param int $limit The amount of Segments in the response. Maximum 300. (optional) * * @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|\onesignal\client\model\GenericError + * @return \onesignal\client\model\GetSegmentsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ - public function getUser($app_id, $alias_label, $alias_id) + public function getSegments($app_id, $offset = null, $limit = null) { - list($response) = $this->getUserWithHttpInfo($app_id, $alias_label, $alias_id); + list($response) = $this->getSegmentsWithHttpInfo($app_id, $offset, $limit); return $response; } /** - * Operation getUserWithHttpInfo + * Operation getSegmentsWithHttpInfo * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) + * Get Segments + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param int $limit The amount of Segments in the response. Maximum 300. (optional) * * @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|\onesignal\client\model\GenericError, 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 getUserWithHttpInfo($app_id, $alias_label, $alias_id) + public function getSegmentsWithHttpInfo($app_id, $offset = null, $limit = null) { - $request = $this->getUserRequest($app_id, $alias_label, $alias_id); + $request = $this->getSegmentsRequest($app_id, $offset, $limit); try { $options = $this->createHttpClientOption(); @@ -10917,18 +10949,18 @@ public function getUserWithHttpInfo($app_id, $alias_label, $alias_id) } switch($statusCode) { - case 200: - if ('\onesignal\client\model\User' === '\SplFileObject') { + case 201: + if ('\onesignal\client\model\GetSegmentsSuccessResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\User' !== 'string') { + if ('\onesignal\client\model\GetSegmentsSuccessResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\User', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\GetSegmentsSuccessResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -10942,21 +10974,6 @@ public function getUserWithHttpInfo($app_id, $alias_label, $alias_id) } } - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), @@ -10979,7 +10996,7 @@ public function getUserWithHttpInfo($app_id, $alias_label, $alias_id) ]; } - $returnType = '\onesignal\client\model\User'; + $returnType = '\onesignal\client\model\GetSegmentsSuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -10997,10 +11014,10 @@ public function getUserWithHttpInfo($app_id, $alias_label, $alias_id) } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 201: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\User', + '\onesignal\client\model\GetSegmentsSuccessResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11013,14 +11030,6 @@ public function getUserWithHttpInfo($app_id, $alias_label, $alias_id) ); $e->setResponseObject($data); break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11043,18 +11052,20 @@ public function getUserWithHttpInfo($app_id, $alias_label, $alias_id) } /** - * Operation getUserAsync + * Operation getSegmentsAsync * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) + * Get Segments + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param int $limit The amount of Segments in the response. Maximum 300. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserAsync($app_id, $alias_label, $alias_id) + public function getSegmentsAsync($app_id, $offset = null, $limit = null) { - return $this->getUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id) + return $this->getSegmentsAsyncWithHttpInfo($app_id, $offset, $limit) ->then( function ($response) { return $response[0]; @@ -11063,19 +11074,21 @@ function ($response) { } /** - * Operation getUserAsyncWithHttpInfo + * Operation getSegmentsAsyncWithHttpInfo * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) + * Get Segments + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param int $limit The amount of Segments in the response. Maximum 300. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id) + public function getSegmentsAsyncWithHttpInfo($app_id, $offset = null, $limit = null) { - $returnType = '\onesignal\client\model\User'; - $request = $this->getUserRequest($app_id, $alias_label, $alias_id); + $returnType = '\onesignal\client\model\GetSegmentsSuccessResponse'; + $request = $this->getSegmentsRequest($app_id, $offset, $limit); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11114,43 +11127,49 @@ function ($exception) { } /** - * Create request for operation 'getUser' + * Create request for operation 'getSegments' * - * @param string $app_id (required) - * @param string $alias_label (required) - * @param string $alias_id (required) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param int $offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments. (optional) + * @param int $limit The amount of Segments in the response. Maximum 300. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getUserRequest($app_id, $alias_label, $alias_id) + public function getSegmentsRequest($app_id, $offset = null, $limit = null) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling getUser' - ); - } - // verify the required parameter 'alias_label' is set - if ($alias_label === null || (is_array($alias_label) && count($alias_label) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $alias_label when calling getUser' - ); - } - // verify the required parameter 'alias_id' is set - if ($alias_id === null || (is_array($alias_id) && count($alias_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $alias_id when calling getUser' + 'Missing the required parameter $app_id when calling getSegments' ); } - $resourcePath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'; + $resourcePath = '/apps/{app_id}/segments'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $offset, + 'offset', // param base name + 'integer', // 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 + ) ?? []); // path params @@ -11161,22 +11180,6 @@ public function getUserRequest($app_id, $alias_label, $alias_id) $resourcePath ); } - // path params - if ($alias_label !== null) { - $resourcePath = str_replace( - '{' . 'alias_label' . '}', - ObjectSerializer::toPathValue($alias_label), - $resourcePath - ); - } - // path params - if ($alias_id !== null) { - $resourcePath = str_replace( - '{' . 'alias_id' . '}', - ObjectSerializer::toPathValue($alias_id), - $resourcePath - ); - } if ($multipart) { @@ -11225,7 +11228,7 @@ public function getUserRequest($app_id, $alias_label, $alias_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -11243,38 +11246,36 @@ public function getUserRequest($app_id, $alias_label, $alias_id) } /** - * Operation rotateApiKey - * - * Rotate API key + * Operation getUser * * @param string $app_id app_id (required) - * @param string $token_id token_id (required) - * + * @param string $alias_label alias_label (required) + * @param string $alias_id alias_id (required) + * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\CreateApiKeyResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError + * @return \onesignal\client\model\User|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ - public function rotateApiKey($app_id, $token_id) + public function getUser($app_id, $alias_label, $alias_id) { - list($response) = $this->rotateApiKeyWithHttpInfo($app_id, $token_id); + list($response) = $this->getUserWithHttpInfo($app_id, $alias_label, $alias_id); return $response; } /** - * Operation rotateApiKeyWithHttpInfo - * - * Rotate API key + * Operation getUserWithHttpInfo * * @param string $app_id (required) - * @param string $token_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \onesignal\client\model\CreateApiKeyResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError, 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 rotateApiKeyWithHttpInfo($app_id, $token_id) + public function getUserWithHttpInfo($app_id, $alias_label, $alias_id) { - $request = $this->rotateApiKeyRequest($app_id, $token_id); + $request = $this->getUserRequest($app_id, $alias_label, $alias_id); try { $options = $this->createHttpClientOption(); @@ -11313,17 +11314,17 @@ public function rotateApiKeyWithHttpInfo($app_id, $token_id) switch($statusCode) { case 200: - if ('\onesignal\client\model\CreateApiKeyResponse' === '\SplFileObject') { + if ('\onesignal\client\model\User' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\CreateApiKeyResponse' !== 'string') { + if ('\onesignal\client\model\User' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\CreateApiKeyResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\User', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -11342,9 +11343,39 @@ public function rotateApiKeyWithHttpInfo($app_id, $token_id) $response->getStatusCode(), $response->getHeaders() ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; } - $returnType = '\onesignal\client\model\CreateApiKeyResponse'; + $returnType = '\onesignal\client\model\User'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -11365,7 +11396,7 @@ public function rotateApiKeyWithHttpInfo($app_id, $token_id) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\CreateApiKeyResponse', + '\onesignal\client\model\User', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11378,6 +11409,22 @@ public function rotateApiKeyWithHttpInfo($app_id, $token_id) ); $e->setResponseObject($data); break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11392,19 +11439,18 @@ public function rotateApiKeyWithHttpInfo($app_id, $token_id) } /** - * Operation rotateApiKeyAsync - * - * Rotate API key + * Operation getUserAsync * * @param string $app_id (required) - * @param string $token_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function rotateApiKeyAsync($app_id, $token_id) + public function getUserAsync($app_id, $alias_label, $alias_id) { - return $this->rotateApiKeyAsyncWithHttpInfo($app_id, $token_id) + return $this->getUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id) ->then( function ($response) { return $response[0]; @@ -11413,20 +11459,19 @@ function ($response) { } /** - * Operation rotateApiKeyAsyncWithHttpInfo - * - * Rotate API key + * Operation getUserAsyncWithHttpInfo * * @param string $app_id (required) - * @param string $token_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function rotateApiKeyAsyncWithHttpInfo($app_id, $token_id) + public function getUserAsyncWithHttpInfo($app_id, $alias_label, $alias_id) { - $returnType = '\onesignal\client\model\CreateApiKeyResponse'; - $request = $this->rotateApiKeyRequest($app_id, $token_id); + $returnType = '\onesignal\client\model\User'; + $request = $this->getUserRequest($app_id, $alias_label, $alias_id); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11465,30 +11510,37 @@ function ($exception) { } /** - * Create request for operation 'rotateApiKey' + * Create request for operation 'getUser' * * @param string $app_id (required) - * @param string $token_id (required) + * @param string $alias_label (required) + * @param string $alias_id (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function rotateApiKeyRequest($app_id, $token_id) + public function getUserRequest($app_id, $alias_label, $alias_id) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling rotateApiKey' + 'Missing the required parameter $app_id when calling getUser' ); } - // verify the required parameter 'token_id' is set - if ($token_id === null || (is_array($token_id) && count($token_id) === 0)) { + // verify the required parameter 'alias_label' is set + if ($alias_label === null || (is_array($alias_label) && count($alias_label) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $token_id when calling rotateApiKey' + 'Missing the required parameter $alias_label when calling getUser' + ); + } + // verify the required parameter 'alias_id' is set + if ($alias_id === null || (is_array($alias_id) && count($alias_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $alias_id when calling getUser' ); } - $resourcePath = '/apps/{app_id}/auth/tokens/{token_id}/rotate'; + $resourcePath = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11506,10 +11558,18 @@ public function rotateApiKeyRequest($app_id, $token_id) ); } // path params - if ($token_id !== null) { + if ($alias_label !== null) { $resourcePath = str_replace( - '{' . 'token_id' . '}', - ObjectSerializer::toPathValue($token_id), + '{' . 'alias_label' . '}', + ObjectSerializer::toPathValue($alias_label), + $resourcePath + ); + } + // path params + if ($alias_id !== null) { + $resourcePath = str_replace( + '{' . 'alias_id' . '}', + ObjectSerializer::toPathValue($alias_id), $resourcePath ); } @@ -11551,8 +11611,8 @@ public function rotateApiKeyRequest($app_id, $token_id) } } - if (!empty($this->config->getOrganizationApiKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getOrganizationApiKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -11561,7 +11621,7 @@ public function rotateApiKeyRequest($app_id, $token_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -11571,7 +11631,7 @@ public function rotateApiKeyRequest($app_id, $token_id) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -11579,40 +11639,58 @@ public function rotateApiKeyRequest($app_id, $token_id) } /** - * Operation startLiveActivity - * - * Start Live Activity - * - * @param string $app_id Your OneSignal App ID in UUID v4 format. (required) - * @param string $activity_type The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) - * @param \onesignal\client\model\StartLiveActivityRequest $start_live_activity_request start_live_activity_request (required) + * Operation listAuditLogs + * + * List audit logs + * + * @param string $organization_id The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. (required) + * @param string $start_time Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. (optional) + * @param string $end_time End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. (optional) + * @param string $cursor Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. (optional) + * @param int $limit Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. (optional) + * @param string[] $app_ids Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. (optional) + * @param string[] $actions Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. (optional) + * @param string[] $actor_ids Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. (optional) + * @param string[] $actor_emails Filter by actor email address. Accepts up to 10 values. (optional) + * @param string[] $target_types Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. (optional) + * @param string[] $target_ids Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. (optional) + * @param string[] $ip_addresses Filter by the IP address the action originated from. Accepts up to 10 values. (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\StartLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError + * @return \onesignal\client\model\ListAuditLogsSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ - public function startLiveActivity($app_id, $activity_type, $start_live_activity_request) + public function listAuditLogs($organization_id, $start_time = null, $end_time = null, $cursor = null, $limit = null, $app_ids = null, $actions = null, $actor_ids = null, $actor_emails = null, $target_types = null, $target_ids = null, $ip_addresses = null) { - list($response) = $this->startLiveActivityWithHttpInfo($app_id, $activity_type, $start_live_activity_request); + list($response) = $this->listAuditLogsWithHttpInfo($organization_id, $start_time, $end_time, $cursor, $limit, $app_ids, $actions, $actor_ids, $actor_emails, $target_types, $target_ids, $ip_addresses); return $response; } /** - * Operation startLiveActivityWithHttpInfo - * - * Start Live Activity - * - * @param string $app_id Your OneSignal App ID in UUID v4 format. (required) - * @param string $activity_type The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) - * @param \onesignal\client\model\StartLiveActivityRequest $start_live_activity_request (required) + * Operation listAuditLogsWithHttpInfo + * + * List audit logs + * + * @param string $organization_id The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. (required) + * @param string $start_time Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. (optional) + * @param string $end_time End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. (optional) + * @param string $cursor Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. (optional) + * @param int $limit Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. (optional) + * @param string[] $app_ids Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. (optional) + * @param string[] $actions Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. (optional) + * @param string[] $actor_ids Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. (optional) + * @param string[] $actor_emails Filter by actor email address. Accepts up to 10 values. (optional) + * @param string[] $target_types Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. (optional) + * @param string[] $target_ids Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. (optional) + * @param string[] $ip_addresses Filter by the IP address the action originated from. Accepts up to 10 values. (optional) * * @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|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\ListAuditLogsSuccessResponse|\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 startLiveActivityWithHttpInfo($app_id, $activity_type, $start_live_activity_request) + public function listAuditLogsWithHttpInfo($organization_id, $start_time = null, $end_time = null, $cursor = null, $limit = null, $app_ids = null, $actions = null, $actor_ids = null, $actor_emails = null, $target_types = null, $target_ids = null, $ip_addresses = null) { - $request = $this->startLiveActivityRequest($app_id, $activity_type, $start_live_activity_request); + $request = $this->listAuditLogsRequest($organization_id, $start_time, $end_time, $cursor, $limit, $app_ids, $actions, $actor_ids, $actor_emails, $target_types, $target_ids, $ip_addresses); try { $options = $this->createHttpClientOption(); @@ -11650,18 +11728,18 @@ public function startLiveActivityWithHttpInfo($app_id, $activity_type, $start_li } switch($statusCode) { - case 201: - if ('\onesignal\client\model\StartLiveActivitySuccessResponse' === '\SplFileObject') { + case 200: + if ('\onesignal\client\model\ListAuditLogsSuccessResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\StartLiveActivitySuccessResponse' !== 'string') { + if ('\onesignal\client\model\ListAuditLogsSuccessResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\StartLiveActivitySuccessResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\ListAuditLogsSuccessResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -11675,6 +11753,36 @@ public function startLiveActivityWithHttpInfo($app_id, $activity_type, $start_li } } + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), @@ -11697,7 +11805,7 @@ public function startLiveActivityWithHttpInfo($app_id, $activity_type, $start_li ]; } - $returnType = '\onesignal\client\model\StartLiveActivitySuccessResponse'; + $returnType = '\onesignal\client\model\ListAuditLogsSuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -11715,10 +11823,10 @@ public function startLiveActivityWithHttpInfo($app_id, $activity_type, $start_li } catch (ApiException $e) { switch ($e->getCode()) { - case 201: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\StartLiveActivitySuccessResponse', + '\onesignal\client\model\ListAuditLogsSuccessResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -11731,6 +11839,22 @@ public function startLiveActivityWithHttpInfo($app_id, $activity_type, $start_li ); $e->setResponseObject($data); break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -11753,20 +11877,29 @@ public function startLiveActivityWithHttpInfo($app_id, $activity_type, $start_li } /** - * Operation startLiveActivityAsync - * - * Start Live Activity - * - * @param string $app_id Your OneSignal App ID in UUID v4 format. (required) - * @param string $activity_type The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) - * @param \onesignal\client\model\StartLiveActivityRequest $start_live_activity_request (required) + * Operation listAuditLogsAsync + * + * List audit logs + * + * @param string $organization_id The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. (required) + * @param string $start_time Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. (optional) + * @param string $end_time End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. (optional) + * @param string $cursor Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. (optional) + * @param int $limit Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. (optional) + * @param string[] $app_ids Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. (optional) + * @param string[] $actions Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. (optional) + * @param string[] $actor_ids Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. (optional) + * @param string[] $actor_emails Filter by actor email address. Accepts up to 10 values. (optional) + * @param string[] $target_types Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. (optional) + * @param string[] $target_ids Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. (optional) + * @param string[] $ip_addresses Filter by the IP address the action originated from. Accepts up to 10 values. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function startLiveActivityAsync($app_id, $activity_type, $start_live_activity_request) + public function listAuditLogsAsync($organization_id, $start_time = null, $end_time = null, $cursor = null, $limit = null, $app_ids = null, $actions = null, $actor_ids = null, $actor_emails = null, $target_types = null, $target_ids = null, $ip_addresses = null) { - return $this->startLiveActivityAsyncWithHttpInfo($app_id, $activity_type, $start_live_activity_request) + return $this->listAuditLogsAsyncWithHttpInfo($organization_id, $start_time, $end_time, $cursor, $limit, $app_ids, $actions, $actor_ids, $actor_emails, $target_types, $target_ids, $ip_addresses) ->then( function ($response) { return $response[0]; @@ -11775,21 +11908,30 @@ function ($response) { } /** - * Operation startLiveActivityAsyncWithHttpInfo - * - * Start Live Activity - * - * @param string $app_id Your OneSignal App ID in UUID v4 format. (required) - * @param string $activity_type The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) - * @param \onesignal\client\model\StartLiveActivityRequest $start_live_activity_request (required) + * Operation listAuditLogsAsyncWithHttpInfo + * + * List audit logs + * + * @param string $organization_id The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. (required) + * @param string $start_time Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. (optional) + * @param string $end_time End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. (optional) + * @param string $cursor Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. (optional) + * @param int $limit Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. (optional) + * @param string[] $app_ids Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. (optional) + * @param string[] $actions Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. (optional) + * @param string[] $actor_ids Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. (optional) + * @param string[] $actor_emails Filter by actor email address. Accepts up to 10 values. (optional) + * @param string[] $target_types Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. (optional) + * @param string[] $target_ids Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. (optional) + * @param string[] $ip_addresses Filter by the IP address the action originated from. Accepts up to 10 values. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function startLiveActivityAsyncWithHttpInfo($app_id, $activity_type, $start_live_activity_request) + public function listAuditLogsAsyncWithHttpInfo($organization_id, $start_time = null, $end_time = null, $cursor = null, $limit = null, $app_ids = null, $actions = null, $actor_ids = null, $actor_emails = null, $target_types = null, $target_ids = null, $ip_addresses = null) { - $returnType = '\onesignal\client\model\StartLiveActivitySuccessResponse'; - $request = $this->startLiveActivityRequest($app_id, $activity_type, $start_live_activity_request); + $returnType = '\onesignal\client\model\ListAuditLogsSuccessResponse'; + $request = $this->listAuditLogsRequest($organization_id, $start_time, $end_time, $cursor, $limit, $app_ids, $actions, $actor_ids, $actor_emails, $target_types, $target_ids, $ip_addresses); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -11828,37 +11970,1273 @@ function ($exception) { } /** - * Create request for operation 'startLiveActivity' - * - * @param string $app_id Your OneSignal App ID in UUID v4 format. (required) - * @param string $activity_type The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) - * @param \onesignal\client\model\StartLiveActivityRequest $start_live_activity_request (required) + * Create request for operation 'listAuditLogs' + * + * @param string $organization_id The UUID of the organization to retrieve audit logs for. Must match the authenticated Organization API Key. (required) + * @param string $start_time Start of the time range in ISO 8601 format (e.g. 2026-02-01T00:00:00Z). Required unless cursor is provided. Must be within the last 90 days. (optional) + * @param string $end_time End of the time range in ISO 8601 format. Defaults to the current time. Must be after start_time. (optional) + * @param string $cursor Pagination cursor returned in a previous response as next_cursor. When provided, start_time and end_time are ignored. (optional) + * @param int $limit Maximum number of events to return per page. Minimum 1, maximum 100. Values outside this range are clamped automatically by the server. (optional) + * @param string[] $app_ids Filter events by app UUID. Accepts up to 10 values. Org-level events are always included. (optional) + * @param string[] $actions Filter by action type (e.g. notification.sent, segment.created). Accepts up to 20 values. (optional) + * @param string[] $actor_ids Filter by actor UUID (the user or service that performed the action). Accepts up to 10 values. (optional) + * @param string[] $actor_emails Filter by actor email address. Accepts up to 10 values. (optional) + * @param string[] $target_types Filter by the type of resource the action was performed on (e.g. notification, segment, journey). Accepts up to 10 values. (optional) + * @param string[] $target_ids Filter by the UUID of the resource the action was performed on. Accepts up to 10 values. (optional) + * @param string[] $ip_addresses Filter by the IP address the action originated from. Accepts up to 10 values. (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function startLiveActivityRequest($app_id, $activity_type, $start_live_activity_request) + public function listAuditLogsRequest($organization_id, $start_time = null, $end_time = null, $cursor = null, $limit = null, $app_ids = null, $actions = null, $actor_ids = null, $actor_emails = null, $target_types = null, $target_ids = null, $ip_addresses = null) { - // verify the required parameter 'app_id' is set - if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { + // verify the required parameter 'organization_id' is set + if ($organization_id === null || (is_array($organization_id) && count($organization_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling startLiveActivity' + 'Missing the required parameter $organization_id when calling listAuditLogs' ); } - // verify the required parameter 'activity_type' is set - if ($activity_type === null || (is_array($activity_type) && count($activity_type) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $activity_type when calling startLiveActivity' - ); + if ($app_ids !== null && count($app_ids) > 10) { + throw new \InvalidArgumentException('invalid value for "$app_ids" when calling DefaultApi.listAuditLogs, number of items must be less than or equal to 10.'); } - // verify the required parameter 'start_live_activity_request' is set - if ($start_live_activity_request === null || (is_array($start_live_activity_request) && count($start_live_activity_request) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $start_live_activity_request when calling startLiveActivity' - ); + + if ($actions !== null && count($actions) > 20) { + throw new \InvalidArgumentException('invalid value for "$actions" when calling DefaultApi.listAuditLogs, number of items must be less than or equal to 20.'); + } + + if ($actor_ids !== null && count($actor_ids) > 10) { + throw new \InvalidArgumentException('invalid value for "$actor_ids" when calling DefaultApi.listAuditLogs, number of items must be less than or equal to 10.'); + } + + if ($actor_emails !== null && count($actor_emails) > 10) { + throw new \InvalidArgumentException('invalid value for "$actor_emails" when calling DefaultApi.listAuditLogs, number of items must be less than or equal to 10.'); + } + + if ($target_types !== null && count($target_types) > 10) { + throw new \InvalidArgumentException('invalid value for "$target_types" when calling DefaultApi.listAuditLogs, number of items must be less than or equal to 10.'); + } + + if ($target_ids !== null && count($target_ids) > 10) { + throw new \InvalidArgumentException('invalid value for "$target_ids" when calling DefaultApi.listAuditLogs, number of items must be less than or equal to 10.'); + } + + if ($ip_addresses !== null && count($ip_addresses) > 10) { + throw new \InvalidArgumentException('invalid value for "$ip_addresses" when calling DefaultApi.listAuditLogs, number of items must be less than or equal to 10.'); + } + + + $resourcePath = '/organizations/{organization_id}/audit_logs'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $start_time, + 'start_time', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $end_time, + 'end_time', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $cursor, + 'cursor', // 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 + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $app_ids, + 'app_ids', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $actions, + 'actions', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $actor_ids, + 'actor_ids', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $actor_emails, + 'actor_emails', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $target_types, + 'target_types', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $target_ids, + 'target_ids', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $ip_addresses, + 'ip_addresses', // param base name + 'array', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($organization_id !== null) { + $resourcePath = str_replace( + '{' . 'organization_id' . '}', + ObjectSerializer::toPathValue($organization_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // 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 ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + if (!empty($this->config->getOrganizationApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getOrganizationApiKeyToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + // Adding the telemetry header + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation rotateApiKey + * + * Rotate API key + * + * @param string $app_id app_id (required) + * @param string $token_id token_id (required) + * + * @throws \onesignal\client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \onesignal\client\model\CreateApiKeyResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError + */ + public function rotateApiKey($app_id, $token_id) + { + list($response) = $this->rotateApiKeyWithHttpInfo($app_id, $token_id); + return $response; + } + + /** + * Operation rotateApiKeyWithHttpInfo + * + * Rotate API key + * + * @param string $app_id (required) + * @param string $token_id (required) + * + * @throws \onesignal\client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @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) + { + $request = $this->rotateApiKeyRequest($app_id, $token_id); + + 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 ('\onesignal\client\model\CreateApiKeyResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\CreateApiKeyResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\CreateApiKeyResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\onesignal\client\model\CreateApiKeyResponse'; + 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() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\CreateApiKeyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation rotateApiKeyAsync + * + * Rotate API key + * + * @param string $app_id (required) + * @param string $token_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function rotateApiKeyAsync($app_id, $token_id) + { + return $this->rotateApiKeyAsyncWithHttpInfo($app_id, $token_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation rotateApiKeyAsyncWithHttpInfo + * + * Rotate API key + * + * @param string $app_id (required) + * @param string $token_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function rotateApiKeyAsyncWithHttpInfo($app_id, $token_id) + { + $returnType = '\onesignal\client\model\CreateApiKeyResponse'; + $request = $this->rotateApiKeyRequest($app_id, $token_id); + + 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 'rotateApiKey' + * + * @param string $app_id (required) + * @param string $token_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function rotateApiKeyRequest($app_id, $token_id) + { + // verify the required parameter 'app_id' is set + if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $app_id when calling rotateApiKey' + ); + } + // verify the required parameter 'token_id' is set + if ($token_id === null || (is_array($token_id) && count($token_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $token_id when calling rotateApiKey' + ); + } + + $resourcePath = '/apps/{app_id}/auth/tokens/{token_id}/rotate'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($app_id !== null) { + $resourcePath = str_replace( + '{' . 'app_id' . '}', + ObjectSerializer::toPathValue($app_id), + $resourcePath + ); + } + // path params + if ($token_id !== null) { + $resourcePath = str_replace( + '{' . 'token_id' . '}', + ObjectSerializer::toPathValue($token_id), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // 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 ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + if (!empty($this->config->getOrganizationApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getOrganizationApiKeyToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + // Adding the telemetry header + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation startLiveActivity + * + * Start Live Activity + * + * @param string $app_id Your OneSignal App ID in UUID v4 format. (required) + * @param string $activity_type The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) + * @param \onesignal\client\model\StartLiveActivityRequest $start_live_activity_request start_live_activity_request (required) + * + * @throws \onesignal\client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @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) + { + list($response) = $this->startLiveActivityWithHttpInfo($app_id, $activity_type, $start_live_activity_request); + return $response; + } + + /** + * Operation startLiveActivityWithHttpInfo + * + * Start Live Activity + * + * @param string $app_id Your OneSignal App ID in UUID v4 format. (required) + * @param string $activity_type The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) + * @param \onesignal\client\model\StartLiveActivityRequest $start_live_activity_request (required) + * + * @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|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + */ + public function startLiveActivityWithHttpInfo($app_id, $activity_type, $start_live_activity_request) + { + $request = $this->startLiveActivityRequest($app_id, $activity_type, $start_live_activity_request); + + 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 201: + if ('\onesignal\client\model\StartLiveActivitySuccessResponse' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\StartLiveActivitySuccessResponse' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\StartLiveActivitySuccessResponse', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\onesignal\client\model\StartLiveActivitySuccessResponse'; + 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() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 201: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\StartLiveActivitySuccessResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation startLiveActivityAsync + * + * Start Live Activity + * + * @param string $app_id Your OneSignal App ID in UUID v4 format. (required) + * @param string $activity_type The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) + * @param \onesignal\client\model\StartLiveActivityRequest $start_live_activity_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function startLiveActivityAsync($app_id, $activity_type, $start_live_activity_request) + { + return $this->startLiveActivityAsyncWithHttpInfo($app_id, $activity_type, $start_live_activity_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation startLiveActivityAsyncWithHttpInfo + * + * Start Live Activity + * + * @param string $app_id Your OneSignal App ID in UUID v4 format. (required) + * @param string $activity_type The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) + * @param \onesignal\client\model\StartLiveActivityRequest $start_live_activity_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function startLiveActivityAsyncWithHttpInfo($app_id, $activity_type, $start_live_activity_request) + { + $returnType = '\onesignal\client\model\StartLiveActivitySuccessResponse'; + $request = $this->startLiveActivityRequest($app_id, $activity_type, $start_live_activity_request); + + 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 'startLiveActivity' + * + * @param string $app_id Your OneSignal App ID in UUID v4 format. (required) + * @param string $activity_type The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation. (required) + * @param \onesignal\client\model\StartLiveActivityRequest $start_live_activity_request (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function startLiveActivityRequest($app_id, $activity_type, $start_live_activity_request) + { + // verify the required parameter 'app_id' is set + if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $app_id when calling startLiveActivity' + ); + } + // verify the required parameter 'activity_type' is set + if ($activity_type === null || (is_array($activity_type) && count($activity_type) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $activity_type when calling startLiveActivity' + ); + } + // verify the required parameter 'start_live_activity_request' is set + if ($start_live_activity_request === null || (is_array($start_live_activity_request) && count($start_live_activity_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $start_live_activity_request when calling startLiveActivity' + ); + } + + $resourcePath = '/apps/{app_id}/activities/activity/{activity_type}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($app_id !== null) { + $resourcePath = str_replace( + '{' . 'app_id' . '}', + ObjectSerializer::toPathValue($app_id), + $resourcePath + ); + } + // path params + if ($activity_type !== null) { + $resourcePath = str_replace( + '{' . 'activity_type' . '}', + ObjectSerializer::toPathValue($activity_type), + $resourcePath + ); + } + + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($start_live_activity_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($start_live_activity_request)); + } else { + $httpBody = $start_live_activity_request; + } + } elseif (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 ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + // Adding the telemetry header + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation transferSubscription + * + * @param string $app_id app_id (required) + * @param string $subscription_id subscription_id (required) + * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body transfer_subscription_request_body (required) + * + * @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|\onesignal\client\model\GenericError + */ + public function transferSubscription($app_id, $subscription_id, $transfer_subscription_request_body) + { + list($response) = $this->transferSubscriptionWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body); + return $response; + } + + /** + * Operation transferSubscriptionWithHttpInfo + * + * @param string $app_id (required) + * @param string $subscription_id (required) + * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) + * + * @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|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + */ + public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body) + { + $request = $this->transferSubscriptionRequest($app_id, $subscription_id, $transfer_subscription_request_body); + + 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 ('\onesignal\client\model\UserIdentityBody' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\UserIdentityBody' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\UserIdentityBody', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 400: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 409: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 429: + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + $returnType = '\onesignal\client\model\UserIdentityBody'; + 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() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\UserIdentityBody', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 409: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation transferSubscriptionAsync + * + * @param string $app_id (required) + * @param string $subscription_id (required) + * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function transferSubscriptionAsync($app_id, $subscription_id, $transfer_subscription_request_body) + { + return $this->transferSubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation transferSubscriptionAsyncWithHttpInfo + * + * @param string $app_id (required) + * @param string $subscription_id (required) + * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function transferSubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body) + { + $returnType = '\onesignal\client\model\UserIdentityBody'; + $request = $this->transferSubscriptionRequest($app_id, $subscription_id, $transfer_subscription_request_body); + + 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 'transferSubscription' + * + * @param string $app_id (required) + * @param string $subscription_id (required) + * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function transferSubscriptionRequest($app_id, $subscription_id, $transfer_subscription_request_body) + { + // verify the required parameter 'app_id' is set + if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $app_id when calling transferSubscription' + ); + } + // verify the required parameter 'subscription_id' is set + if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $subscription_id when calling transferSubscription' + ); + } + // verify the required parameter 'transfer_subscription_request_body' is set + if ($transfer_subscription_request_body === null || (is_array($transfer_subscription_request_body) && count($transfer_subscription_request_body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $transfer_subscription_request_body when calling transferSubscription' + ); } - $resourcePath = '/apps/{app_id}/activities/activity/{activity_type}'; + $resourcePath = '/apps/{app_id}/subscriptions/{subscription_id}/owner'; $formParams = []; $queryParams = []; $headerParams = []; @@ -11876,10 +13254,10 @@ public function startLiveActivityRequest($app_id, $activity_type, $start_live_ac ); } // path params - if ($activity_type !== null) { + if ($subscription_id !== null) { $resourcePath = str_replace( - '{' . 'activity_type' . '}', - ObjectSerializer::toPathValue($activity_type), + '{' . 'subscription_id' . '}', + ObjectSerializer::toPathValue($subscription_id), $resourcePath ); } @@ -11897,11 +13275,11 @@ public function startLiveActivityRequest($app_id, $activity_type, $start_live_ac } // for model (json/xml) - if (isset($start_live_activity_request)) { + if (isset($transfer_subscription_request_body)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($start_live_activity_request)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($transfer_subscription_request_body)); } else { - $httpBody = $start_live_activity_request; + $httpBody = $transfer_subscription_request_body; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -11937,7 +13315,7 @@ public function startLiveActivityRequest($app_id, $activity_type, $start_live_ac } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -11947,7 +13325,7 @@ public function startLiveActivityRequest($app_id, $activity_type, $start_live_ac $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -11955,36 +13333,40 @@ public function startLiveActivityRequest($app_id, $activity_type, $start_live_ac } /** - * Operation transferSubscription + * Operation unsubscribeEmailWithToken * - * @param string $app_id app_id (required) - * @param string $subscription_id subscription_id (required) - * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body transfer_subscription_request_body (required) + * Unsubscribe with token + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) * * @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|\onesignal\client\model\GenericError + * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ - public function transferSubscription($app_id, $subscription_id, $transfer_subscription_request_body) + public function unsubscribeEmailWithToken($app_id, $notification_id, $token) { - list($response) = $this->transferSubscriptionWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body); + list($response) = $this->unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, $token); return $response; } /** - * Operation transferSubscriptionWithHttpInfo + * Operation unsubscribeEmailWithTokenWithHttpInfo * - * @param string $app_id (required) - * @param string $subscription_id (required) - * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) + * Unsubscribe with token + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) * * @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|\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\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) + public function unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, $token) { - $request = $this->transferSubscriptionRequest($app_id, $subscription_id, $transfer_subscription_request_body); + $request = $this->unsubscribeEmailWithTokenRequest($app_id, $notification_id, $token); try { $options = $this->createHttpClientOption(); @@ -12022,18 +13404,18 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra } switch($statusCode) { - case 200: - if ('\onesignal\client\model\UserIdentityBody' === '\SplFileObject') { + case 202: + if ('\onesignal\client\model\GenericSuccessBoolResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\UserIdentityBody' !== 'string') { + if ('\onesignal\client\model\GenericSuccessBoolResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\UserIdentityBody', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericSuccessBoolResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -12047,36 +13429,6 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra } } - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 404: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - case 409: - if ('\onesignal\client\model\GenericError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericError' !== 'string') { - $content = json_decode($content); - } - } - return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), @@ -12099,7 +13451,7 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra ]; } - $returnType = '\onesignal\client\model\UserIdentityBody'; + $returnType = '\onesignal\client\model\GenericSuccessBoolResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -12117,10 +13469,10 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra } catch (ApiException $e) { switch ($e->getCode()) { - case 200: + case 202: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\UserIdentityBody', + '\onesignal\client\model\GenericSuccessBoolResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12133,22 +13485,6 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra ); $e->setResponseObject($data); break; - case 404: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - case 409: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\GenericError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12171,18 +13507,20 @@ public function transferSubscriptionWithHttpInfo($app_id, $subscription_id, $tra } /** - * Operation transferSubscriptionAsync + * Operation unsubscribeEmailWithTokenAsync * - * @param string $app_id (required) - * @param string $subscription_id (required) - * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) + * Unsubscribe with token + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function transferSubscriptionAsync($app_id, $subscription_id, $transfer_subscription_request_body) + public function unsubscribeEmailWithTokenAsync($app_id, $notification_id, $token) { - return $this->transferSubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body) + return $this->unsubscribeEmailWithTokenAsyncWithHttpInfo($app_id, $notification_id, $token) ->then( function ($response) { return $response[0]; @@ -12191,19 +13529,21 @@ function ($response) { } /** - * Operation transferSubscriptionAsyncWithHttpInfo + * Operation unsubscribeEmailWithTokenAsyncWithHttpInfo * - * @param string $app_id (required) - * @param string $subscription_id (required) - * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) + * Unsubscribe with token + * + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function transferSubscriptionAsyncWithHttpInfo($app_id, $subscription_id, $transfer_subscription_request_body) + public function unsubscribeEmailWithTokenAsyncWithHttpInfo($app_id, $notification_id, $token) { - $returnType = '\onesignal\client\model\UserIdentityBody'; - $request = $this->transferSubscriptionRequest($app_id, $subscription_id, $transfer_subscription_request_body); + $returnType = '\onesignal\client\model\GenericSuccessBoolResponse'; + $request = $this->unsubscribeEmailWithTokenRequest($app_id, $notification_id, $token); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12242,43 +13582,52 @@ function ($exception) { } /** - * Create request for operation 'transferSubscription' + * Create request for operation 'unsubscribeEmailWithToken' * - * @param string $app_id (required) - * @param string $subscription_id (required) - * @param \onesignal\client\model\TransferSubscriptionRequestBody $transfer_subscription_request_body (required) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) + * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function transferSubscriptionRequest($app_id, $subscription_id, $transfer_subscription_request_body) + public function unsubscribeEmailWithTokenRequest($app_id, $notification_id, $token) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling transferSubscription' + 'Missing the required parameter $app_id when calling unsubscribeEmailWithToken' ); } - // verify the required parameter 'subscription_id' is set - if ($subscription_id === null || (is_array($subscription_id) && count($subscription_id) === 0)) { + // verify the required parameter 'notification_id' is set + if ($notification_id === null || (is_array($notification_id) && count($notification_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $subscription_id when calling transferSubscription' + 'Missing the required parameter $notification_id when calling unsubscribeEmailWithToken' ); } - // verify the required parameter 'transfer_subscription_request_body' is set - if ($transfer_subscription_request_body === null || (is_array($transfer_subscription_request_body) && count($transfer_subscription_request_body) === 0)) { + // verify the required parameter 'token' is set + if ($token === null || (is_array($token) && count($token) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $transfer_subscription_request_body when calling transferSubscription' + 'Missing the required parameter $token when calling unsubscribeEmailWithToken' ); } - $resourcePath = '/apps/{app_id}/subscriptions/{subscription_id}/owner'; + $resourcePath = '/apps/{app_id}/notifications/{notification_id}/unsubscribe'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $token, + 'token', // param base name + 'string', // openApiType + 'form', // style + true, // explode + true // required + ) ?? []); // path params @@ -12290,10 +13639,10 @@ public function transferSubscriptionRequest($app_id, $subscription_id, $transfer ); } // path params - if ($subscription_id !== null) { + if ($notification_id !== null) { $resourcePath = str_replace( - '{' . 'subscription_id' . '}', - ObjectSerializer::toPathValue($subscription_id), + '{' . 'notification_id' . '}', + ObjectSerializer::toPathValue($notification_id), $resourcePath ); } @@ -12306,18 +13655,12 @@ public function transferSubscriptionRequest($app_id, $subscription_id, $transfer } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } - // for model (json/xml) - if (isset($transfer_subscription_request_body)) { - if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($transfer_subscription_request_body)); - } else { - $httpBody = $transfer_subscription_request_body; - } - } elseif (count($formParams) > 0) { + // for model (json/xml) + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -12351,7 +13694,7 @@ public function transferSubscriptionRequest($app_id, $subscription_id, $transfer } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -12361,7 +13704,7 @@ public function transferSubscriptionRequest($app_id, $subscription_id, $transfer $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PATCH', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -12369,40 +13712,40 @@ public function transferSubscriptionRequest($app_id, $subscription_id, $transfer } /** - * Operation unsubscribeEmailWithToken + * Operation updateApiKey * - * Unsubscribe with token + * Update API key * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) - * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) + * @param string $app_id app_id (required) + * @param string $token_id token_id (required) + * @param \onesignal\client\model\UpdateApiKeyRequest $update_api_key_request update_api_key_request (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\GenericSuccessBoolResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError + * @return object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError */ - public function unsubscribeEmailWithToken($app_id, $notification_id, $token) + public function updateApiKey($app_id, $token_id, $update_api_key_request) { - list($response) = $this->unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, $token); + list($response) = $this->updateApiKeyWithHttpInfo($app_id, $token_id, $update_api_key_request); return $response; } /** - * Operation unsubscribeEmailWithTokenWithHttpInfo + * Operation updateApiKeyWithHttpInfo * - * Unsubscribe with token + * Update API key * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) - * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) + * @param string $app_id (required) + * @param string $token_id (required) + * @param \onesignal\client\model\UpdateApiKeyRequest $update_api_key_request (required) * * @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|\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 unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, $token) + public function updateApiKeyWithHttpInfo($app_id, $token_id, $update_api_key_request) { - $request = $this->unsubscribeEmailWithTokenRequest($app_id, $notification_id, $token); + $request = $this->updateApiKeyRequest($app_id, $token_id, $update_api_key_request); try { $options = $this->createHttpClientOption(); @@ -12440,18 +13783,18 @@ public function unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, } switch($statusCode) { - case 202: - if ('\onesignal\client\model\GenericSuccessBoolResponse' === '\SplFileObject') { + case 200: + if ('object' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\GenericSuccessBoolResponse' !== 'string') { + if ('object' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericSuccessBoolResponse', []), + ObjectSerializer::deserialize($content, 'object', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -12470,24 +13813,9 @@ public function unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, $response->getStatusCode(), $response->getHeaders() ]; - case 429: - if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\onesignal\client\model\RateLimitError' !== 'string') { - $content = json_decode($content); - } - } - - return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), - $response->getStatusCode(), - $response->getHeaders() - ]; } - $returnType = '\onesignal\client\model\GenericSuccessBoolResponse'; + $returnType = 'object'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -12505,10 +13833,10 @@ public function unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, } catch (ApiException $e) { switch ($e->getCode()) { - case 202: + case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\GenericSuccessBoolResponse', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12521,14 +13849,6 @@ public function unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, ); $e->setResponseObject($data); break; - case 429: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\onesignal\client\model\RateLimitError', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12543,20 +13863,20 @@ public function unsubscribeEmailWithTokenWithHttpInfo($app_id, $notification_id, } /** - * Operation unsubscribeEmailWithTokenAsync + * Operation updateApiKeyAsync * - * Unsubscribe with token + * Update API key * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) - * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) + * @param string $app_id (required) + * @param string $token_id (required) + * @param \onesignal\client\model\UpdateApiKeyRequest $update_api_key_request (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function unsubscribeEmailWithTokenAsync($app_id, $notification_id, $token) + public function updateApiKeyAsync($app_id, $token_id, $update_api_key_request) { - return $this->unsubscribeEmailWithTokenAsyncWithHttpInfo($app_id, $notification_id, $token) + return $this->updateApiKeyAsyncWithHttpInfo($app_id, $token_id, $update_api_key_request) ->then( function ($response) { return $response[0]; @@ -12565,21 +13885,21 @@ function ($response) { } /** - * Operation unsubscribeEmailWithTokenAsyncWithHttpInfo + * Operation updateApiKeyAsyncWithHttpInfo * - * Unsubscribe with token + * Update API key * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) - * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) + * @param string $app_id (required) + * @param string $token_id (required) + * @param \onesignal\client\model\UpdateApiKeyRequest $update_api_key_request (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function unsubscribeEmailWithTokenAsyncWithHttpInfo($app_id, $notification_id, $token) + public function updateApiKeyAsyncWithHttpInfo($app_id, $token_id, $update_api_key_request) { - $returnType = '\onesignal\client\model\GenericSuccessBoolResponse'; - $request = $this->unsubscribeEmailWithTokenRequest($app_id, $notification_id, $token); + $returnType = 'object'; + $request = $this->updateApiKeyRequest($app_id, $token_id, $update_api_key_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12618,52 +13938,43 @@ function ($exception) { } /** - * Create request for operation 'unsubscribeEmailWithToken' + * Create request for operation 'updateApiKey' * - * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $notification_id The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. (required) - * @param string $token The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. (required) + * @param string $app_id (required) + * @param string $token_id (required) + * @param \onesignal\client\model\UpdateApiKeyRequest $update_api_key_request (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function unsubscribeEmailWithTokenRequest($app_id, $notification_id, $token) + public function updateApiKeyRequest($app_id, $token_id, $update_api_key_request) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling unsubscribeEmailWithToken' + 'Missing the required parameter $app_id when calling updateApiKey' ); } - // verify the required parameter 'notification_id' is set - if ($notification_id === null || (is_array($notification_id) && count($notification_id) === 0)) { + // verify the required parameter 'token_id' is set + if ($token_id === null || (is_array($token_id) && count($token_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $notification_id when calling unsubscribeEmailWithToken' + 'Missing the required parameter $token_id when calling updateApiKey' ); } - // verify the required parameter 'token' is set - if ($token === null || (is_array($token) && count($token) === 0)) { + // verify the required parameter 'update_api_key_request' is set + if ($update_api_key_request === null || (is_array($update_api_key_request) && count($update_api_key_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $token when calling unsubscribeEmailWithToken' + 'Missing the required parameter $update_api_key_request when calling updateApiKey' ); } - $resourcePath = '/apps/{app_id}/notifications/{notification_id}/unsubscribe'; + $resourcePath = '/apps/{app_id}/auth/tokens/{token_id}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $token, - 'token', // param base name - 'string', // openApiType - 'form', // style - true, // explode - true // required - ) ?? []); // path params @@ -12675,10 +13986,10 @@ public function unsubscribeEmailWithTokenRequest($app_id, $notification_id, $tok ); } // path params - if ($notification_id !== null) { + if ($token_id !== null) { $resourcePath = str_replace( - '{' . 'notification_id' . '}', - ObjectSerializer::toPathValue($notification_id), + '{' . 'token_id' . '}', + ObjectSerializer::toPathValue($token_id), $resourcePath ); } @@ -12691,12 +14002,18 @@ public function unsubscribeEmailWithTokenRequest($app_id, $notification_id, $tok } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } // for model (json/xml) - if (count($formParams) > 0) { + if (isset($update_api_key_request)) { + if ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_api_key_request)); + } else { + $httpBody = $update_api_key_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -12720,8 +14037,8 @@ public function unsubscribeEmailWithTokenRequest($app_id, $notification_id, $tok } } - if (!empty($this->config->getRestApiKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); + if (!empty($this->config->getOrganizationApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getOrganizationApiKeyToken(); } $defaultHeaders = []; @@ -12730,7 +14047,7 @@ public function unsubscribeEmailWithTokenRequest($app_id, $notification_id, $tok } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -12740,7 +14057,7 @@ public function unsubscribeEmailWithTokenRequest($app_id, $notification_id, $tok $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -12748,40 +14065,38 @@ public function unsubscribeEmailWithTokenRequest($app_id, $notification_id, $tok } /** - * Operation updateApiKey + * Operation updateApp * - * Update API key + * Update an app * - * @param string $app_id app_id (required) - * @param string $token_id token_id (required) - * @param \onesignal\client\model\UpdateApiKeyRequest $update_api_key_request update_api_key_request (required) + * @param string $app_id An app id (required) + * @param \onesignal\client\model\App $app app (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError + * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ - public function updateApiKey($app_id, $token_id, $update_api_key_request) + public function updateApp($app_id, $app) { - list($response) = $this->updateApiKeyWithHttpInfo($app_id, $token_id, $update_api_key_request); + list($response) = $this->updateAppWithHttpInfo($app_id, $app); return $response; } /** - * Operation updateApiKeyWithHttpInfo + * Operation updateAppWithHttpInfo * - * Update API key + * Update an app * - * @param string $app_id (required) - * @param string $token_id (required) - * @param \onesignal\client\model\UpdateApiKeyRequest $update_api_key_request (required) + * @param string $app_id An app id (required) + * @param \onesignal\client\model\App $app (required) * * @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 \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 updateApiKeyWithHttpInfo($app_id, $token_id, $update_api_key_request) + public function updateAppWithHttpInfo($app_id, $app) { - $request = $this->updateApiKeyRequest($app_id, $token_id, $update_api_key_request); + $request = $this->updateAppRequest($app_id, $app); try { $options = $this->createHttpClientOption(); @@ -12820,17 +14135,17 @@ public function updateApiKeyWithHttpInfo($app_id, $token_id, $update_api_key_req switch($statusCode) { case 200: - if ('object' === '\SplFileObject') { + if ('\onesignal\client\model\App' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('object' !== 'string') { + if ('\onesignal\client\model\App' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, 'object', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\App', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -12849,9 +14164,24 @@ public function updateApiKeyWithHttpInfo($app_id, $token_id, $update_api_key_req $response->getStatusCode(), $response->getHeaders() ]; + case 429: + if ('\onesignal\client\model\RateLimitError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\RateLimitError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\RateLimitError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; } - $returnType = 'object'; + $returnType = '\onesignal\client\model\App'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -12872,7 +14202,7 @@ public function updateApiKeyWithHttpInfo($app_id, $token_id, $update_api_key_req case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\onesignal\client\model\App', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -12885,6 +14215,14 @@ public function updateApiKeyWithHttpInfo($app_id, $token_id, $update_api_key_req ); $e->setResponseObject($data); break; + case 429: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\RateLimitError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -12899,20 +14237,19 @@ public function updateApiKeyWithHttpInfo($app_id, $token_id, $update_api_key_req } /** - * Operation updateApiKeyAsync + * Operation updateAppAsync * - * Update API key + * Update an app * - * @param string $app_id (required) - * @param string $token_id (required) - * @param \onesignal\client\model\UpdateApiKeyRequest $update_api_key_request (required) + * @param string $app_id An app id (required) + * @param \onesignal\client\model\App $app (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateApiKeyAsync($app_id, $token_id, $update_api_key_request) + public function updateAppAsync($app_id, $app) { - return $this->updateApiKeyAsyncWithHttpInfo($app_id, $token_id, $update_api_key_request) + return $this->updateAppAsyncWithHttpInfo($app_id, $app) ->then( function ($response) { return $response[0]; @@ -12921,21 +14258,20 @@ function ($response) { } /** - * Operation updateApiKeyAsyncWithHttpInfo + * Operation updateAppAsyncWithHttpInfo * - * Update API key + * Update an app * - * @param string $app_id (required) - * @param string $token_id (required) - * @param \onesignal\client\model\UpdateApiKeyRequest $update_api_key_request (required) + * @param string $app_id An app id (required) + * @param \onesignal\client\model\App $app (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateApiKeyAsyncWithHttpInfo($app_id, $token_id, $update_api_key_request) + public function updateAppAsyncWithHttpInfo($app_id, $app) { - $returnType = 'object'; - $request = $this->updateApiKeyRequest($app_id, $token_id, $update_api_key_request); + $returnType = '\onesignal\client\model\App'; + $request = $this->updateAppRequest($app_id, $app); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -12974,37 +14310,30 @@ function ($exception) { } /** - * Create request for operation 'updateApiKey' - * - * @param string $app_id (required) - * @param string $token_id (required) - * @param \onesignal\client\model\UpdateApiKeyRequest $update_api_key_request (required) + * Create request for operation 'updateApp' + * + * @param string $app_id An app id (required) + * @param \onesignal\client\model\App $app (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateApiKeyRequest($app_id, $token_id, $update_api_key_request) + public function updateAppRequest($app_id, $app) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling updateApiKey' - ); - } - // verify the required parameter 'token_id' is set - if ($token_id === null || (is_array($token_id) && count($token_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $token_id when calling updateApiKey' + 'Missing the required parameter $app_id when calling updateApp' ); } - // verify the required parameter 'update_api_key_request' is set - if ($update_api_key_request === null || (is_array($update_api_key_request) && count($update_api_key_request) === 0)) { + // verify the required parameter 'app' is set + if ($app === null || (is_array($app) && count($app) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_api_key_request when calling updateApiKey' + 'Missing the required parameter $app when calling updateApp' ); } - $resourcePath = '/apps/{app_id}/auth/tokens/{token_id}'; + $resourcePath = '/apps/{app_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13021,14 +14350,6 @@ public function updateApiKeyRequest($app_id, $token_id, $update_api_key_request) $resourcePath ); } - // path params - if ($token_id !== null) { - $resourcePath = str_replace( - '{' . 'token_id' . '}', - ObjectSerializer::toPathValue($token_id), - $resourcePath - ); - } if ($multipart) { @@ -13043,11 +14364,11 @@ public function updateApiKeyRequest($app_id, $token_id, $update_api_key_request) } // for model (json/xml) - if (isset($update_api_key_request)) { + if (isset($app)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_api_key_request)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($app)); } else { - $httpBody = $update_api_key_request; + $httpBody = $app; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -13083,7 +14404,7 @@ public function updateApiKeyRequest($app_id, $token_id, $update_api_key_request) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -13093,7 +14414,7 @@ public function updateApiKeyRequest($app_id, $token_id, $update_api_key_request) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PATCH', + 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -13101,38 +14422,40 @@ public function updateApiKeyRequest($app_id, $token_id, $update_api_key_request) } /** - * Operation updateApp + * Operation updateLiveActivity * - * Update an app + * Update a Live Activity via Push * - * @param string $app_id An app id (required) - * @param \onesignal\client\model\App $app app (required) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $activity_id Live Activity record ID (required) + * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request update_live_activity_request (required) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\App|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError + * @return \onesignal\client\model\UpdateLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ - public function updateApp($app_id, $app) + public function updateLiveActivity($app_id, $activity_id, $update_live_activity_request) { - list($response) = $this->updateAppWithHttpInfo($app_id, $app); + list($response) = $this->updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_live_activity_request); return $response; } /** - * Operation updateAppWithHttpInfo + * Operation updateLiveActivityWithHttpInfo * - * Update an app + * Update a Live Activity via Push * - * @param string $app_id An app id (required) - * @param \onesignal\client\model\App $app (required) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $activity_id Live Activity record ID (required) + * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) * * @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|\onesignal\client\model\GenericError, 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 updateAppWithHttpInfo($app_id, $app) + public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_live_activity_request) { - $request = $this->updateAppRequest($app_id, $app); + $request = $this->updateLiveActivityRequest($app_id, $activity_id, $update_live_activity_request); try { $options = $this->createHttpClientOption(); @@ -13171,17 +14494,17 @@ public function updateAppWithHttpInfo($app_id, $app) switch($statusCode) { case 200: - if ('\onesignal\client\model\App' === '\SplFileObject') { + if ('\onesignal\client\model\UpdateLiveActivitySuccessResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\App' !== 'string') { + if ('\onesignal\client\model\UpdateLiveActivitySuccessResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\App', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\UpdateLiveActivitySuccessResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -13217,7 +14540,7 @@ public function updateAppWithHttpInfo($app_id, $app) ]; } - $returnType = '\onesignal\client\model\App'; + $returnType = '\onesignal\client\model\UpdateLiveActivitySuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -13238,7 +14561,7 @@ public function updateAppWithHttpInfo($app_id, $app) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\App', + '\onesignal\client\model\UpdateLiveActivitySuccessResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13273,19 +14596,20 @@ public function updateAppWithHttpInfo($app_id, $app) } /** - * Operation updateAppAsync + * Operation updateLiveActivityAsync * - * Update an app + * Update a Live Activity via Push * - * @param string $app_id An app id (required) - * @param \onesignal\client\model\App $app (required) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $activity_id Live Activity record ID (required) + * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAppAsync($app_id, $app) + public function updateLiveActivityAsync($app_id, $activity_id, $update_live_activity_request) { - return $this->updateAppAsyncWithHttpInfo($app_id, $app) + return $this->updateLiveActivityAsyncWithHttpInfo($app_id, $activity_id, $update_live_activity_request) ->then( function ($response) { return $response[0]; @@ -13294,20 +14618,21 @@ function ($response) { } /** - * Operation updateAppAsyncWithHttpInfo + * Operation updateLiveActivityAsyncWithHttpInfo * - * Update an app + * Update a Live Activity via Push * - * @param string $app_id An app id (required) - * @param \onesignal\client\model\App $app (required) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $activity_id Live Activity record ID (required) + * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateAppAsyncWithHttpInfo($app_id, $app) + public function updateLiveActivityAsyncWithHttpInfo($app_id, $activity_id, $update_live_activity_request) { - $returnType = '\onesignal\client\model\App'; - $request = $this->updateAppRequest($app_id, $app); + $returnType = '\onesignal\client\model\UpdateLiveActivitySuccessResponse'; + $request = $this->updateLiveActivityRequest($app_id, $activity_id, $update_live_activity_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13346,30 +14671,37 @@ function ($exception) { } /** - * Create request for operation 'updateApp' + * Create request for operation 'updateLiveActivity' * - * @param string $app_id An app id (required) - * @param \onesignal\client\model\App $app (required) + * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) + * @param string $activity_id Live Activity record ID (required) + * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateAppRequest($app_id, $app) + public function updateLiveActivityRequest($app_id, $activity_id, $update_live_activity_request) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling updateApp' + 'Missing the required parameter $app_id when calling updateLiveActivity' ); } - // verify the required parameter 'app' is set - if ($app === null || (is_array($app) && count($app) === 0)) { + // verify the required parameter 'activity_id' is set + if ($activity_id === null || (is_array($activity_id) && count($activity_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app when calling updateApp' + 'Missing the required parameter $activity_id when calling updateLiveActivity' + ); + } + // verify the required parameter 'update_live_activity_request' is set + if ($update_live_activity_request === null || (is_array($update_live_activity_request) && count($update_live_activity_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $update_live_activity_request when calling updateLiveActivity' ); } - $resourcePath = '/apps/{app_id}'; + $resourcePath = '/apps/{app_id}/live_activities/{activity_id}/notifications'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13386,6 +14718,14 @@ public function updateAppRequest($app_id, $app) $resourcePath ); } + // path params + if ($activity_id !== null) { + $resourcePath = str_replace( + '{' . 'activity_id' . '}', + ObjectSerializer::toPathValue($activity_id), + $resourcePath + ); + } if ($multipart) { @@ -13400,11 +14740,11 @@ public function updateAppRequest($app_id, $app) } // for model (json/xml) - if (isset($app)) { + if (isset($update_live_activity_request)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($app)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_live_activity_request)); } else { - $httpBody = $app; + $httpBody = $update_live_activity_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -13430,8 +14770,8 @@ public function updateAppRequest($app_id, $app) } } - if (!empty($this->config->getOrganizationApiKeyToken())) { - $headers['Authorization'] = 'Key ' . $this->config->getOrganizationApiKeyToken(); + if (!empty($this->config->getRestApiKeyToken())) { + $headers['Authorization'] = 'Key ' . $this->config->getRestApiKeyToken(); } $defaultHeaders = []; @@ -13440,7 +14780,7 @@ public function updateAppRequest($app_id, $app) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -13450,7 +14790,7 @@ public function updateAppRequest($app_id, $app) $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -13458,40 +14798,40 @@ public function updateAppRequest($app_id, $app) } /** - * Operation updateLiveActivity + * Operation updateSegment * - * Update a Live Activity via Push + * Update Segment * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request update_live_activity_request (required) + * @param string $segment_id The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param \onesignal\client\model\UpdateSegmentRequest $update_segment_request update_segment_request (optional) * * @throws \onesignal\client\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \onesignal\client\model\UpdateLiveActivitySuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError + * @return \onesignal\client\model\UpdateSegmentSuccessResponse|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\GenericError|\onesignal\client\model\RateLimitError|\onesignal\client\model\GenericError */ - public function updateLiveActivity($app_id, $activity_id, $update_live_activity_request) + public function updateSegment($app_id, $segment_id, $update_segment_request = null) { - list($response) = $this->updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_live_activity_request); + list($response) = $this->updateSegmentWithHttpInfo($app_id, $segment_id, $update_segment_request); return $response; } /** - * Operation updateLiveActivityWithHttpInfo + * Operation updateSegmentWithHttpInfo * - * Update a Live Activity via Push + * Update Segment * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) + * @param string $segment_id The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param \onesignal\client\model\UpdateSegmentRequest $update_segment_request (optional) * * @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|\onesignal\client\model\GenericError, HTTP status code, HTTP response headers (array of strings) + * @return array of \onesignal\client\model\UpdateSegmentSuccessResponse|\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 updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_live_activity_request) + public function updateSegmentWithHttpInfo($app_id, $segment_id, $update_segment_request = null) { - $request = $this->updateLiveActivityRequest($app_id, $activity_id, $update_live_activity_request); + $request = $this->updateSegmentRequest($app_id, $segment_id, $update_segment_request); try { $options = $this->createHttpClientOption(); @@ -13530,17 +14870,17 @@ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_li switch($statusCode) { case 200: - if ('\onesignal\client\model\UpdateLiveActivitySuccessResponse' === '\SplFileObject') { + if ('\onesignal\client\model\UpdateSegmentSuccessResponse' === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { $content = (string) $response->getBody(); - if ('\onesignal\client\model\UpdateLiveActivitySuccessResponse' !== 'string') { + if ('\onesignal\client\model\UpdateSegmentSuccessResponse' !== 'string') { $content = json_decode($content); } } return [ - ObjectSerializer::deserialize($content, '\onesignal\client\model\UpdateLiveActivitySuccessResponse', []), + ObjectSerializer::deserialize($content, '\onesignal\client\model\UpdateSegmentSuccessResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -13554,6 +14894,36 @@ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_li } } + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 403: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), + $response->getStatusCode(), + $response->getHeaders() + ]; + case 404: + if ('\onesignal\client\model\GenericError' === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ('\onesignal\client\model\GenericError' !== 'string') { + $content = json_decode($content); + } + } + return [ ObjectSerializer::deserialize($content, '\onesignal\client\model\GenericError', []), $response->getStatusCode(), @@ -13576,7 +14946,7 @@ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_li ]; } - $returnType = '\onesignal\client\model\UpdateLiveActivitySuccessResponse'; + $returnType = '\onesignal\client\model\UpdateSegmentSuccessResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer } else { @@ -13597,7 +14967,7 @@ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_li case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\onesignal\client\model\UpdateLiveActivitySuccessResponse', + '\onesignal\client\model\UpdateSegmentSuccessResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -13610,6 +14980,22 @@ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_li ); $e->setResponseObject($data); break; + case 403: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 404: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\onesignal\client\model\GenericError', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; case 429: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -13632,20 +15018,20 @@ public function updateLiveActivityWithHttpInfo($app_id, $activity_id, $update_li } /** - * Operation updateLiveActivityAsync + * Operation updateSegmentAsync * - * Update a Live Activity via Push + * Update Segment * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) + * @param string $segment_id The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param \onesignal\client\model\UpdateSegmentRequest $update_segment_request (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLiveActivityAsync($app_id, $activity_id, $update_live_activity_request) + public function updateSegmentAsync($app_id, $segment_id, $update_segment_request = null) { - return $this->updateLiveActivityAsyncWithHttpInfo($app_id, $activity_id, $update_live_activity_request) + return $this->updateSegmentAsyncWithHttpInfo($app_id, $segment_id, $update_segment_request) ->then( function ($response) { return $response[0]; @@ -13654,21 +15040,21 @@ function ($response) { } /** - * Operation updateLiveActivityAsyncWithHttpInfo + * Operation updateSegmentAsyncWithHttpInfo * - * Update a Live Activity via Push + * Update Segment * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) + * @param string $segment_id The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param \onesignal\client\model\UpdateSegmentRequest $update_segment_request (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function updateLiveActivityAsyncWithHttpInfo($app_id, $activity_id, $update_live_activity_request) + public function updateSegmentAsyncWithHttpInfo($app_id, $segment_id, $update_segment_request = null) { - $returnType = '\onesignal\client\model\UpdateLiveActivitySuccessResponse'; - $request = $this->updateLiveActivityRequest($app_id, $activity_id, $update_live_activity_request); + $returnType = '\onesignal\client\model\UpdateSegmentSuccessResponse'; + $request = $this->updateSegmentRequest($app_id, $segment_id, $update_segment_request); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -13707,37 +15093,31 @@ function ($exception) { } /** - * Create request for operation 'updateLiveActivity' + * Create request for operation 'updateSegment' * * @param string $app_id The OneSignal App ID for your app. Available in Keys & IDs. (required) - * @param string $activity_id Live Activity record ID (required) - * @param \onesignal\client\model\UpdateLiveActivityRequest $update_live_activity_request (required) + * @param string $segment_id The segment's unique identifier. Can be found using the View Segments API or in the URL of the segment when viewing it in the dashboard. (required) + * @param \onesignal\client\model\UpdateSegmentRequest $update_segment_request (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function updateLiveActivityRequest($app_id, $activity_id, $update_live_activity_request) + public function updateSegmentRequest($app_id, $segment_id, $update_segment_request = null) { // verify the required parameter 'app_id' is set if ($app_id === null || (is_array($app_id) && count($app_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $app_id when calling updateLiveActivity' - ); - } - // verify the required parameter 'activity_id' is set - if ($activity_id === null || (is_array($activity_id) && count($activity_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $activity_id when calling updateLiveActivity' + 'Missing the required parameter $app_id when calling updateSegment' ); } - // verify the required parameter 'update_live_activity_request' is set - if ($update_live_activity_request === null || (is_array($update_live_activity_request) && count($update_live_activity_request) === 0)) { + // verify the required parameter 'segment_id' is set + if ($segment_id === null || (is_array($segment_id) && count($segment_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $update_live_activity_request when calling updateLiveActivity' + 'Missing the required parameter $segment_id when calling updateSegment' ); } - $resourcePath = '/apps/{app_id}/live_activities/{activity_id}/notifications'; + $resourcePath = '/apps/{app_id}/segments/{segment_id}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -13755,10 +15135,10 @@ public function updateLiveActivityRequest($app_id, $activity_id, $update_live_ac ); } // path params - if ($activity_id !== null) { + if ($segment_id !== null) { $resourcePath = str_replace( - '{' . 'activity_id' . '}', - ObjectSerializer::toPathValue($activity_id), + '{' . 'segment_id' . '}', + ObjectSerializer::toPathValue($segment_id), $resourcePath ); } @@ -13776,11 +15156,11 @@ public function updateLiveActivityRequest($app_id, $activity_id, $update_live_ac } // for model (json/xml) - if (isset($update_live_activity_request)) { + if (isset($update_segment_request)) { if ($headers['Content-Type'] === 'application/json') { - $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_live_activity_request)); + $httpBody = \GuzzleHttp\json_encode(ObjectSerializer::sanitizeForSerialization($update_segment_request)); } else { - $httpBody = $update_live_activity_request; + $httpBody = $update_segment_request; } } elseif (count($formParams) > 0) { if ($multipart) { @@ -13816,7 +15196,7 @@ public function updateLiveActivityRequest($app_id, $activity_id, $update_live_ac } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -13826,7 +15206,7 @@ public function updateLiveActivityRequest($app_id, $activity_id, $update_live_ac $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -14116,7 +15496,7 @@ public function updateSubscriptionRequest($app_id, $subscription_id, $subscripti } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -14511,7 +15891,7 @@ public function updateSubscriptionByTokenRequest($app_id, $token_type, $token, $ } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -14865,7 +16245,7 @@ public function updateTemplateRequest($template_id, $app_id, $update_template_re } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -15275,7 +16655,7 @@ public function updateUserRequest($app_id, $alias_label, $alias_id, $update_user } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -15592,7 +16972,7 @@ public function viewApiKeysRequest($app_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -15952,7 +17332,7 @@ public function viewTemplateRequest($template_id, $app_id) } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, @@ -16335,7 +17715,7 @@ public function viewTemplatesRequest($app_id, $limit = 50, $offset = 0, $channel } // Adding the telemetry header - $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.10.0'; + $defaultHeaders['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-php, version=5.11.0'; $headers = array_merge( $defaultHeaders, diff --git a/lib/model/ApiKeyToken.php b/lib/model/ApiKeyToken.php index bf4451d..9ee2bce 100644 --- a/lib/model/ApiKeyToken.php +++ b/lib/model/ApiKeyToken.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/ApiKeyTokensListResponse.php b/lib/model/ApiKeyTokensListResponse.php index 78746aa..23cba70 100644 --- a/lib/model/ApiKeyTokensListResponse.php +++ b/lib/model/ApiKeyTokensListResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/App.php b/lib/model/App.php index 61a6e30..23c16b9 100644 --- a/lib/model/App.php +++ b/lib/model/App.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/AuditLogActor.php b/lib/model/AuditLogActor.php new file mode 100644 index 0000000..7bf5a33 --- /dev/null +++ b/lib/model/AuditLogActor.php @@ -0,0 +1,444 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AuditLogActor implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuditLogActor'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'email' => 'string', + 'id' => 'string', + 'metadata' => 'object', + 'name' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'email' => null, + 'id' => null, + 'metadata' => null, + 'name' => null, + 'type' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'email' => 'email', + 'id' => 'id', + 'metadata' => 'metadata', + 'name' => 'name', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'email' => 'setEmail', + 'id' => 'setId', + 'metadata' => 'setMetadata', + 'name' => 'setName', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'email' => 'getEmail', + 'id' => 'getId', + 'metadata' => 'getMetadata', + 'name' => 'getName', + 'type' => 'getType' + ]; + + /** + * 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->container['email'] = $data['email'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['metadata'] = $data['metadata'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['type'] = $data['type'] ?? null; + } + + /** + * 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; + } + + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email Email address of the actor. Absent if unavailable. + * + * @return self + */ + public function setEmail($email) + { + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id UUID of the actor. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets metadata + * + * @return object|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param object|null $metadata Additional actor-specific data. + * + * @return self + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Display name of the actor. Absent if unavailable. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Actor type (e.g. member, api_key, system). + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/AuditLogContext.php b/lib/model/AuditLogContext.php new file mode 100644 index 0000000..32b21aa --- /dev/null +++ b/lib/model/AuditLogContext.php @@ -0,0 +1,414 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AuditLogContext implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuditLogContext'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'country' => 'string', + 'ip' => 'string', + 'metadata' => 'object', + 'user_agent' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'country' => null, + 'ip' => null, + 'metadata' => null, + 'user_agent' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country' => 'country', + 'ip' => 'ip', + 'metadata' => 'metadata', + 'user_agent' => 'user_agent' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country' => 'setCountry', + 'ip' => 'setIp', + 'metadata' => 'setMetadata', + 'user_agent' => 'setUserAgent' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country' => 'getCountry', + 'ip' => 'getIp', + 'metadata' => 'getMetadata', + 'user_agent' => 'getUserAgent' + ]; + + /** + * 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->container['country'] = $data['country'] ?? null; + $this->container['ip'] = $data['ip'] ?? null; + $this->container['metadata'] = $data['metadata'] ?? null; + $this->container['user_agent'] = $data['user_agent'] ?? null; + } + + /** + * 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; + } + + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country Country code derived from the request IP. + * + * @return self + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets ip + * + * @return string|null + */ + public function getIp() + { + return $this->container['ip']; + } + + /** + * Sets ip + * + * @param string|null $ip IP address the request originated from. + * + * @return self + */ + public function setIp($ip) + { + $this->container['ip'] = $ip; + + return $this; + } + + /** + * Gets metadata + * + * @return object|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param object|null $metadata Additional context-specific data. + * + * @return self + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets user_agent + * + * @return string|null + */ + public function getUserAgent() + { + return $this->container['user_agent']; + } + + /** + * Sets user_agent + * + * @param string|null $user_agent User agent of the client that made the request. + * + * @return self + */ + public function setUserAgent($user_agent) + { + $this->container['user_agent'] = $user_agent; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/AuditLogEvent.php b/lib/model/AuditLogEvent.php new file mode 100644 index 0000000..86dffd6 --- /dev/null +++ b/lib/model/AuditLogEvent.php @@ -0,0 +1,593 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AuditLogEvent implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuditLogEvent'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'action' => 'string', + 'actor' => '\onesignal\client\model\AuditLogActor', + 'app_id' => 'string', + 'context' => '\onesignal\client\model\AuditLogContext', + 'id' => 'string', + 'metadata' => 'object', + 'occurred_at' => 'string', + 'organization_id' => 'string', + 'targets' => '\onesignal\client\model\AuditLogTarget[]', + 'version' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'action' => null, + 'actor' => null, + 'app_id' => null, + 'context' => null, + 'id' => null, + 'metadata' => null, + 'occurred_at' => null, + 'organization_id' => null, + 'targets' => null, + 'version' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'action' => 'action', + 'actor' => 'actor', + 'app_id' => 'app_id', + 'context' => 'context', + 'id' => 'id', + 'metadata' => 'metadata', + 'occurred_at' => 'occurred_at', + 'organization_id' => 'organization_id', + 'targets' => 'targets', + 'version' => 'version' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'action' => 'setAction', + 'actor' => 'setActor', + 'app_id' => 'setAppId', + 'context' => 'setContext', + 'id' => 'setId', + 'metadata' => 'setMetadata', + 'occurred_at' => 'setOccurredAt', + 'organization_id' => 'setOrganizationId', + 'targets' => 'setTargets', + 'version' => 'setVersion' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'action' => 'getAction', + 'actor' => 'getActor', + 'app_id' => 'getAppId', + 'context' => 'getContext', + 'id' => 'getId', + 'metadata' => 'getMetadata', + 'occurred_at' => 'getOccurredAt', + 'organization_id' => 'getOrganizationId', + 'targets' => 'getTargets', + 'version' => 'getVersion' + ]; + + /** + * 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->container['action'] = $data['action'] ?? null; + $this->container['actor'] = $data['actor'] ?? null; + $this->container['app_id'] = $data['app_id'] ?? null; + $this->container['context'] = $data['context'] ?? null; + $this->container['id'] = $data['id'] ?? null; + $this->container['metadata'] = $data['metadata'] ?? null; + $this->container['occurred_at'] = $data['occurred_at'] ?? null; + $this->container['organization_id'] = $data['organization_id'] ?? null; + $this->container['targets'] = $data['targets'] ?? null; + $this->container['version'] = $data['version'] ?? null; + } + + /** + * 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; + } + + + /** + * Gets action + * + * @return string|null + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string|null $action The action that was performed (e.g. notification.sent, segment.created, member.invited). + * + * @return self + */ + public function setAction($action) + { + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets actor + * + * @return \onesignal\client\model\AuditLogActor|null + */ + public function getActor() + { + return $this->container['actor']; + } + + /** + * Sets actor + * + * @param \onesignal\client\model\AuditLogActor|null $actor actor + * + * @return self + */ + public function setActor($actor) + { + $this->container['actor'] = $actor; + + return $this; + } + + /** + * Gets app_id + * + * @return string|null + */ + public function getAppId() + { + return $this->container['app_id']; + } + + /** + * Sets app_id + * + * @param string|null $app_id UUID of the app the event is associated with. Absent for org-level events. + * + * @return self + */ + public function setAppId($app_id) + { + $this->container['app_id'] = $app_id; + + return $this; + } + + /** + * Gets context + * + * @return \onesignal\client\model\AuditLogContext|null + */ + public function getContext() + { + return $this->container['context']; + } + + /** + * Sets context + * + * @param \onesignal\client\model\AuditLogContext|null $context context + * + * @return self + */ + public function setContext($context) + { + $this->container['context'] = $context; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id UUID of the audit log event. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets metadata + * + * @return object|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param object|null $metadata Additional event-specific data that does not fit into the standard fields. + * + * @return self + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets occurred_at + * + * @return string|null + */ + public function getOccurredAt() + { + return $this->container['occurred_at']; + } + + /** + * Sets occurred_at + * + * @param string|null $occurred_at RFC 3339 timestamp of when the event occurred (e.g. 2026-02-18T12:34:56Z). + * + * @return self + */ + public function setOccurredAt($occurred_at) + { + $this->container['occurred_at'] = $occurred_at; + + return $this; + } + + /** + * Gets organization_id + * + * @return string|null + */ + public function getOrganizationId() + { + return $this->container['organization_id']; + } + + /** + * Sets organization_id + * + * @param string|null $organization_id UUID of the organization the event belongs to. + * + * @return self + */ + public function setOrganizationId($organization_id) + { + $this->container['organization_id'] = $organization_id; + + return $this; + } + + /** + * Gets targets + * + * @return \onesignal\client\model\AuditLogTarget[]|null + */ + public function getTargets() + { + return $this->container['targets']; + } + + /** + * Sets targets + * + * @param \onesignal\client\model\AuditLogTarget[]|null $targets The resources the action was performed on. May be empty for org-level events. + * + * @return self + */ + public function setTargets($targets) + { + $this->container['targets'] = $targets; + + return $this; + } + + /** + * Gets version + * + * @return int|null + */ + public function getVersion() + { + return $this->container['version']; + } + + /** + * Sets version + * + * @param int|null $version Schema version of the event payload. + * + * @return self + */ + public function setVersion($version) + { + $this->container['version'] = $version; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/AuditLogTarget.php b/lib/model/AuditLogTarget.php new file mode 100644 index 0000000..ffaba4f --- /dev/null +++ b/lib/model/AuditLogTarget.php @@ -0,0 +1,414 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class AuditLogTarget implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuditLogTarget'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'metadata' => 'object', + 'name' => 'string', + 'type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'metadata' => null, + 'name' => null, + 'type' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'metadata' => 'metadata', + 'name' => 'name', + 'type' => 'type' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'metadata' => 'setMetadata', + 'name' => 'setName', + 'type' => 'setType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'metadata' => 'getMetadata', + 'name' => 'getName', + 'type' => 'getType' + ]; + + /** + * 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->container['id'] = $data['id'] ?? null; + $this->container['metadata'] = $data['metadata'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['type'] = $data['type'] ?? null; + } + + /** + * 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; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id UUID of the resource. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets metadata + * + * @return object|null + */ + public function getMetadata() + { + return $this->container['metadata']; + } + + /** + * Sets metadata + * + * @param object|null $metadata Additional resource-specific data. + * + * @return self + */ + public function setMetadata($metadata) + { + $this->container['metadata'] = $metadata; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name Display name of the resource. Absent if unavailable. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets type + * + * @return string|null + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string|null $type Resource type (e.g. notification, segment, journey, app). + * + * @return self + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/BasicNotification.php b/lib/model/BasicNotification.php index 4576f63..dc2016f 100644 --- a/lib/model/BasicNotification.php +++ b/lib/model/BasicNotification.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/BasicNotificationAllOf.php b/lib/model/BasicNotificationAllOf.php index 7785e66..4a5657e 100644 --- a/lib/model/BasicNotificationAllOf.php +++ b/lib/model/BasicNotificationAllOf.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/BasicNotificationAllOfAndroidBackgroundLayout.php b/lib/model/BasicNotificationAllOfAndroidBackgroundLayout.php index f649025..438843c 100644 --- a/lib/model/BasicNotificationAllOfAndroidBackgroundLayout.php +++ b/lib/model/BasicNotificationAllOfAndroidBackgroundLayout.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/Button.php b/lib/model/Button.php index 94ffbf8..7135948 100644 --- a/lib/model/Button.php +++ b/lib/model/Button.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CopyTemplateRequest.php b/lib/model/CopyTemplateRequest.php index 1a03399..2507830 100644 --- a/lib/model/CopyTemplateRequest.php +++ b/lib/model/CopyTemplateRequest.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateApiKeyRequest.php b/lib/model/CreateApiKeyRequest.php index d26217b..4c3b54b 100644 --- a/lib/model/CreateApiKeyRequest.php +++ b/lib/model/CreateApiKeyRequest.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateApiKeyResponse.php b/lib/model/CreateApiKeyResponse.php index 0bf2230..d7ddfe6 100644 --- a/lib/model/CreateApiKeyResponse.php +++ b/lib/model/CreateApiKeyResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateNotificationSuccessResponse.php b/lib/model/CreateNotificationSuccessResponse.php index 6320c5c..ce5bd22 100644 --- a/lib/model/CreateNotificationSuccessResponse.php +++ b/lib/model/CreateNotificationSuccessResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateSegmentConflictResponse.php b/lib/model/CreateSegmentConflictResponse.php index 9589b69..a5eef57 100644 --- a/lib/model/CreateSegmentConflictResponse.php +++ b/lib/model/CreateSegmentConflictResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateSegmentSuccessResponse.php b/lib/model/CreateSegmentSuccessResponse.php index 2d8b2fd..60f429f 100644 --- a/lib/model/CreateSegmentSuccessResponse.php +++ b/lib/model/CreateSegmentSuccessResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateTemplateRequest.php b/lib/model/CreateTemplateRequest.php index 88d0990..c41cc10 100644 --- a/lib/model/CreateTemplateRequest.php +++ b/lib/model/CreateTemplateRequest.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateUserConflictResponse.php b/lib/model/CreateUserConflictResponse.php index f0849cb..89f0621 100644 --- a/lib/model/CreateUserConflictResponse.php +++ b/lib/model/CreateUserConflictResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateUserConflictResponseErrorsInner.php b/lib/model/CreateUserConflictResponseErrorsInner.php index 5577cf9..0db25e9 100644 --- a/lib/model/CreateUserConflictResponseErrorsInner.php +++ b/lib/model/CreateUserConflictResponseErrorsInner.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CreateUserConflictResponseErrorsItemsMeta.php b/lib/model/CreateUserConflictResponseErrorsItemsMeta.php index 50d8d38..e1bfc00 100644 --- a/lib/model/CreateUserConflictResponseErrorsItemsMeta.php +++ b/lib/model/CreateUserConflictResponseErrorsItemsMeta.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CustomEvent.php b/lib/model/CustomEvent.php index 735ab87..733d803 100644 --- a/lib/model/CustomEvent.php +++ b/lib/model/CustomEvent.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/CustomEventsRequest.php b/lib/model/CustomEventsRequest.php index 2cbfd25..083aead 100644 --- a/lib/model/CustomEventsRequest.php +++ b/lib/model/CustomEventsRequest.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/DeliveryData.php b/lib/model/DeliveryData.php index b4d81c6..bab058b 100644 --- a/lib/model/DeliveryData.php +++ b/lib/model/DeliveryData.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/ExportEventsSuccessResponse.php b/lib/model/ExportEventsSuccessResponse.php index cbcec68..1087246 100644 --- a/lib/model/ExportEventsSuccessResponse.php +++ b/lib/model/ExportEventsSuccessResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/ExportSubscriptionsRequestBody.php b/lib/model/ExportSubscriptionsRequestBody.php index ef23a1d..59790ca 100644 --- a/lib/model/ExportSubscriptionsRequestBody.php +++ b/lib/model/ExportSubscriptionsRequestBody.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/ExportSubscriptionsSuccessResponse.php b/lib/model/ExportSubscriptionsSuccessResponse.php index 36b4f9d..02e499a 100644 --- a/lib/model/ExportSubscriptionsSuccessResponse.php +++ b/lib/model/ExportSubscriptionsSuccessResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/Filter.php b/lib/model/Filter.php index 58c56f7..0724cae 100644 --- a/lib/model/Filter.php +++ b/lib/model/Filter.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/FilterExpression.php b/lib/model/FilterExpression.php index b14dbb3..e73b283 100644 --- a/lib/model/FilterExpression.php +++ b/lib/model/FilterExpression.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/GenericError.php b/lib/model/GenericError.php index 46ceba8..c8d743e 100644 --- a/lib/model/GenericError.php +++ b/lib/model/GenericError.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/GenericSuccessBoolResponse.php b/lib/model/GenericSuccessBoolResponse.php index ab20dc3..f5d0659 100644 --- a/lib/model/GenericSuccessBoolResponse.php +++ b/lib/model/GenericSuccessBoolResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/GetNotificationHistoryRequestBody.php b/lib/model/GetNotificationHistoryRequestBody.php index 2524bf4..4fd97ea 100644 --- a/lib/model/GetNotificationHistoryRequestBody.php +++ b/lib/model/GetNotificationHistoryRequestBody.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/GetSegmentSuccessResponse.php b/lib/model/GetSegmentSuccessResponse.php new file mode 100644 index 0000000..b6b3914 --- /dev/null +++ b/lib/model/GetSegmentSuccessResponse.php @@ -0,0 +1,353 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class GetSegmentSuccessResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'GetSegmentSuccessResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'subscriber_count' => 'int', + 'payload' => '\onesignal\client\model\SegmentDetails' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'subscriber_count' => null, + 'payload' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'subscriber_count' => 'subscriber_count', + 'payload' => 'payload' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'subscriber_count' => 'setSubscriberCount', + 'payload' => 'setPayload' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'subscriber_count' => 'getSubscriberCount', + 'payload' => 'getPayload' + ]; + + /** + * 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->container['subscriber_count'] = $data['subscriber_count'] ?? null; + $this->container['payload'] = $data['payload'] ?? null; + } + + /** + * 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; + } + + + /** + * Gets subscriber_count + * + * @return int|null + */ + public function getSubscriberCount() + { + return $this->container['subscriber_count']; + } + + /** + * Sets subscriber_count + * + * @param int|null $subscriber_count The number of subscribers matching this segment. + * + * @return self + */ + public function setSubscriberCount($subscriber_count) + { + $this->container['subscriber_count'] = $subscriber_count; + + return $this; + } + + /** + * Gets payload + * + * @return \onesignal\client\model\SegmentDetails|null + */ + public function getPayload() + { + return $this->container['payload']; + } + + /** + * Sets payload + * + * @param \onesignal\client\model\SegmentDetails|null $payload payload + * + * @return self + */ + public function setPayload($payload) + { + $this->container['payload'] = $payload; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/GetSegmentsSuccessResponse.php b/lib/model/GetSegmentsSuccessResponse.php index be0e8c9..c02b9e1 100644 --- a/lib/model/GetSegmentsSuccessResponse.php +++ b/lib/model/GetSegmentsSuccessResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/LanguageStringMap.php b/lib/model/LanguageStringMap.php index eba2e71..16c16e7 100644 --- a/lib/model/LanguageStringMap.php +++ b/lib/model/LanguageStringMap.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/ListAuditLogsSuccessResponse.php b/lib/model/ListAuditLogsSuccessResponse.php new file mode 100644 index 0000000..9252e50 --- /dev/null +++ b/lib/model/ListAuditLogsSuccessResponse.php @@ -0,0 +1,383 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class ListAuditLogsSuccessResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListAuditLogsSuccessResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'audit_logs' => '\onesignal\client\model\AuditLogEvent[]', + 'has_more' => 'bool', + 'next_cursor' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'audit_logs' => null, + 'has_more' => null, + 'next_cursor' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'audit_logs' => 'audit_logs', + 'has_more' => 'has_more', + 'next_cursor' => 'next_cursor' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'audit_logs' => 'setAuditLogs', + 'has_more' => 'setHasMore', + 'next_cursor' => 'setNextCursor' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'audit_logs' => 'getAuditLogs', + 'has_more' => 'getHasMore', + 'next_cursor' => 'getNextCursor' + ]; + + /** + * 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->container['audit_logs'] = $data['audit_logs'] ?? null; + $this->container['has_more'] = $data['has_more'] ?? null; + $this->container['next_cursor'] = $data['next_cursor'] ?? null; + } + + /** + * 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; + } + + + /** + * Gets audit_logs + * + * @return \onesignal\client\model\AuditLogEvent[]|null + */ + public function getAuditLogs() + { + return $this->container['audit_logs']; + } + + /** + * Sets audit_logs + * + * @param \onesignal\client\model\AuditLogEvent[]|null $audit_logs Array of audit log events, ordered by occurred_at ascending. + * + * @return self + */ + public function setAuditLogs($audit_logs) + { + $this->container['audit_logs'] = $audit_logs; + + return $this; + } + + /** + * Gets has_more + * + * @return bool|null + */ + public function getHasMore() + { + return $this->container['has_more']; + } + + /** + * Sets has_more + * + * @param bool|null $has_more True if additional events exist beyond this page. Use next_cursor to fetch the next page. + * + * @return self + */ + public function setHasMore($has_more) + { + $this->container['has_more'] = $has_more; + + return $this; + } + + /** + * Gets next_cursor + * + * @return string|null + */ + public function getNextCursor() + { + return $this->container['next_cursor']; + } + + /** + * Sets next_cursor + * + * @param string|null $next_cursor Opaque cursor to pass as cursor in the next request. Only present when has_more is true. + * + * @return self + */ + public function setNextCursor($next_cursor) + { + $this->container['next_cursor'] = $next_cursor; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/ModelInterface.php b/lib/model/ModelInterface.php index 1b156c4..b92c257 100644 --- a/lib/model/ModelInterface.php +++ b/lib/model/ModelInterface.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/Notification.php b/lib/model/Notification.php index b8fb750..854d3d4 100644 --- a/lib/model/Notification.php +++ b/lib/model/Notification.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/NotificationAllOf.php b/lib/model/NotificationAllOf.php index fb36fdc..edbd264 100644 --- a/lib/model/NotificationAllOf.php +++ b/lib/model/NotificationAllOf.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/NotificationHistorySuccessResponse.php b/lib/model/NotificationHistorySuccessResponse.php index 7a85b9a..c3b03df 100644 --- a/lib/model/NotificationHistorySuccessResponse.php +++ b/lib/model/NotificationHistorySuccessResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/NotificationSlice.php b/lib/model/NotificationSlice.php index e2e2c56..6bd65b3 100644 --- a/lib/model/NotificationSlice.php +++ b/lib/model/NotificationSlice.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/NotificationTarget.php b/lib/model/NotificationTarget.php index 31af80e..4917805 100644 --- a/lib/model/NotificationTarget.php +++ b/lib/model/NotificationTarget.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/NotificationWithMeta.php b/lib/model/NotificationWithMeta.php index a90a13e..b5e55c1 100644 --- a/lib/model/NotificationWithMeta.php +++ b/lib/model/NotificationWithMeta.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/NotificationWithMetaAllOf.php b/lib/model/NotificationWithMetaAllOf.php index 972830d..f6322e9 100644 --- a/lib/model/NotificationWithMetaAllOf.php +++ b/lib/model/NotificationWithMetaAllOf.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/Operator.php b/lib/model/Operator.php index a6b33ad..43f5543 100644 --- a/lib/model/Operator.php +++ b/lib/model/Operator.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/OutcomeData.php b/lib/model/OutcomeData.php index dbaee1c..0753d18 100644 --- a/lib/model/OutcomeData.php +++ b/lib/model/OutcomeData.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/OutcomesData.php b/lib/model/OutcomesData.php index 0c26748..f060563 100644 --- a/lib/model/OutcomesData.php +++ b/lib/model/OutcomesData.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/PlatformDeliveryData.php b/lib/model/PlatformDeliveryData.php index 4538b85..cd7ff43 100644 --- a/lib/model/PlatformDeliveryData.php +++ b/lib/model/PlatformDeliveryData.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/PlatformDeliveryDataEmailAllOf.php b/lib/model/PlatformDeliveryDataEmailAllOf.php index 46195ea..5173dca 100644 --- a/lib/model/PlatformDeliveryDataEmailAllOf.php +++ b/lib/model/PlatformDeliveryDataEmailAllOf.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/PlatformDeliveryDataSmsAllOf.php b/lib/model/PlatformDeliveryDataSmsAllOf.php index 7e11a1d..68ffbb5 100644 --- a/lib/model/PlatformDeliveryDataSmsAllOf.php +++ b/lib/model/PlatformDeliveryDataSmsAllOf.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/PropertiesBody.php b/lib/model/PropertiesBody.php index c63b05f..89fc855 100644 --- a/lib/model/PropertiesBody.php +++ b/lib/model/PropertiesBody.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/PropertiesDeltas.php b/lib/model/PropertiesDeltas.php index b4b6bd2..14907ff 100644 --- a/lib/model/PropertiesDeltas.php +++ b/lib/model/PropertiesDeltas.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/PropertiesObject.php b/lib/model/PropertiesObject.php index a7bfdb0..e36dda7 100644 --- a/lib/model/PropertiesObject.php +++ b/lib/model/PropertiesObject.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/Purchase.php b/lib/model/Purchase.php index 98b2661..309e789 100644 --- a/lib/model/Purchase.php +++ b/lib/model/Purchase.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/RateLimitError.php b/lib/model/RateLimitError.php index 7373187..6ccb547 100644 --- a/lib/model/RateLimitError.php +++ b/lib/model/RateLimitError.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/Segment.php b/lib/model/Segment.php index 760c972..b9f4afd 100644 --- a/lib/model/Segment.php +++ b/lib/model/Segment.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/SegmentData.php b/lib/model/SegmentData.php index 732216c..b6e3aae 100644 --- a/lib/model/SegmentData.php +++ b/lib/model/SegmentData.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/SegmentDetails.php b/lib/model/SegmentDetails.php new file mode 100644 index 0000000..68becf2 --- /dev/null +++ b/lib/model/SegmentDetails.php @@ -0,0 +1,510 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class SegmentDetails implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SegmentDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'description' => 'string', + 'created_at' => 'int', + 'source' => 'string', + 'filters' => '\onesignal\client\model\FilterExpression[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => null, + 'name' => null, + 'description' => null, + 'created_at' => null, + 'source' => null, + 'filters' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'description' => 'description', + 'created_at' => 'created_at', + 'source' => 'source', + 'filters' => 'filters' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'description' => 'setDescription', + 'created_at' => 'setCreatedAt', + 'source' => 'setSource', + 'filters' => 'setFilters' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'description' => 'getDescription', + 'created_at' => 'getCreatedAt', + 'source' => 'getSource', + 'filters' => 'getFilters' + ]; + + /** + * 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 SOURCE__DEFAULT = 'default'; + public const SOURCE_CUSTOM = 'custom'; + public const SOURCE_QUICKSTART = 'quickstart'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSourceAllowableValues() + { + return [ + self::SOURCE__DEFAULT, + self::SOURCE_CUSTOM, + self::SOURCE_QUICKSTART, + ]; + } + + /** + * 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->container['id'] = $data['id'] ?? null; + $this->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['created_at'] = $data['created_at'] ?? null; + $this->container['source'] = $data['source'] ?? null; + $this->container['filters'] = $data['filters'] ?? null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + $allowedValues = $this->getSourceAllowableValues(); + if (!is_null($this->container['source']) && !in_array($this->container['source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'source', must be one of '%s'", + $this->container['source'], + implode("', '", $allowedValues) + ); + } + + 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|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id The unique identifier for the segment (UUID v4). + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name The segment name. + * + * @return self + */ + public function setName($name) + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Human-readable description for the segment. `null` when unset. Maximum 255 characters. + * + * @return self + */ + public function setDescription($description) + { + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets created_at + * + * @return int|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param int|null $created_at Unix timestamp when the segment was created. + * + * @return self + */ + public function setCreatedAt($created_at) + { + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets source + * + * @return string|null + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param string|null $source The source of the segment. + * + * @return self + */ + public function setSource($source) + { + $allowedValues = $this->getSourceAllowableValues(); + if (!is_null($source) && !in_array($source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'source', must be one of '%s'", + $source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets filters + * + * @return \onesignal\client\model\FilterExpression[]|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param \onesignal\client\model\FilterExpression[]|null $filters Array of filter and operator objects defining the segment criteria. Uses the same format as the Create Segment API, so filters can be directly used to recreate or update the segment. + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/SegmentNotificationTarget.php b/lib/model/SegmentNotificationTarget.php index dbe829c..7dbb37e 100644 --- a/lib/model/SegmentNotificationTarget.php +++ b/lib/model/SegmentNotificationTarget.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/StartLiveActivityRequest.php b/lib/model/StartLiveActivityRequest.php index 35f67d7..3cc8953 100644 --- a/lib/model/StartLiveActivityRequest.php +++ b/lib/model/StartLiveActivityRequest.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/StartLiveActivitySuccessResponse.php b/lib/model/StartLiveActivitySuccessResponse.php index c235a4a..f384a42 100644 --- a/lib/model/StartLiveActivitySuccessResponse.php +++ b/lib/model/StartLiveActivitySuccessResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/Subscription.php b/lib/model/Subscription.php index 6f7b2b6..be1757d 100644 --- a/lib/model/Subscription.php +++ b/lib/model/Subscription.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/SubscriptionBody.php b/lib/model/SubscriptionBody.php index 5cb2917..98e79f0 100644 --- a/lib/model/SubscriptionBody.php +++ b/lib/model/SubscriptionBody.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/SubscriptionNotificationTarget.php b/lib/model/SubscriptionNotificationTarget.php index c62edc0..23f187d 100644 --- a/lib/model/SubscriptionNotificationTarget.php +++ b/lib/model/SubscriptionNotificationTarget.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/TemplateResource.php b/lib/model/TemplateResource.php index 4480df9..5c61b02 100644 --- a/lib/model/TemplateResource.php +++ b/lib/model/TemplateResource.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/TemplatesListResponse.php b/lib/model/TemplatesListResponse.php index 2ec5560..0d75b5a 100644 --- a/lib/model/TemplatesListResponse.php +++ b/lib/model/TemplatesListResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/TransferSubscriptionRequestBody.php b/lib/model/TransferSubscriptionRequestBody.php index d0558cf..c60eb10 100644 --- a/lib/model/TransferSubscriptionRequestBody.php +++ b/lib/model/TransferSubscriptionRequestBody.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/UpdateApiKeyRequest.php b/lib/model/UpdateApiKeyRequest.php index 1417f19..af32dea 100644 --- a/lib/model/UpdateApiKeyRequest.php +++ b/lib/model/UpdateApiKeyRequest.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/UpdateLiveActivityRequest.php b/lib/model/UpdateLiveActivityRequest.php index ff8f0f7..2863285 100644 --- a/lib/model/UpdateLiveActivityRequest.php +++ b/lib/model/UpdateLiveActivityRequest.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/UpdateLiveActivitySuccessResponse.php b/lib/model/UpdateLiveActivitySuccessResponse.php index c3e218f..43c1dfd 100644 --- a/lib/model/UpdateLiveActivitySuccessResponse.php +++ b/lib/model/UpdateLiveActivitySuccessResponse.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/UpdateSegmentRequest.php b/lib/model/UpdateSegmentRequest.php new file mode 100644 index 0000000..754912f --- /dev/null +++ b/lib/model/UpdateSegmentRequest.php @@ -0,0 +1,402 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateSegmentRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateSegmentRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'description' => 'string', + 'filters' => '\onesignal\client\model\FilterExpression[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'description' => null, + 'filters' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'description' => 'description', + 'filters' => 'filters' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'description' => 'setDescription', + 'filters' => 'setFilters' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'description' => 'getDescription', + 'filters' => 'getFilters' + ]; + + /** + * 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->container['name'] = $data['name'] ?? null; + $this->container['description'] = $data['description'] ?? null; + $this->container['filters'] = $data['filters'] ?? null; + } + + /** + * 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"; + } + if ((mb_strlen($this->container['name']) > 128)) { + $invalidProperties[] = "invalid value for 'name', the character length must be smaller than or equal to 128."; + } + + if (!is_null($this->container['description']) && (mb_strlen($this->container['description']) > 255)) { + $invalidProperties[] = "invalid value for 'description', the character length must be smaller than or equal to 255."; + } + + 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 Required. The segment name. Maximum 128 characters. + * + * @return self + */ + public function setName($name) + { + if ((mb_strlen($name) > 128)) { + throw new \InvalidArgumentException('invalid length for $name when calling UpdateSegmentRequest., must be smaller than or equal to 128.'); + } + + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets description + * + * @return string|null + */ + public function getDescription() + { + return $this->container['description']; + } + + /** + * Sets description + * + * @param string|null $description Optional human-readable description for the segment. Maximum 255 characters. Pass an empty string to clear; omit to leave unchanged. + * + * @return self + */ + public function setDescription($description) + { + if (!is_null($description) && (mb_strlen($description) > 255)) { + throw new \InvalidArgumentException('invalid length for $description when calling UpdateSegmentRequest., must be smaller than or equal to 255.'); + } + + $this->container['description'] = $description; + + return $this; + } + + /** + * Gets filters + * + * @return \onesignal\client\model\FilterExpression[]|null + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param \onesignal\client\model\FilterExpression[]|null $filters Optional. When provided, replaces all existing filters. Filters define the segment based on user properties like tags, activity, or location using flexible AND/OR logic. Limited to 200 total entries, including fields and OR operators. + * + * @return self + */ + public function setFilters($filters) + { + $this->container['filters'] = $filters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/UpdateSegmentSuccessResponse.php b/lib/model/UpdateSegmentSuccessResponse.php new file mode 100644 index 0000000..e1abe62 --- /dev/null +++ b/lib/model/UpdateSegmentSuccessResponse.php @@ -0,0 +1,353 @@ + + * @template TKey int|null + * @template TValue mixed|null + */ +class UpdateSegmentSuccessResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateSegmentSuccessResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'success' => 'bool', + 'id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'success' => null, + 'id' => null + ]; + + /** + * 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 attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'success' => 'success', + 'id' => 'id' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'success' => 'setSuccess', + 'id' => 'setId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'success' => 'getSuccess', + 'id' => 'getId' + ]; + + /** + * 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->container['success'] = $data['success'] ?? null; + $this->container['id'] = $data['id'] ?? null; + } + + /** + * 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; + } + + + /** + * Gets success + * + * @return bool|null + */ + public function getSuccess() + { + return $this->container['success']; + } + + /** + * Sets success + * + * @param bool|null $success true if the segment was updated successfully, false otherwise. + * + * @return self + */ + public function setSuccess($success) + { + $this->container['success'] = $success; + + return $this; + } + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id UUID of the updated segment. + * + * @return self + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/lib/model/UpdateTemplateRequest.php b/lib/model/UpdateTemplateRequest.php index 5af2856..245ed35 100644 --- a/lib/model/UpdateTemplateRequest.php +++ b/lib/model/UpdateTemplateRequest.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/UpdateUserRequest.php b/lib/model/UpdateUserRequest.php index 35b62ae..9493e56 100644 --- a/lib/model/UpdateUserRequest.php +++ b/lib/model/UpdateUserRequest.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/User.php b/lib/model/User.php index c5df616..1a8c4e6 100644 --- a/lib/model/User.php +++ b/lib/model/User.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/UserIdentityBody.php b/lib/model/UserIdentityBody.php index e8150ea..a917055 100644 --- a/lib/model/UserIdentityBody.php +++ b/lib/model/UserIdentityBody.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/model/WebButton.php b/lib/model/WebButton.php index 49ef012..5418a82 100644 --- a/lib/model/WebButton.php +++ b/lib/model/WebButton.php @@ -15,7 +15,7 @@ * * A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com * - * The version of the OpenAPI document: 5.10.0 + * The version of the OpenAPI document: 5.11.0 * Contact: devrel@onesignal.com * Generated by: https://openapi-generator.tech * OpenAPI Generator version: 6.0.0-SNAPSHOT