diff --git a/.github/workflows/Zapier.yml b/.github/workflows/Zapier.yml index 3665dd5..074f7c1 100644 --- a/.github/workflows/Zapier.yml +++ b/.github/workflows/Zapier.yml @@ -7,7 +7,7 @@ on: # Triggers the workflow on push or pull request events but only for the "main" branch issues: types: [closed] - + permissions: issues: read @@ -31,4 +31,4 @@ jobs: --header 'Accept: application/json' \ --data-raw '{ "task_name" : "$ISSUE_TITLE" - }' + }' \ No newline at end of file diff --git a/README.md b/README.md index 72278cf..96b132c 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ A powerful way to send personalized messages at scale and build effective custom This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 1.0.2 -- Package version: 1.0.2 +- API version: 1.2.1 +- Package version: 2.0.0 - Build package: org.openapitools.codegen.languages.RubyClientCodegen For more information, please visit [https://onesignal.com](https://onesignal.com) @@ -24,16 +24,16 @@ gem build onesignal.gemspec Then either install the gem locally: ```shell -gem install ./onesignal-1.0.2.gem +gem install ./onesignal-2.0.0.gem ``` -(for development, run `gem install --dev ./onesignal-1.0.2.gem` to install the development dependencies) +(for development, run `gem install --dev ./onesignal-2.0.0.gem` to install the development dependencies) or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/). Finally add this to the Gemfile: - gem 'onesignal', '~> 1.0.2' + gem 'onesignal', '~> 2.0.0' ### Install from Git @@ -89,22 +89,36 @@ Class | Method | HTTP request | Description *OneSignal::DefaultApi* | [**create_notification**](docs/DefaultApi.md#create_notification) | **POST** /notifications | Create notification *OneSignal::DefaultApi* | [**create_player**](docs/DefaultApi.md#create_player) | **POST** /players | Add a device *OneSignal::DefaultApi* | [**create_segments**](docs/DefaultApi.md#create_segments) | **POST** /apps/{app_id}/segments | Create Segments +*OneSignal::DefaultApi* | [**create_subscription**](docs/DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | +*OneSignal::DefaultApi* | [**create_user**](docs/DefaultApi.md#create_user) | **POST** /apps/{app_id}/users | +*OneSignal::DefaultApi* | [**delete_alias**](docs/DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | *OneSignal::DefaultApi* | [**delete_player**](docs/DefaultApi.md#delete_player) | **DELETE** /players/{player_id} | Delete a user record *OneSignal::DefaultApi* | [**delete_segments**](docs/DefaultApi.md#delete_segments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments +*OneSignal::DefaultApi* | [**delete_subscription**](docs/DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | +*OneSignal::DefaultApi* | [**delete_user**](docs/DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | *OneSignal::DefaultApi* | [**end_live_activity**](docs/DefaultApi.md#end_live_activity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity *OneSignal::DefaultApi* | [**export_players**](docs/DefaultApi.md#export_players) | **POST** /players/csv_export?app_id={app_id} | CSV export +*OneSignal::DefaultApi* | [**fetch_aliases**](docs/DefaultApi.md#fetch_aliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +*OneSignal::DefaultApi* | [**fetch_user**](docs/DefaultApi.md#fetch_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | +*OneSignal::DefaultApi* | [**fetch_user_identity**](docs/DefaultApi.md#fetch_user_identity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | *OneSignal::DefaultApi* | [**get_app**](docs/DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app *OneSignal::DefaultApi* | [**get_apps**](docs/DefaultApi.md#get_apps) | **GET** /apps | View apps +*OneSignal::DefaultApi* | [**get_eligible_iams**](docs/DefaultApi.md#get_eligible_iams) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/iams | *OneSignal::DefaultApi* | [**get_notification**](docs/DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification *OneSignal::DefaultApi* | [**get_notification_history**](docs/DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History *OneSignal::DefaultApi* | [**get_notifications**](docs/DefaultApi.md#get_notifications) | **GET** /notifications | View notifications *OneSignal::DefaultApi* | [**get_outcomes**](docs/DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes *OneSignal::DefaultApi* | [**get_player**](docs/DefaultApi.md#get_player) | **GET** /players/{player_id} | View device *OneSignal::DefaultApi* | [**get_players**](docs/DefaultApi.md#get_players) | **GET** /players | View devices +*OneSignal::DefaultApi* | [**identify_user_by_alias**](docs/DefaultApi.md#identify_user_by_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | +*OneSignal::DefaultApi* | [**identify_user_by_subscription_id**](docs/DefaultApi.md#identify_user_by_subscription_id) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | +*OneSignal::DefaultApi* | [**transfer_subscription**](docs/DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | *OneSignal::DefaultApi* | [**update_app**](docs/DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app *OneSignal::DefaultApi* | [**update_live_activity**](docs/DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push *OneSignal::DefaultApi* | [**update_player**](docs/DefaultApi.md#update_player) | **PUT** /players/{player_id} | Edit device *OneSignal::DefaultApi* | [**update_player_tags**](docs/DefaultApi.md#update_player_tags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id +*OneSignal::DefaultApi* | [**update_subscription**](docs/DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | +*OneSignal::DefaultApi* | [**update_user**](docs/DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | ## Documentation for Models @@ -121,6 +135,10 @@ Class | Method | HTTP request | Description - [OneSignal::CreatePlayerSuccessResponse](docs/CreatePlayerSuccessResponse.md) - [OneSignal::CreateSegmentConflictResponse](docs/CreateSegmentConflictResponse.md) - [OneSignal::CreateSegmentSuccessResponse](docs/CreateSegmentSuccessResponse.md) + - [OneSignal::CreateSubscriptionRequestBody](docs/CreateSubscriptionRequestBody.md) + - [OneSignal::CreateUserConflictResponse](docs/CreateUserConflictResponse.md) + - [OneSignal::CreateUserConflictResponseErrorsInner](docs/CreateUserConflictResponseErrorsInner.md) + - [OneSignal::CreateUserConflictResponseErrorsItemsMeta](docs/CreateUserConflictResponseErrorsItemsMeta.md) - [OneSignal::DeletePlayerNotFoundResponse](docs/DeletePlayerNotFoundResponse.md) - [OneSignal::DeletePlayerSuccessResponse](docs/DeletePlayerSuccessResponse.md) - [OneSignal::DeleteSegmentNotFoundResponse](docs/DeleteSegmentNotFoundResponse.md) @@ -131,6 +149,12 @@ Class | Method | HTTP request | Description - [OneSignal::Filter](docs/Filter.md) - [OneSignal::FilterExpressions](docs/FilterExpressions.md) - [OneSignal::GetNotificationRequestBody](docs/GetNotificationRequestBody.md) + - [OneSignal::IdentifyUserConflictResponse](docs/IdentifyUserConflictResponse.md) + - [OneSignal::IdentifyUserConflictResponseErrorsInner](docs/IdentifyUserConflictResponseErrorsInner.md) + - [OneSignal::InlineResponse200](docs/InlineResponse200.md) + - [OneSignal::InlineResponse2003](docs/InlineResponse2003.md) + - [OneSignal::InlineResponse201](docs/InlineResponse201.md) + - [OneSignal::InlineResponse202](docs/InlineResponse202.md) - [OneSignal::InvalidIdentifierError](docs/InvalidIdentifierError.md) - [OneSignal::Notification](docs/Notification.md) - [OneSignal::Notification200Errors](docs/Notification200Errors.md) @@ -148,16 +172,27 @@ Class | Method | HTTP request | Description - [OneSignal::PlatformDeliveryDataSmsAllOf](docs/PlatformDeliveryDataSmsAllOf.md) - [OneSignal::Player](docs/Player.md) - [OneSignal::PlayerNotificationTarget](docs/PlayerNotificationTarget.md) + - [OneSignal::PlayerNotificationTargetIncludeAliases](docs/PlayerNotificationTargetIncludeAliases.md) - [OneSignal::PlayerSlice](docs/PlayerSlice.md) + - [OneSignal::PropertiesDeltas](docs/PropertiesDeltas.md) + - [OneSignal::PropertiesObject](docs/PropertiesObject.md) - [OneSignal::Purchase](docs/Purchase.md) - [OneSignal::Segment](docs/Segment.md) - [OneSignal::SegmentNotificationTarget](docs/SegmentNotificationTarget.md) - [OneSignal::StringMap](docs/StringMap.md) + - [OneSignal::SubscriptionObject](docs/SubscriptionObject.md) + - [OneSignal::TransferSubscriptionRequestBody](docs/TransferSubscriptionRequestBody.md) - [OneSignal::UpdateLiveActivityRequest](docs/UpdateLiveActivityRequest.md) - [OneSignal::UpdateLiveActivitySuccessResponse](docs/UpdateLiveActivitySuccessResponse.md) - [OneSignal::UpdatePlayerSuccessResponse](docs/UpdatePlayerSuccessResponse.md) - [OneSignal::UpdatePlayerTagsRequestBody](docs/UpdatePlayerTagsRequestBody.md) - [OneSignal::UpdatePlayerTagsSuccessResponse](docs/UpdatePlayerTagsSuccessResponse.md) + - [OneSignal::UpdateSubscriptionRequestBody](docs/UpdateSubscriptionRequestBody.md) + - [OneSignal::UpdateUserRequest](docs/UpdateUserRequest.md) + - [OneSignal::User](docs/User.md) + - [OneSignal::UserIdentityRequestBody](docs/UserIdentityRequestBody.md) + - [OneSignal::UserIdentityResponse](docs/UserIdentityResponse.md) + - [OneSignal::UserSubscriptionOptions](docs/UserSubscriptionOptions.md) ## Documentation for Authorization diff --git a/docs/BasicNotification.md b/docs/BasicNotification.md index 9c52d94..dd00c43 100644 --- a/docs/BasicNotification.md +++ b/docs/BasicNotification.md @@ -16,6 +16,8 @@ | **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | | **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | | **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_aliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +| **target_channel** | **String** | | [optional] | | **id** | **String** | | [optional] | | **value** | **Integer** | | [optional][readonly] | | **name** | **String** | Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user. | [optional] | @@ -124,6 +126,8 @@ instance = OneSignal::BasicNotification.new( include_chrome_reg_ids: null, include_chrome_web_reg_ids: null, include_android_reg_ids: null, + include_aliases: null, + target_channel: null, id: null, value: null, name: null, diff --git a/docs/CreateNotificationSuccessResponse.md b/docs/CreateNotificationSuccessResponse.md index bc5af3a..2a1d231 100644 --- a/docs/CreateNotificationSuccessResponse.md +++ b/docs/CreateNotificationSuccessResponse.md @@ -4,8 +4,8 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **id** | **String** | | | -| **recipients** | **Integer** | Estimated number of subscribers targetted by notification. | | +| **id** | **String** | | [optional] | +| **recipients** | **Integer** | Estimated number of subscribers targetted by notification. | [optional] | | **external_id** | **String** | | [optional] | | **errors** | [**Notification200Errors**](Notification200Errors.md) | | [optional] | diff --git a/docs/CreateSubscriptionRequestBody.md b/docs/CreateSubscriptionRequestBody.md new file mode 100644 index 0000000..0717215 --- /dev/null +++ b/docs/CreateSubscriptionRequestBody.md @@ -0,0 +1,20 @@ +# OneSignal::CreateSubscriptionRequestBody + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **subscription** | [**SubscriptionObject**](SubscriptionObject.md) | | [optional] | +| **retain_previous_owner** | **Boolean** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::CreateSubscriptionRequestBody.new( + subscription: null, + retain_previous_owner: null +) +``` + diff --git a/docs/CreateUserConflictResponse.md b/docs/CreateUserConflictResponse.md new file mode 100644 index 0000000..68ee038 --- /dev/null +++ b/docs/CreateUserConflictResponse.md @@ -0,0 +1,18 @@ +# OneSignal::CreateUserConflictResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **errors** | [**Array<CreateUserConflictResponseErrorsInner>**](CreateUserConflictResponseErrorsInner.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::CreateUserConflictResponse.new( + errors: null +) +``` + diff --git a/docs/CreateUserConflictResponseErrorsInner.md b/docs/CreateUserConflictResponseErrorsInner.md new file mode 100644 index 0000000..f140585 --- /dev/null +++ b/docs/CreateUserConflictResponseErrorsInner.md @@ -0,0 +1,22 @@ +# OneSignal::CreateUserConflictResponseErrorsInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **code** | **String** | | [optional] | +| **title** | **String** | | [optional] | +| **meta** | [**CreateUserConflictResponseErrorsItemsMeta**](CreateUserConflictResponseErrorsItemsMeta.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::CreateUserConflictResponseErrorsInner.new( + code: null, + title: null, + meta: null +) +``` + diff --git a/docs/CreateUserConflictResponseErrorsItemsMeta.md b/docs/CreateUserConflictResponseErrorsItemsMeta.md new file mode 100644 index 0000000..73f92db --- /dev/null +++ b/docs/CreateUserConflictResponseErrorsItemsMeta.md @@ -0,0 +1,18 @@ +# OneSignal::CreateUserConflictResponseErrorsItemsMeta + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **conflicting_aliases** | **Object** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::CreateUserConflictResponseErrorsItemsMeta.new( + conflicting_aliases: null +) +``` + diff --git a/docs/DefaultApi.md b/docs/DefaultApi.md index 0bb031b..f81a19a 100644 --- a/docs/DefaultApi.md +++ b/docs/DefaultApi.md @@ -10,22 +10,36 @@ All URIs are relative to *https://onesignal.com/api/v1* | [**create_notification**](DefaultApi.md#create_notification) | **POST** /notifications | Create notification | | [**create_player**](DefaultApi.md#create_player) | **POST** /players | Add a device | | [**create_segments**](DefaultApi.md#create_segments) | **POST** /apps/{app_id}/segments | Create Segments | +| [**create_subscription**](DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | | +| [**create_user**](DefaultApi.md#create_user) | **POST** /apps/{app_id}/users | | +| [**delete_alias**](DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | | | [**delete_player**](DefaultApi.md#delete_player) | **DELETE** /players/{player_id} | Delete a user record | | [**delete_segments**](DefaultApi.md#delete_segments) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segments | +| [**delete_subscription**](DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | | +| [**delete_user**](DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | | [**end_live_activity**](DefaultApi.md#end_live_activity) | **DELETE** /apps/{app_id}/live_activities/{activity_id}/token/{subscription_id} | Stop Live Activity | | [**export_players**](DefaultApi.md#export_players) | **POST** /players/csv_export?app_id={app_id} | CSV export | +| [**fetch_aliases**](DefaultApi.md#fetch_aliases) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | +| [**fetch_user**](DefaultApi.md#fetch_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | +| [**fetch_user_identity**](DefaultApi.md#fetch_user_identity) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | | | [**get_app**](DefaultApi.md#get_app) | **GET** /apps/{app_id} | View an app | | [**get_apps**](DefaultApi.md#get_apps) | **GET** /apps | View apps | +| [**get_eligible_iams**](DefaultApi.md#get_eligible_iams) | **GET** /apps/{app_id}/subscriptions/{subscription_id}/iams | | | [**get_notification**](DefaultApi.md#get_notification) | **GET** /notifications/{notification_id} | View notification | | [**get_notification_history**](DefaultApi.md#get_notification_history) | **POST** /notifications/{notification_id}/history | Notification History | | [**get_notifications**](DefaultApi.md#get_notifications) | **GET** /notifications | View notifications | | [**get_outcomes**](DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes | | [**get_player**](DefaultApi.md#get_player) | **GET** /players/{player_id} | View device | | [**get_players**](DefaultApi.md#get_players) | **GET** /players | View devices | +| [**identify_user_by_alias**](DefaultApi.md#identify_user_by_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | | +| [**identify_user_by_subscription_id**](DefaultApi.md#identify_user_by_subscription_id) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | | +| [**transfer_subscription**](DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | | | [**update_app**](DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app | | [**update_live_activity**](DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push | | [**update_player**](DefaultApi.md#update_player) | **PUT** /players/{player_id} | Edit device | | [**update_player_tags**](DefaultApi.md#update_player_tags) | **PUT** /apps/{app_id}/users/{external_user_id} | Edit tags with external user id | +| [**update_subscription**](DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | | +| [**update_user**](DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | | ## begin_live_activity @@ -451,13 +465,13 @@ end - **Accept**: application/json -## delete_player +## create_subscription -> delete_player(app_id, player_id) +> create_subscription(app_id, alias_label, alias_id, create_subscription_request_body) -Delete a user record -Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. + +Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. ### Examples @@ -471,33 +485,35 @@ OneSignal.configure do |config| end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. -player_id = 'player_id_example' # String | The OneSignal player_id +app_id = 'app_id_example' # String | +alias_label = 'alias_label_example' # String | +alias_id = 'alias_id_example' # String | +create_subscription_request_body = OneSignal::CreateSubscriptionRequestBody.new # CreateSubscriptionRequestBody | begin - # Delete a user record - result = api_instance.delete_player(app_id, player_id) + + result = api_instance.create_subscription(app_id, alias_label, alias_id, create_subscription_request_body) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->delete_player: #{e}" + puts "Error when calling DefaultApi->create_subscription: #{e}" end ``` -#### Using the delete_player_with_http_info variant +#### Using the create_subscription_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> delete_player_with_http_info(app_id, player_id) +> , Integer, Hash)> create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body) ```ruby begin - # Delete a user record - data, status_code, headers = api_instance.delete_player_with_http_info(app_id, player_id) + + data, status_code, headers = api_instance.create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->delete_player_with_http_info: #{e}" + puts "Error when calling DefaultApi->create_subscription_with_http_info: #{e}" end ``` @@ -505,12 +521,14 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | -| **player_id** | **String** | The OneSignal player_id | | +| **app_id** | **String** | | | +| **alias_label** | **String** | | | +| **alias_id** | **String** | | | +| **create_subscription_request_body** | [**CreateSubscriptionRequestBody**](CreateSubscriptionRequestBody.md) | | | ### Return type -[**DeletePlayerSuccessResponse**](DeletePlayerSuccessResponse.md) +[**InlineResponse201**](InlineResponse201.md) ### Authorization @@ -518,17 +536,17 @@ end ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json -## delete_segments +## create_user -> delete_segments(app_id, segment_id) +> create_user(app_id, user) -Delete Segments -Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. + +Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. ### Examples @@ -542,33 +560,33 @@ OneSignal.configure do |config| end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. -segment_id = 'segment_id_example' # String | The segment_id can be found in the URL of the segment when viewing it in the dashboard. +app_id = 'app_id_example' # String | +user = OneSignal::User.new # User | begin - # Delete Segments - result = api_instance.delete_segments(app_id, segment_id) + + result = api_instance.create_user(app_id, user) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->delete_segments: #{e}" + puts "Error when calling DefaultApi->create_user: #{e}" end ``` -#### Using the delete_segments_with_http_info variant +#### Using the create_user_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> delete_segments_with_http_info(app_id, segment_id) +> , Integer, Hash)> create_user_with_http_info(app_id, user) ```ruby begin - # Delete Segments - data, status_code, headers = api_instance.delete_segments_with_http_info(app_id, segment_id) + + data, status_code, headers = api_instance.create_user_with_http_info(app_id, user) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->delete_segments_with_http_info: #{e}" + puts "Error when calling DefaultApi->create_user_with_http_info: #{e}" end ``` @@ -576,12 +594,12 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | -| **segment_id** | **String** | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | | +| **app_id** | **String** | | | +| **user** | [**User**](User.md) | | | ### Return type -[**DeleteSegmentSuccessResponse**](DeleteSegmentSuccessResponse.md) +[**User**](User.md) ### Authorization @@ -589,17 +607,17 @@ end ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json -## end_live_activity +## delete_alias -> end_live_activity(app_id, activity_id, subscription_id) +> delete_alias(app_id, alias_label, alias_id, alias_label_to_delete) -Stop Live Activity -Stops a Live Activity + +Deletes an alias by alias label ### Examples @@ -613,33 +631,35 @@ OneSignal.configure do |config| end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. -activity_id = 'activity_id_example' # String | Live Activity record ID -subscription_id = 'subscription_id_example' # String | Subscription ID +app_id = 'app_id_example' # String | +alias_label = 'alias_label_example' # String | +alias_id = 'alias_id_example' # String | +alias_label_to_delete = 'alias_label_to_delete_example' # String | begin - # Stop Live Activity - api_instance.end_live_activity(app_id, activity_id, subscription_id) + + result = api_instance.delete_alias(app_id, alias_label, alias_id, alias_label_to_delete) + p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->end_live_activity: #{e}" + puts "Error when calling DefaultApi->delete_alias: #{e}" end ``` -#### Using the end_live_activity_with_http_info variant +#### Using the delete_alias_with_http_info variant -This returns an Array which contains the response data (`nil` in this case), status code and headers. +This returns an Array which contains the response data, status code and headers. -> end_live_activity_with_http_info(app_id, activity_id, subscription_id) +> , Integer, Hash)> delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete) ```ruby begin - # Stop Live Activity - data, status_code, headers = api_instance.end_live_activity_with_http_info(app_id, activity_id, subscription_id) + + data, status_code, headers = api_instance.delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete) p status_code # => 2xx p headers # => { ... } - p data # => nil + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->end_live_activity_with_http_info: #{e}" + puts "Error when calling DefaultApi->delete_alias_with_http_info: #{e}" end ``` @@ -647,13 +667,14 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | -| **activity_id** | **String** | Live Activity record ID | | -| **subscription_id** | **String** | Subscription ID | | +| **app_id** | **String** | | | +| **alias_label** | **String** | | | +| **alias_id** | **String** | | | +| **alias_label_to_delete** | **String** | | | ### Return type -nil (empty response body) +[**InlineResponse200**](InlineResponse200.md) ### Authorization @@ -665,13 +686,13 @@ nil (empty response body) - **Accept**: application/json -## export_players +## delete_player -> export_players(app_id, opts) +> delete_player(app_id, player_id) -CSV export +Delete a user record -Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | +Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. ### Examples @@ -685,35 +706,33 @@ OneSignal.configure do |config| end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The app ID that you want to export devices from -opts = { - export_players_request_body: OneSignal::ExportPlayersRequestBody.new # ExportPlayersRequestBody | -} +app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. +player_id = 'player_id_example' # String | The OneSignal player_id begin - # CSV export - result = api_instance.export_players(app_id, opts) + # Delete a user record + result = api_instance.delete_player(app_id, player_id) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->export_players: #{e}" + puts "Error when calling DefaultApi->delete_player: #{e}" end ``` -#### Using the export_players_with_http_info variant +#### Using the delete_player_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> export_players_with_http_info(app_id, opts) +> , Integer, Hash)> delete_player_with_http_info(app_id, player_id) ```ruby begin - # CSV export - data, status_code, headers = api_instance.export_players_with_http_info(app_id, opts) + # Delete a user record + data, status_code, headers = api_instance.delete_player_with_http_info(app_id, player_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->export_players_with_http_info: #{e}" + puts "Error when calling DefaultApi->delete_player_with_http_info: #{e}" end ``` @@ -721,12 +740,12 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The app ID that you want to export devices from | | -| **export_players_request_body** | [**ExportPlayersRequestBody**](ExportPlayersRequestBody.md) | | [optional] | +| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | +| **player_id** | **String** | The OneSignal player_id | | ### Return type -[**ExportPlayersSuccessResponse**](ExportPlayersSuccessResponse.md) +[**DeletePlayerSuccessResponse**](DeletePlayerSuccessResponse.md) ### Authorization @@ -734,17 +753,17 @@ end ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json -## get_app +## delete_segments -> get_app(app_id) +> delete_segments(app_id, segment_id) -View an app +Delete Segments -View the details of a single OneSignal app +Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. ### Examples @@ -752,38 +771,39 @@ View the details of a single OneSignal app require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'YOUR_BEARER_TOKEN' + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | An app id +app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. +segment_id = 'segment_id_example' # String | The segment_id can be found in the URL of the segment when viewing it in the dashboard. begin - # View an app - result = api_instance.get_app(app_id) + # Delete Segments + result = api_instance.delete_segments(app_id, segment_id) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_app: #{e}" + puts "Error when calling DefaultApi->delete_segments: #{e}" end ``` -#### Using the get_app_with_http_info variant +#### Using the delete_segments_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get_app_with_http_info(app_id) +> , Integer, Hash)> delete_segments_with_http_info(app_id, segment_id) ```ruby begin - # View an app - data, status_code, headers = api_instance.get_app_with_http_info(app_id) + # Delete Segments + data, status_code, headers = api_instance.delete_segments_with_http_info(app_id, segment_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_app_with_http_info: #{e}" + puts "Error when calling DefaultApi->delete_segments_with_http_info: #{e}" end ``` @@ -791,15 +811,16 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | An app id | | +| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | +| **segment_id** | **String** | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | | ### Return type -[**App**](App.md) +[**DeleteSegmentSuccessResponse**](DeleteSegmentSuccessResponse.md) ### Authorization -[user_key](../README.md#user_key) +[app_key](../README.md#app_key) ### HTTP request headers @@ -807,13 +828,13 @@ end - **Accept**: application/json -## get_apps +## delete_subscription -> > get_apps +> delete_subscription(app_id, subscription_id) -View apps -View the details of all of your current OneSignal apps + +Deletes the Subscription. ### Examples @@ -821,105 +842,103 @@ View the details of all of your current OneSignal apps require 'onesignal' # setup authorization OneSignal.configure do |config| - # Configure Bearer authorization: user_key - config.user_key = 'YOUR_BEARER_TOKEN' + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' end api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | +subscription_id = 'subscription_id_example' # String | begin - # View apps - result = api_instance.get_apps - p result + + api_instance.delete_subscription(app_id, subscription_id) rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_apps: #{e}" + puts "Error when calling DefaultApi->delete_subscription: #{e}" end ``` -#### Using the get_apps_with_http_info variant +#### Using the delete_subscription_with_http_info variant -This returns an Array which contains the response data, status code and headers. +This returns an Array which contains the response data (`nil` in this case), status code and headers. -> >, Integer, Hash)> get_apps_with_http_info +> delete_subscription_with_http_info(app_id, subscription_id) ```ruby begin - # View apps - data, status_code, headers = api_instance.get_apps_with_http_info + + data, status_code, headers = api_instance.delete_subscription_with_http_info(app_id, subscription_id) p status_code # => 2xx p headers # => { ... } - p data # => > + p data # => nil rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_apps_with_http_info: #{e}" + puts "Error when calling DefaultApi->delete_subscription_with_http_info: #{e}" end ``` ### Parameters -This endpoint does not need any parameter. +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | | | +| **subscription_id** | **String** | | | ### Return type -[**Array<App>**](App.md) +nil (empty response body) ### Authorization -[user_key](../README.md#user_key) +[app_key](../README.md#app_key) ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: Not defined -## get_notification +## delete_user -> get_notification(app_id, notification_id) +> delete_user(app_id, alias_label, alias_id) -View notification -View the details of a single notification and outcomes associated with it + +Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases ### Examples ```ruby require 'onesignal' -# setup authorization -OneSignal.configure do |config| - # Configure Bearer authorization: app_key - config.app_key = 'YOUR_BEARER_TOKEN' - -end api_instance = OneSignal::DefaultApi.new app_id = 'app_id_example' # String | -notification_id = 'notification_id_example' # String | +alias_label = 'alias_label_example' # String | +alias_id = 'alias_id_example' # String | begin - # View notification - result = api_instance.get_notification(app_id, notification_id) - p result + + api_instance.delete_user(app_id, alias_label, alias_id) rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_notification: #{e}" + puts "Error when calling DefaultApi->delete_user: #{e}" end ``` -#### Using the get_notification_with_http_info variant +#### Using the delete_user_with_http_info variant -This returns an Array which contains the response data, status code and headers. +This returns an Array which contains the response data (`nil` in this case), status code and headers. -> , Integer, Hash)> get_notification_with_http_info(app_id, notification_id) +> delete_user_with_http_info(app_id, alias_label, alias_id) ```ruby begin - # View notification - data, status_code, headers = api_instance.get_notification_with_http_info(app_id, notification_id) + + data, status_code, headers = api_instance.delete_user_with_http_info(app_id, alias_label, alias_id) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => nil rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_notification_with_http_info: #{e}" + puts "Error when calling DefaultApi->delete_user_with_http_info: #{e}" end ``` @@ -928,29 +947,30 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **app_id** | **String** | | | -| **notification_id** | **String** | | | +| **alias_label** | **String** | | | +| **alias_id** | **String** | | | ### Return type -[**NotificationWithMeta**](NotificationWithMeta.md) +nil (empty response body) ### Authorization -[app_key](../README.md#app_key) +No authorization required ### HTTP request headers - **Content-Type**: Not defined -- **Accept**: application/json +- **Accept**: Not defined -## get_notification_history +## end_live_activity -> get_notification_history(notification_id, get_notification_request_body) +> end_live_activity(app_id, activity_id, subscription_id) -Notification History +Stop Live Activity --> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. +Stops a Live Activity ### Examples @@ -964,33 +984,904 @@ OneSignal.configure do |config| end api_instance = OneSignal::DefaultApi.new -notification_id = 'notification_id_example' # String | The \"id\" of the message found in the Notification object -get_notification_request_body = OneSignal::GetNotificationRequestBody.new # GetNotificationRequestBody | +app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. +activity_id = 'activity_id_example' # String | Live Activity record ID +subscription_id = 'subscription_id_example' # String | Subscription ID begin - # Notification History - result = api_instance.get_notification_history(notification_id, get_notification_request_body) - p result + # Stop Live Activity + api_instance.end_live_activity(app_id, activity_id, subscription_id) rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_notification_history: #{e}" + puts "Error when calling DefaultApi->end_live_activity: #{e}" end ``` -#### Using the get_notification_history_with_http_info variant +#### Using the end_live_activity_with_http_info variant -This returns an Array which contains the response data, status code and headers. +This returns an Array which contains the response data (`nil` in this case), status code and headers. -> , Integer, Hash)> get_notification_history_with_http_info(notification_id, get_notification_request_body) +> end_live_activity_with_http_info(app_id, activity_id, subscription_id) ```ruby begin - # Notification History - data, status_code, headers = api_instance.get_notification_history_with_http_info(notification_id, get_notification_request_body) + # Stop Live Activity + data, status_code, headers = api_instance.end_live_activity_with_http_info(app_id, activity_id, subscription_id) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->end_live_activity_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | +| **activity_id** | **String** | Live Activity record ID | | +| **subscription_id** | **String** | Subscription ID | | + +### Return type + +nil (empty response body) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## export_players + +> export_players(app_id, opts) + +CSV export + +Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | The app ID that you want to export devices from +opts = { + export_players_request_body: OneSignal::ExportPlayersRequestBody.new # ExportPlayersRequestBody | +} + +begin + # CSV export + result = api_instance.export_players(app_id, opts) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->export_players: #{e}" +end +``` + +#### Using the export_players_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> export_players_with_http_info(app_id, opts) + +```ruby +begin + # CSV export + data, status_code, headers = api_instance.export_players_with_http_info(app_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->export_players_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | The app ID that you want to export devices from | | +| **export_players_request_body** | [**ExportPlayersRequestBody**](ExportPlayersRequestBody.md) | | [optional] | + +### Return type + +[**ExportPlayersSuccessResponse**](ExportPlayersSuccessResponse.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## fetch_aliases + +> fetch_aliases(app_id, subscription_id) + + + +Lists all Aliases for the User identified by :subscription_id. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | +subscription_id = 'subscription_id_example' # String | + +begin + + result = api_instance.fetch_aliases(app_id, subscription_id) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->fetch_aliases: #{e}" +end +``` + +#### Using the fetch_aliases_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> fetch_aliases_with_http_info(app_id, subscription_id) + +```ruby +begin + + data, status_code, headers = api_instance.fetch_aliases_with_http_info(app_id, subscription_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->fetch_aliases_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | | | +| **subscription_id** | **String** | | | + +### Return type + +[**UserIdentityResponse**](UserIdentityResponse.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## fetch_user + +> fetch_user(app_id, alias_label, alias_id) + + + +Returns the User’s properties, Aliases, and Subscriptions. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | +alias_label = 'alias_label_example' # String | +alias_id = 'alias_id_example' # String | + +begin + + result = api_instance.fetch_user(app_id, alias_label, alias_id) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->fetch_user: #{e}" +end +``` + +#### Using the fetch_user_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> fetch_user_with_http_info(app_id, alias_label, alias_id) + +```ruby +begin + + data, status_code, headers = api_instance.fetch_user_with_http_info(app_id, alias_label, alias_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->fetch_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | | | +| **alias_label** | **String** | | | +| **alias_id** | **String** | | | + +### Return type + +[**User**](User.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## fetch_user_identity + +> fetch_user_identity(app_id, alias_label, alias_id) + + + +Lists all Aliases for the User identified by (:alias_label, :alias_id). + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | +alias_label = 'alias_label_example' # String | +alias_id = 'alias_id_example' # String | + +begin + + result = api_instance.fetch_user_identity(app_id, alias_label, alias_id) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->fetch_user_identity: #{e}" +end +``` + +#### Using the fetch_user_identity_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> fetch_user_identity_with_http_info(app_id, alias_label, alias_id) + +```ruby +begin + + data, status_code, headers = api_instance.fetch_user_identity_with_http_info(app_id, alias_label, alias_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->fetch_user_identity_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | | | +| **alias_label** | **String** | | | +| **alias_id** | **String** | | | + +### Return type + +[**InlineResponse200**](InlineResponse200.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_app + +> get_app(app_id) + +View an app + +View the details of a single OneSignal app + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: user_key + config.user_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | An app id + +begin + # View an app + result = api_instance.get_app(app_id) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_app: #{e}" +end +``` + +#### Using the get_app_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_app_with_http_info(app_id) + +```ruby +begin + # View an app + data, status_code, headers = api_instance.get_app_with_http_info(app_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_app_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | An app id | | + +### Return type + +[**App**](App.md) + +### Authorization + +[user_key](../README.md#user_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_apps + +> > get_apps + +View apps + +View the details of all of your current OneSignal apps + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: user_key + config.user_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new + +begin + # View apps + result = api_instance.get_apps + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_apps: #{e}" +end +``` + +#### Using the get_apps_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> >, Integer, Hash)> get_apps_with_http_info + +```ruby +begin + # View apps + data, status_code, headers = api_instance.get_apps_with_http_info + p status_code # => 2xx + p headers # => { ... } + p data # => > +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_apps_with_http_info: #{e}" +end +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Array<App>**](App.md) + +### Authorization + +[user_key](../README.md#user_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_eligible_iams + +> get_eligible_iams(app_id, subscription_id) + + + +Manifest of In-App Messages the Subscription is eligible to display by the SDK. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | +subscription_id = 'subscription_id_example' # String | + +begin + + result = api_instance.get_eligible_iams(app_id, subscription_id) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_eligible_iams: #{e}" +end +``` + +#### Using the get_eligible_iams_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_eligible_iams_with_http_info(app_id, subscription_id) + +```ruby +begin + + data, status_code, headers = api_instance.get_eligible_iams_with_http_info(app_id, subscription_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_eligible_iams_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | | | +| **subscription_id** | **String** | | | + +### Return type + +[**InlineResponse2003**](InlineResponse2003.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_notification + +> get_notification(app_id, notification_id) + +View notification + +View the details of a single notification and outcomes associated with it + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | +notification_id = 'notification_id_example' # String | + +begin + # View notification + result = api_instance.get_notification(app_id, notification_id) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_notification: #{e}" +end +``` + +#### Using the get_notification_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_notification_with_http_info(app_id, notification_id) + +```ruby +begin + # View notification + data, status_code, headers = api_instance.get_notification_with_http_info(app_id, notification_id) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_notification_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | | | +| **notification_id** | **String** | | | + +### Return type + +[**NotificationWithMeta**](NotificationWithMeta.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_notification_history + +> get_notification_history(notification_id, get_notification_request_body) + +Notification History + +-> View the devices sent a message - OneSignal Paid Plan Required This method will return all devices that were sent the given notification_id of an Email or Push Notification if used within 7 days of the date sent. After 7 days of the sending date, the message history data will be unavailable. After a successful response is received, the destination url may be polled until the file becomes available. Most exports are done in ~1-3 minutes, so setting a poll interval of 10 seconds should be adequate. For use cases that are not meant to be consumed by a script, an email will be sent to the supplied email address. 🚧 Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -> Analytics. Cannot get data before this was turned on. Must be called within 7 days after sending the message. Messages targeting under 1000 recipients will not have \"sent\" events recorded, but will show \"clicked\" events. Requires your OneSignal App's REST API Key, available in Keys & IDs. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +notification_id = 'notification_id_example' # String | The \"id\" of the message found in the Notification object +get_notification_request_body = OneSignal::GetNotificationRequestBody.new # GetNotificationRequestBody | + +begin + # Notification History + result = api_instance.get_notification_history(notification_id, get_notification_request_body) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_notification_history: #{e}" +end +``` + +#### Using the get_notification_history_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_notification_history_with_http_info(notification_id, get_notification_request_body) + +```ruby +begin + # Notification History + data, status_code, headers = api_instance.get_notification_history_with_http_info(notification_id, get_notification_request_body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_notification_history_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **notification_id** | **String** | The \"id\" of the message found in the Notification object | | +| **get_notification_request_body** | [**GetNotificationRequestBody**](GetNotificationRequestBody.md) | | | + +### Return type + +[**NotificationHistorySuccessResponse**](NotificationHistorySuccessResponse.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## get_notifications + +> get_notifications(app_id, opts) + +View notifications + +View the details of multiple notifications + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | The app ID that you want to view notifications from +opts = { + limit: 56, # Integer | How many notifications to return. Max is 50. Default is 50. + offset: 56, # Integer | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. + kind: 0 # Integer | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only +} + +begin + # View notifications + result = api_instance.get_notifications(app_id, opts) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_notifications: #{e}" +end +``` + +#### Using the get_notifications_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_notifications_with_http_info(app_id, opts) + +```ruby +begin + # View notifications + data, status_code, headers = api_instance.get_notifications_with_http_info(app_id, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_notifications_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | The app ID that you want to view notifications from | | +| **limit** | **Integer** | How many notifications to return. Max is 50. Default is 50. | [optional] | +| **offset** | **Integer** | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | [optional] | +| **kind** | **Integer** | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | [optional] | + +### Return type + +[**NotificationSlice**](NotificationSlice.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_outcomes + +> get_outcomes(app_id, outcome_names, opts) + +View Outcomes + +View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. +outcome_names = 'outcome_names_example' # String | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum +opts = { + outcome_names2: 'outcome_names_example', # String | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. + outcome_time_range: 'outcome_time_range_example', # String | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. + outcome_platforms: 'outcome_platforms_example', # String | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. + outcome_attribution: 'outcome_attribution_example' # String | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. +} + +begin + # View Outcomes + result = api_instance.get_outcomes(app_id, outcome_names, opts) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_outcomes: #{e}" +end +``` + +#### Using the get_outcomes_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_outcomes_with_http_info(app_id, outcome_names, opts) + +```ruby +begin + # View Outcomes + data, status_code, headers = api_instance.get_outcomes_with_http_info(app_id, outcome_names, opts) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_outcomes_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | +| **outcome_names** | **String** | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | | +| **outcome_names2** | **String** | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. | [optional] | +| **outcome_time_range** | **String** | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | [optional] | +| **outcome_platforms** | **String** | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | [optional] | +| **outcome_attribution** | **String** | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. | [optional] | + +### Return type + +[**OutcomesData**](OutcomesData.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_player + +> get_player(app_id, player_id, opts) + +View device + +View the details of an existing device in one of your OneSignal apps + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | Your app_id for this device +player_id = 'player_id_example' # String | Player's OneSignal ID +opts = { + email_auth_hash: 'email_auth_hash_example' # String | Email - Only required if you have enabled Identity Verification and device_type is email (11). +} + +begin + # View device + result = api_instance.get_player(app_id, player_id, opts) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->get_player: #{e}" +end +``` + +#### Using the get_player_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> get_player_with_http_info(app_id, player_id, opts) + +```ruby +begin + # View device + data, status_code, headers = api_instance.get_player_with_http_info(app_id, player_id, opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_notification_history_with_http_info: #{e}" + puts "Error when calling DefaultApi->get_player_with_http_info: #{e}" end ``` @@ -998,12 +1889,13 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **notification_id** | **String** | The \"id\" of the message found in the Notification object | | -| **get_notification_request_body** | [**GetNotificationRequestBody**](GetNotificationRequestBody.md) | | | +| **app_id** | **String** | Your app_id for this device | | +| **player_id** | **String** | Player's OneSignal ID | | +| **email_auth_hash** | **String** | Email - Only required if you have enabled Identity Verification and device_type is email (11). | [optional] | ### Return type -[**NotificationHistorySuccessResponse**](NotificationHistorySuccessResponse.md) +[**Player**](Player.md) ### Authorization @@ -1011,17 +1903,17 @@ end ### HTTP request headers -- **Content-Type**: application/json +- **Content-Type**: Not defined - **Accept**: application/json -## get_notifications +## get_players -> get_notifications(app_id, opts) +> get_players(app_id, opts) -View notifications +View devices -View the details of multiple notifications +View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. ### Examples @@ -1035,37 +1927,36 @@ OneSignal.configure do |config| end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The app ID that you want to view notifications from +app_id = 'app_id_example' # String | The app ID that you want to view players from opts = { - limit: 56, # Integer | How many notifications to return. Max is 50. Default is 50. - offset: 56, # Integer | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. - kind: 0 # Integer | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only + limit: 56, # Integer | How many devices to return. Max is 300. Default is 300 + offset: 56 # Integer | Result offset. Default is 0. Results are sorted by id; } begin - # View notifications - result = api_instance.get_notifications(app_id, opts) + # View devices + result = api_instance.get_players(app_id, opts) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_notifications: #{e}" + puts "Error when calling DefaultApi->get_players: #{e}" end ``` -#### Using the get_notifications_with_http_info variant +#### Using the get_players_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get_notifications_with_http_info(app_id, opts) +> , Integer, Hash)> get_players_with_http_info(app_id, opts) ```ruby begin - # View notifications - data, status_code, headers = api_instance.get_notifications_with_http_info(app_id, opts) + # View devices + data, status_code, headers = api_instance.get_players_with_http_info(app_id, opts) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_notifications_with_http_info: #{e}" + puts "Error when calling DefaultApi->get_players_with_http_info: #{e}" end ``` @@ -1073,14 +1964,13 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The app ID that you want to view notifications from | | -| **limit** | **Integer** | How many notifications to return. Max is 50. Default is 50. | [optional] | -| **offset** | **Integer** | Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at. | [optional] | -| **kind** | **Integer** | Kind of notifications returned: * unset - All notification types (default) * `0` - Dashboard only * `1` - API only * `3` - Automated only | [optional] | +| **app_id** | **String** | The app ID that you want to view players from | | +| **limit** | **Integer** | How many devices to return. Max is 300. Default is 300 | [optional] | +| **offset** | **Integer** | Result offset. Default is 0. Results are sorted by id; | [optional] | ### Return type -[**NotificationSlice**](NotificationSlice.md) +[**PlayerSlice**](PlayerSlice.md) ### Authorization @@ -1092,13 +1982,13 @@ end - **Accept**: application/json -## get_outcomes +## identify_user_by_alias -> get_outcomes(app_id, outcome_names, opts) +> identify_user_by_alias(app_id, alias_label, alias_id, user_identity_request_body) -View Outcomes -View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + +Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). ### Examples @@ -1112,39 +2002,35 @@ OneSignal.configure do |config| end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs. -outcome_names = 'outcome_names_example' # String | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum -opts = { - outcome_names2: 'outcome_names_example', # String | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. - outcome_time_range: 'outcome_time_range_example', # String | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. - outcome_platforms: 'outcome_platforms_example', # String | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. - outcome_attribution: 'outcome_attribution_example' # String | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. -} +app_id = 'app_id_example' # String | +alias_label = 'alias_label_example' # String | +alias_id = 'alias_id_example' # String | +user_identity_request_body = OneSignal::UserIdentityRequestBody.new # UserIdentityRequestBody | begin - # View Outcomes - result = api_instance.get_outcomes(app_id, outcome_names, opts) + + result = api_instance.identify_user_by_alias(app_id, alias_label, alias_id, user_identity_request_body) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_outcomes: #{e}" + puts "Error when calling DefaultApi->identify_user_by_alias: #{e}" end ``` -#### Using the get_outcomes_with_http_info variant +#### Using the identify_user_by_alias_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get_outcomes_with_http_info(app_id, outcome_names, opts) +> , Integer, Hash)> identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body) ```ruby begin - # View Outcomes - data, status_code, headers = api_instance.get_outcomes_with_http_info(app_id, outcome_names, opts) + + data, status_code, headers = api_instance.identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_outcomes_with_http_info: #{e}" + puts "Error when calling DefaultApi->identify_user_by_alias_with_http_info: #{e}" end ``` @@ -1152,16 +2038,14 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The OneSignal App ID for your app. Available in Keys & IDs. | | -| **outcome_names** | **String** | Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum | | -| **outcome_names2** | **String** | Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. | [optional] | -| **outcome_time_range** | **String** | Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. | [optional] | -| **outcome_platforms** | **String** | Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. | [optional] | -| **outcome_attribution** | **String** | Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. | [optional] | +| **app_id** | **String** | | | +| **alias_label** | **String** | | | +| **alias_id** | **String** | | | +| **user_identity_request_body** | [**UserIdentityRequestBody**](UserIdentityRequestBody.md) | | | ### Return type -[**OutcomesData**](OutcomesData.md) +[**InlineResponse200**](InlineResponse200.md) ### Authorization @@ -1169,17 +2053,17 @@ end ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json -## get_player +## identify_user_by_subscription_id -> get_player(app_id, player_id, opts) +> identify_user_by_subscription_id(app_id, subscription_id, user_identity_request_body) -View device -View the details of an existing device in one of your OneSignal apps + +Upserts one or more Aliases for the User identified by :subscription_id. ### Examples @@ -1193,36 +2077,34 @@ OneSignal.configure do |config| end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | Your app_id for this device -player_id = 'player_id_example' # String | Player's OneSignal ID -opts = { - email_auth_hash: 'email_auth_hash_example' # String | Email - Only required if you have enabled Identity Verification and device_type is email (11). -} +app_id = 'app_id_example' # String | +subscription_id = 'subscription_id_example' # String | +user_identity_request_body = OneSignal::UserIdentityRequestBody.new # UserIdentityRequestBody | begin - # View device - result = api_instance.get_player(app_id, player_id, opts) + + result = api_instance.identify_user_by_subscription_id(app_id, subscription_id, user_identity_request_body) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_player: #{e}" + puts "Error when calling DefaultApi->identify_user_by_subscription_id: #{e}" end ``` -#### Using the get_player_with_http_info variant +#### Using the identify_user_by_subscription_id_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get_player_with_http_info(app_id, player_id, opts) +> , Integer, Hash)> identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body) ```ruby begin - # View device - data, status_code, headers = api_instance.get_player_with_http_info(app_id, player_id, opts) + + data, status_code, headers = api_instance.identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_player_with_http_info: #{e}" + puts "Error when calling DefaultApi->identify_user_by_subscription_id_with_http_info: #{e}" end ``` @@ -1230,13 +2112,13 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | Your app_id for this device | | -| **player_id** | **String** | Player's OneSignal ID | | -| **email_auth_hash** | **String** | Email - Only required if you have enabled Identity Verification and device_type is email (11). | [optional] | +| **app_id** | **String** | | | +| **subscription_id** | **String** | | | +| **user_identity_request_body** | [**UserIdentityRequestBody**](UserIdentityRequestBody.md) | | | ### Return type -[**Player**](Player.md) +[**UserIdentityResponse**](UserIdentityResponse.md) ### Authorization @@ -1244,17 +2126,17 @@ end ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json -## get_players +## transfer_subscription -> get_players(app_id, opts) +> transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) -View devices -View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. + +Transfers this Subscription to the User identified by the identity in the payload. ### Examples @@ -1268,36 +2150,34 @@ OneSignal.configure do |config| end api_instance = OneSignal::DefaultApi.new -app_id = 'app_id_example' # String | The app ID that you want to view players from -opts = { - limit: 56, # Integer | How many devices to return. Max is 300. Default is 300 - offset: 56 # Integer | Result offset. Default is 0. Results are sorted by id; -} +app_id = 'app_id_example' # String | +subscription_id = 'subscription_id_example' # String | +transfer_subscription_request_body = OneSignal::TransferSubscriptionRequestBody.new # TransferSubscriptionRequestBody | begin - # View devices - result = api_instance.get_players(app_id, opts) + + result = api_instance.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body) p result rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_players: #{e}" + puts "Error when calling DefaultApi->transfer_subscription: #{e}" end ``` -#### Using the get_players_with_http_info variant +#### Using the transfer_subscription_with_http_info variant This returns an Array which contains the response data, status code and headers. -> , Integer, Hash)> get_players_with_http_info(app_id, opts) +> , Integer, Hash)> transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body) ```ruby begin - # View devices - data, status_code, headers = api_instance.get_players_with_http_info(app_id, opts) + + data, status_code, headers = api_instance.transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body) p status_code # => 2xx p headers # => { ... } - p data # => + p data # => rescue OneSignal::ApiError => e - puts "Error when calling DefaultApi->get_players_with_http_info: #{e}" + puts "Error when calling DefaultApi->transfer_subscription_with_http_info: #{e}" end ``` @@ -1305,13 +2185,13 @@ end | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | -| **app_id** | **String** | The app ID that you want to view players from | | -| **limit** | **Integer** | How many devices to return. Max is 300. Default is 300 | [optional] | -| **offset** | **Integer** | Result offset. Default is 0. Results are sorted by id; | [optional] | +| **app_id** | **String** | | | +| **subscription_id** | **String** | | | +| **transfer_subscription_request_body** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md) | | | ### Return type -[**PlayerSlice**](PlayerSlice.md) +[**UserIdentityResponse**](UserIdentityResponse.md) ### Authorization @@ -1319,7 +2199,7 @@ end ### HTTP request headers -- **Content-Type**: Not defined +- **Content-Type**: application/json - **Accept**: application/json @@ -1612,3 +2492,150 @@ end - **Content-Type**: application/json - **Accept**: application/json + +## update_subscription + +> update_subscription(app_id, subscription_id, update_subscription_request_body) + + + +Updates an existing Subscription’s properties. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | +subscription_id = 'subscription_id_example' # String | +update_subscription_request_body = OneSignal::UpdateSubscriptionRequestBody.new # UpdateSubscriptionRequestBody | + +begin + + api_instance.update_subscription(app_id, subscription_id, update_subscription_request_body) +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_subscription: #{e}" +end +``` + +#### Using the update_subscription_with_http_info variant + +This returns an Array which contains the response data (`nil` in this case), status code and headers. + +> update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body) + +```ruby +begin + + data, status_code, headers = api_instance.update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body) + p status_code # => 2xx + p headers # => { ... } + p data # => nil +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_subscription_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | | | +| **subscription_id** | **String** | | | +| **update_subscription_request_body** | [**UpdateSubscriptionRequestBody**](UpdateSubscriptionRequestBody.md) | | | + +### Return type + +nil (empty response body) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + + +## update_user + +> update_user(app_id, alias_label, alias_id, update_user_request) + + + +Updates an existing User’s properties. + +### Examples + +```ruby +require 'onesignal' +# setup authorization +OneSignal.configure do |config| + # Configure Bearer authorization: app_key + config.app_key = 'YOUR_BEARER_TOKEN' + +end + +api_instance = OneSignal::DefaultApi.new +app_id = 'app_id_example' # String | +alias_label = 'alias_label_example' # String | +alias_id = 'alias_id_example' # String | +update_user_request = OneSignal::UpdateUserRequest.new # UpdateUserRequest | + +begin + + result = api_instance.update_user(app_id, alias_label, alias_id, update_user_request) + p result +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_user: #{e}" +end +``` + +#### Using the update_user_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_user_with_http_info(app_id, alias_label, alias_id, update_user_request) + +```ruby +begin + + data, status_code, headers = api_instance.update_user_with_http_info(app_id, alias_label, alias_id, update_user_request) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue OneSignal::ApiError => e + puts "Error when calling DefaultApi->update_user_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **app_id** | **String** | | | +| **alias_label** | **String** | | | +| **alias_id** | **String** | | | +| **update_user_request** | [**UpdateUserRequest**](UpdateUserRequest.md) | | | + +### Return type + +[**InlineResponse202**](InlineResponse202.md) + +### Authorization + +[app_key](../README.md#app_key) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/IdentifyUserConflictResponse.md b/docs/IdentifyUserConflictResponse.md new file mode 100644 index 0000000..5080939 --- /dev/null +++ b/docs/IdentifyUserConflictResponse.md @@ -0,0 +1,18 @@ +# OneSignal::IdentifyUserConflictResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **errors** | [**Array<IdentifyUserConflictResponseErrorsInner>**](IdentifyUserConflictResponseErrorsInner.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::IdentifyUserConflictResponse.new( + errors: null +) +``` + diff --git a/docs/IdentifyUserConflictResponseErrorsInner.md b/docs/IdentifyUserConflictResponseErrorsInner.md new file mode 100644 index 0000000..72c75c1 --- /dev/null +++ b/docs/IdentifyUserConflictResponseErrorsInner.md @@ -0,0 +1,20 @@ +# OneSignal::IdentifyUserConflictResponseErrorsInner + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **code** | **String** | | [optional] | +| **title** | **String** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::IdentifyUserConflictResponseErrorsInner.new( + code: null, + title: null +) +``` + diff --git a/docs/InlineResponse200.md b/docs/InlineResponse200.md new file mode 100644 index 0000000..059e84a --- /dev/null +++ b/docs/InlineResponse200.md @@ -0,0 +1,18 @@ +# OneSignal::InlineResponse200 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **identity** | **Hash<String, Object>** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::InlineResponse200.new( + identity: null +) +``` + diff --git a/docs/InlineResponse2003.md b/docs/InlineResponse2003.md new file mode 100644 index 0000000..7e14059 --- /dev/null +++ b/docs/InlineResponse2003.md @@ -0,0 +1,18 @@ +# OneSignal::InlineResponse2003 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **in_app_messages** | **Array<Object>** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::InlineResponse2003.new( + in_app_messages: null +) +``` + diff --git a/docs/InlineResponse201.md b/docs/InlineResponse201.md new file mode 100644 index 0000000..eb691ec --- /dev/null +++ b/docs/InlineResponse201.md @@ -0,0 +1,18 @@ +# OneSignal::InlineResponse201 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **subscription** | [**SubscriptionObject**](SubscriptionObject.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::InlineResponse201.new( + subscription: null +) +``` + diff --git a/docs/InlineResponse202.md b/docs/InlineResponse202.md new file mode 100644 index 0000000..353bc48 --- /dev/null +++ b/docs/InlineResponse202.md @@ -0,0 +1,18 @@ +# OneSignal::InlineResponse202 + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **properties** | [**PropertiesObject**](PropertiesObject.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::InlineResponse202.new( + properties: null +) +``` + diff --git a/docs/Notification.md b/docs/Notification.md index fcab533..841da75 100644 --- a/docs/Notification.md +++ b/docs/Notification.md @@ -16,6 +16,8 @@ | **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | | **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | | **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_aliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +| **target_channel** | **String** | | [optional] | | **id** | **String** | | [optional] | | **value** | **Integer** | | [optional][readonly] | | **name** | **String** | Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user. | [optional] | @@ -125,6 +127,8 @@ instance = OneSignal::Notification.new( include_chrome_reg_ids: null, include_chrome_web_reg_ids: null, include_android_reg_ids: null, + include_aliases: null, + target_channel: null, id: null, value: null, name: null, diff --git a/docs/NotificationTarget.md b/docs/NotificationTarget.md index 36f430f..f8ed086 100644 --- a/docs/NotificationTarget.md +++ b/docs/NotificationTarget.md @@ -16,6 +16,8 @@ | **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | | **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | | **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_aliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +| **target_channel** | **String** | | [optional] | ## Example @@ -34,7 +36,9 @@ instance = OneSignal::NotificationTarget.new( include_amazon_reg_ids: null, include_chrome_reg_ids: null, include_chrome_web_reg_ids: null, - include_android_reg_ids: null + include_android_reg_ids: null, + include_aliases: null, + target_channel: null ) ``` diff --git a/docs/NotificationWithMeta.md b/docs/NotificationWithMeta.md index 6c63798..8e35cbe 100644 --- a/docs/NotificationWithMeta.md +++ b/docs/NotificationWithMeta.md @@ -16,6 +16,8 @@ | **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | | **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | | **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_aliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +| **target_channel** | **String** | | [optional] | | **id** | **String** | | [optional] | | **value** | **Integer** | | [optional][readonly] | | **name** | **String** | Required for SMS Messages. An identifier for tracking message within the OneSignal dashboard or export analytics. Not shown to end user. | [optional] | @@ -135,6 +137,8 @@ instance = OneSignal::NotificationWithMeta.new( include_chrome_reg_ids: null, include_chrome_web_reg_ids: null, include_android_reg_ids: null, + include_aliases: null, + target_channel: null, id: null, value: null, name: null, diff --git a/docs/PlayerNotificationTarget.md b/docs/PlayerNotificationTarget.md index ba00dfe..865f9a1 100644 --- a/docs/PlayerNotificationTarget.md +++ b/docs/PlayerNotificationTarget.md @@ -14,6 +14,8 @@ | **include_chrome_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | | **include_chrome_web_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | | **include_android_reg_ids** | **Array<String>** | Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call | [optional] | +| **include_aliases** | [**PlayerNotificationTargetIncludeAliases**](PlayerNotificationTargetIncludeAliases.md) | | [optional] | +| **target_channel** | **String** | | [optional] | ## Example @@ -30,7 +32,9 @@ instance = OneSignal::PlayerNotificationTarget.new( include_amazon_reg_ids: null, include_chrome_reg_ids: null, include_chrome_web_reg_ids: null, - include_android_reg_ids: null + include_android_reg_ids: null, + include_aliases: null, + target_channel: null ) ``` diff --git a/docs/PlayerNotificationTargetIncludeAliases.md b/docs/PlayerNotificationTargetIncludeAliases.md new file mode 100644 index 0000000..8d2bd8b --- /dev/null +++ b/docs/PlayerNotificationTargetIncludeAliases.md @@ -0,0 +1,18 @@ +# OneSignal::PlayerNotificationTargetIncludeAliases + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **alias_label** | **Array<String>** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::PlayerNotificationTargetIncludeAliases.new( + alias_label: null +) +``` + diff --git a/docs/PropertiesDeltas.md b/docs/PropertiesDeltas.md new file mode 100644 index 0000000..a19592b --- /dev/null +++ b/docs/PropertiesDeltas.md @@ -0,0 +1,22 @@ +# OneSignal::PropertiesDeltas + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **session_time** | **Float** | | [optional] | +| **session_count** | **Float** | | [optional] | +| **purchases** | [**Array<Purchase>**](Purchase.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::PropertiesDeltas.new( + session_time: null, + session_count: null, + purchases: null +) +``` + diff --git a/docs/PropertiesObject.md b/docs/PropertiesObject.md new file mode 100644 index 0000000..9446813 --- /dev/null +++ b/docs/PropertiesObject.md @@ -0,0 +1,38 @@ +# OneSignal::PropertiesObject + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **tags** | **Hash<String, Object>** | | [optional] | +| **language** | **String** | | [optional] | +| **timezone_id** | **String** | | [optional] | +| **lat** | **Float** | | [optional] | +| **long** | **Float** | | [optional] | +| **country** | **String** | | [optional] | +| **first_active** | **Float** | | [optional] | +| **last_active** | **Float** | | [optional] | +| **amount_spent** | **Float** | | [optional] | +| **purchases** | [**Array<Purchase>**](Purchase.md) | | [optional] | +| **ip** | **String** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::PropertiesObject.new( + tags: null, + language: null, + timezone_id: null, + lat: null, + long: null, + country: null, + first_active: null, + last_active: null, + amount_spent: null, + purchases: null, + ip: null +) +``` + diff --git a/docs/Purchase.md b/docs/Purchase.md index cbcce76..85677bc 100644 --- a/docs/Purchase.md +++ b/docs/Purchase.md @@ -5,8 +5,9 @@ | Name | Type | Description | Notes | | ---- | ---- | ----------- | ----- | | **sku** | **String** | The unique identifier of the purchased item. | | -| **amount** | **Float** | The amount, in USD, spent purchasing the item. | | +| **amount** | **String** | The amount, in USD, spent purchasing the item. | | | **iso** | **String** | The 3-letter ISO 4217 currency code. Required for correct storage and conversion of amount. | | +| **count** | **Float** | | [optional] | ## Example @@ -16,7 +17,8 @@ require 'onesignal' instance = OneSignal::Purchase.new( sku: null, amount: null, - iso: null + iso: null, + count: null ) ``` diff --git a/docs/SubscriptionObject.md b/docs/SubscriptionObject.md new file mode 100644 index 0000000..1bb05dc --- /dev/null +++ b/docs/SubscriptionObject.md @@ -0,0 +1,50 @@ +# OneSignal::SubscriptionObject + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **id** | **String** | | [optional] | +| **type** | **String** | | [optional] | +| **token** | **String** | | [optional] | +| **enabled** | **Boolean** | | [optional] | +| **notification_types** | **Float** | | [optional] | +| **session_time** | **Float** | | [optional] | +| **session_count** | **Float** | | [optional] | +| **sdk** | **String** | | [optional] | +| **device_model** | **String** | | [optional] | +| **device_os** | **String** | | [optional] | +| **rooted** | **Boolean** | | [optional] | +| **test_type** | **Float** | | [optional] | +| **app_version** | **String** | | [optional] | +| **net_type** | **Float** | | [optional] | +| **carrier** | **String** | | [optional] | +| **web_auth** | **String** | | [optional] | +| **web_p256** | **String** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::SubscriptionObject.new( + id: null, + type: null, + token: null, + enabled: null, + notification_types: null, + session_time: null, + session_count: null, + sdk: null, + device_model: null, + device_os: null, + rooted: null, + test_type: null, + app_version: null, + net_type: null, + carrier: null, + web_auth: null, + web_p256: null +) +``` + diff --git a/docs/TransferSubscriptionRequestBody.md b/docs/TransferSubscriptionRequestBody.md new file mode 100644 index 0000000..185c57f --- /dev/null +++ b/docs/TransferSubscriptionRequestBody.md @@ -0,0 +1,18 @@ +# OneSignal::TransferSubscriptionRequestBody + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **identity** | **Hash<String, Object>** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::TransferSubscriptionRequestBody.new( + identity: null +) +``` + diff --git a/docs/UpdateSubscriptionRequestBody.md b/docs/UpdateSubscriptionRequestBody.md new file mode 100644 index 0000000..e0c04c8 --- /dev/null +++ b/docs/UpdateSubscriptionRequestBody.md @@ -0,0 +1,18 @@ +# OneSignal::UpdateSubscriptionRequestBody + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **subscription** | [**SubscriptionObject**](SubscriptionObject.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::UpdateSubscriptionRequestBody.new( + subscription: null +) +``` + diff --git a/docs/UpdateUserRequest.md b/docs/UpdateUserRequest.md new file mode 100644 index 0000000..ae63784 --- /dev/null +++ b/docs/UpdateUserRequest.md @@ -0,0 +1,22 @@ +# OneSignal::UpdateUserRequest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **properties** | [**PropertiesObject**](PropertiesObject.md) | | [optional] | +| **refresh_device_metadata** | **Boolean** | | [optional][default to false] | +| **deltas** | [**PropertiesDeltas**](PropertiesDeltas.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::UpdateUserRequest.new( + properties: null, + refresh_device_metadata: null, + deltas: null +) +``` + diff --git a/docs/User.md b/docs/User.md new file mode 100644 index 0000000..90f2ae2 --- /dev/null +++ b/docs/User.md @@ -0,0 +1,24 @@ +# OneSignal::User + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **properties** | [**PropertiesObject**](PropertiesObject.md) | | [optional] | +| **identity** | **Hash<String, Object>** | | [optional] | +| **subscriptions** | [**Array<SubscriptionObject>**](SubscriptionObject.md) | | [optional] | +| **subscription_options** | [**UserSubscriptionOptions**](UserSubscriptionOptions.md) | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::User.new( + properties: null, + identity: null, + subscriptions: null, + subscription_options: null +) +``` + diff --git a/docs/UserIdentityRequestBody.md b/docs/UserIdentityRequestBody.md new file mode 100644 index 0000000..797866e --- /dev/null +++ b/docs/UserIdentityRequestBody.md @@ -0,0 +1,18 @@ +# OneSignal::UserIdentityRequestBody + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **identity** | **Hash<String, Object>** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::UserIdentityRequestBody.new( + identity: null +) +``` + diff --git a/docs/UserIdentityResponse.md b/docs/UserIdentityResponse.md new file mode 100644 index 0000000..84f4cb1 --- /dev/null +++ b/docs/UserIdentityResponse.md @@ -0,0 +1,18 @@ +# OneSignal::UserIdentityResponse + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **identity** | **Hash<String, Object>** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::UserIdentityResponse.new( + identity: null +) +``` + diff --git a/docs/UserSubscriptionOptions.md b/docs/UserSubscriptionOptions.md new file mode 100644 index 0000000..9dcd472 --- /dev/null +++ b/docs/UserSubscriptionOptions.md @@ -0,0 +1,18 @@ +# OneSignal::UserSubscriptionOptions + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **retain_previous_owner** | **Boolean** | | [optional] | + +## Example + +```ruby +require 'onesignal' + +instance = OneSignal::UserSubscriptionOptions.new( + retain_previous_owner: null +) +``` + diff --git a/lib/onesignal.rb b/lib/onesignal.rb index 9209bf5..d664b75 100644 --- a/lib/onesignal.rb +++ b/lib/onesignal.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -29,6 +29,10 @@ require 'onesignal/models/create_player_success_response' require 'onesignal/models/create_segment_conflict_response' require 'onesignal/models/create_segment_success_response' +require 'onesignal/models/create_subscription_request_body' +require 'onesignal/models/create_user_conflict_response' +require 'onesignal/models/create_user_conflict_response_errors_inner' +require 'onesignal/models/create_user_conflict_response_errors_items_meta' require 'onesignal/models/delete_player_not_found_response' require 'onesignal/models/delete_player_success_response' require 'onesignal/models/delete_segment_not_found_response' @@ -39,6 +43,12 @@ require 'onesignal/models/filter' require 'onesignal/models/filter_expressions' require 'onesignal/models/get_notification_request_body' +require 'onesignal/models/identify_user_conflict_response' +require 'onesignal/models/identify_user_conflict_response_errors_inner' +require 'onesignal/models/inline_response200' +require 'onesignal/models/inline_response2003' +require 'onesignal/models/inline_response201' +require 'onesignal/models/inline_response202' require 'onesignal/models/invalid_identifier_error' require 'onesignal/models/notification' require 'onesignal/models/notification200_errors' @@ -56,16 +66,27 @@ require 'onesignal/models/platform_delivery_data_sms_all_of' require 'onesignal/models/player' require 'onesignal/models/player_notification_target' +require 'onesignal/models/player_notification_target_include_aliases' require 'onesignal/models/player_slice' +require 'onesignal/models/properties_deltas' +require 'onesignal/models/properties_object' require 'onesignal/models/purchase' require 'onesignal/models/segment' require 'onesignal/models/segment_notification_target' require 'onesignal/models/string_map' +require 'onesignal/models/subscription_object' +require 'onesignal/models/transfer_subscription_request_body' require 'onesignal/models/update_live_activity_request' require 'onesignal/models/update_live_activity_success_response' require 'onesignal/models/update_player_success_response' require 'onesignal/models/update_player_tags_request_body' require 'onesignal/models/update_player_tags_success_response' +require 'onesignal/models/update_subscription_request_body' +require 'onesignal/models/update_user_request' +require 'onesignal/models/user' +require 'onesignal/models/user_identity_request_body' +require 'onesignal/models/user_identity_response' +require 'onesignal/models/user_subscription_options' # APIs require 'onesignal/api/default_api' diff --git a/lib/onesignal/api/default_api.rb b/lib/onesignal/api/default_api.rb index f28a6a8..36d5602 100644 --- a/lib/onesignal/api/default_api.rb +++ b/lib/onesignal/api/default_api.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -443,61 +443,75 @@ def create_segments_with_http_info(app_id, opts = {}) return data, status_code, headers end - # Delete a user record - # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param player_id [String] The OneSignal player_id + # Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. + # @param app_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param create_subscription_request_body [CreateSubscriptionRequestBody] # @param [Hash] opts the optional parameters - # @return [DeletePlayerSuccessResponse] - def delete_player(app_id, player_id, opts = {}) - data, _status_code, _headers = delete_player_with_http_info(app_id, player_id, opts) + # @return [InlineResponse201] + def create_subscription(app_id, alias_label, alias_id, create_subscription_request_body, opts = {}) + data, _status_code, _headers = create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body, opts) data end - # Delete a user record - # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param player_id [String] The OneSignal player_id + # Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. + # @param app_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param create_subscription_request_body [CreateSubscriptionRequestBody] # @param [Hash] opts the optional parameters - # @return [Array<(DeletePlayerSuccessResponse, Integer, Hash)>] DeletePlayerSuccessResponse data, response status code and response headers - def delete_player_with_http_info(app_id, player_id, opts = {}) + # @return [Array<(InlineResponse201, Integer, Hash)>] InlineResponse201 data, response status code and response headers + def create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.delete_player ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.create_subscription ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_player" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_subscription" end - # verify the required parameter 'player_id' is set - if @api_client.config.client_side_validation && player_id.nil? - fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.delete_player" + # verify the required parameter 'alias_label' is set + if @api_client.config.client_side_validation && alias_label.nil? + fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.create_subscription" + end + # verify the required parameter 'alias_id' is set + if @api_client.config.client_side_validation && alias_id.nil? + fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.create_subscription" + end + # verify the required parameter 'create_subscription_request_body' is set + if @api_client.config.client_side_validation && create_subscription_request_body.nil? + fail ArgumentError, "Missing the required parameter 'create_subscription_request_body' when calling DefaultApi.create_subscription" end # resource path - local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s)) + local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'app_id'] = app_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(create_subscription_request_body) # return_type - return_type = opts[:debug_return_type] || 'DeletePlayerSuccessResponse' + return_type = opts[:debug_return_type] || 'InlineResponse201' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] new_options = opts.merge( - :operation => :"DefaultApi.delete_player", + :operation => :"DefaultApi.create_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -506,44 +520,42 @@ def delete_player_with_http_info(app_id, player_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#delete_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#create_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Segments - # Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard. + # Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. + # @param app_id [String] + # @param user [User] # @param [Hash] opts the optional parameters - # @return [DeleteSegmentSuccessResponse] - def delete_segments(app_id, segment_id, opts = {}) - data, _status_code, _headers = delete_segments_with_http_info(app_id, segment_id, opts) + # @return [User] + def create_user(app_id, user, opts = {}) + data, _status_code, _headers = create_user_with_http_info(app_id, user, opts) data end - # Delete Segments - # Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard. + # Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. + # @param app_id [String] + # @param user [User] # @param [Hash] opts the optional parameters - # @return [Array<(DeleteSegmentSuccessResponse, Integer, Hash)>] DeleteSegmentSuccessResponse data, response status code and response headers - def delete_segments_with_http_info(app_id, segment_id, opts = {}) + # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers + def create_user_with_http_info(app_id, user, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.delete_segments ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.create_user ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_segments" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_user" end - # verify the required parameter 'segment_id' is set - if @api_client.config.client_side_validation && segment_id.nil? - fail ArgumentError, "Missing the required parameter 'segment_id' when calling DefaultApi.delete_segments" + # verify the required parameter 'user' is set + if @api_client.config.client_side_validation && user.nil? + fail ArgumentError, "Missing the required parameter 'user' when calling DefaultApi.create_user" end # resource path - local_var_path = '/apps/{app_id}/segments/{segment_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'segment_id' + '}', CGI.escape(segment_id.to_s)) + local_var_path = '/apps/{app_id}/users'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -552,21 +564,26 @@ def delete_segments_with_http_info(app_id, segment_id, opts = {}) header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user) # return_type - return_type = opts[:debug_return_type] || 'DeleteSegmentSuccessResponse' + return_type = opts[:debug_return_type] || 'User' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] new_options = opts.merge( - :operation => :"DefaultApi.delete_segments", + :operation => :"DefaultApi.create_user", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -575,50 +592,54 @@ def delete_segments_with_http_info(app_id, segment_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#delete_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Stop Live Activity - # Stops a Live Activity - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param activity_id [String] Live Activity record ID - # @param subscription_id [String] Subscription ID + # Deletes an alias by alias label + # @param app_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param alias_label_to_delete [String] # @param [Hash] opts the optional parameters - # @return [nil] - def end_live_activity(app_id, activity_id, subscription_id, opts = {}) - end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts) - nil + # @return [InlineResponse200] + def delete_alias(app_id, alias_label, alias_id, alias_label_to_delete, opts = {}) + data, _status_code, _headers = delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts) + data end - # Stop Live Activity - # Stops a Live Activity - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param activity_id [String] Live Activity record ID - # @param subscription_id [String] Subscription ID + # Deletes an alias by alias label + # @param app_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param alias_label_to_delete [String] # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts = {}) + # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers + def delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.end_live_activity ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.delete_alias ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.end_live_activity" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_alias" end - # verify the required parameter 'activity_id' is set - if @api_client.config.client_side_validation && activity_id.nil? - fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.end_live_activity" + # verify the required parameter 'alias_label' is set + if @api_client.config.client_side_validation && alias_label.nil? + fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.delete_alias" end - # verify the required parameter 'subscription_id' is set - if @api_client.config.client_side_validation && subscription_id.nil? - fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.end_live_activity" + # verify the required parameter 'alias_id' is set + if @api_client.config.client_side_validation && alias_id.nil? + fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.delete_alias" + end + # verify the required parameter 'alias_label_to_delete' is set + if @api_client.config.client_side_validation && alias_label_to_delete.nil? + fail ArgumentError, "Missing the required parameter 'alias_label_to_delete' when calling DefaultApi.delete_alias" end # resource path - local_var_path = '/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_id' + '}', CGI.escape(activity_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) + local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)).sub('{' + 'alias_label_to_delete' + '}', CGI.escape(alias_label_to_delete.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -635,13 +656,13 @@ def end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'InlineResponse200' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] new_options = opts.merge( - :operation => :"DefaultApi.end_live_activity", + :operation => :"DefaultApi.delete_alias", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -652,66 +673,66 @@ def end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#end_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#delete_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # CSV export - # Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | - # @param app_id [String] The app ID that you want to export devices from + # Delete a user record + # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. + # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. + # @param player_id [String] The OneSignal player_id # @param [Hash] opts the optional parameters - # @option opts [ExportPlayersRequestBody] :export_players_request_body - # @return [ExportPlayersSuccessResponse] - def export_players(app_id, opts = {}) - data, _status_code, _headers = export_players_with_http_info(app_id, opts) + # @return [DeletePlayerSuccessResponse] + def delete_player(app_id, player_id, opts = {}) + data, _status_code, _headers = delete_player_with_http_info(app_id, player_id, opts) data end - # CSV export - # Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | - # @param app_id [String] The app ID that you want to export devices from + # Delete a user record + # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. + # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. + # @param player_id [String] The OneSignal player_id # @param [Hash] opts the optional parameters - # @option opts [ExportPlayersRequestBody] :export_players_request_body - # @return [Array<(ExportPlayersSuccessResponse, Integer, Hash)>] ExportPlayersSuccessResponse data, response status code and response headers - def export_players_with_http_info(app_id, opts = {}) + # @return [Array<(DeletePlayerSuccessResponse, Integer, Hash)>] DeletePlayerSuccessResponse data, response status code and response headers + def delete_player_with_http_info(app_id, player_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.export_players ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.delete_player ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_players" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_player" + end + # verify the required parameter 'player_id' is set + if @api_client.config.client_side_validation && player_id.nil? + fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.delete_player" end # resource path - local_var_path = '/players/csv_export?app_id={app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) + local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s)) # query parameters query_params = opts[:query_params] || {} + query_params[:'app_id'] = app_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - content_type = @api_client.select_header_content_type(['application/json']) - if !content_type.nil? - header_params['Content-Type'] = content_type - end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'export_players_request_body']) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'ExportPlayersSuccessResponse' + return_type = opts[:debug_return_type] || 'DeletePlayerSuccessResponse' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] new_options = opts.merge( - :operation => :"DefaultApi.export_players", + :operation => :"DefaultApi.delete_player", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -720,38 +741,44 @@ def export_players_with_http_info(app_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#export_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#delete_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # View an app - # View the details of a single OneSignal app - # @param app_id [String] An app id + # Delete Segments + # Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. + # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. + # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard. # @param [Hash] opts the optional parameters - # @return [App] - def get_app(app_id, opts = {}) - data, _status_code, _headers = get_app_with_http_info(app_id, opts) + # @return [DeleteSegmentSuccessResponse] + def delete_segments(app_id, segment_id, opts = {}) + data, _status_code, _headers = delete_segments_with_http_info(app_id, segment_id, opts) data end - # View an app - # View the details of a single OneSignal app - # @param app_id [String] An app id + # Delete Segments + # Delete segments (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard. + # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. + # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard. # @param [Hash] opts the optional parameters - # @return [Array<(App, Integer, Hash)>] App data, response status code and response headers - def get_app_with_http_info(app_id, opts = {}) + # @return [Array<(DeleteSegmentSuccessResponse, Integer, Hash)>] DeleteSegmentSuccessResponse data, response status code and response headers + def delete_segments_with_http_info(app_id, segment_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.get_app ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.delete_segments ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_app" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_segments" + end + # verify the required parameter 'segment_id' is set + if @api_client.config.client_side_validation && segment_id.nil? + fail ArgumentError, "Missing the required parameter 'segment_id' when calling DefaultApi.delete_segments" end # resource path - local_var_path = '/apps/{app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) + local_var_path = '/apps/{app_id}/segments/{segment_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'segment_id' + '}', CGI.escape(segment_id.to_s)) # query parameters query_params = opts[:query_params] || {} @@ -768,13 +795,13 @@ def get_app_with_http_info(app_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'App' + return_type = opts[:debug_return_type] || 'DeleteSegmentSuccessResponse' # auth_names - auth_names = opts[:debug_auth_names] || ['user_key'] + auth_names = opts[:debug_auth_names] || ['app_key'] new_options = opts.merge( - :operation => :"DefaultApi.get_app", + :operation => :"DefaultApi.delete_segments", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -783,40 +810,48 @@ def get_app_with_http_info(app_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#get_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#delete_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # View apps - # View the details of all of your current OneSignal apps + # Deletes the Subscription. + # @param app_id [String] + # @param subscription_id [String] # @param [Hash] opts the optional parameters - # @return [Array] - def get_apps(opts = {}) - data, _status_code, _headers = get_apps_with_http_info(opts) - data + # @return [nil] + def delete_subscription(app_id, subscription_id, opts = {}) + delete_subscription_with_http_info(app_id, subscription_id, opts) + nil end - # View apps - # View the details of all of your current OneSignal apps + # Deletes the Subscription. + # @param app_id [String] + # @param subscription_id [String] # @param [Hash] opts the optional parameters - # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers - def get_apps_with_http_info(opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_subscription_with_http_info(app_id, subscription_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.get_apps ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.delete_subscription ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_subscription" + end + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.delete_subscription" end # resource path - local_var_path = '/apps' + local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} @@ -825,13 +860,13 @@ def get_apps_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'Array' + return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['user_key'] + auth_names = opts[:debug_auth_names] || ['app_key'] new_options = opts.merge( - :operation => :"DefaultApi.get_apps", + :operation => :"DefaultApi.delete_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -840,53 +875,54 @@ def get_apps_with_http_info(opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#get_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#delete_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # View notification - # View the details of a single notification and outcomes associated with it + # Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases # @param app_id [String] - # @param notification_id [String] + # @param alias_label [String] + # @param alias_id [String] # @param [Hash] opts the optional parameters - # @return [NotificationWithMeta] - def get_notification(app_id, notification_id, opts = {}) - data, _status_code, _headers = get_notification_with_http_info(app_id, notification_id, opts) - data + # @return [nil] + def delete_user(app_id, alias_label, alias_id, opts = {}) + delete_user_with_http_info(app_id, alias_label, alias_id, opts) + nil end - # View notification - # View the details of a single notification and outcomes associated with it + # Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases # @param app_id [String] - # @param notification_id [String] + # @param alias_label [String] + # @param alias_id [String] # @param [Hash] opts the optional parameters - # @return [Array<(NotificationWithMeta, Integer, Hash)>] NotificationWithMeta data, response status code and response headers - def get_notification_with_http_info(app_id, notification_id, opts = {}) + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_user_with_http_info(app_id, alias_label, alias_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.get_notification ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.delete_user ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_notification" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_user" end - # verify the required parameter 'notification_id' is set - if @api_client.config.client_side_validation && notification_id.nil? - fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.get_notification" + # verify the required parameter 'alias_label' is set + if @api_client.config.client_side_validation && alias_label.nil? + fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.delete_user" + end + # verify the required parameter 'alias_id' is set + if @api_client.config.client_side_validation && alias_id.nil? + fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.delete_user" end # resource path - local_var_path = '/notifications/{notification_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s)) + local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'app_id'] = app_id # header parameters header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} @@ -895,10 +931,625 @@ def get_notification_with_http_info(app_id, notification_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'NotificationWithMeta' + return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || ['app_key'] + auth_names = opts[:debug_auth_names] || [] + + new_options = opts.merge( + :operation => :"DefaultApi.delete_user", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Stop Live Activity + # Stops a Live Activity + # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. + # @param activity_id [String] Live Activity record ID + # @param subscription_id [String] Subscription ID + # @param [Hash] opts the optional parameters + # @return [nil] + def end_live_activity(app_id, activity_id, subscription_id, opts = {}) + end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts) + nil + end + + # Stop Live Activity + # Stops a Live Activity + # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. + # @param activity_id [String] Live Activity record ID + # @param subscription_id [String] Subscription ID + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.end_live_activity ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.end_live_activity" + end + # verify the required parameter 'activity_id' is set + if @api_client.config.client_side_validation && activity_id.nil? + fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.end_live_activity" + end + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.end_live_activity" + end + # resource path + local_var_path = '/apps/{app_id}/live_activities/{activity_id}/token/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_id' + '}', CGI.escape(activity_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['app_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.end_live_activity", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#end_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # CSV export + # Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. 🚧 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + # @param app_id [String] The app ID that you want to export devices from + # @param [Hash] opts the optional parameters + # @option opts [ExportPlayersRequestBody] :export_players_request_body + # @return [ExportPlayersSuccessResponse] + def export_players(app_id, opts = {}) + data, _status_code, _headers = export_players_with_http_info(app_id, opts) + data + end + + # CSV export + # Generate a compressed CSV export of all of your current user data This method can be used to generate a compressed CSV export of all of your current user data. It is a much faster alternative than retrieving this data using the /players API endpoint. The file will be compressed using GZip. The file may take several minutes to generate depending on the number of users in your app. The URL generated will be available for 3 days and includes random v4 uuid as part of the resource name to be unguessable. &#x1F6A7; 403 Error Responses You can test if it is complete by making a GET request to the csv_file_url value. This file may take time to generate depending on how many device records are being pulled. If the file is not ready, a 403 error will be returned. Otherwise the file itself will be returned. &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Concurrent Exports Only one concurrent export is allowed per OneSignal account. Please ensure you have successfully downloaded the .csv.gz file before exporting another app. CSV File Format: - Default Columns: | Field | Details | | --- | --- | | id | OneSignal Player Id | | identifier | Push Token | | session_count | Number of times they visited the app or site | language | Device language code | | timezone | Number of seconds away from UTC. Example: -28800 | | game_version | Version of your mobile app gathered from Android Studio versionCode in your App/build.gradle and iOS uses kCFBundleVersionKey in Xcode. | | device_os | Device Operating System Version. Example: 80 = Chrome 80, 9 = Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have `Linux armv` | | ad_id | Based on the Google Advertising Id for Android, identifierForVendor for iOS. OptedOut means user turned off Advertising tracking on the device. | | tags | Current OneSignal Data Tags on the device. | | last_active | Date and time the user last opened the mobile app or visited the site. | | playtime | Total amount of time in seconds the user had the mobile app open. | | amount_spent | Mobile only - amount spent in USD on In-App Purchases. | | created_at | Date and time the device record was created in OneSignal. Mobile - first time they opened the app with OneSignal SDK. Web - first time the user subscribed to the site. | | invalid_identifier | t = unsubscribed, f = subscibed | | badge_count | Current number of badges on the device | - Extra Columns: | Field | Details | | --- | --- | | external_user_id | Your User Id set on the device | | notification_types | Notification types | | location | Location points (Latitude and Longitude) set on the device. | | country | Country code | | rooted | Android device rooted or not | | ip | IP Address of the device if being tracked. See Handling Personal Data. | | web_auth | Web Only authorization key. | | web_p256 | Web Only p256 key. | + # @param app_id [String] The app ID that you want to export devices from + # @param [Hash] opts the optional parameters + # @option opts [ExportPlayersRequestBody] :export_players_request_body + # @return [Array<(ExportPlayersSuccessResponse, Integer, Hash)>] ExportPlayersSuccessResponse data, response status code and response headers + def export_players_with_http_info(app_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.export_players ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_players" + end + # resource path + local_var_path = '/players/csv_export?app_id={app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'export_players_request_body']) + + # return_type + return_type = opts[:debug_return_type] || 'ExportPlayersSuccessResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['app_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.export_players", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#export_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Lists all Aliases for the User identified by :subscription_id. + # @param app_id [String] + # @param subscription_id [String] + # @param [Hash] opts the optional parameters + # @return [UserIdentityResponse] + def fetch_aliases(app_id, subscription_id, opts = {}) + data, _status_code, _headers = fetch_aliases_with_http_info(app_id, subscription_id, opts) + data + end + + # Lists all Aliases for the User identified by :subscription_id. + # @param app_id [String] + # @param subscription_id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers + def fetch_aliases_with_http_info(app_id, subscription_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_aliases ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_aliases" + end + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.fetch_aliases" + end + # resource path + local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'UserIdentityResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || ['app_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.fetch_aliases", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#fetch_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Returns the User’s properties, Aliases, and Subscriptions. + # @param app_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param [Hash] opts the optional parameters + # @return [User] + def fetch_user(app_id, alias_label, alias_id, opts = {}) + data, _status_code, _headers = fetch_user_with_http_info(app_id, alias_label, alias_id, opts) + data + end + + # Returns the User’s properties, Aliases, and Subscriptions. + # @param app_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers + def fetch_user_with_http_info(app_id, alias_label, alias_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_user ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_user" + end + # verify the required parameter 'alias_label' is set + if @api_client.config.client_side_validation && alias_label.nil? + fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.fetch_user" + end + # verify the required parameter 'alias_id' is set + if @api_client.config.client_side_validation && alias_id.nil? + fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.fetch_user" + end + # resource path + local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'User' + + # auth_names + auth_names = opts[:debug_auth_names] || ['app_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.fetch_user", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#fetch_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Lists all Aliases for the User identified by (:alias_label, :alias_id). + # @param app_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param [Hash] opts the optional parameters + # @return [InlineResponse200] + def fetch_user_identity(app_id, alias_label, alias_id, opts = {}) + data, _status_code, _headers = fetch_user_identity_with_http_info(app_id, alias_label, alias_id, opts) + data + end + + # Lists all Aliases for the User identified by (:alias_label, :alias_id). + # @param app_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers + def fetch_user_identity_with_http_info(app_id, alias_label, alias_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_user_identity ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_user_identity" + end + # verify the required parameter 'alias_label' is set + if @api_client.config.client_side_validation && alias_label.nil? + fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.fetch_user_identity" + end + # verify the required parameter 'alias_id' is set + if @api_client.config.client_side_validation && alias_id.nil? + fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.fetch_user_identity" + end + # resource path + local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'InlineResponse200' + + # auth_names + auth_names = opts[:debug_auth_names] || ['app_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.fetch_user_identity", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#fetch_user_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # View an app + # View the details of a single OneSignal app + # @param app_id [String] An app id + # @param [Hash] opts the optional parameters + # @return [App] + def get_app(app_id, opts = {}) + data, _status_code, _headers = get_app_with_http_info(app_id, opts) + data + end + + # View an app + # View the details of a single OneSignal app + # @param app_id [String] An app id + # @param [Hash] opts the optional parameters + # @return [Array<(App, Integer, Hash)>] App data, response status code and response headers + def get_app_with_http_info(app_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.get_app ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_app" + end + # resource path + local_var_path = '/apps/{app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'App' + + # auth_names + auth_names = opts[:debug_auth_names] || ['user_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.get_app", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#get_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # View apps + # View the details of all of your current OneSignal apps + # @param [Hash] opts the optional parameters + # @return [Array] + def get_apps(opts = {}) + data, _status_code, _headers = get_apps_with_http_info(opts) + data + end + + # View apps + # View the details of all of your current OneSignal apps + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def get_apps_with_http_info(opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.get_apps ...' + end + # resource path + local_var_path = '/apps' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Array' + + # auth_names + auth_names = opts[:debug_auth_names] || ['user_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.get_apps", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#get_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Manifest of In-App Messages the Subscription is eligible to display by the SDK. + # @param app_id [String] + # @param subscription_id [String] + # @param [Hash] opts the optional parameters + # @return [InlineResponse2003] + def get_eligible_iams(app_id, subscription_id, opts = {}) + data, _status_code, _headers = get_eligible_iams_with_http_info(app_id, subscription_id, opts) + data + end + + # Manifest of In-App Messages the Subscription is eligible to display by the SDK. + # @param app_id [String] + # @param subscription_id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers + def get_eligible_iams_with_http_info(app_id, subscription_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.get_eligible_iams ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_eligible_iams" + end + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.get_eligible_iams" + end + # resource path + local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/iams'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'InlineResponse2003' + + # auth_names + auth_names = opts[:debug_auth_names] || ['app_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.get_eligible_iams", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#get_eligible_iams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # View notification + # View the details of a single notification and outcomes associated with it + # @param app_id [String] + # @param notification_id [String] + # @param [Hash] opts the optional parameters + # @return [NotificationWithMeta] + def get_notification(app_id, notification_id, opts = {}) + data, _status_code, _headers = get_notification_with_http_info(app_id, notification_id, opts) + data + end + + # View notification + # View the details of a single notification and outcomes associated with it + # @param app_id [String] + # @param notification_id [String] + # @param [Hash] opts the optional parameters + # @return [Array<(NotificationWithMeta, Integer, Hash)>] NotificationWithMeta data, response status code and response headers + def get_notification_with_http_info(app_id, notification_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.get_notification ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_notification" + end + # verify the required parameter 'notification_id' is set + if @api_client.config.client_side_validation && notification_id.nil? + fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.get_notification" + end + # resource path + local_var_path = '/notifications/{notification_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'app_id'] = app_id + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'NotificationWithMeta' + + # auth_names + auth_names = opts[:debug_auth_names] || ['app_key'] new_options = opts.merge( :operation => :"DefaultApi.get_notification", @@ -1014,25 +1665,250 @@ def get_notifications(app_id, opts = {}) # @return [Array<(NotificationSlice, Integer, Hash)>] NotificationSlice data, response status code and response headers def get_notifications_with_http_info(app_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.get_notifications ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.get_notifications ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_notifications" + end + allowable_values = [0, 1, 3] + if @api_client.config.client_side_validation && opts[:'kind'] && !allowable_values.include?(opts[:'kind']) + fail ArgumentError, "invalid value for \"kind\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/notifications' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'app_id'] = app_id + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? + query_params[:'kind'] = opts[:'kind'] if !opts[:'kind'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'NotificationSlice' + + # auth_names + auth_names = opts[:debug_auth_names] || ['app_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.get_notifications", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#get_notifications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # View Outcomes + # View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. + # @param outcome_names [String] Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum + # @param [Hash] opts the optional parameters + # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. + # @option opts [String] :outcome_time_range Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. + # @option opts [String] :outcome_platforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. + # @option opts [String] :outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. + # @return [OutcomesData] + def get_outcomes(app_id, outcome_names, opts = {}) + data, _status_code, _headers = get_outcomes_with_http_info(app_id, outcome_names, opts) + data + end + + # View Outcomes + # View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. + # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. + # @param outcome_names [String] Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum + # @param [Hash] opts the optional parameters + # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. + # @option opts [String] :outcome_time_range Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. + # @option opts [String] :outcome_platforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. + # @option opts [String] :outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. + # @return [Array<(OutcomesData, Integer, Hash)>] OutcomesData data, response status code and response headers + def get_outcomes_with_http_info(app_id, outcome_names, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.get_outcomes ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_outcomes" + end + # verify the required parameter 'outcome_names' is set + if @api_client.config.client_side_validation && outcome_names.nil? + fail ArgumentError, "Missing the required parameter 'outcome_names' when calling DefaultApi.get_outcomes" + end + # resource path + local_var_path = '/apps/{app_id}/outcomes'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'outcome_names'] = outcome_names + query_params[:'outcome_names[]'] = opts[:'outcome_names2'] if !opts[:'outcome_names2'].nil? + query_params[:'outcome_time_range'] = opts[:'outcome_time_range'] if !opts[:'outcome_time_range'].nil? + query_params[:'outcome_platforms'] = opts[:'outcome_platforms'] if !opts[:'outcome_platforms'].nil? + query_params[:'outcome_attribution'] = opts[:'outcome_attribution'] if !opts[:'outcome_attribution'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OutcomesData' + + # auth_names + auth_names = opts[:debug_auth_names] || ['app_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.get_outcomes", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#get_outcomes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # View device + # View the details of an existing device in one of your OneSignal apps + # @param app_id [String] Your app_id for this device + # @param player_id [String] Player's OneSignal ID + # @param [Hash] opts the optional parameters + # @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11). + # @return [Player] + def get_player(app_id, player_id, opts = {}) + data, _status_code, _headers = get_player_with_http_info(app_id, player_id, opts) + data + end + + # View device + # View the details of an existing device in one of your OneSignal apps + # @param app_id [String] Your app_id for this device + # @param player_id [String] Player's OneSignal ID + # @param [Hash] opts the optional parameters + # @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11). + # @return [Array<(Player, Integer, Hash)>] Player data, response status code and response headers + def get_player_with_http_info(app_id, player_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.get_player ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_player" + end + # verify the required parameter 'player_id' is set + if @api_client.config.client_side_validation && player_id.nil? + fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.get_player" + end + # resource path + local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'app_id'] = app_id + query_params[:'email_auth_hash'] = opts[:'email_auth_hash'] if !opts[:'email_auth_hash'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'Player' + + # auth_names + auth_names = opts[:debug_auth_names] || ['app_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.get_player", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#get_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # View devices + # View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. + # @param app_id [String] The app ID that you want to view players from + # @param [Hash] opts the optional parameters + # @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300 + # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id; + # @return [PlayerSlice] + def get_players(app_id, opts = {}) + data, _status_code, _headers = get_players_with_http_info(app_id, opts) + data + end + + # View devices + # View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. + # @param app_id [String] The app ID that you want to view players from + # @param [Hash] opts the optional parameters + # @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300 + # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id; + # @return [Array<(PlayerSlice, Integer, Hash)>] PlayerSlice data, response status code and response headers + def get_players_with_http_info(app_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.get_players ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_notifications" - end - allowable_values = [0, 1, 3] - if @api_client.config.client_side_validation && opts[:'kind'] && !allowable_values.include?(opts[:'kind']) - fail ArgumentError, "invalid value for \"kind\", must be one of #{allowable_values}" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_players" end # resource path - local_var_path = '/notifications' + local_var_path = '/players' # query parameters query_params = opts[:query_params] || {} query_params[:'app_id'] = app_id query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? - query_params[:'kind'] = opts[:'kind'] if !opts[:'kind'].nil? # header parameters header_params = opts[:header_params] || {} @@ -1046,13 +1922,13 @@ def get_notifications_with_http_info(app_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'NotificationSlice' + return_type = opts[:debug_return_type] || 'PlayerSlice' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] new_options = opts.merge( - :operation => :"DefaultApi.get_notifications", + :operation => :"DefaultApi.get_players", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1063,78 +1939,80 @@ def get_notifications_with_http_info(app_id, opts = {}) data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#get_notifications\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#get_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # View Outcomes - # View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. 🚧 Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param outcome_names [String] Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum + # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). + # @param app_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param user_identity_request_body [UserIdentityRequestBody] # @param [Hash] opts the optional parameters - # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. - # @option opts [String] :outcome_time_range Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. - # @option opts [String] :outcome_platforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. - # @option opts [String] :outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. - # @return [OutcomesData] - def get_outcomes(app_id, outcome_names, opts = {}) - data, _status_code, _headers = get_outcomes_with_http_info(app_id, outcome_names, opts) + # @return [InlineResponse200] + def identify_user_by_alias(app_id, alias_label, alias_id, user_identity_request_body, opts = {}) + data, _status_code, _headers = identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body, opts) data end - # View Outcomes - # View the details of all the outcomes associated with your app &#x1F6A7; Requires Authentication Key Requires your OneSignal App's REST API Key, available in Keys & IDs. &#x1F6A7; Outcome Data Limitations Outcomes are only accessible for around 30 days before deleted from our servers. You will need to export this data every month if you want to keep it. - # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs. - # @param outcome_names [String] Required Comma-separated list of names and the value (sum/count) for the returned outcome data. Note: Clicks only support count aggregation. For out-of-the-box OneSignal outcomes such as click and session duration, please use the \"os\" prefix with two underscores. For other outcomes, please use the name specified by the user. Example:os__session_duration.count,os__click.count,CustomOutcomeName.sum + # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). + # @param app_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param user_identity_request_body [UserIdentityRequestBody] # @param [Hash] opts the optional parameters - # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]=os__click.count&outcome_names[]=Sales, Purchase.count where \"Sales, Purchase\" is the custom outcomes with a comma in the name. - # @option opts [String] :outcome_time_range Optional Time range for the returned data. The values can be 1h (for the last 1 hour data), 1d (for the last 1 day data), or 1mo (for the last 1 month data). Default is 1h if the parameter is omitted. - # @option opts [String] :outcome_platforms Optional Platform id. Refer device's platform ids for values. Example: outcome_platform=0 for iOS outcome_platform=7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted. - # @option opts [String] :outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution=direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted. - # @return [Array<(OutcomesData, Integer, Hash)>] OutcomesData data, response status code and response headers - def get_outcomes_with_http_info(app_id, outcome_names, opts = {}) + # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers + def identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.get_outcomes ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_alias ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_outcomes" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.identify_user_by_alias" end - # verify the required parameter 'outcome_names' is set - if @api_client.config.client_side_validation && outcome_names.nil? - fail ArgumentError, "Missing the required parameter 'outcome_names' when calling DefaultApi.get_outcomes" + # verify the required parameter 'alias_label' is set + if @api_client.config.client_side_validation && alias_label.nil? + fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.identify_user_by_alias" + end + # verify the required parameter 'alias_id' is set + if @api_client.config.client_side_validation && alias_id.nil? + fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.identify_user_by_alias" + end + # verify the required parameter 'user_identity_request_body' is set + if @api_client.config.client_side_validation && user_identity_request_body.nil? + fail ArgumentError, "Missing the required parameter 'user_identity_request_body' when calling DefaultApi.identify_user_by_alias" end # resource path - local_var_path = '/apps/{app_id}/outcomes'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)) + local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'outcome_names'] = outcome_names - query_params[:'outcome_names[]'] = opts[:'outcome_names2'] if !opts[:'outcome_names2'].nil? - query_params[:'outcome_time_range'] = opts[:'outcome_time_range'] if !opts[:'outcome_time_range'].nil? - query_params[:'outcome_platforms'] = opts[:'outcome_platforms'] if !opts[:'outcome_platforms'].nil? - query_params[:'outcome_attribution'] = opts[:'outcome_attribution'] if !opts[:'outcome_attribution'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_request_body) # return_type - return_type = opts[:debug_return_type] || 'OutcomesData' + return_type = opts[:debug_return_type] || 'InlineResponse200' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] new_options = opts.merge( - :operation => :"DefaultApi.get_outcomes", + :operation => :"DefaultApi.identify_user_by_alias", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1143,71 +2021,76 @@ def get_outcomes_with_http_info(app_id, outcome_names, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#get_outcomes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#identify_user_by_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # View device - # View the details of an existing device in one of your OneSignal apps - # @param app_id [String] Your app_id for this device - # @param player_id [String] Player's OneSignal ID + # Upserts one or more Aliases for the User identified by :subscription_id. + # @param app_id [String] + # @param subscription_id [String] + # @param user_identity_request_body [UserIdentityRequestBody] # @param [Hash] opts the optional parameters - # @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11). - # @return [Player] - def get_player(app_id, player_id, opts = {}) - data, _status_code, _headers = get_player_with_http_info(app_id, player_id, opts) + # @return [UserIdentityResponse] + def identify_user_by_subscription_id(app_id, subscription_id, user_identity_request_body, opts = {}) + data, _status_code, _headers = identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body, opts) data end - # View device - # View the details of an existing device in one of your OneSignal apps - # @param app_id [String] Your app_id for this device - # @param player_id [String] Player's OneSignal ID + # Upserts one or more Aliases for the User identified by :subscription_id. + # @param app_id [String] + # @param subscription_id [String] + # @param user_identity_request_body [UserIdentityRequestBody] # @param [Hash] opts the optional parameters - # @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11). - # @return [Array<(Player, Integer, Hash)>] Player data, response status code and response headers - def get_player_with_http_info(app_id, player_id, opts = {}) + # @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers + def identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.get_player ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_subscription_id ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_player" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.identify_user_by_subscription_id" end - # verify the required parameter 'player_id' is set - if @api_client.config.client_side_validation && player_id.nil? - fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.get_player" + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.identify_user_by_subscription_id" + end + # verify the required parameter 'user_identity_request_body' is set + if @api_client.config.client_side_validation && user_identity_request_body.nil? + fail ArgumentError, "Missing the required parameter 'user_identity_request_body' when calling DefaultApi.identify_user_by_subscription_id" end # resource path - local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s)) + local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/user/identity'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'app_id'] = app_id - query_params[:'email_auth_hash'] = opts[:'email_auth_hash'] if !opts[:'email_auth_hash'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_request_body) # return_type - return_type = opts[:debug_return_type] || 'Player' + return_type = opts[:debug_return_type] || 'UserIdentityResponse' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] new_options = opts.merge( - :operation => :"DefaultApi.get_player", + :operation => :"DefaultApi.identify_user_by_subscription_id", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1216,68 +2099,76 @@ def get_player_with_http_info(app_id, player_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#get_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#identify_user_by_subscription_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # View devices - # View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. - # @param app_id [String] The app ID that you want to view players from + # Transfers this Subscription to the User identified by the identity in the payload. + # @param app_id [String] + # @param subscription_id [String] + # @param transfer_subscription_request_body [TransferSubscriptionRequestBody] # @param [Hash] opts the optional parameters - # @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300 - # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id; - # @return [PlayerSlice] - def get_players(app_id, opts = {}) - data, _status_code, _headers = get_players_with_http_info(app_id, opts) + # @return [UserIdentityResponse] + def transfer_subscription(app_id, subscription_id, transfer_subscription_request_body, opts = {}) + data, _status_code, _headers = transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts) data end - # View devices - # View the details of multiple devices in one of your OneSignal apps Unavailable for Apps Over 80,000 Users For performance reasons, this method is not available for larger apps. Larger apps should use the CSV export API endpoint, which is much more performant. - # @param app_id [String] The app ID that you want to view players from + # Transfers this Subscription to the User identified by the identity in the payload. + # @param app_id [String] + # @param subscription_id [String] + # @param transfer_subscription_request_body [TransferSubscriptionRequestBody] # @param [Hash] opts the optional parameters - # @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300 - # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id; - # @return [Array<(PlayerSlice, Integer, Hash)>] PlayerSlice data, response status code and response headers - def get_players_with_http_info(app_id, opts = {}) + # @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers + def transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: DefaultApi.get_players ...' + @api_client.config.logger.debug 'Calling API: DefaultApi.transfer_subscription ...' end # verify the required parameter 'app_id' is set if @api_client.config.client_side_validation && app_id.nil? - fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_players" + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.transfer_subscription" + end + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.transfer_subscription" + end + # verify the required parameter 'transfer_subscription_request_body' is set + if @api_client.config.client_side_validation && transfer_subscription_request_body.nil? + fail ArgumentError, "Missing the required parameter 'transfer_subscription_request_body' when calling DefaultApi.transfer_subscription" end # resource path - local_var_path = '/players' + local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}/owner'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) # query parameters query_params = opts[:query_params] || {} - query_params[:'app_id'] = app_id - query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? - query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_subscription_request_body) # return_type - return_type = opts[:debug_return_type] || 'PlayerSlice' + return_type = opts[:debug_return_type] || 'UserIdentityResponse' # auth_names auth_names = opts[:debug_auth_names] || ['app_key'] new_options = opts.merge( - :operation => :"DefaultApi.get_players", + :operation => :"DefaultApi.transfer_subscription", :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1286,9 +2177,9 @@ def get_players_with_http_info(app_id, opts = {}) :return_type => return_type ) - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: DefaultApi#get_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: DefaultApi#transfer_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -1596,5 +2487,165 @@ def update_player_tags_with_http_info(app_id, external_user_id, opts = {}) end return data, status_code, headers end + + # Updates an existing Subscription’s properties. + # @param app_id [String] + # @param subscription_id [String] + # @param update_subscription_request_body [UpdateSubscriptionRequestBody] + # @param [Hash] opts the optional parameters + # @return [nil] + def update_subscription(app_id, subscription_id, update_subscription_request_body, opts = {}) + update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body, opts) + nil + end + + # Updates an existing Subscription’s properties. + # @param app_id [String] + # @param subscription_id [String] + # @param update_subscription_request_body [UpdateSubscriptionRequestBody] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.update_subscription ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_subscription" + end + # verify the required parameter 'subscription_id' is set + if @api_client.config.client_side_validation && subscription_id.nil? + fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.update_subscription" + end + # verify the required parameter 'update_subscription_request_body' is set + if @api_client.config.client_side_validation && update_subscription_request_body.nil? + fail ArgumentError, "Missing the required parameter 'update_subscription_request_body' when calling DefaultApi.update_subscription" + end + # resource path + local_var_path = '/apps/{app_id}/subscriptions/{subscription_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'subscription_id' + '}', CGI.escape(subscription_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_subscription_request_body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || ['app_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.update_subscription", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#update_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Updates an existing User’s properties. + # @param app_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param update_user_request [UpdateUserRequest] + # @param [Hash] opts the optional parameters + # @return [InlineResponse202] + def update_user(app_id, alias_label, alias_id, update_user_request, opts = {}) + data, _status_code, _headers = update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts) + data + end + + # Updates an existing User’s properties. + # @param app_id [String] + # @param alias_label [String] + # @param alias_id [String] + # @param update_user_request [UpdateUserRequest] + # @param [Hash] opts the optional parameters + # @return [Array<(InlineResponse202, Integer, Hash)>] InlineResponse202 data, response status code and response headers + def update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DefaultApi.update_user ...' + end + # verify the required parameter 'app_id' is set + if @api_client.config.client_side_validation && app_id.nil? + fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_user" + end + # verify the required parameter 'alias_label' is set + if @api_client.config.client_side_validation && alias_label.nil? + fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.update_user" + end + # verify the required parameter 'alias_id' is set + if @api_client.config.client_side_validation && alias_id.nil? + fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.update_user" + end + # verify the required parameter 'update_user_request' is set + if @api_client.config.client_side_validation && update_user_request.nil? + fail ArgumentError, "Missing the required parameter 'update_user_request' when calling DefaultApi.update_user" + end + # resource path + local_var_path = '/apps/{app_id}/users/by/{alias_label}/{alias_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'alias_label' + '}', CGI.escape(alias_label.to_s)).sub('{' + 'alias_id' + '}', CGI.escape(alias_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + content_type = @api_client.select_header_content_type(['application/json']) + if !content_type.nil? + header_params['Content-Type'] = content_type + end + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(update_user_request) + + # return_type + return_type = opts[:debug_return_type] || 'InlineResponse202' + + # auth_names + auth_names = opts[:debug_auth_names] || ['app_key'] + + new_options = opts.merge( + :operation => :"DefaultApi.update_user", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: DefaultApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/onesignal/api_client.rb b/lib/onesignal/api_client.rb index a2e1a83..e8a605b 100644 --- a/lib/onesignal/api_client.rb +++ b/lib/onesignal/api_client.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -90,7 +90,7 @@ def build_request(http_method, path, opts = {}) url = build_request_url(path, opts) http_method = http_method.to_sym.downcase - opts[:header_params]['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-ruby, version=1.0.2' + opts[:header_params]['OS-Usage-Data'] = 'kind=sdk, sdk-name=onesignal-ruby, version=1.2.1' header_params = @default_headers.merge(opts[:header_params] || {}) query_params = opts[:query_params] || {} form_params = opts[:form_params] || {} diff --git a/lib/onesignal/api_error.rb b/lib/onesignal/api_error.rb index e38197a..668197f 100644 --- a/lib/onesignal/api_error.rb +++ b/lib/onesignal/api_error.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/configuration.rb b/lib/onesignal/configuration.rb index 958d536..2b034a9 100644 --- a/lib/onesignal/configuration.rb +++ b/lib/onesignal/configuration.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/app.rb b/lib/onesignal/models/app.rb index 09765be..b85ed96 100644 --- a/lib/onesignal/models/app.rb +++ b/lib/onesignal/models/app.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -221,9 +221,14 @@ def self.openapi_nullable :'chrome_web_sub_domain', :'apns_env', :'apns_certificates', + :'apns_key_id', + :'apns_team_id', + :'apns_bundle_id', + :'apns_p8', :'safari_site_origin', :'safari_push_id', :'site_name', + :'basic_auth_key', ]) end diff --git a/lib/onesignal/models/bad_request_error.rb b/lib/onesignal/models/bad_request_error.rb index e42bff1..9d48b76 100644 --- a/lib/onesignal/models/bad_request_error.rb +++ b/lib/onesignal/models/bad_request_error.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/basic_notification.rb b/lib/onesignal/models/basic_notification.rb index bace90d..51c0358 100644 --- a/lib/onesignal/models/basic_notification.rb +++ b/lib/onesignal/models/basic_notification.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -51,6 +51,10 @@ class BasicNotification # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call attr_accessor :include_android_reg_ids + attr_accessor :include_aliases + + attr_accessor :target_channel + attr_accessor :id attr_accessor :value @@ -347,6 +351,8 @@ def self.attribute_map :'include_chrome_reg_ids' => :'include_chrome_reg_ids', :'include_chrome_web_reg_ids' => :'include_chrome_web_reg_ids', :'include_android_reg_ids' => :'include_android_reg_ids', + :'include_aliases' => :'include_aliases', + :'target_channel' => :'target_channel', :'id' => :'id', :'value' => :'value', :'name' => :'name', @@ -459,6 +465,8 @@ def self.openapi_types :'include_chrome_reg_ids' => :'Array', :'include_chrome_web_reg_ids' => :'Array', :'include_android_reg_ids' => :'Array', + :'include_aliases' => :'PlayerNotificationTargetIncludeAliases', + :'target_channel' => :'String', :'id' => :'String', :'value' => :'Integer', :'name' => :'String', @@ -556,6 +564,7 @@ def self.openapi_nullable Set.new([ :'include_player_ids', :'include_external_user_ids', + :'include_aliases', :'name', :'is_ios', :'is_android', @@ -567,6 +576,7 @@ def self.openapi_nullable :'is_wp_wns', :'is_adm', :'is_chrome', + :'external_id', :'contents', :'headings', :'subtitle', @@ -728,6 +738,14 @@ def initialize(attributes = {}) end end + if attributes.key?(:'include_aliases') + self.include_aliases = attributes[:'include_aliases'] + end + + if attributes.key?(:'target_channel') + self.target_channel = attributes[:'target_channel'] + end + if attributes.key?(:'id') self.id = attributes[:'id'] end @@ -1107,12 +1125,24 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + target_channel_validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) + return false unless target_channel_validator.valid?(@target_channel) aggregation_validator = EnumAttributeValidator.new('String', ["sum", "count"]) return false unless aggregation_validator.valid?(@aggregation) return false if @app_id.nil? true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] target_channel Object to be assigned + def target_channel=(target_channel) + validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) + unless validator.valid?(target_channel) + fail ArgumentError, "invalid value for \"target_channel\", must be one of #{validator.allowable_values}." + end + @target_channel = target_channel + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] aggregation Object to be assigned def aggregation=(aggregation) @@ -1140,6 +1170,8 @@ def ==(o) include_chrome_reg_ids == o.include_chrome_reg_ids && include_chrome_web_reg_ids == o.include_chrome_web_reg_ids && include_android_reg_ids == o.include_android_reg_ids && + include_aliases == o.include_aliases && + target_channel == o.target_channel && id == o.id && value == o.value && name == o.name && @@ -1240,7 +1272,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [included_segments, excluded_segments, include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, channel_for_external_user_ids, app_id, external_id, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, email_subject, email_body, email_from_name, email_from_address, sms_from, sms_media_urls, filters].hash + [included_segments, excluded_segments, include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, include_aliases, target_channel, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, channel_for_external_user_ids, app_id, external_id, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, email_subject, email_body, email_from_name, email_from_address, sms_from, sms_media_urls, filters].hash end # Builds the object from hash diff --git a/lib/onesignal/models/basic_notification_all_of.rb b/lib/onesignal/models/basic_notification_all_of.rb index effabc4..ac96c0d 100644 --- a/lib/onesignal/models/basic_notification_all_of.rb +++ b/lib/onesignal/models/basic_notification_all_of.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -505,6 +505,7 @@ def self.openapi_nullable :'is_wp_wns', :'is_adm', :'is_chrome', + :'external_id', :'contents', :'headings', :'subtitle', diff --git a/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb b/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb index 6df4477..8effb4d 100644 --- a/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb +++ b/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/begin_live_activity_request.rb b/lib/onesignal/models/begin_live_activity_request.rb index 961404c..92c4af9 100644 --- a/lib/onesignal/models/begin_live_activity_request.rb +++ b/lib/onesignal/models/begin_live_activity_request.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/button.rb b/lib/onesignal/models/button.rb index 7f32a2f..1436a3e 100644 --- a/lib/onesignal/models/button.rb +++ b/lib/onesignal/models/button.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/cancel_notification_success_response.rb b/lib/onesignal/models/cancel_notification_success_response.rb index 87988c9..8799acc 100644 --- a/lib/onesignal/models/cancel_notification_success_response.rb +++ b/lib/onesignal/models/cancel_notification_success_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/create_notification_success_response.rb b/lib/onesignal/models/create_notification_success_response.rb index 696590f..7fe1e11 100644 --- a/lib/onesignal/models/create_notification_success_response.rb +++ b/lib/onesignal/models/create_notification_success_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -92,22 +92,12 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if @id.nil? - invalid_properties.push('invalid value for "id", id cannot be nil.') - end - - if @recipients.nil? - invalid_properties.push('invalid value for "recipients", recipients cannot be nil.') - end - invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - return false if @id.nil? - return false if @recipients.nil? true end diff --git a/lib/onesignal/models/create_player_success_response.rb b/lib/onesignal/models/create_player_success_response.rb index 24ae2be..1f6e9ef 100644 --- a/lib/onesignal/models/create_player_success_response.rb +++ b/lib/onesignal/models/create_player_success_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/create_segment_conflict_response.rb b/lib/onesignal/models/create_segment_conflict_response.rb index 5b21c69..8ae2dde 100644 --- a/lib/onesignal/models/create_segment_conflict_response.rb +++ b/lib/onesignal/models/create_segment_conflict_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/create_segment_success_response.rb b/lib/onesignal/models/create_segment_success_response.rb index ed0039c..edd6e70 100644 --- a/lib/onesignal/models/create_segment_success_response.rb +++ b/lib/onesignal/models/create_segment_success_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/create_subscription_request_body.rb b/lib/onesignal/models/create_subscription_request_body.rb new file mode 100644 index 0000000..96b7dfd --- /dev/null +++ b/lib/onesignal/models/create_subscription_request_body.rb @@ -0,0 +1,228 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class CreateSubscriptionRequestBody + attr_accessor :subscription + + attr_accessor :retain_previous_owner + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'subscription' => :'subscription', + :'retain_previous_owner' => :'retain_previous_owner' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'subscription' => :'SubscriptionObject', + :'retain_previous_owner' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::CreateSubscriptionRequestBody` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::CreateSubscriptionRequestBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'subscription') + self.subscription = attributes[:'subscription'] + end + + if attributes.key?(:'retain_previous_owner') + self.retain_previous_owner = attributes[:'retain_previous_owner'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + subscription == o.subscription && + retain_previous_owner == o.retain_previous_owner + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [subscription, retain_previous_owner].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/create_user_conflict_response.rb b/lib/onesignal/models/create_user_conflict_response.rb new file mode 100644 index 0000000..84f1b29 --- /dev/null +++ b/lib/onesignal/models/create_user_conflict_response.rb @@ -0,0 +1,221 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class CreateUserConflictResponse + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'errors' => :'errors' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::CreateUserConflictResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::CreateUserConflictResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + errors == o.errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/create_user_conflict_response_errors_inner.rb b/lib/onesignal/models/create_user_conflict_response_errors_inner.rb new file mode 100644 index 0000000..d9b03b9 --- /dev/null +++ b/lib/onesignal/models/create_user_conflict_response_errors_inner.rb @@ -0,0 +1,237 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class CreateUserConflictResponseErrorsInner + attr_accessor :code + + attr_accessor :title + + attr_accessor :meta + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'title' => :'title', + :'meta' => :'meta' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'title' => :'String', + :'meta' => :'CreateUserConflictResponseErrorsItemsMeta' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::CreateUserConflictResponseErrorsInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::CreateUserConflictResponseErrorsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + title == o.title && + meta == o.meta + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, title, meta].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb b/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb new file mode 100644 index 0000000..0c47956 --- /dev/null +++ b/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb @@ -0,0 +1,219 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class CreateUserConflictResponseErrorsItemsMeta + attr_accessor :conflicting_aliases + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'conflicting_aliases' => :'conflicting_aliases' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'conflicting_aliases' => :'Object' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::CreateUserConflictResponseErrorsItemsMeta` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::CreateUserConflictResponseErrorsItemsMeta`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'conflicting_aliases') + self.conflicting_aliases = attributes[:'conflicting_aliases'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + conflicting_aliases == o.conflicting_aliases + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [conflicting_aliases].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/delete_player_not_found_response.rb b/lib/onesignal/models/delete_player_not_found_response.rb index ebec7ff..b489955 100644 --- a/lib/onesignal/models/delete_player_not_found_response.rb +++ b/lib/onesignal/models/delete_player_not_found_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/delete_player_success_response.rb b/lib/onesignal/models/delete_player_success_response.rb index 463d07d..00d2365 100644 --- a/lib/onesignal/models/delete_player_success_response.rb +++ b/lib/onesignal/models/delete_player_success_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/delete_segment_not_found_response.rb b/lib/onesignal/models/delete_segment_not_found_response.rb index 27a4af6..deb2ec8 100644 --- a/lib/onesignal/models/delete_segment_not_found_response.rb +++ b/lib/onesignal/models/delete_segment_not_found_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/delete_segment_success_response.rb b/lib/onesignal/models/delete_segment_success_response.rb index 3edf497..92fc4d5 100644 --- a/lib/onesignal/models/delete_segment_success_response.rb +++ b/lib/onesignal/models/delete_segment_success_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/delivery_data.rb b/lib/onesignal/models/delivery_data.rb index 5451d8f..f8a1895 100644 --- a/lib/onesignal/models/delivery_data.rb +++ b/lib/onesignal/models/delivery_data.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/export_players_request_body.rb b/lib/onesignal/models/export_players_request_body.rb index 78cbb5b..01ba661 100644 --- a/lib/onesignal/models/export_players_request_body.rb +++ b/lib/onesignal/models/export_players_request_body.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/export_players_success_response.rb b/lib/onesignal/models/export_players_success_response.rb index 77d7c6f..34595ad 100644 --- a/lib/onesignal/models/export_players_success_response.rb +++ b/lib/onesignal/models/export_players_success_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/filter.rb b/lib/onesignal/models/filter.rb index 0d0e9fe..e708237 100644 --- a/lib/onesignal/models/filter.rb +++ b/lib/onesignal/models/filter.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/filter_expressions.rb b/lib/onesignal/models/filter_expressions.rb index 153192c..5d2841f 100644 --- a/lib/onesignal/models/filter_expressions.rb +++ b/lib/onesignal/models/filter_expressions.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/get_notification_request_body.rb b/lib/onesignal/models/get_notification_request_body.rb index 88a976e..e4e90cb 100644 --- a/lib/onesignal/models/get_notification_request_body.rb +++ b/lib/onesignal/models/get_notification_request_body.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/identify_user_conflict_response.rb b/lib/onesignal/models/identify_user_conflict_response.rb new file mode 100644 index 0000000..b92111a --- /dev/null +++ b/lib/onesignal/models/identify_user_conflict_response.rb @@ -0,0 +1,221 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class IdentifyUserConflictResponse + attr_accessor :errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'errors' => :'errors' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'errors' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::IdentifyUserConflictResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::IdentifyUserConflictResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + errors == o.errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/identify_user_conflict_response_errors_inner.rb b/lib/onesignal/models/identify_user_conflict_response_errors_inner.rb new file mode 100644 index 0000000..21221b6 --- /dev/null +++ b/lib/onesignal/models/identify_user_conflict_response_errors_inner.rb @@ -0,0 +1,228 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class IdentifyUserConflictResponseErrorsInner + attr_accessor :code + + attr_accessor :title + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'code', + :'title' => :'title' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'title' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::IdentifyUserConflictResponseErrorsInner` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::IdentifyUserConflictResponseErrorsInner`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + title == o.title + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, title].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/inline_response200.rb b/lib/onesignal/models/inline_response200.rb new file mode 100644 index 0000000..8efe4dd --- /dev/null +++ b/lib/onesignal/models/inline_response200.rb @@ -0,0 +1,221 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class InlineResponse200 + attr_accessor :identity + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'identity' => :'identity' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'identity' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse200` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse200`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'identity') + if (value = attributes[:'identity']).is_a?(Hash) + self.identity = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + identity == o.identity + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [identity].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/inline_response2003.rb b/lib/onesignal/models/inline_response2003.rb new file mode 100644 index 0000000..2d3048b --- /dev/null +++ b/lib/onesignal/models/inline_response2003.rb @@ -0,0 +1,221 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class InlineResponse2003 + attr_accessor :in_app_messages + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'in_app_messages' => :'in_app_messages' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'in_app_messages' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse2003` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse2003`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'in_app_messages') + if (value = attributes[:'in_app_messages']).is_a?(Array) + self.in_app_messages = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + in_app_messages == o.in_app_messages + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [in_app_messages].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/inline_response201.rb b/lib/onesignal/models/inline_response201.rb new file mode 100644 index 0000000..0cc48ed --- /dev/null +++ b/lib/onesignal/models/inline_response201.rb @@ -0,0 +1,219 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class InlineResponse201 + attr_accessor :subscription + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'subscription' => :'subscription' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'subscription' => :'SubscriptionObject' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse201` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse201`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'subscription') + self.subscription = attributes[:'subscription'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + subscription == o.subscription + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [subscription].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/inline_response202.rb b/lib/onesignal/models/inline_response202.rb new file mode 100644 index 0000000..be3430b --- /dev/null +++ b/lib/onesignal/models/inline_response202.rb @@ -0,0 +1,219 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class InlineResponse202 + attr_accessor :properties + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'properties' => :'properties' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'properties' => :'PropertiesObject' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse202` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse202`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'properties') + self.properties = attributes[:'properties'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + properties == o.properties + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [properties].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/invalid_identifier_error.rb b/lib/onesignal/models/invalid_identifier_error.rb index cc0fb5c..9bed1a6 100644 --- a/lib/onesignal/models/invalid_identifier_error.rb +++ b/lib/onesignal/models/invalid_identifier_error.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/notification.rb b/lib/onesignal/models/notification.rb index f2af407..19c5c3e 100644 --- a/lib/onesignal/models/notification.rb +++ b/lib/onesignal/models/notification.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -51,6 +51,10 @@ class Notification # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call attr_accessor :include_android_reg_ids + attr_accessor :include_aliases + + attr_accessor :target_channel + attr_accessor :id attr_accessor :value @@ -350,6 +354,8 @@ def self.attribute_map :'include_chrome_reg_ids' => :'include_chrome_reg_ids', :'include_chrome_web_reg_ids' => :'include_chrome_web_reg_ids', :'include_android_reg_ids' => :'include_android_reg_ids', + :'include_aliases' => :'include_aliases', + :'target_channel' => :'target_channel', :'id' => :'id', :'value' => :'value', :'name' => :'name', @@ -463,6 +469,8 @@ def self.openapi_types :'include_chrome_reg_ids' => :'Array', :'include_chrome_web_reg_ids' => :'Array', :'include_android_reg_ids' => :'Array', + :'include_aliases' => :'PlayerNotificationTargetIncludeAliases', + :'target_channel' => :'String', :'id' => :'String', :'value' => :'Integer', :'name' => :'String', @@ -561,6 +569,7 @@ def self.openapi_nullable Set.new([ :'include_player_ids', :'include_external_user_ids', + :'include_aliases', :'name', :'is_ios', :'is_android', @@ -572,6 +581,7 @@ def self.openapi_nullable :'is_wp_wns', :'is_adm', :'is_chrome', + :'external_id', :'contents', :'headings', :'subtitle', @@ -734,6 +744,14 @@ def initialize(attributes = {}) end end + if attributes.key?(:'include_aliases') + self.include_aliases = attributes[:'include_aliases'] + end + + if attributes.key?(:'target_channel') + self.target_channel = attributes[:'target_channel'] + end + if attributes.key?(:'id') self.id = attributes[:'id'] end @@ -1117,12 +1135,24 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + target_channel_validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) + return false unless target_channel_validator.valid?(@target_channel) aggregation_validator = EnumAttributeValidator.new('String', ["sum", "count"]) return false unless aggregation_validator.valid?(@aggregation) return false if @app_id.nil? true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] target_channel Object to be assigned + def target_channel=(target_channel) + validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) + unless validator.valid?(target_channel) + fail ArgumentError, "invalid value for \"target_channel\", must be one of #{validator.allowable_values}." + end + @target_channel = target_channel + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] aggregation Object to be assigned def aggregation=(aggregation) @@ -1150,6 +1180,8 @@ def ==(o) include_chrome_reg_ids == o.include_chrome_reg_ids && include_chrome_web_reg_ids == o.include_chrome_web_reg_ids && include_android_reg_ids == o.include_android_reg_ids && + include_aliases == o.include_aliases && + target_channel == o.target_channel && id == o.id && value == o.value && name == o.name && @@ -1251,7 +1283,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [included_segments, excluded_segments, include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, channel_for_external_user_ids, app_id, external_id, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, email_subject, email_body, email_from_name, email_from_address, sms_from, sms_media_urls, filters, send_after].hash + [included_segments, excluded_segments, include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, include_aliases, target_channel, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, channel_for_external_user_ids, app_id, external_id, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, email_subject, email_body, email_from_name, email_from_address, sms_from, sms_media_urls, filters, send_after].hash end # Builds the object from hash diff --git a/lib/onesignal/models/notification200_errors.rb b/lib/onesignal/models/notification200_errors.rb index 49b3a0e..6b7b05d 100644 --- a/lib/onesignal/models/notification200_errors.rb +++ b/lib/onesignal/models/notification200_errors.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/notification_all_of.rb b/lib/onesignal/models/notification_all_of.rb index e056969..65ab5eb 100644 --- a/lib/onesignal/models/notification_all_of.rb +++ b/lib/onesignal/models/notification_all_of.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/notification_history_success_response.rb b/lib/onesignal/models/notification_history_success_response.rb index 18cc3d3..b657641 100644 --- a/lib/onesignal/models/notification_history_success_response.rb +++ b/lib/onesignal/models/notification_history_success_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/notification_slice.rb b/lib/onesignal/models/notification_slice.rb index 5ad0147..a13a2b5 100644 --- a/lib/onesignal/models/notification_slice.rb +++ b/lib/onesignal/models/notification_slice.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/notification_target.rb b/lib/onesignal/models/notification_target.rb index cd820a8..a90eef6 100644 --- a/lib/onesignal/models/notification_target.rb +++ b/lib/onesignal/models/notification_target.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -51,6 +51,32 @@ class NotificationTarget # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call attr_accessor :include_android_reg_ids + attr_accessor :include_aliases + + attr_accessor :target_channel + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -65,7 +91,9 @@ def self.attribute_map :'include_amazon_reg_ids' => :'include_amazon_reg_ids', :'include_chrome_reg_ids' => :'include_chrome_reg_ids', :'include_chrome_web_reg_ids' => :'include_chrome_web_reg_ids', - :'include_android_reg_ids' => :'include_android_reg_ids' + :'include_android_reg_ids' => :'include_android_reg_ids', + :'include_aliases' => :'include_aliases', + :'target_channel' => :'target_channel' } end @@ -88,7 +116,9 @@ def self.openapi_types :'include_amazon_reg_ids' => :'Array', :'include_chrome_reg_ids' => :'Array', :'include_chrome_web_reg_ids' => :'Array', - :'include_android_reg_ids' => :'Array' + :'include_android_reg_ids' => :'Array', + :'include_aliases' => :'PlayerNotificationTargetIncludeAliases', + :'target_channel' => :'String' } end @@ -97,6 +127,7 @@ def self.openapi_nullable Set.new([ :'include_player_ids', :'include_external_user_ids', + :'include_aliases', ]) end @@ -194,6 +225,14 @@ def initialize(attributes = {}) self.include_android_reg_ids = value end end + + if attributes.key?(:'include_aliases') + self.include_aliases = attributes[:'include_aliases'] + end + + if attributes.key?(:'target_channel') + self.target_channel = attributes[:'target_channel'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -206,6 +245,8 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + target_channel_validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) + return false unless target_channel_validator.valid?(@target_channel) _any_of_found = false self.class.openapi_any_of.each do |_class| _any_of = OneSignal.const_get(_class).build_from_hash(self.to_hash) @@ -221,6 +262,16 @@ def valid? true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] target_channel Object to be assigned + def target_channel=(target_channel) + validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) + unless validator.valid?(target_channel) + fail ArgumentError, "invalid value for \"target_channel\", must be one of #{validator.allowable_values}." + end + @target_channel = target_channel + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -237,7 +288,9 @@ def ==(o) include_amazon_reg_ids == o.include_amazon_reg_ids && include_chrome_reg_ids == o.include_chrome_reg_ids && include_chrome_web_reg_ids == o.include_chrome_web_reg_ids && - include_android_reg_ids == o.include_android_reg_ids + include_android_reg_ids == o.include_android_reg_ids && + include_aliases == o.include_aliases && + target_channel == o.target_channel end # @see the `==` method @@ -249,7 +302,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [included_segments, excluded_segments, include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids].hash + [included_segments, excluded_segments, include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, include_aliases, target_channel].hash end # Builds the object from hash diff --git a/lib/onesignal/models/notification_with_meta.rb b/lib/onesignal/models/notification_with_meta.rb index 4930b05..6c270e1 100644 --- a/lib/onesignal/models/notification_with_meta.rb +++ b/lib/onesignal/models/notification_with_meta.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -51,6 +51,10 @@ class NotificationWithMeta # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call attr_accessor :include_android_reg_ids + attr_accessor :include_aliases + + attr_accessor :target_channel + attr_accessor :id attr_accessor :value @@ -378,6 +382,8 @@ def self.attribute_map :'include_chrome_reg_ids' => :'include_chrome_reg_ids', :'include_chrome_web_reg_ids' => :'include_chrome_web_reg_ids', :'include_android_reg_ids' => :'include_android_reg_ids', + :'include_aliases' => :'include_aliases', + :'target_channel' => :'target_channel', :'id' => :'id', :'value' => :'value', :'name' => :'name', @@ -501,6 +507,8 @@ def self.openapi_types :'include_chrome_reg_ids' => :'Array', :'include_chrome_web_reg_ids' => :'Array', :'include_android_reg_ids' => :'Array', + :'include_aliases' => :'PlayerNotificationTargetIncludeAliases', + :'target_channel' => :'String', :'id' => :'String', :'value' => :'Integer', :'name' => :'String', @@ -609,6 +617,7 @@ def self.openapi_nullable Set.new([ :'include_player_ids', :'include_external_user_ids', + :'include_aliases', :'name', :'is_ios', :'is_android', @@ -620,6 +629,7 @@ def self.openapi_nullable :'is_wp_wns', :'is_adm', :'is_chrome', + :'external_id', :'contents', :'headings', :'subtitle', @@ -786,6 +796,14 @@ def initialize(attributes = {}) end end + if attributes.key?(:'include_aliases') + self.include_aliases = attributes[:'include_aliases'] + end + + if attributes.key?(:'target_channel') + self.target_channel = attributes[:'target_channel'] + end + if attributes.key?(:'id') self.id = attributes[:'id'] end @@ -1211,12 +1229,24 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + target_channel_validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) + return false unless target_channel_validator.valid?(@target_channel) aggregation_validator = EnumAttributeValidator.new('String', ["sum", "count"]) return false unless aggregation_validator.valid?(@aggregation) return false if @app_id.nil? true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] target_channel Object to be assigned + def target_channel=(target_channel) + validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) + unless validator.valid?(target_channel) + fail ArgumentError, "invalid value for \"target_channel\", must be one of #{validator.allowable_values}." + end + @target_channel = target_channel + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] aggregation Object to be assigned def aggregation=(aggregation) @@ -1244,6 +1274,8 @@ def ==(o) include_chrome_reg_ids == o.include_chrome_reg_ids && include_chrome_web_reg_ids == o.include_chrome_web_reg_ids && include_android_reg_ids == o.include_android_reg_ids && + include_aliases == o.include_aliases && + target_channel == o.target_channel && id == o.id && value == o.value && name == o.name && @@ -1355,7 +1387,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [included_segments, excluded_segments, include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, channel_for_external_user_ids, app_id, external_id, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, email_subject, email_body, email_from_name, email_from_address, sms_from, sms_media_urls, filters, successful, failed, errored, converted, received, outcomes, remaining, queued_at, send_after, completed_at, platform_delivery_stats].hash + [included_segments, excluded_segments, include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, include_aliases, target_channel, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, channel_for_external_user_ids, app_id, external_id, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, email_subject, email_body, email_from_name, email_from_address, sms_from, sms_media_urls, filters, successful, failed, errored, converted, received, outcomes, remaining, queued_at, send_after, completed_at, platform_delivery_stats].hash end # Builds the object from hash diff --git a/lib/onesignal/models/notification_with_meta_all_of.rb b/lib/onesignal/models/notification_with_meta_all_of.rb index 7cc61fa..d0fdfc2 100644 --- a/lib/onesignal/models/notification_with_meta_all_of.rb +++ b/lib/onesignal/models/notification_with_meta_all_of.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/operator.rb b/lib/onesignal/models/operator.rb index a1eb100..0bd5856 100644 --- a/lib/onesignal/models/operator.rb +++ b/lib/onesignal/models/operator.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/outcome_data.rb b/lib/onesignal/models/outcome_data.rb index 876cb31..f46791f 100644 --- a/lib/onesignal/models/outcome_data.rb +++ b/lib/onesignal/models/outcome_data.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/outcomes_data.rb b/lib/onesignal/models/outcomes_data.rb index 9e9921e..5e77b6a 100644 --- a/lib/onesignal/models/outcomes_data.rb +++ b/lib/onesignal/models/outcomes_data.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/platform_delivery_data.rb b/lib/onesignal/models/platform_delivery_data.rb index 0e1667c..3bb1927 100644 --- a/lib/onesignal/models/platform_delivery_data.rb +++ b/lib/onesignal/models/platform_delivery_data.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/platform_delivery_data_email_all_of.rb b/lib/onesignal/models/platform_delivery_data_email_all_of.rb index 77e68ff..5ad3749 100644 --- a/lib/onesignal/models/platform_delivery_data_email_all_of.rb +++ b/lib/onesignal/models/platform_delivery_data_email_all_of.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/platform_delivery_data_sms_all_of.rb b/lib/onesignal/models/platform_delivery_data_sms_all_of.rb index a39014e..75b2249 100644 --- a/lib/onesignal/models/platform_delivery_data_sms_all_of.rb +++ b/lib/onesignal/models/platform_delivery_data_sms_all_of.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/player.rb b/lib/onesignal/models/player.rb index d461728..e11b19c 100644 --- a/lib/onesignal/models/player.rb +++ b/lib/onesignal/models/player.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/player_notification_target.rb b/lib/onesignal/models/player_notification_target.rb index d81dc82..7cd4a40 100644 --- a/lib/onesignal/models/player_notification_target.rb +++ b/lib/onesignal/models/player_notification_target.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -45,6 +45,32 @@ class PlayerNotificationTarget # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call attr_accessor :include_android_reg_ids + attr_accessor :include_aliases + + attr_accessor :target_channel + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { @@ -57,7 +83,9 @@ def self.attribute_map :'include_amazon_reg_ids' => :'include_amazon_reg_ids', :'include_chrome_reg_ids' => :'include_chrome_reg_ids', :'include_chrome_web_reg_ids' => :'include_chrome_web_reg_ids', - :'include_android_reg_ids' => :'include_android_reg_ids' + :'include_android_reg_ids' => :'include_android_reg_ids', + :'include_aliases' => :'include_aliases', + :'target_channel' => :'target_channel' } end @@ -78,7 +106,9 @@ def self.openapi_types :'include_amazon_reg_ids' => :'Array', :'include_chrome_reg_ids' => :'Array', :'include_chrome_web_reg_ids' => :'Array', - :'include_android_reg_ids' => :'Array' + :'include_android_reg_ids' => :'Array', + :'include_aliases' => :'PlayerNotificationTargetIncludeAliases', + :'target_channel' => :'String' } end @@ -87,6 +117,7 @@ def self.openapi_nullable Set.new([ :'include_player_ids', :'include_external_user_ids', + :'include_aliases', ]) end @@ -164,6 +195,14 @@ def initialize(attributes = {}) self.include_android_reg_ids = value end end + + if attributes.key?(:'include_aliases') + self.include_aliases = attributes[:'include_aliases'] + end + + if attributes.key?(:'target_channel') + self.target_channel = attributes[:'target_channel'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -176,9 +215,21 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + target_channel_validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) + return false unless target_channel_validator.valid?(@target_channel) true end + # Custom attribute writer method checking allowed values (enum). + # @param [Object] target_channel Object to be assigned + def target_channel=(target_channel) + validator = EnumAttributeValidator.new('String', ["push", "email", "sms"]) + unless validator.valid?(target_channel) + fail ArgumentError, "invalid value for \"target_channel\", must be one of #{validator.allowable_values}." + end + @target_channel = target_channel + end + # Checks equality by comparing each attribute. # @param [Object] Object to be compared def ==(o) @@ -193,7 +244,9 @@ def ==(o) include_amazon_reg_ids == o.include_amazon_reg_ids && include_chrome_reg_ids == o.include_chrome_reg_ids && include_chrome_web_reg_ids == o.include_chrome_web_reg_ids && - include_android_reg_ids == o.include_android_reg_ids + include_android_reg_ids == o.include_android_reg_ids && + include_aliases == o.include_aliases && + target_channel == o.target_channel end # @see the `==` method @@ -205,7 +258,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids].hash + [include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, include_aliases, target_channel].hash end # Builds the object from hash diff --git a/lib/onesignal/models/player_notification_target_include_aliases.rb b/lib/onesignal/models/player_notification_target_include_aliases.rb new file mode 100644 index 0000000..93479cc --- /dev/null +++ b/lib/onesignal/models/player_notification_target_include_aliases.rb @@ -0,0 +1,221 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class PlayerNotificationTargetIncludeAliases + attr_accessor :alias_label + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'alias_label' => :'alias_label' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'alias_label' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::PlayerNotificationTargetIncludeAliases` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::PlayerNotificationTargetIncludeAliases`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'alias_label') + if (value = attributes[:'alias_label']).is_a?(Array) + self.alias_label = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + alias_label == o.alias_label + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [alias_label].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/player_slice.rb b/lib/onesignal/models/player_slice.rb index b2029ca..f068676 100644 --- a/lib/onesignal/models/player_slice.rb +++ b/lib/onesignal/models/player_slice.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/properties_deltas.rb b/lib/onesignal/models/properties_deltas.rb new file mode 100644 index 0000000..73000e5 --- /dev/null +++ b/lib/onesignal/models/properties_deltas.rb @@ -0,0 +1,239 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class PropertiesDeltas + attr_accessor :session_time + + attr_accessor :session_count + + attr_accessor :purchases + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'session_time' => :'session_time', + :'session_count' => :'session_count', + :'purchases' => :'purchases' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'session_time' => :'Float', + :'session_count' => :'Float', + :'purchases' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::PropertiesDeltas` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::PropertiesDeltas`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'session_time') + self.session_time = attributes[:'session_time'] + end + + if attributes.key?(:'session_count') + self.session_count = attributes[:'session_count'] + end + + if attributes.key?(:'purchases') + if (value = attributes[:'purchases']).is_a?(Array) + self.purchases = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + session_time == o.session_time && + session_count == o.session_count && + purchases == o.purchases + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [session_time, session_count, purchases].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/properties_object.rb b/lib/onesignal/models/properties_object.rb new file mode 100644 index 0000000..0dc9cca --- /dev/null +++ b/lib/onesignal/models/properties_object.rb @@ -0,0 +1,313 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class PropertiesObject + attr_accessor :tags + + attr_accessor :language + + attr_accessor :timezone_id + + attr_accessor :lat + + attr_accessor :long + + attr_accessor :country + + attr_accessor :first_active + + attr_accessor :last_active + + attr_accessor :amount_spent + + attr_accessor :purchases + + attr_accessor :ip + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tags' => :'tags', + :'language' => :'language', + :'timezone_id' => :'timezone_id', + :'lat' => :'lat', + :'long' => :'long', + :'country' => :'country', + :'first_active' => :'first_active', + :'last_active' => :'last_active', + :'amount_spent' => :'amount_spent', + :'purchases' => :'purchases', + :'ip' => :'ip' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'tags' => :'Hash', + :'language' => :'String', + :'timezone_id' => :'String', + :'lat' => :'Float', + :'long' => :'Float', + :'country' => :'String', + :'first_active' => :'Float', + :'last_active' => :'Float', + :'amount_spent' => :'Float', + :'purchases' => :'Array', + :'ip' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::PropertiesObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::PropertiesObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Hash) + self.tags = value + end + end + + if attributes.key?(:'language') + self.language = attributes[:'language'] + end + + if attributes.key?(:'timezone_id') + self.timezone_id = attributes[:'timezone_id'] + end + + if attributes.key?(:'lat') + self.lat = attributes[:'lat'] + end + + if attributes.key?(:'long') + self.long = attributes[:'long'] + end + + if attributes.key?(:'country') + self.country = attributes[:'country'] + end + + if attributes.key?(:'first_active') + self.first_active = attributes[:'first_active'] + end + + if attributes.key?(:'last_active') + self.last_active = attributes[:'last_active'] + end + + if attributes.key?(:'amount_spent') + self.amount_spent = attributes[:'amount_spent'] + end + + if attributes.key?(:'purchases') + if (value = attributes[:'purchases']).is_a?(Array) + self.purchases = value + end + end + + if attributes.key?(:'ip') + self.ip = attributes[:'ip'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tags == o.tags && + language == o.language && + timezone_id == o.timezone_id && + lat == o.lat && + long == o.long && + country == o.country && + first_active == o.first_active && + last_active == o.last_active && + amount_spent == o.amount_spent && + purchases == o.purchases && + ip == o.ip + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tags, language, timezone_id, lat, long, country, first_active, last_active, amount_spent, purchases, ip].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/purchase.rb b/lib/onesignal/models/purchase.rb index 2f5f5f8..b2f224c 100644 --- a/lib/onesignal/models/purchase.rb +++ b/lib/onesignal/models/purchase.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -24,12 +24,15 @@ class Purchase # The 3-letter ISO 4217 currency code. Required for correct storage and conversion of amount. attr_accessor :iso + attr_accessor :count + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { :'sku' => :'sku', :'amount' => :'amount', - :'iso' => :'iso' + :'iso' => :'iso', + :'count' => :'count' } end @@ -42,8 +45,9 @@ def self.acceptable_attributes def self.openapi_types { :'sku' => :'String', - :'amount' => :'Float', - :'iso' => :'String' + :'amount' => :'String', + :'iso' => :'String', + :'count' => :'Float' } end @@ -79,6 +83,10 @@ def initialize(attributes = {}) if attributes.key?(:'iso') self.iso = attributes[:'iso'] end + + if attributes.key?(:'count') + self.count = attributes[:'count'] + end end # Show invalid properties with the reasons. Usually used together with valid? @@ -116,7 +124,8 @@ def ==(o) self.class == o.class && sku == o.sku && amount == o.amount && - iso == o.iso + iso == o.iso && + count == o.count end # @see the `==` method @@ -128,7 +137,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [sku, amount, iso].hash + [sku, amount, iso, count].hash end # Builds the object from hash diff --git a/lib/onesignal/models/segment.rb b/lib/onesignal/models/segment.rb index c02c405..4bd32fe 100644 --- a/lib/onesignal/models/segment.rb +++ b/lib/onesignal/models/segment.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/segment_notification_target.rb b/lib/onesignal/models/segment_notification_target.rb index 34ca8f9..d5ba139 100644 --- a/lib/onesignal/models/segment_notification_target.rb +++ b/lib/onesignal/models/segment_notification_target.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/string_map.rb b/lib/onesignal/models/string_map.rb index 4cf13ec..d988eb4 100644 --- a/lib/onesignal/models/string_map.rb +++ b/lib/onesignal/models/string_map.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/subscription_object.rb b/lib/onesignal/models/subscription_object.rb new file mode 100644 index 0000000..a894e48 --- /dev/null +++ b/lib/onesignal/models/subscription_object.rb @@ -0,0 +1,397 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class SubscriptionObject + attr_accessor :id + + attr_accessor :type + + attr_accessor :token + + attr_accessor :enabled + + attr_accessor :notification_types + + attr_accessor :session_time + + attr_accessor :session_count + + attr_accessor :sdk + + attr_accessor :device_model + + attr_accessor :device_os + + attr_accessor :rooted + + attr_accessor :test_type + + attr_accessor :app_version + + attr_accessor :net_type + + attr_accessor :carrier + + attr_accessor :web_auth + + attr_accessor :web_p256 + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type', + :'token' => :'token', + :'enabled' => :'enabled', + :'notification_types' => :'notification_types', + :'session_time' => :'session_time', + :'session_count' => :'session_count', + :'sdk' => :'sdk', + :'device_model' => :'device_model', + :'device_os' => :'device_os', + :'rooted' => :'rooted', + :'test_type' => :'test_type', + :'app_version' => :'app_version', + :'net_type' => :'net_type', + :'carrier' => :'carrier', + :'web_auth' => :'web_auth', + :'web_p256' => :'web_p256' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'type' => :'String', + :'token' => :'String', + :'enabled' => :'Boolean', + :'notification_types' => :'Float', + :'session_time' => :'Float', + :'session_count' => :'Float', + :'sdk' => :'String', + :'device_model' => :'String', + :'device_os' => :'String', + :'rooted' => :'Boolean', + :'test_type' => :'Float', + :'app_version' => :'String', + :'net_type' => :'Float', + :'carrier' => :'String', + :'web_auth' => :'String', + :'web_p256' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::SubscriptionObject` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::SubscriptionObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'token') + self.token = attributes[:'token'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'notification_types') + self.notification_types = attributes[:'notification_types'] + end + + if attributes.key?(:'session_time') + self.session_time = attributes[:'session_time'] + end + + if attributes.key?(:'session_count') + self.session_count = attributes[:'session_count'] + end + + if attributes.key?(:'sdk') + self.sdk = attributes[:'sdk'] + end + + if attributes.key?(:'device_model') + self.device_model = attributes[:'device_model'] + end + + if attributes.key?(:'device_os') + self.device_os = attributes[:'device_os'] + end + + if attributes.key?(:'rooted') + self.rooted = attributes[:'rooted'] + end + + if attributes.key?(:'test_type') + self.test_type = attributes[:'test_type'] + end + + if attributes.key?(:'app_version') + self.app_version = attributes[:'app_version'] + end + + if attributes.key?(:'net_type') + self.net_type = attributes[:'net_type'] + end + + if attributes.key?(:'carrier') + self.carrier = attributes[:'carrier'] + end + + if attributes.key?(:'web_auth') + self.web_auth = attributes[:'web_auth'] + end + + if attributes.key?(:'web_p256') + self.web_p256 = attributes[:'web_p256'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["iOSPush", "AndroidPush", "FireOSPush", "ChromeExtensionPush", "ChromePush", "WindowsPush", "SafariLegacyPush", "FirefoxPush", "macOSPush", "HuaweiPush", "SafariPush", "Email", "SMS"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["iOSPush", "AndroidPush", "FireOSPush", "ChromeExtensionPush", "ChromePush", "WindowsPush", "SafariLegacyPush", "FirefoxPush", "macOSPush", "HuaweiPush", "SafariPush", "Email", "SMS"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + token == o.token && + enabled == o.enabled && + notification_types == o.notification_types && + session_time == o.session_time && + session_count == o.session_count && + sdk == o.sdk && + device_model == o.device_model && + device_os == o.device_os && + rooted == o.rooted && + test_type == o.test_type && + app_version == o.app_version && + net_type == o.net_type && + carrier == o.carrier && + web_auth == o.web_auth && + web_p256 == o.web_p256 + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, type, token, enabled, notification_types, session_time, session_count, sdk, device_model, device_os, rooted, test_type, app_version, net_type, carrier, web_auth, web_p256].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/transfer_subscription_request_body.rb b/lib/onesignal/models/transfer_subscription_request_body.rb new file mode 100644 index 0000000..9d48fd0 --- /dev/null +++ b/lib/onesignal/models/transfer_subscription_request_body.rb @@ -0,0 +1,221 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class TransferSubscriptionRequestBody + attr_accessor :identity + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'identity' => :'identity' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'identity' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::TransferSubscriptionRequestBody` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::TransferSubscriptionRequestBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'identity') + if (value = attributes[:'identity']).is_a?(Hash) + self.identity = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + identity == o.identity + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [identity].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/update_live_activity_request.rb b/lib/onesignal/models/update_live_activity_request.rb index 4df51bb..32afb07 100644 --- a/lib/onesignal/models/update_live_activity_request.rb +++ b/lib/onesignal/models/update_live_activity_request.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/update_live_activity_success_response.rb b/lib/onesignal/models/update_live_activity_success_response.rb index 8908673..211f401 100644 --- a/lib/onesignal/models/update_live_activity_success_response.rb +++ b/lib/onesignal/models/update_live_activity_success_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/update_player_success_response.rb b/lib/onesignal/models/update_player_success_response.rb index 14fb7cb..1f6bcec 100644 --- a/lib/onesignal/models/update_player_success_response.rb +++ b/lib/onesignal/models/update_player_success_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/update_player_tags_request_body.rb b/lib/onesignal/models/update_player_tags_request_body.rb index a195835..d76edd9 100644 --- a/lib/onesignal/models/update_player_tags_request_body.rb +++ b/lib/onesignal/models/update_player_tags_request_body.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/update_player_tags_success_response.rb b/lib/onesignal/models/update_player_tags_success_response.rb index 2528f71..6966311 100644 --- a/lib/onesignal/models/update_player_tags_success_response.rb +++ b/lib/onesignal/models/update_player_tags_success_response.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/lib/onesignal/models/update_subscription_request_body.rb b/lib/onesignal/models/update_subscription_request_body.rb new file mode 100644 index 0000000..58a5114 --- /dev/null +++ b/lib/onesignal/models/update_subscription_request_body.rb @@ -0,0 +1,219 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class UpdateSubscriptionRequestBody + attr_accessor :subscription + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'subscription' => :'subscription' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'subscription' => :'SubscriptionObject' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::UpdateSubscriptionRequestBody` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::UpdateSubscriptionRequestBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'subscription') + self.subscription = attributes[:'subscription'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + subscription == o.subscription + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [subscription].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/update_user_request.rb b/lib/onesignal/models/update_user_request.rb new file mode 100644 index 0000000..993ab8f --- /dev/null +++ b/lib/onesignal/models/update_user_request.rb @@ -0,0 +1,239 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class UpdateUserRequest + attr_accessor :properties + + attr_accessor :refresh_device_metadata + + attr_accessor :deltas + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'properties' => :'properties', + :'refresh_device_metadata' => :'refresh_device_metadata', + :'deltas' => :'deltas' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'properties' => :'PropertiesObject', + :'refresh_device_metadata' => :'Boolean', + :'deltas' => :'PropertiesDeltas' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::UpdateUserRequest` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::UpdateUserRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'properties') + self.properties = attributes[:'properties'] + end + + if attributes.key?(:'refresh_device_metadata') + self.refresh_device_metadata = attributes[:'refresh_device_metadata'] + else + self.refresh_device_metadata = false + end + + if attributes.key?(:'deltas') + self.deltas = attributes[:'deltas'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + properties == o.properties && + refresh_device_metadata == o.refresh_device_metadata && + deltas == o.deltas + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [properties, refresh_device_metadata, deltas].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/user.rb b/lib/onesignal/models/user.rb new file mode 100644 index 0000000..37ad70f --- /dev/null +++ b/lib/onesignal/models/user.rb @@ -0,0 +1,250 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class User + attr_accessor :properties + + attr_accessor :identity + + attr_accessor :subscriptions + + attr_accessor :subscription_options + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'properties' => :'properties', + :'identity' => :'identity', + :'subscriptions' => :'subscriptions', + :'subscription_options' => :'subscription_options' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'properties' => :'PropertiesObject', + :'identity' => :'Hash', + :'subscriptions' => :'Array', + :'subscription_options' => :'UserSubscriptionOptions' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::User` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'properties') + self.properties = attributes[:'properties'] + end + + if attributes.key?(:'identity') + if (value = attributes[:'identity']).is_a?(Hash) + self.identity = value + end + end + + if attributes.key?(:'subscriptions') + if (value = attributes[:'subscriptions']).is_a?(Array) + self.subscriptions = value + end + end + + if attributes.key?(:'subscription_options') + self.subscription_options = attributes[:'subscription_options'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + properties == o.properties && + identity == o.identity && + subscriptions == o.subscriptions && + subscription_options == o.subscription_options + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [properties, identity, subscriptions, subscription_options].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/user_identity_request_body.rb b/lib/onesignal/models/user_identity_request_body.rb new file mode 100644 index 0000000..c8a4e8c --- /dev/null +++ b/lib/onesignal/models/user_identity_request_body.rb @@ -0,0 +1,221 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class UserIdentityRequestBody + attr_accessor :identity + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'identity' => :'identity' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'identity' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::UserIdentityRequestBody` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::UserIdentityRequestBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'identity') + if (value = attributes[:'identity']).is_a?(Hash) + self.identity = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + identity == o.identity + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [identity].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/user_identity_response.rb b/lib/onesignal/models/user_identity_response.rb new file mode 100644 index 0000000..56663f2 --- /dev/null +++ b/lib/onesignal/models/user_identity_response.rb @@ -0,0 +1,221 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class UserIdentityResponse + attr_accessor :identity + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'identity' => :'identity' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'identity' => :'Hash' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::UserIdentityResponse` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::UserIdentityResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'identity') + if (value = attributes[:'identity']).is_a?(Hash) + self.identity = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + identity == o.identity + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [identity].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/models/user_subscription_options.rb b/lib/onesignal/models/user_subscription_options.rb new file mode 100644 index 0000000..543991f --- /dev/null +++ b/lib/onesignal/models/user_subscription_options.rb @@ -0,0 +1,219 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'date' +require 'time' + +module OneSignal + class UserSubscriptionOptions + attr_accessor :retain_previous_owner + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'retain_previous_owner' => :'retain_previous_owner' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'retain_previous_owner' => :'Boolean' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::UserSubscriptionOptions` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::UserSubscriptionOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'retain_previous_owner') + self.retain_previous_owner = attributes[:'retain_previous_owner'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + retain_previous_owner == o.retain_previous_owner + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [retain_previous_owner].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + attributes = attributes.transform_keys(&:to_sym) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = OneSignal.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/onesignal/version.rb b/lib/onesignal/version.rb index 3e07deb..b5e2df6 100644 --- a/lib/onesignal/version.rb +++ b/lib/onesignal/version.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -11,5 +11,5 @@ =end module OneSignal - VERSION = '1.0.2' + VERSION = '2.0.0' end diff --git a/onesignal.gemspec b/onesignal.gemspec index afbe80a..5fd28f6 100644 --- a/onesignal.gemspec +++ b/onesignal.gemspec @@ -5,7 +5,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/api/default_api_spec.rb b/spec/api/default_api_spec.rb index a093645..3e13193 100644 --- a/spec/api/default_api_spec.rb +++ b/spec/api/default_api_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -108,6 +108,46 @@ end end + # unit tests for create_subscription + # Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User. + # @param app_id + # @param alias_label + # @param alias_id + # @param create_subscription_request_body + # @param [Hash] opts the optional parameters + # @return [InlineResponse201] + describe 'create_subscription test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_user + # Creates a User, optionally Subscriptions owned by the User as well as Aliases. Aliases provided in the payload will be used to look up an existing User. + # @param app_id + # @param user + # @param [Hash] opts the optional parameters + # @return [User] + describe 'create_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_alias + # Deletes an alias by alias label + # @param app_id + # @param alias_label + # @param alias_id + # @param alias_label_to_delete + # @param [Hash] opts the optional parameters + # @return [InlineResponse200] + describe 'delete_alias test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for delete_player # Delete a user record # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app. @@ -134,6 +174,31 @@ end end + # unit tests for delete_subscription + # Deletes the Subscription. + # @param app_id + # @param subscription_id + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_subscription test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_user + # Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases + # @param app_id + # @param alias_label + # @param alias_id + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for end_live_activity # Stop Live Activity # Stops a Live Activity @@ -161,6 +226,44 @@ end end + # unit tests for fetch_aliases + # Lists all Aliases for the User identified by :subscription_id. + # @param app_id + # @param subscription_id + # @param [Hash] opts the optional parameters + # @return [UserIdentityResponse] + describe 'fetch_aliases test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for fetch_user + # Returns the User’s properties, Aliases, and Subscriptions. + # @param app_id + # @param alias_label + # @param alias_id + # @param [Hash] opts the optional parameters + # @return [User] + describe 'fetch_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for fetch_user_identity + # Lists all Aliases for the User identified by (:alias_label, :alias_id). + # @param app_id + # @param alias_label + # @param alias_id + # @param [Hash] opts the optional parameters + # @return [InlineResponse200] + describe 'fetch_user_identity test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for get_app # View an app # View the details of a single OneSignal app @@ -184,6 +287,18 @@ end end + # unit tests for get_eligible_iams + # Manifest of In-App Messages the Subscription is eligible to display by the SDK. + # @param app_id + # @param subscription_id + # @param [Hash] opts the optional parameters + # @return [InlineResponse2003] + describe 'get_eligible_iams test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for get_notification # View notification # View the details of a single notification and outcomes associated with it @@ -270,6 +385,46 @@ end end + # unit tests for identify_user_by_alias + # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id). + # @param app_id + # @param alias_label + # @param alias_id + # @param user_identity_request_body + # @param [Hash] opts the optional parameters + # @return [InlineResponse200] + describe 'identify_user_by_alias test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for identify_user_by_subscription_id + # Upserts one or more Aliases for the User identified by :subscription_id. + # @param app_id + # @param subscription_id + # @param user_identity_request_body + # @param [Hash] opts the optional parameters + # @return [UserIdentityResponse] + describe 'identify_user_by_subscription_id test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for transfer_subscription + # Transfers this Subscription to the User identified by the identity in the payload. + # @param app_id + # @param subscription_id + # @param transfer_subscription_request_body + # @param [Hash] opts the optional parameters + # @return [UserIdentityResponse] + describe 'transfer_subscription test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + # unit tests for update_app # Update an app # Updates the name or configuration settings of an existing OneSignal app @@ -324,4 +479,31 @@ end end + # unit tests for update_subscription + # Updates an existing Subscription’s properties. + # @param app_id + # @param subscription_id + # @param update_subscription_request_body + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_subscription test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_user + # Updates an existing User’s properties. + # @param app_id + # @param alias_label + # @param alias_id + # @param update_user_request + # @param [Hash] opts the optional parameters + # @return [InlineResponse202] + describe 'update_user test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index c36ab17..3711f00 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index 80909ee..58faed0 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/app_spec.rb b/spec/models/app_spec.rb index 661e47d..92141fa 100644 --- a/spec/models/app_spec.rb +++ b/spec/models/app_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/bad_request_error_spec.rb b/spec/models/bad_request_error_spec.rb index 6165cc0..2c67a35 100644 --- a/spec/models/bad_request_error_spec.rb +++ b/spec/models/bad_request_error_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/basic_notification_all_of_android_background_layout_spec.rb b/spec/models/basic_notification_all_of_android_background_layout_spec.rb index 740441a..3546d37 100644 --- a/spec/models/basic_notification_all_of_android_background_layout_spec.rb +++ b/spec/models/basic_notification_all_of_android_background_layout_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/basic_notification_all_of_spec.rb b/spec/models/basic_notification_all_of_spec.rb index 5a980a8..bc0626c 100644 --- a/spec/models/basic_notification_all_of_spec.rb +++ b/spec/models/basic_notification_all_of_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/basic_notification_spec.rb b/spec/models/basic_notification_spec.rb index a83dc38..3a19a2a 100644 --- a/spec/models/basic_notification_spec.rb +++ b/spec/models/basic_notification_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -97,6 +97,22 @@ end end + describe 'test attribute "include_aliases"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "target_channel"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["push", "email", "sms"]) + # validator.allowable_values.each do |value| + # expect { instance.target_channel = value }.not_to raise_error + # end + end + end + describe 'test attribute "id"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/spec/models/begin_live_activity_request_spec.rb b/spec/models/begin_live_activity_request_spec.rb index 638946d..f844b4e 100644 --- a/spec/models/begin_live_activity_request_spec.rb +++ b/spec/models/begin_live_activity_request_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/button_spec.rb b/spec/models/button_spec.rb index 4543921..bca2d70 100644 --- a/spec/models/button_spec.rb +++ b/spec/models/button_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/cancel_notification_success_response_spec.rb b/spec/models/cancel_notification_success_response_spec.rb index ddffc6b..c2a8ee0 100644 --- a/spec/models/cancel_notification_success_response_spec.rb +++ b/spec/models/cancel_notification_success_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/create_notification_success_response_spec.rb b/spec/models/create_notification_success_response_spec.rb index 25ad133..64756d5 100644 --- a/spec/models/create_notification_success_response_spec.rb +++ b/spec/models/create_notification_success_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/create_player_success_response_spec.rb b/spec/models/create_player_success_response_spec.rb index 80b9208..56bc65d 100644 --- a/spec/models/create_player_success_response_spec.rb +++ b/spec/models/create_player_success_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/create_segment_conflict_response_spec.rb b/spec/models/create_segment_conflict_response_spec.rb index 90b762d..75d5550 100644 --- a/spec/models/create_segment_conflict_response_spec.rb +++ b/spec/models/create_segment_conflict_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/create_segment_success_response_spec.rb b/spec/models/create_segment_success_response_spec.rb index 678b889..feb51eb 100644 --- a/spec/models/create_segment_success_response_spec.rb +++ b/spec/models/create_segment_success_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/create_subscription_request_body_spec.rb b/spec/models/create_subscription_request_body_spec.rb new file mode 100644 index 0000000..538b62d --- /dev/null +++ b/spec/models/create_subscription_request_body_spec.rb @@ -0,0 +1,40 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::CreateSubscriptionRequestBody +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::CreateSubscriptionRequestBody do + let(:instance) { OneSignal::CreateSubscriptionRequestBody.new } + + describe 'test an instance of CreateSubscriptionRequestBody' do + it 'should create an instance of CreateSubscriptionRequestBody' do + expect(instance).to be_instance_of(OneSignal::CreateSubscriptionRequestBody) + end + end + describe 'test attribute "subscription"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "retain_previous_owner"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/create_user_conflict_response_errors_inner_spec.rb b/spec/models/create_user_conflict_response_errors_inner_spec.rb new file mode 100644 index 0000000..b39727c --- /dev/null +++ b/spec/models/create_user_conflict_response_errors_inner_spec.rb @@ -0,0 +1,46 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::CreateUserConflictResponseErrorsInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::CreateUserConflictResponseErrorsInner do + let(:instance) { OneSignal::CreateUserConflictResponseErrorsInner.new } + + describe 'test an instance of CreateUserConflictResponseErrorsInner' do + it 'should create an instance of CreateUserConflictResponseErrorsInner' do + expect(instance).to be_instance_of(OneSignal::CreateUserConflictResponseErrorsInner) + end + end + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "title"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "meta"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/create_user_conflict_response_errors_items_meta_spec.rb b/spec/models/create_user_conflict_response_errors_items_meta_spec.rb new file mode 100644 index 0000000..3b3975f --- /dev/null +++ b/spec/models/create_user_conflict_response_errors_items_meta_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::CreateUserConflictResponseErrorsItemsMeta +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::CreateUserConflictResponseErrorsItemsMeta do + let(:instance) { OneSignal::CreateUserConflictResponseErrorsItemsMeta.new } + + describe 'test an instance of CreateUserConflictResponseErrorsItemsMeta' do + it 'should create an instance of CreateUserConflictResponseErrorsItemsMeta' do + expect(instance).to be_instance_of(OneSignal::CreateUserConflictResponseErrorsItemsMeta) + end + end + describe 'test attribute "conflicting_aliases"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/create_user_conflict_response_spec.rb b/spec/models/create_user_conflict_response_spec.rb new file mode 100644 index 0000000..7280326 --- /dev/null +++ b/spec/models/create_user_conflict_response_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::CreateUserConflictResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::CreateUserConflictResponse do + let(:instance) { OneSignal::CreateUserConflictResponse.new } + + describe 'test an instance of CreateUserConflictResponse' do + it 'should create an instance of CreateUserConflictResponse' do + expect(instance).to be_instance_of(OneSignal::CreateUserConflictResponse) + end + end + describe 'test attribute "errors"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/delete_player_not_found_response_spec.rb b/spec/models/delete_player_not_found_response_spec.rb index 3d3fcfa..4859a0c 100644 --- a/spec/models/delete_player_not_found_response_spec.rb +++ b/spec/models/delete_player_not_found_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/delete_player_success_response_spec.rb b/spec/models/delete_player_success_response_spec.rb index 3584194..148c884 100644 --- a/spec/models/delete_player_success_response_spec.rb +++ b/spec/models/delete_player_success_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/delete_segment_not_found_response_spec.rb b/spec/models/delete_segment_not_found_response_spec.rb index 3e5940d..17e642f 100644 --- a/spec/models/delete_segment_not_found_response_spec.rb +++ b/spec/models/delete_segment_not_found_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/delete_segment_success_response_spec.rb b/spec/models/delete_segment_success_response_spec.rb index ac25486..87501d2 100644 --- a/spec/models/delete_segment_success_response_spec.rb +++ b/spec/models/delete_segment_success_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/delivery_data_spec.rb b/spec/models/delivery_data_spec.rb index b7ffa0f..54e344e 100644 --- a/spec/models/delivery_data_spec.rb +++ b/spec/models/delivery_data_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/export_players_request_body_spec.rb b/spec/models/export_players_request_body_spec.rb index 2508a33..9050638 100644 --- a/spec/models/export_players_request_body_spec.rb +++ b/spec/models/export_players_request_body_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/export_players_success_response_spec.rb b/spec/models/export_players_success_response_spec.rb index 5f8d850..42b4ef5 100644 --- a/spec/models/export_players_success_response_spec.rb +++ b/spec/models/export_players_success_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/filter_expressions_spec.rb b/spec/models/filter_expressions_spec.rb index 64deaaf..8d86df5 100644 --- a/spec/models/filter_expressions_spec.rb +++ b/spec/models/filter_expressions_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/filter_spec.rb b/spec/models/filter_spec.rb index 319ba2b..bf32d54 100644 --- a/spec/models/filter_spec.rb +++ b/spec/models/filter_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/get_notification_request_body_spec.rb b/spec/models/get_notification_request_body_spec.rb index 0363828..e1496df 100644 --- a/spec/models/get_notification_request_body_spec.rb +++ b/spec/models/get_notification_request_body_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/identify_user_conflict_response_errors_inner_spec.rb b/spec/models/identify_user_conflict_response_errors_inner_spec.rb new file mode 100644 index 0000000..1bb0ee0 --- /dev/null +++ b/spec/models/identify_user_conflict_response_errors_inner_spec.rb @@ -0,0 +1,40 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::IdentifyUserConflictResponseErrorsInner +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::IdentifyUserConflictResponseErrorsInner do + let(:instance) { OneSignal::IdentifyUserConflictResponseErrorsInner.new } + + describe 'test an instance of IdentifyUserConflictResponseErrorsInner' do + it 'should create an instance of IdentifyUserConflictResponseErrorsInner' do + expect(instance).to be_instance_of(OneSignal::IdentifyUserConflictResponseErrorsInner) + end + end + describe 'test attribute "code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "title"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/identify_user_conflict_response_spec.rb b/spec/models/identify_user_conflict_response_spec.rb new file mode 100644 index 0000000..4a086bf --- /dev/null +++ b/spec/models/identify_user_conflict_response_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::IdentifyUserConflictResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::IdentifyUserConflictResponse do + let(:instance) { OneSignal::IdentifyUserConflictResponse.new } + + describe 'test an instance of IdentifyUserConflictResponse' do + it 'should create an instance of IdentifyUserConflictResponse' do + expect(instance).to be_instance_of(OneSignal::IdentifyUserConflictResponse) + end + end + describe 'test attribute "errors"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/inline_response2003_spec.rb b/spec/models/inline_response2003_spec.rb new file mode 100644 index 0000000..62c0a7b --- /dev/null +++ b/spec/models/inline_response2003_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::InlineResponse2003 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::InlineResponse2003 do + let(:instance) { OneSignal::InlineResponse2003.new } + + describe 'test an instance of InlineResponse2003' do + it 'should create an instance of InlineResponse2003' do + expect(instance).to be_instance_of(OneSignal::InlineResponse2003) + end + end + describe 'test attribute "in_app_messages"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/inline_response200_spec.rb b/spec/models/inline_response200_spec.rb new file mode 100644 index 0000000..f08cac0 --- /dev/null +++ b/spec/models/inline_response200_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::InlineResponse200 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::InlineResponse200 do + let(:instance) { OneSignal::InlineResponse200.new } + + describe 'test an instance of InlineResponse200' do + it 'should create an instance of InlineResponse200' do + expect(instance).to be_instance_of(OneSignal::InlineResponse200) + end + end + describe 'test attribute "identity"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/inline_response201_spec.rb b/spec/models/inline_response201_spec.rb new file mode 100644 index 0000000..ba7f2b1 --- /dev/null +++ b/spec/models/inline_response201_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::InlineResponse201 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::InlineResponse201 do + let(:instance) { OneSignal::InlineResponse201.new } + + describe 'test an instance of InlineResponse201' do + it 'should create an instance of InlineResponse201' do + expect(instance).to be_instance_of(OneSignal::InlineResponse201) + end + end + describe 'test attribute "subscription"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/inline_response202_spec.rb b/spec/models/inline_response202_spec.rb new file mode 100644 index 0000000..c1623cf --- /dev/null +++ b/spec/models/inline_response202_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::InlineResponse202 +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::InlineResponse202 do + let(:instance) { OneSignal::InlineResponse202.new } + + describe 'test an instance of InlineResponse202' do + it 'should create an instance of InlineResponse202' do + expect(instance).to be_instance_of(OneSignal::InlineResponse202) + end + end + describe 'test attribute "properties"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/invalid_identifier_error_spec.rb b/spec/models/invalid_identifier_error_spec.rb index 5e15ba1..a93fd1a 100644 --- a/spec/models/invalid_identifier_error_spec.rb +++ b/spec/models/invalid_identifier_error_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification200_errors_spec.rb b/spec/models/notification200_errors_spec.rb index fae03ac..7080271 100644 --- a/spec/models/notification200_errors_spec.rb +++ b/spec/models/notification200_errors_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification_all_of_spec.rb b/spec/models/notification_all_of_spec.rb index 33e0d8c..c26fa0d 100644 --- a/spec/models/notification_all_of_spec.rb +++ b/spec/models/notification_all_of_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification_history_success_response_spec.rb b/spec/models/notification_history_success_response_spec.rb index d4438bf..5a6fd5e 100644 --- a/spec/models/notification_history_success_response_spec.rb +++ b/spec/models/notification_history_success_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification_slice_spec.rb b/spec/models/notification_slice_spec.rb index 5130120..af0a1b8 100644 --- a/spec/models/notification_slice_spec.rb +++ b/spec/models/notification_slice_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb index cd7dbe9..fb1e37d 100644 --- a/spec/models/notification_spec.rb +++ b/spec/models/notification_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -97,6 +97,22 @@ end end + describe 'test attribute "include_aliases"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "target_channel"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["push", "email", "sms"]) + # validator.allowable_values.each do |value| + # expect { instance.target_channel = value }.not_to raise_error + # end + end + end + describe 'test attribute "id"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/spec/models/notification_target_spec.rb b/spec/models/notification_target_spec.rb index 9d0a398..1d1d8c4 100644 --- a/spec/models/notification_target_spec.rb +++ b/spec/models/notification_target_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -97,4 +97,20 @@ end end + describe 'test attribute "include_aliases"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "target_channel"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["push", "email", "sms"]) + # validator.allowable_values.each do |value| + # expect { instance.target_channel = value }.not_to raise_error + # end + end + end + end diff --git a/spec/models/notification_with_meta_all_of_spec.rb b/spec/models/notification_with_meta_all_of_spec.rb index eaba5e3..ad52b2e 100644 --- a/spec/models/notification_with_meta_all_of_spec.rb +++ b/spec/models/notification_with_meta_all_of_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/notification_with_meta_spec.rb b/spec/models/notification_with_meta_spec.rb index d67f4ee..a128c46 100644 --- a/spec/models/notification_with_meta_spec.rb +++ b/spec/models/notification_with_meta_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -97,6 +97,22 @@ end end + describe 'test attribute "include_aliases"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "target_channel"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["push", "email", "sms"]) + # validator.allowable_values.each do |value| + # expect { instance.target_channel = value }.not_to raise_error + # end + end + end + describe 'test attribute "id"' do it 'should work' do # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers diff --git a/spec/models/operator_spec.rb b/spec/models/operator_spec.rb index 19ab5d3..6947ad3 100644 --- a/spec/models/operator_spec.rb +++ b/spec/models/operator_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/outcome_data_spec.rb b/spec/models/outcome_data_spec.rb index 46d7f12..502b97f 100644 --- a/spec/models/outcome_data_spec.rb +++ b/spec/models/outcome_data_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/outcomes_data_spec.rb b/spec/models/outcomes_data_spec.rb index 863f73b..5f0213a 100644 --- a/spec/models/outcomes_data_spec.rb +++ b/spec/models/outcomes_data_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/platform_delivery_data_email_all_of_spec.rb b/spec/models/platform_delivery_data_email_all_of_spec.rb index 42f674c..dba8ea6 100644 --- a/spec/models/platform_delivery_data_email_all_of_spec.rb +++ b/spec/models/platform_delivery_data_email_all_of_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/platform_delivery_data_sms_all_of_spec.rb b/spec/models/platform_delivery_data_sms_all_of_spec.rb index 91c4d90..e3da3b2 100644 --- a/spec/models/platform_delivery_data_sms_all_of_spec.rb +++ b/spec/models/platform_delivery_data_sms_all_of_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/platform_delivery_data_spec.rb b/spec/models/platform_delivery_data_spec.rb index 87a4395..74a580a 100644 --- a/spec/models/platform_delivery_data_spec.rb +++ b/spec/models/platform_delivery_data_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/player_notification_target_include_aliases_spec.rb b/spec/models/player_notification_target_include_aliases_spec.rb new file mode 100644 index 0000000..6cd2f71 --- /dev/null +++ b/spec/models/player_notification_target_include_aliases_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::PlayerNotificationTargetIncludeAliases +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::PlayerNotificationTargetIncludeAliases do + let(:instance) { OneSignal::PlayerNotificationTargetIncludeAliases.new } + + describe 'test an instance of PlayerNotificationTargetIncludeAliases' do + it 'should create an instance of PlayerNotificationTargetIncludeAliases' do + expect(instance).to be_instance_of(OneSignal::PlayerNotificationTargetIncludeAliases) + end + end + describe 'test attribute "alias_label"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/player_notification_target_spec.rb b/spec/models/player_notification_target_spec.rb index 5e30cc1..bed01ed 100644 --- a/spec/models/player_notification_target_spec.rb +++ b/spec/models/player_notification_target_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -85,4 +85,20 @@ end end + describe 'test attribute "include_aliases"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "target_channel"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["push", "email", "sms"]) + # validator.allowable_values.each do |value| + # expect { instance.target_channel = value }.not_to raise_error + # end + end + end + end diff --git a/spec/models/player_slice_spec.rb b/spec/models/player_slice_spec.rb index 11685fe..243d0b1 100644 --- a/spec/models/player_slice_spec.rb +++ b/spec/models/player_slice_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/player_spec.rb b/spec/models/player_spec.rb index a54d1cf..4fa232e 100644 --- a/spec/models/player_spec.rb +++ b/spec/models/player_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/properties_deltas_spec.rb b/spec/models/properties_deltas_spec.rb new file mode 100644 index 0000000..8e5ce26 --- /dev/null +++ b/spec/models/properties_deltas_spec.rb @@ -0,0 +1,46 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::PropertiesDeltas +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::PropertiesDeltas do + let(:instance) { OneSignal::PropertiesDeltas.new } + + describe 'test an instance of PropertiesDeltas' do + it 'should create an instance of PropertiesDeltas' do + expect(instance).to be_instance_of(OneSignal::PropertiesDeltas) + end + end + describe 'test attribute "session_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "session_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "purchases"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/properties_object_spec.rb b/spec/models/properties_object_spec.rb new file mode 100644 index 0000000..7457034 --- /dev/null +++ b/spec/models/properties_object_spec.rb @@ -0,0 +1,94 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::PropertiesObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::PropertiesObject do + let(:instance) { OneSignal::PropertiesObject.new } + + describe 'test an instance of PropertiesObject' do + it 'should create an instance of PropertiesObject' do + expect(instance).to be_instance_of(OneSignal::PropertiesObject) + end + end + describe 'test attribute "tags"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "language"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "timezone_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "lat"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "long"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "country"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "first_active"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "last_active"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount_spent"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "purchases"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "ip"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/purchase_spec.rb b/spec/models/purchase_spec.rb index ebc3b82..c0295b1 100644 --- a/spec/models/purchase_spec.rb +++ b/spec/models/purchase_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT @@ -43,4 +43,10 @@ end end + describe 'test attribute "count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + end diff --git a/spec/models/segment_notification_target_spec.rb b/spec/models/segment_notification_target_spec.rb index 78b1b08..9314042 100644 --- a/spec/models/segment_notification_target_spec.rb +++ b/spec/models/segment_notification_target_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/segment_spec.rb b/spec/models/segment_spec.rb index c056ef0..0173e99 100644 --- a/spec/models/segment_spec.rb +++ b/spec/models/segment_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/string_map_spec.rb b/spec/models/string_map_spec.rb index 27c6997..d2f3321 100644 --- a/spec/models/string_map_spec.rb +++ b/spec/models/string_map_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/subscription_object_spec.rb b/spec/models/subscription_object_spec.rb new file mode 100644 index 0000000..5b9a381 --- /dev/null +++ b/spec/models/subscription_object_spec.rb @@ -0,0 +1,134 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::SubscriptionObject +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::SubscriptionObject do + let(:instance) { OneSignal::SubscriptionObject.new } + + describe 'test an instance of SubscriptionObject' do + it 'should create an instance of SubscriptionObject' do + expect(instance).to be_instance_of(OneSignal::SubscriptionObject) + end + end + describe 'test attribute "id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["iOSPush", "AndroidPush", "FireOSPush", "ChromeExtensionPush", "ChromePush", "WindowsPush", "SafariLegacyPush", "FirefoxPush", "macOSPush", "HuaweiPush", "SafariPush", "Email", "SMS"]) + # validator.allowable_values.each do |value| + # expect { instance.type = value }.not_to raise_error + # end + end + end + + describe 'test attribute "token"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "enabled"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "notification_types"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "session_time"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "session_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sdk"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "device_model"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "device_os"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rooted"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "test_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "app_version"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "net_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "carrier"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "web_auth"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "web_p256"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/transfer_subscription_request_body_spec.rb b/spec/models/transfer_subscription_request_body_spec.rb new file mode 100644 index 0000000..489c2df --- /dev/null +++ b/spec/models/transfer_subscription_request_body_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::TransferSubscriptionRequestBody +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::TransferSubscriptionRequestBody do + let(:instance) { OneSignal::TransferSubscriptionRequestBody.new } + + describe 'test an instance of TransferSubscriptionRequestBody' do + it 'should create an instance of TransferSubscriptionRequestBody' do + expect(instance).to be_instance_of(OneSignal::TransferSubscriptionRequestBody) + end + end + describe 'test attribute "identity"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/update_live_activity_request_spec.rb b/spec/models/update_live_activity_request_spec.rb index 3c0322d..b677f38 100644 --- a/spec/models/update_live_activity_request_spec.rb +++ b/spec/models/update_live_activity_request_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/update_live_activity_success_response_spec.rb b/spec/models/update_live_activity_success_response_spec.rb index efdd1a1..89e60e4 100644 --- a/spec/models/update_live_activity_success_response_spec.rb +++ b/spec/models/update_live_activity_success_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/update_player_success_response_spec.rb b/spec/models/update_player_success_response_spec.rb index 9388e19..ca56066 100644 --- a/spec/models/update_player_success_response_spec.rb +++ b/spec/models/update_player_success_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/update_player_tags_request_body_spec.rb b/spec/models/update_player_tags_request_body_spec.rb index 9df2ca9..f47c491 100644 --- a/spec/models/update_player_tags_request_body_spec.rb +++ b/spec/models/update_player_tags_request_body_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/update_player_tags_success_response_spec.rb b/spec/models/update_player_tags_success_response_spec.rb index 7fbea2c..89c7cba 100644 --- a/spec/models/update_player_tags_success_response_spec.rb +++ b/spec/models/update_player_tags_success_response_spec.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT diff --git a/spec/models/update_subscription_request_body_spec.rb b/spec/models/update_subscription_request_body_spec.rb new file mode 100644 index 0000000..6e6017d --- /dev/null +++ b/spec/models/update_subscription_request_body_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::UpdateSubscriptionRequestBody +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::UpdateSubscriptionRequestBody do + let(:instance) { OneSignal::UpdateSubscriptionRequestBody.new } + + describe 'test an instance of UpdateSubscriptionRequestBody' do + it 'should create an instance of UpdateSubscriptionRequestBody' do + expect(instance).to be_instance_of(OneSignal::UpdateSubscriptionRequestBody) + end + end + describe 'test attribute "subscription"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/update_user_request_spec.rb b/spec/models/update_user_request_spec.rb new file mode 100644 index 0000000..a91a6f9 --- /dev/null +++ b/spec/models/update_user_request_spec.rb @@ -0,0 +1,46 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::UpdateUserRequest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::UpdateUserRequest do + let(:instance) { OneSignal::UpdateUserRequest.new } + + describe 'test an instance of UpdateUserRequest' do + it 'should create an instance of UpdateUserRequest' do + expect(instance).to be_instance_of(OneSignal::UpdateUserRequest) + end + end + describe 'test attribute "properties"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "refresh_device_metadata"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deltas"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/user_identity_request_body_spec.rb b/spec/models/user_identity_request_body_spec.rb new file mode 100644 index 0000000..0dab52a --- /dev/null +++ b/spec/models/user_identity_request_body_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::UserIdentityRequestBody +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::UserIdentityRequestBody do + let(:instance) { OneSignal::UserIdentityRequestBody.new } + + describe 'test an instance of UserIdentityRequestBody' do + it 'should create an instance of UserIdentityRequestBody' do + expect(instance).to be_instance_of(OneSignal::UserIdentityRequestBody) + end + end + describe 'test attribute "identity"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/user_identity_response_spec.rb b/spec/models/user_identity_response_spec.rb new file mode 100644 index 0000000..02dcd56 --- /dev/null +++ b/spec/models/user_identity_response_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::UserIdentityResponse +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::UserIdentityResponse do + let(:instance) { OneSignal::UserIdentityResponse.new } + + describe 'test an instance of UserIdentityResponse' do + it 'should create an instance of UserIdentityResponse' do + expect(instance).to be_instance_of(OneSignal::UserIdentityResponse) + end + end + describe 'test attribute "identity"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb new file mode 100644 index 0000000..42ed37b --- /dev/null +++ b/spec/models/user_spec.rb @@ -0,0 +1,52 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::User +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::User do + let(:instance) { OneSignal::User.new } + + describe 'test an instance of User' do + it 'should create an instance of User' do + expect(instance).to be_instance_of(OneSignal::User) + end + end + describe 'test attribute "properties"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "identity"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subscriptions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subscription_options"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/models/user_subscription_options_spec.rb b/spec/models/user_subscription_options_spec.rb new file mode 100644 index 0000000..c609dc2 --- /dev/null +++ b/spec/models/user_subscription_options_spec.rb @@ -0,0 +1,34 @@ +=begin +#OneSignal + +#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: 1.2.1 +Contact: devrel@onesignal.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 6.0.0-SNAPSHOT + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for OneSignal::UserSubscriptionOptions +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe OneSignal::UserSubscriptionOptions do + let(:instance) { OneSignal::UserSubscriptionOptions.new } + + describe 'test an instance of UserSubscriptionOptions' do + it 'should create an instance of UserSubscriptionOptions' do + expect(instance).to be_instance_of(OneSignal::UserSubscriptionOptions) + end + end + describe 'test attribute "retain_previous_owner"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 39c9be7..6e7876c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,7 +3,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: 1.0.2 +The version of the OpenAPI document: 1.2.1 Contact: devrel@onesignal.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 6.0.0-SNAPSHOT