onesignal 5.2.1.pre.beta1 → 5.3.0.pre.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +33 -5
  3. data/docs/ApiKeyToken.md +28 -0
  4. data/docs/ApiKeyTokensListResponse.md +18 -0
  5. data/docs/CopyTemplateRequest.md +18 -0
  6. data/docs/CreateApiKeyRequest.md +22 -0
  7. data/docs/CreateApiKeyResponse.md +20 -0
  8. data/docs/CreateTemplateRequest.md +32 -0
  9. data/docs/CustomEvent.md +26 -0
  10. data/docs/CustomEventsRequest.md +18 -0
  11. data/docs/DefaultApi.md +1132 -110
  12. data/docs/StartLiveActivityRequest.md +48 -0
  13. data/docs/StartLiveActivitySuccessResponse.md +18 -0
  14. data/docs/TemplateResource.md +28 -0
  15. data/docs/TemplatesListResponse.md +18 -0
  16. data/docs/UpdateApiKeyRequest.md +22 -0
  17. data/docs/UpdateTemplateRequest.md +30 -0
  18. data/lib/onesignal/api/default_api.rb +1043 -1
  19. data/lib/onesignal/api_client.rb +2 -2
  20. data/lib/onesignal/api_error.rb +1 -1
  21. data/lib/onesignal/configuration.rb +1 -1
  22. data/lib/onesignal/models/api_key_token.rb +300 -0
  23. data/lib/onesignal/models/api_key_tokens_list_response.rb +221 -0
  24. data/lib/onesignal/models/app.rb +1 -1
  25. data/lib/onesignal/models/basic_notification.rb +1 -1
  26. data/lib/onesignal/models/basic_notification_all_of.rb +1 -1
  27. data/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb +1 -1
  28. data/lib/onesignal/models/button.rb +1 -1
  29. data/lib/onesignal/models/copy_template_request.rb +225 -0
  30. data/lib/onesignal/models/create_api_key_request.rb +273 -0
  31. data/lib/onesignal/models/create_api_key_response.rb +228 -0
  32. data/lib/onesignal/models/create_notification_success_response.rb +1 -1
  33. data/lib/onesignal/models/create_segment_conflict_response.rb +1 -1
  34. data/lib/onesignal/models/create_segment_success_response.rb +1 -1
  35. data/lib/onesignal/models/create_template_request.rb +307 -0
  36. data/lib/onesignal/models/create_user_conflict_response.rb +1 -1
  37. data/lib/onesignal/models/create_user_conflict_response_errors_inner.rb +1 -1
  38. data/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb +1 -1
  39. data/lib/onesignal/models/custom_event.rb +269 -0
  40. data/lib/onesignal/models/custom_events_request.rb +226 -0
  41. data/lib/onesignal/models/delivery_data.rb +1 -1
  42. data/lib/onesignal/models/export_events_success_response.rb +1 -1
  43. data/lib/onesignal/models/export_subscriptions_request_body.rb +1 -1
  44. data/lib/onesignal/models/export_subscriptions_success_response.rb +1 -1
  45. data/lib/onesignal/models/filter.rb +1 -1
  46. data/lib/onesignal/models/filter_expression.rb +1 -1
  47. data/lib/onesignal/models/generic_error.rb +1 -1
  48. data/lib/onesignal/models/generic_success_bool_response.rb +1 -1
  49. data/lib/onesignal/models/get_notification_history_request_body.rb +1 -1
  50. data/lib/onesignal/models/get_segments_success_response.rb +1 -1
  51. data/lib/onesignal/models/language_string_map.rb +1 -1
  52. data/lib/onesignal/models/notification.rb +1 -1
  53. data/lib/onesignal/models/notification_all_of.rb +1 -1
  54. data/lib/onesignal/models/notification_history_success_response.rb +1 -1
  55. data/lib/onesignal/models/notification_slice.rb +1 -1
  56. data/lib/onesignal/models/notification_target.rb +1 -1
  57. data/lib/onesignal/models/notification_with_meta.rb +1 -1
  58. data/lib/onesignal/models/notification_with_meta_all_of.rb +1 -1
  59. data/lib/onesignal/models/operator.rb +1 -1
  60. data/lib/onesignal/models/outcome_data.rb +1 -1
  61. data/lib/onesignal/models/outcomes_data.rb +1 -1
  62. data/lib/onesignal/models/platform_delivery_data.rb +1 -1
  63. data/lib/onesignal/models/platform_delivery_data_email_all_of.rb +1 -1
  64. data/lib/onesignal/models/platform_delivery_data_sms_all_of.rb +1 -1
  65. data/lib/onesignal/models/properties_body.rb +1 -1
  66. data/lib/onesignal/models/properties_deltas.rb +1 -1
  67. data/lib/onesignal/models/properties_object.rb +1 -1
  68. data/lib/onesignal/models/purchase.rb +1 -1
  69. data/lib/onesignal/models/rate_limit_error.rb +1 -1
  70. data/lib/onesignal/models/segment.rb +1 -1
  71. data/lib/onesignal/models/segment_data.rb +1 -1
  72. data/lib/onesignal/models/segment_notification_target.rb +1 -1
  73. data/lib/onesignal/models/start_live_activity_request.rb +454 -0
  74. data/lib/onesignal/models/start_live_activity_success_response.rb +219 -0
  75. data/lib/onesignal/models/subscription.rb +1 -1
  76. data/lib/onesignal/models/subscription_body.rb +1 -1
  77. data/lib/onesignal/models/subscription_notification_target.rb +1 -1
  78. data/lib/onesignal/models/template_resource.rb +302 -0
  79. data/lib/onesignal/models/templates_list_response.rb +221 -0
  80. data/lib/onesignal/models/transfer_subscription_request_body.rb +1 -1
  81. data/lib/onesignal/models/update_api_key_request.rb +273 -0
  82. data/lib/onesignal/models/update_live_activity_request.rb +1 -1
  83. data/lib/onesignal/models/update_live_activity_success_response.rb +1 -1
  84. data/lib/onesignal/models/update_template_request.rb +282 -0
  85. data/lib/onesignal/models/update_user_request.rb +1 -1
  86. data/lib/onesignal/models/user.rb +1 -1
  87. data/lib/onesignal/models/user_identity_body.rb +1 -1
  88. data/lib/onesignal/models/web_button.rb +1 -1
  89. data/lib/onesignal/version.rb +2 -2
  90. data/lib/onesignal.rb +15 -1
  91. data/onesignal.gemspec +1 -1
  92. data/spec/api/default_api_spec.rb +189 -1
  93. data/spec/api_client_spec.rb +1 -1
  94. data/spec/configuration_spec.rb +1 -1
  95. data/spec/models/api_key_token_spec.rb +68 -0
  96. data/spec/models/api_key_tokens_list_response_spec.rb +34 -0
  97. data/spec/models/app_spec.rb +1 -1
  98. data/spec/models/basic_notification_all_of_android_background_layout_spec.rb +1 -1
  99. data/spec/models/basic_notification_all_of_spec.rb +1 -1
  100. data/spec/models/basic_notification_spec.rb +1 -1
  101. data/spec/models/button_spec.rb +1 -1
  102. data/spec/models/copy_template_request_spec.rb +34 -0
  103. data/spec/models/create_api_key_request_spec.rb +50 -0
  104. data/spec/models/create_api_key_response_spec.rb +40 -0
  105. data/spec/models/create_notification_success_response_spec.rb +1 -1
  106. data/spec/models/create_segment_conflict_response_spec.rb +1 -1
  107. data/spec/models/create_segment_success_response_spec.rb +1 -1
  108. data/spec/models/create_template_request_spec.rb +76 -0
  109. data/spec/models/create_user_conflict_response_errors_inner_spec.rb +1 -1
  110. data/spec/models/create_user_conflict_response_errors_items_meta_spec.rb +1 -1
  111. data/spec/models/create_user_conflict_response_spec.rb +1 -1
  112. data/spec/models/custom_event_spec.rb +58 -0
  113. data/spec/models/custom_events_request_spec.rb +34 -0
  114. data/spec/models/delivery_data_spec.rb +1 -1
  115. data/spec/models/export_events_success_response_spec.rb +1 -1
  116. data/spec/models/export_subscriptions_request_body_spec.rb +1 -1
  117. data/spec/models/export_subscriptions_success_response_spec.rb +1 -1
  118. data/spec/models/filter_expression_spec.rb +1 -1
  119. data/spec/models/filter_spec.rb +1 -1
  120. data/spec/models/generic_error_spec.rb +1 -1
  121. data/spec/models/generic_success_bool_response_spec.rb +1 -1
  122. data/spec/models/get_notification_history_request_body_spec.rb +1 -1
  123. data/spec/models/get_segments_success_response_spec.rb +1 -1
  124. data/spec/models/language_string_map_spec.rb +1 -1
  125. data/spec/models/notification_all_of_spec.rb +1 -1
  126. data/spec/models/notification_history_success_response_spec.rb +1 -1
  127. data/spec/models/notification_slice_spec.rb +1 -1
  128. data/spec/models/notification_spec.rb +1 -1
  129. data/spec/models/notification_target_spec.rb +1 -1
  130. data/spec/models/notification_with_meta_all_of_spec.rb +1 -1
  131. data/spec/models/notification_with_meta_spec.rb +1 -1
  132. data/spec/models/operator_spec.rb +1 -1
  133. data/spec/models/outcome_data_spec.rb +1 -1
  134. data/spec/models/outcomes_data_spec.rb +1 -1
  135. data/spec/models/platform_delivery_data_email_all_of_spec.rb +1 -1
  136. data/spec/models/platform_delivery_data_sms_all_of_spec.rb +1 -1
  137. data/spec/models/platform_delivery_data_spec.rb +1 -1
  138. data/spec/models/properties_body_spec.rb +1 -1
  139. data/spec/models/properties_deltas_spec.rb +1 -1
  140. data/spec/models/properties_object_spec.rb +1 -1
  141. data/spec/models/purchase_spec.rb +1 -1
  142. data/spec/models/rate_limit_error_spec.rb +1 -1
  143. data/spec/models/segment_data_spec.rb +1 -1
  144. data/spec/models/segment_notification_target_spec.rb +1 -1
  145. data/spec/models/segment_spec.rb +1 -1
  146. data/spec/models/start_live_activity_request_spec.rb +128 -0
  147. data/spec/models/start_live_activity_success_response_spec.rb +34 -0
  148. data/spec/models/subscription_body_spec.rb +1 -1
  149. data/spec/models/subscription_notification_target_spec.rb +1 -1
  150. data/spec/models/subscription_spec.rb +1 -1
  151. data/spec/models/template_resource_spec.rb +68 -0
  152. data/spec/models/templates_list_response_spec.rb +34 -0
  153. data/spec/models/transfer_subscription_request_body_spec.rb +1 -1
  154. data/spec/models/update_api_key_request_spec.rb +50 -0
  155. data/spec/models/update_live_activity_request_spec.rb +1 -1
  156. data/spec/models/update_live_activity_success_response_spec.rb +1 -1
  157. data/spec/models/update_template_request_spec.rb +70 -0
  158. data/spec/models/update_user_request_spec.rb +1 -1
  159. data/spec/models/user_identity_body_spec.rb +1 -1
  160. data/spec/models/user_spec.rb +1 -1
  161. data/spec/models/web_button_spec.rb +1 -1
  162. data/spec/spec_helper.rb +1 -1
  163. metadata +57 -1
data/docs/DefaultApi.md CHANGED
@@ -5,16 +5,22 @@ All URIs are relative to *https://api.onesignal.com*
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
7
  | [**cancel_notification**](DefaultApi.md#cancel_notification) | **DELETE** /notifications/{notification_id} | Stop a scheduled or currently outgoing notification |
8
+ | [**copy_template_to_app**](DefaultApi.md#copy_template_to_app) | **POST** /templates/{template_id}/copy_to_app | Copy template to another app |
8
9
  | [**create_alias**](DefaultApi.md#create_alias) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity | |
9
10
  | [**create_alias_by_subscription**](DefaultApi.md#create_alias_by_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/user/identity | |
11
+ | [**create_api_key**](DefaultApi.md#create_api_key) | **POST** /apps/{app_id}/auth/tokens | Create API key |
10
12
  | [**create_app**](DefaultApi.md#create_app) | **POST** /apps | Create an app |
13
+ | [**create_custom_events**](DefaultApi.md#create_custom_events) | **POST** /apps/{app_id}/integrations/custom_events | Create custom events |
11
14
  | [**create_notification**](DefaultApi.md#create_notification) | **POST** /notifications | Create notification |
12
15
  | [**create_segment**](DefaultApi.md#create_segment) | **POST** /apps/{app_id}/segments | Create Segment |
13
16
  | [**create_subscription**](DefaultApi.md#create_subscription) | **POST** /apps/{app_id}/users/by/{alias_label}/{alias_id}/subscriptions | |
17
+ | [**create_template**](DefaultApi.md#create_template) | **POST** /templates | Create template |
14
18
  | [**create_user**](DefaultApi.md#create_user) | **POST** /apps/{app_id}/users | |
15
19
  | [**delete_alias**](DefaultApi.md#delete_alias) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id}/identity/{alias_label_to_delete} | |
20
+ | [**delete_api_key**](DefaultApi.md#delete_api_key) | **DELETE** /apps/{app_id}/auth/tokens/{token_id} | Delete API key |
16
21
  | [**delete_segment**](DefaultApi.md#delete_segment) | **DELETE** /apps/{app_id}/segments/{segment_id} | Delete Segment |
17
22
  | [**delete_subscription**](DefaultApi.md#delete_subscription) | **DELETE** /apps/{app_id}/subscriptions/{subscription_id} | |
23
+ | [**delete_template**](DefaultApi.md#delete_template) | **DELETE** /templates/{template_id} | Delete template |
18
24
  | [**delete_user**](DefaultApi.md#delete_user) | **DELETE** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
19
25
  | [**export_events**](DefaultApi.md#export_events) | **POST** /notifications/{notification_id}/export_events?app_id={app_id} | Export CSV of Events |
20
26
  | [**export_subscriptions**](DefaultApi.md#export_subscriptions) | **POST** /players/csv_export?app_id={app_id} | Export CSV of Subscriptions |
@@ -28,12 +34,20 @@ All URIs are relative to *https://api.onesignal.com*
28
34
  | [**get_outcomes**](DefaultApi.md#get_outcomes) | **GET** /apps/{app_id}/outcomes | View Outcomes |
29
35
  | [**get_segments**](DefaultApi.md#get_segments) | **GET** /apps/{app_id}/segments | Get Segments |
30
36
  | [**get_user**](DefaultApi.md#get_user) | **GET** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
37
+ | [**rotate_api_key**](DefaultApi.md#rotate_api_key) | **POST** /apps/{app_id}/auth/tokens/{token_id}/rotate | Rotate API key |
38
+ | [**start_live_activity**](DefaultApi.md#start_live_activity) | **POST** /apps/{app_id}/activities/activity/{activity_type} | Start Live Activity |
31
39
  | [**transfer_subscription**](DefaultApi.md#transfer_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id}/owner | |
32
40
  | [**unsubscribe_email_with_token**](DefaultApi.md#unsubscribe_email_with_token) | **POST** /apps/{app_id}/notifications/{notification_id}/unsubscribe | Unsubscribe with token |
41
+ | [**update_api_key**](DefaultApi.md#update_api_key) | **PATCH** /apps/{app_id}/auth/tokens/{token_id} | Update API key |
33
42
  | [**update_app**](DefaultApi.md#update_app) | **PUT** /apps/{app_id} | Update an app |
34
43
  | [**update_live_activity**](DefaultApi.md#update_live_activity) | **POST** /apps/{app_id}/live_activities/{activity_id}/notifications | Update a Live Activity via Push |
35
44
  | [**update_subscription**](DefaultApi.md#update_subscription) | **PATCH** /apps/{app_id}/subscriptions/{subscription_id} | |
45
+ | [**update_subscription_by_token**](DefaultApi.md#update_subscription_by_token) | **PATCH** /apps/{app_id}/subscriptions_by_token/{token_type}/{token} | Update subscription by token |
46
+ | [**update_template**](DefaultApi.md#update_template) | **PATCH** /templates/{template_id} | Update template |
36
47
  | [**update_user**](DefaultApi.md#update_user) | **PATCH** /apps/{app_id}/users/by/{alias_label}/{alias_id} | |
48
+ | [**view_api_keys**](DefaultApi.md#view_api_keys) | **GET** /apps/{app_id}/auth/tokens | View API keys |
49
+ | [**view_template**](DefaultApi.md#view_template) | **GET** /templates/{template_id} | View template |
50
+ | [**view_templates**](DefaultApi.md#view_templates) | **GET** /templates | View templates |
37
51
 
38
52
 
39
53
  ## cancel_notification
@@ -107,6 +121,79 @@ end
107
121
  - **Accept**: application/json
108
122
 
109
123
 
124
+ ## copy_template_to_app
125
+
126
+ > <TemplateResource> copy_template_to_app(template_id, app_id, copy_template_request)
127
+
128
+ Copy template to another app
129
+
130
+ Copy a template to a destination app.
131
+
132
+ ### Examples
133
+
134
+ ```ruby
135
+ require 'onesignal'
136
+ # setup authorization
137
+ OneSignal.configure do |config|
138
+ # Configure Bearer authorization: organization_api_key
139
+ config.organization_api_key = 'YOUR_BEARER_TOKEN'
140
+
141
+ end
142
+
143
+ api_instance = OneSignal::DefaultApi.new
144
+ template_id = 'template_id_example' # String |
145
+ app_id = 'app_id_example' # String |
146
+ copy_template_request = OneSignal::CopyTemplateRequest.new({target_app_id: 'target_app_id_example'}) # CopyTemplateRequest |
147
+
148
+ begin
149
+ # Copy template to another app
150
+ result = api_instance.copy_template_to_app(template_id, app_id, copy_template_request)
151
+ p result
152
+ rescue OneSignal::ApiError => e
153
+ puts "Error when calling DefaultApi->copy_template_to_app: #{e}"
154
+ end
155
+ ```
156
+
157
+ #### Using the copy_template_to_app_with_http_info variant
158
+
159
+ This returns an Array which contains the response data, status code and headers.
160
+
161
+ > <Array(<TemplateResource>, Integer, Hash)> copy_template_to_app_with_http_info(template_id, app_id, copy_template_request)
162
+
163
+ ```ruby
164
+ begin
165
+ # Copy template to another app
166
+ data, status_code, headers = api_instance.copy_template_to_app_with_http_info(template_id, app_id, copy_template_request)
167
+ p status_code # => 2xx
168
+ p headers # => { ... }
169
+ p data # => <TemplateResource>
170
+ rescue OneSignal::ApiError => e
171
+ puts "Error when calling DefaultApi->copy_template_to_app_with_http_info: #{e}"
172
+ end
173
+ ```
174
+
175
+ ### Parameters
176
+
177
+ | Name | Type | Description | Notes |
178
+ | ---- | ---- | ----------- | ----- |
179
+ | **template_id** | **String** | | |
180
+ | **app_id** | **String** | | |
181
+ | **copy_template_request** | [**CopyTemplateRequest**](CopyTemplateRequest.md) | | |
182
+
183
+ ### Return type
184
+
185
+ [**TemplateResource**](TemplateResource.md)
186
+
187
+ ### Authorization
188
+
189
+ [organization_api_key](../README.md#organization_api_key)
190
+
191
+ ### HTTP request headers
192
+
193
+ - **Content-Type**: application/json
194
+ - **Accept**: application/json
195
+
196
+
110
197
  ## create_alias
111
198
 
112
199
  > <UserIdentityBody> create_alias(app_id, alias_label, alias_id, user_identity_body)
@@ -255,6 +342,77 @@ end
255
342
  - **Accept**: application/json
256
343
 
257
344
 
345
+ ## create_api_key
346
+
347
+ > <CreateApiKeyResponse> create_api_key(app_id, create_api_key_request)
348
+
349
+ Create API key
350
+
351
+ Use this API to create a new App API Key (also called a Rich Authentication Token) for a specific OneSignal app. These keys are used to authenticate API requests at the app level and offer enhanced security features, including optional IP allowlisting.
352
+
353
+ ### Examples
354
+
355
+ ```ruby
356
+ require 'onesignal'
357
+ # setup authorization
358
+ OneSignal.configure do |config|
359
+ # Configure Bearer authorization: organization_api_key
360
+ config.organization_api_key = 'YOUR_BEARER_TOKEN'
361
+
362
+ end
363
+
364
+ api_instance = OneSignal::DefaultApi.new
365
+ app_id = 'app_id_example' # String |
366
+ create_api_key_request = OneSignal::CreateApiKeyRequest.new # CreateApiKeyRequest |
367
+
368
+ begin
369
+ # Create API key
370
+ result = api_instance.create_api_key(app_id, create_api_key_request)
371
+ p result
372
+ rescue OneSignal::ApiError => e
373
+ puts "Error when calling DefaultApi->create_api_key: #{e}"
374
+ end
375
+ ```
376
+
377
+ #### Using the create_api_key_with_http_info variant
378
+
379
+ This returns an Array which contains the response data, status code and headers.
380
+
381
+ > <Array(<CreateApiKeyResponse>, Integer, Hash)> create_api_key_with_http_info(app_id, create_api_key_request)
382
+
383
+ ```ruby
384
+ begin
385
+ # Create API key
386
+ data, status_code, headers = api_instance.create_api_key_with_http_info(app_id, create_api_key_request)
387
+ p status_code # => 2xx
388
+ p headers # => { ... }
389
+ p data # => <CreateApiKeyResponse>
390
+ rescue OneSignal::ApiError => e
391
+ puts "Error when calling DefaultApi->create_api_key_with_http_info: #{e}"
392
+ end
393
+ ```
394
+
395
+ ### Parameters
396
+
397
+ | Name | Type | Description | Notes |
398
+ | ---- | ---- | ----------- | ----- |
399
+ | **app_id** | **String** | | |
400
+ | **create_api_key_request** | [**CreateApiKeyRequest**](CreateApiKeyRequest.md) | | |
401
+
402
+ ### Return type
403
+
404
+ [**CreateApiKeyResponse**](CreateApiKeyResponse.md)
405
+
406
+ ### Authorization
407
+
408
+ [organization_api_key](../README.md#organization_api_key)
409
+
410
+ ### HTTP request headers
411
+
412
+ - **Content-Type**: application/json
413
+ - **Accept**: application/json
414
+
415
+
258
416
  ## create_app
259
417
 
260
418
  > <App> create_app(app)
@@ -324,6 +482,77 @@ end
324
482
  - **Accept**: application/json
325
483
 
326
484
 
485
+ ## create_custom_events
486
+
487
+ > Object create_custom_events(app_id, custom_events_request)
488
+
489
+ Create custom events
490
+
491
+ The Custom Events API allows you to record user events. Custom events can represent any action users take in your application, such as completing a purchase, viewing content, or achieving milestones.
492
+
493
+ ### Examples
494
+
495
+ ```ruby
496
+ require 'onesignal'
497
+ # setup authorization
498
+ OneSignal.configure do |config|
499
+ # Configure Bearer authorization: rest_api_key
500
+ config.rest_api_key = 'YOUR_BEARER_TOKEN'
501
+
502
+ end
503
+
504
+ api_instance = OneSignal::DefaultApi.new
505
+ app_id = 'app_id_example' # String | Your OneSignal App ID in UUID v4 format.
506
+ custom_events_request = OneSignal::CustomEventsRequest.new({events: [OneSignal::CustomEvent.new({name: 'name_example'})]}) # CustomEventsRequest |
507
+
508
+ begin
509
+ # Create custom events
510
+ result = api_instance.create_custom_events(app_id, custom_events_request)
511
+ p result
512
+ rescue OneSignal::ApiError => e
513
+ puts "Error when calling DefaultApi->create_custom_events: #{e}"
514
+ end
515
+ ```
516
+
517
+ #### Using the create_custom_events_with_http_info variant
518
+
519
+ This returns an Array which contains the response data, status code and headers.
520
+
521
+ > <Array(Object, Integer, Hash)> create_custom_events_with_http_info(app_id, custom_events_request)
522
+
523
+ ```ruby
524
+ begin
525
+ # Create custom events
526
+ data, status_code, headers = api_instance.create_custom_events_with_http_info(app_id, custom_events_request)
527
+ p status_code # => 2xx
528
+ p headers # => { ... }
529
+ p data # => Object
530
+ rescue OneSignal::ApiError => e
531
+ puts "Error when calling DefaultApi->create_custom_events_with_http_info: #{e}"
532
+ end
533
+ ```
534
+
535
+ ### Parameters
536
+
537
+ | Name | Type | Description | Notes |
538
+ | ---- | ---- | ----------- | ----- |
539
+ | **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | |
540
+ | **custom_events_request** | [**CustomEventsRequest**](CustomEventsRequest.md) | | |
541
+
542
+ ### Return type
543
+
544
+ **Object**
545
+
546
+ ### Authorization
547
+
548
+ [rest_api_key](../README.md#rest_api_key)
549
+
550
+ ### HTTP request headers
551
+
552
+ - **Content-Type**: application/json
553
+ - **Accept**: application/json
554
+
555
+
327
556
  ## create_notification
328
557
 
329
558
  > <CreateNotificationSuccessResponse> create_notification(notification)
@@ -541,6 +770,75 @@ end
541
770
  - **Accept**: application/json
542
771
 
543
772
 
773
+ ## create_template
774
+
775
+ > <TemplateResource> create_template(create_template_request)
776
+
777
+ Create template
778
+
779
+ Create reusable message templates for push, email, and SMS channels.
780
+
781
+ ### Examples
782
+
783
+ ```ruby
784
+ require 'onesignal'
785
+ # setup authorization
786
+ OneSignal.configure do |config|
787
+ # Configure Bearer authorization: rest_api_key
788
+ config.rest_api_key = 'YOUR_BEARER_TOKEN'
789
+
790
+ end
791
+
792
+ api_instance = OneSignal::DefaultApi.new
793
+ create_template_request = OneSignal::CreateTemplateRequest.new({app_id: 'app_id_example', name: 'name_example', contents: OneSignal::LanguageStringMap.new}) # CreateTemplateRequest |
794
+
795
+ begin
796
+ # Create template
797
+ result = api_instance.create_template(create_template_request)
798
+ p result
799
+ rescue OneSignal::ApiError => e
800
+ puts "Error when calling DefaultApi->create_template: #{e}"
801
+ end
802
+ ```
803
+
804
+ #### Using the create_template_with_http_info variant
805
+
806
+ This returns an Array which contains the response data, status code and headers.
807
+
808
+ > <Array(<TemplateResource>, Integer, Hash)> create_template_with_http_info(create_template_request)
809
+
810
+ ```ruby
811
+ begin
812
+ # Create template
813
+ data, status_code, headers = api_instance.create_template_with_http_info(create_template_request)
814
+ p status_code # => 2xx
815
+ p headers # => { ... }
816
+ p data # => <TemplateResource>
817
+ rescue OneSignal::ApiError => e
818
+ puts "Error when calling DefaultApi->create_template_with_http_info: #{e}"
819
+ end
820
+ ```
821
+
822
+ ### Parameters
823
+
824
+ | Name | Type | Description | Notes |
825
+ | ---- | ---- | ----------- | ----- |
826
+ | **create_template_request** | [**CreateTemplateRequest**](CreateTemplateRequest.md) | | |
827
+
828
+ ### Return type
829
+
830
+ [**TemplateResource**](TemplateResource.md)
831
+
832
+ ### Authorization
833
+
834
+ [rest_api_key](../README.md#rest_api_key)
835
+
836
+ ### HTTP request headers
837
+
838
+ - **Content-Type**: application/json
839
+ - **Accept**: application/json
840
+
841
+
544
842
  ## create_user
545
843
 
546
844
  > <User> create_user(app_id, user)
@@ -687,13 +985,13 @@ end
687
985
  - **Accept**: application/json
688
986
 
689
987
 
690
- ## delete_segment
988
+ ## delete_api_key
691
989
 
692
- > <GenericSuccessBoolResponse> delete_segment(app_id, segment_id)
990
+ > Object delete_api_key(app_id, token_id)
693
991
 
694
- Delete Segment
992
+ Delete API key
695
993
 
696
- Delete a segment (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.
994
+ Delete a specific Rich Authentication Token (App API Key) for a OneSignal app. Requires your Organization API Key and the token’s unique ID, not the token value itself.
697
995
 
698
996
  ### Examples
699
997
 
@@ -701,39 +999,39 @@ Delete a segment (not user devices) - Required: OneSignal Paid Plan You can dele
701
999
  require 'onesignal'
702
1000
  # setup authorization
703
1001
  OneSignal.configure do |config|
704
- # Configure Bearer authorization: rest_api_key
705
- config.rest_api_key = 'YOUR_BEARER_TOKEN'
1002
+ # Configure Bearer authorization: organization_api_key
1003
+ config.organization_api_key = 'YOUR_BEARER_TOKEN'
706
1004
 
707
1005
  end
708
1006
 
709
1007
  api_instance = OneSignal::DefaultApi.new
710
- app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
711
- segment_id = 'segment_id_example' # String | The segment_id can be found in the URL of the segment when viewing it in the dashboard.
1008
+ app_id = 'app_id_example' # String |
1009
+ token_id = 'token_id_example' # String |
712
1010
 
713
1011
  begin
714
- # Delete Segment
715
- result = api_instance.delete_segment(app_id, segment_id)
1012
+ # Delete API key
1013
+ result = api_instance.delete_api_key(app_id, token_id)
716
1014
  p result
717
1015
  rescue OneSignal::ApiError => e
718
- puts "Error when calling DefaultApi->delete_segment: #{e}"
1016
+ puts "Error when calling DefaultApi->delete_api_key: #{e}"
719
1017
  end
720
1018
  ```
721
1019
 
722
- #### Using the delete_segment_with_http_info variant
1020
+ #### Using the delete_api_key_with_http_info variant
723
1021
 
724
1022
  This returns an Array which contains the response data, status code and headers.
725
1023
 
726
- > <Array(<GenericSuccessBoolResponse>, Integer, Hash)> delete_segment_with_http_info(app_id, segment_id)
1024
+ > <Array(Object, Integer, Hash)> delete_api_key_with_http_info(app_id, token_id)
727
1025
 
728
1026
  ```ruby
729
1027
  begin
730
- # Delete Segment
731
- data, status_code, headers = api_instance.delete_segment_with_http_info(app_id, segment_id)
1028
+ # Delete API key
1029
+ data, status_code, headers = api_instance.delete_api_key_with_http_info(app_id, token_id)
732
1030
  p status_code # => 2xx
733
1031
  p headers # => { ... }
734
- p data # => <GenericSuccessBoolResponse>
1032
+ p data # => Object
735
1033
  rescue OneSignal::ApiError => e
736
- puts "Error when calling DefaultApi->delete_segment_with_http_info: #{e}"
1034
+ puts "Error when calling DefaultApi->delete_api_key_with_http_info: #{e}"
737
1035
  end
738
1036
  ```
739
1037
 
@@ -741,16 +1039,16 @@ end
741
1039
 
742
1040
  | Name | Type | Description | Notes |
743
1041
  | ---- | ---- | ----------- | ----- |
744
- | **app_id** | **String** | The OneSignal App ID for your app. Available in Keys &amp; IDs. | |
745
- | **segment_id** | **String** | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | |
1042
+ | **app_id** | **String** | | |
1043
+ | **token_id** | **String** | | |
746
1044
 
747
1045
  ### Return type
748
1046
 
749
- [**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)
1047
+ **Object**
750
1048
 
751
1049
  ### Authorization
752
1050
 
753
- [rest_api_key](../README.md#rest_api_key)
1051
+ [organization_api_key](../README.md#organization_api_key)
754
1052
 
755
1053
  ### HTTP request headers
756
1054
 
@@ -758,13 +1056,13 @@ end
758
1056
  - **Accept**: application/json
759
1057
 
760
1058
 
761
- ## delete_subscription
762
-
763
- > delete_subscription(app_id, subscription_id)
1059
+ ## delete_segment
764
1060
 
1061
+ > <GenericSuccessBoolResponse> delete_segment(app_id, segment_id)
765
1062
 
1063
+ Delete Segment
766
1064
 
767
- Deletes the Subscription.
1065
+ Delete a segment (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.
768
1066
 
769
1067
  ### Examples
770
1068
 
@@ -778,12 +1076,83 @@ OneSignal.configure do |config|
778
1076
  end
779
1077
 
780
1078
  api_instance = OneSignal::DefaultApi.new
781
- app_id = 'app_id_example' # String |
782
- subscription_id = 'subscription_id_example' # String |
1079
+ app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
1080
+ segment_id = 'segment_id_example' # String | The segment_id can be found in the URL of the segment when viewing it in the dashboard.
783
1081
 
784
1082
  begin
785
-
786
- api_instance.delete_subscription(app_id, subscription_id)
1083
+ # Delete Segment
1084
+ result = api_instance.delete_segment(app_id, segment_id)
1085
+ p result
1086
+ rescue OneSignal::ApiError => e
1087
+ puts "Error when calling DefaultApi->delete_segment: #{e}"
1088
+ end
1089
+ ```
1090
+
1091
+ #### Using the delete_segment_with_http_info variant
1092
+
1093
+ This returns an Array which contains the response data, status code and headers.
1094
+
1095
+ > <Array(<GenericSuccessBoolResponse>, Integer, Hash)> delete_segment_with_http_info(app_id, segment_id)
1096
+
1097
+ ```ruby
1098
+ begin
1099
+ # Delete Segment
1100
+ data, status_code, headers = api_instance.delete_segment_with_http_info(app_id, segment_id)
1101
+ p status_code # => 2xx
1102
+ p headers # => { ... }
1103
+ p data # => <GenericSuccessBoolResponse>
1104
+ rescue OneSignal::ApiError => e
1105
+ puts "Error when calling DefaultApi->delete_segment_with_http_info: #{e}"
1106
+ end
1107
+ ```
1108
+
1109
+ ### Parameters
1110
+
1111
+ | Name | Type | Description | Notes |
1112
+ | ---- | ---- | ----------- | ----- |
1113
+ | **app_id** | **String** | The OneSignal App ID for your app. Available in Keys &amp; IDs. | |
1114
+ | **segment_id** | **String** | The segment_id can be found in the URL of the segment when viewing it in the dashboard. | |
1115
+
1116
+ ### Return type
1117
+
1118
+ [**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)
1119
+
1120
+ ### Authorization
1121
+
1122
+ [rest_api_key](../README.md#rest_api_key)
1123
+
1124
+ ### HTTP request headers
1125
+
1126
+ - **Content-Type**: Not defined
1127
+ - **Accept**: application/json
1128
+
1129
+
1130
+ ## delete_subscription
1131
+
1132
+ > delete_subscription(app_id, subscription_id)
1133
+
1134
+
1135
+
1136
+ Deletes the Subscription.
1137
+
1138
+ ### Examples
1139
+
1140
+ ```ruby
1141
+ require 'onesignal'
1142
+ # setup authorization
1143
+ OneSignal.configure do |config|
1144
+ # Configure Bearer authorization: rest_api_key
1145
+ config.rest_api_key = 'YOUR_BEARER_TOKEN'
1146
+
1147
+ end
1148
+
1149
+ api_instance = OneSignal::DefaultApi.new
1150
+ app_id = 'app_id_example' # String |
1151
+ subscription_id = 'subscription_id_example' # String |
1152
+
1153
+ begin
1154
+
1155
+ api_instance.delete_subscription(app_id, subscription_id)
787
1156
  rescue OneSignal::ApiError => e
788
1157
  puts "Error when calling DefaultApi->delete_subscription: #{e}"
789
1158
  end
@@ -828,6 +1197,77 @@ nil (empty response body)
828
1197
  - **Accept**: application/json
829
1198
 
830
1199
 
1200
+ ## delete_template
1201
+
1202
+ > <GenericSuccessBoolResponse> delete_template(template_id, app_id)
1203
+
1204
+ Delete template
1205
+
1206
+ Delete a template by id.
1207
+
1208
+ ### Examples
1209
+
1210
+ ```ruby
1211
+ require 'onesignal'
1212
+ # setup authorization
1213
+ OneSignal.configure do |config|
1214
+ # Configure Bearer authorization: rest_api_key
1215
+ config.rest_api_key = 'YOUR_BEARER_TOKEN'
1216
+
1217
+ end
1218
+
1219
+ api_instance = OneSignal::DefaultApi.new
1220
+ template_id = 'template_id_example' # String |
1221
+ app_id = 'app_id_example' # String |
1222
+
1223
+ begin
1224
+ # Delete template
1225
+ result = api_instance.delete_template(template_id, app_id)
1226
+ p result
1227
+ rescue OneSignal::ApiError => e
1228
+ puts "Error when calling DefaultApi->delete_template: #{e}"
1229
+ end
1230
+ ```
1231
+
1232
+ #### Using the delete_template_with_http_info variant
1233
+
1234
+ This returns an Array which contains the response data, status code and headers.
1235
+
1236
+ > <Array(<GenericSuccessBoolResponse>, Integer, Hash)> delete_template_with_http_info(template_id, app_id)
1237
+
1238
+ ```ruby
1239
+ begin
1240
+ # Delete template
1241
+ data, status_code, headers = api_instance.delete_template_with_http_info(template_id, app_id)
1242
+ p status_code # => 2xx
1243
+ p headers # => { ... }
1244
+ p data # => <GenericSuccessBoolResponse>
1245
+ rescue OneSignal::ApiError => e
1246
+ puts "Error when calling DefaultApi->delete_template_with_http_info: #{e}"
1247
+ end
1248
+ ```
1249
+
1250
+ ### Parameters
1251
+
1252
+ | Name | Type | Description | Notes |
1253
+ | ---- | ---- | ----------- | ----- |
1254
+ | **template_id** | **String** | | |
1255
+ | **app_id** | **String** | | |
1256
+
1257
+ ### Return type
1258
+
1259
+ [**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)
1260
+
1261
+ ### Authorization
1262
+
1263
+ [rest_api_key](../README.md#rest_api_key)
1264
+
1265
+ ### HTTP request headers
1266
+
1267
+ - **Content-Type**: Not defined
1268
+ - **Accept**: application/json
1269
+
1270
+
831
1271
  ## delete_user
832
1272
 
833
1273
  > delete_user(app_id, alias_label, alias_id)
@@ -1771,13 +2211,13 @@ end
1771
2211
  - **Accept**: application/json
1772
2212
 
1773
2213
 
1774
- ## transfer_subscription
1775
-
1776
- > <UserIdentityBody> transfer_subscription(app_id, subscription_id, transfer_subscription_request_body)
2214
+ ## rotate_api_key
1777
2215
 
2216
+ > <CreateApiKeyResponse> rotate_api_key(app_id, token_id)
1778
2217
 
2218
+ Rotate API key
1779
2219
 
1780
- Transfers this Subscription to the User identified by the identity in the payload.
2220
+ Rotate a Rich Authentication Token (App API Key) for a OneSignal app. Rotating a key revokes the current token and generates a new one under the same configuration—ideal when a token is lost or compromised but you don’t want to recreate and reconfigure it from scratch.
1781
2221
 
1782
2222
  ### Examples
1783
2223
 
@@ -1785,40 +2225,39 @@ Transfers this Subscription to the User identified by the identity in the payloa
1785
2225
  require 'onesignal'
1786
2226
  # setup authorization
1787
2227
  OneSignal.configure do |config|
1788
- # Configure Bearer authorization: rest_api_key
1789
- config.rest_api_key = 'YOUR_BEARER_TOKEN'
2228
+ # Configure Bearer authorization: organization_api_key
2229
+ config.organization_api_key = 'YOUR_BEARER_TOKEN'
1790
2230
 
1791
2231
  end
1792
2232
 
1793
2233
  api_instance = OneSignal::DefaultApi.new
1794
2234
  app_id = 'app_id_example' # String |
1795
- subscription_id = 'subscription_id_example' # String |
1796
- transfer_subscription_request_body = OneSignal::TransferSubscriptionRequestBody.new # TransferSubscriptionRequestBody |
2235
+ token_id = 'token_id_example' # String |
1797
2236
 
1798
2237
  begin
1799
-
1800
- result = api_instance.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body)
2238
+ # Rotate API key
2239
+ result = api_instance.rotate_api_key(app_id, token_id)
1801
2240
  p result
1802
2241
  rescue OneSignal::ApiError => e
1803
- puts "Error when calling DefaultApi->transfer_subscription: #{e}"
2242
+ puts "Error when calling DefaultApi->rotate_api_key: #{e}"
1804
2243
  end
1805
2244
  ```
1806
2245
 
1807
- #### Using the transfer_subscription_with_http_info variant
2246
+ #### Using the rotate_api_key_with_http_info variant
1808
2247
 
1809
2248
  This returns an Array which contains the response data, status code and headers.
1810
2249
 
1811
- > <Array(<UserIdentityBody>, Integer, Hash)> transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body)
2250
+ > <Array(<CreateApiKeyResponse>, Integer, Hash)> rotate_api_key_with_http_info(app_id, token_id)
1812
2251
 
1813
2252
  ```ruby
1814
2253
  begin
1815
-
1816
- data, status_code, headers = api_instance.transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body)
2254
+ # Rotate API key
2255
+ data, status_code, headers = api_instance.rotate_api_key_with_http_info(app_id, token_id)
1817
2256
  p status_code # => 2xx
1818
2257
  p headers # => { ... }
1819
- p data # => <UserIdentityBody>
2258
+ p data # => <CreateApiKeyResponse>
1820
2259
  rescue OneSignal::ApiError => e
1821
- puts "Error when calling DefaultApi->transfer_subscription_with_http_info: #{e}"
2260
+ puts "Error when calling DefaultApi->rotate_api_key_with_http_info: #{e}"
1822
2261
  end
1823
2262
  ```
1824
2263
 
@@ -1827,30 +2266,29 @@ end
1827
2266
  | Name | Type | Description | Notes |
1828
2267
  | ---- | ---- | ----------- | ----- |
1829
2268
  | **app_id** | **String** | | |
1830
- | **subscription_id** | **String** | | |
1831
- | **transfer_subscription_request_body** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md) | | |
2269
+ | **token_id** | **String** | | |
1832
2270
 
1833
2271
  ### Return type
1834
2272
 
1835
- [**UserIdentityBody**](UserIdentityBody.md)
2273
+ [**CreateApiKeyResponse**](CreateApiKeyResponse.md)
1836
2274
 
1837
2275
  ### Authorization
1838
2276
 
1839
- [rest_api_key](../README.md#rest_api_key)
2277
+ [organization_api_key](../README.md#organization_api_key)
1840
2278
 
1841
2279
  ### HTTP request headers
1842
2280
 
1843
- - **Content-Type**: application/json
2281
+ - **Content-Type**: Not defined
1844
2282
  - **Accept**: application/json
1845
2283
 
1846
2284
 
1847
- ## unsubscribe_email_with_token
2285
+ ## start_live_activity
1848
2286
 
1849
- > <GenericSuccessBoolResponse> unsubscribe_email_with_token(app_id, notification_id, token)
2287
+ > <StartLiveActivitySuccessResponse> start_live_activity(app_id, activity_type, start_live_activity_request)
1850
2288
 
1851
- Unsubscribe with token
2289
+ Start Live Activity
1852
2290
 
1853
- Unsubscribe an email with a token when using your own custom email unsubscribe landing page
2291
+ Remotely start a Live Activity on iOS devices via OneSignal’s REST API.
1854
2292
 
1855
2293
  ### Examples
1856
2294
 
@@ -1864,34 +2302,34 @@ OneSignal.configure do |config|
1864
2302
  end
1865
2303
 
1866
2304
  api_instance = OneSignal::DefaultApi.new
1867
- app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
1868
- notification_id = 'notification_id_example' # String | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report.
1869
- token = 'token_example' # String | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email.
2305
+ app_id = 'app_id_example' # String | Your OneSignal App ID in UUID v4 format.
2306
+ activity_type = 'activity_type_example' # String | The name of the Live Activity defined in your app. This should match the attributes struct used in your app's Live Activity implementation.
2307
+ start_live_activity_request = OneSignal::StartLiveActivityRequest.new({name: 'name_example', event: 'start', activity_id: 'activity_id_example', event_attributes: 3.56, event_updates: 3.56, contents: OneSignal::LanguageStringMap.new, headings: OneSignal::LanguageStringMap.new}) # StartLiveActivityRequest |
1870
2308
 
1871
2309
  begin
1872
- # Unsubscribe with token
1873
- result = api_instance.unsubscribe_email_with_token(app_id, notification_id, token)
2310
+ # Start Live Activity
2311
+ result = api_instance.start_live_activity(app_id, activity_type, start_live_activity_request)
1874
2312
  p result
1875
2313
  rescue OneSignal::ApiError => e
1876
- puts "Error when calling DefaultApi->unsubscribe_email_with_token: #{e}"
2314
+ puts "Error when calling DefaultApi->start_live_activity: #{e}"
1877
2315
  end
1878
2316
  ```
1879
2317
 
1880
- #### Using the unsubscribe_email_with_token_with_http_info variant
2318
+ #### Using the start_live_activity_with_http_info variant
1881
2319
 
1882
2320
  This returns an Array which contains the response data, status code and headers.
1883
2321
 
1884
- > <Array(<GenericSuccessBoolResponse>, Integer, Hash)> unsubscribe_email_with_token_with_http_info(app_id, notification_id, token)
2322
+ > <Array(<StartLiveActivitySuccessResponse>, Integer, Hash)> start_live_activity_with_http_info(app_id, activity_type, start_live_activity_request)
1885
2323
 
1886
2324
  ```ruby
1887
2325
  begin
1888
- # Unsubscribe with token
1889
- data, status_code, headers = api_instance.unsubscribe_email_with_token_with_http_info(app_id, notification_id, token)
2326
+ # Start Live Activity
2327
+ data, status_code, headers = api_instance.start_live_activity_with_http_info(app_id, activity_type, start_live_activity_request)
1890
2328
  p status_code # => 2xx
1891
2329
  p headers # => { ... }
1892
- p data # => <GenericSuccessBoolResponse>
2330
+ p data # => <StartLiveActivitySuccessResponse>
1893
2331
  rescue OneSignal::ApiError => e
1894
- puts "Error when calling DefaultApi->unsubscribe_email_with_token_with_http_info: #{e}"
2332
+ puts "Error when calling DefaultApi->start_live_activity_with_http_info: #{e}"
1895
2333
  end
1896
2334
  ```
1897
2335
 
@@ -1899,13 +2337,13 @@ end
1899
2337
 
1900
2338
  | Name | Type | Description | Notes |
1901
2339
  | ---- | ---- | ----------- | ----- |
1902
- | **app_id** | **String** | The OneSignal App ID for your app. Available in Keys &amp; IDs. | |
1903
- | **notification_id** | **String** | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | |
1904
- | **token** | **String** | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | |
2340
+ | **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | |
2341
+ | **activity_type** | **String** | The name of the Live Activity defined in your app. This should match the attributes struct used in your app&#39;s Live Activity implementation. | |
2342
+ | **start_live_activity_request** | [**StartLiveActivityRequest**](StartLiveActivityRequest.md) | | |
1905
2343
 
1906
2344
  ### Return type
1907
2345
 
1908
- [**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)
2346
+ [**StartLiveActivitySuccessResponse**](StartLiveActivitySuccessResponse.md)
1909
2347
 
1910
2348
  ### Authorization
1911
2349
 
@@ -1913,17 +2351,17 @@ end
1913
2351
 
1914
2352
  ### HTTP request headers
1915
2353
 
1916
- - **Content-Type**: Not defined
2354
+ - **Content-Type**: application/json
1917
2355
  - **Accept**: application/json
1918
2356
 
1919
2357
 
1920
- ## update_app
2358
+ ## transfer_subscription
1921
2359
 
1922
- > <App> update_app(app_id, app)
2360
+ > <UserIdentityBody> transfer_subscription(app_id, subscription_id, transfer_subscription_request_body)
1923
2361
 
1924
- Update an app
1925
2362
 
1926
- Updates the name or configuration settings of an existing OneSignal app
2363
+
2364
+ Transfers this Subscription to the User identified by the identity in the payload.
1927
2365
 
1928
2366
  ### Examples
1929
2367
 
@@ -1931,39 +2369,40 @@ Updates the name or configuration settings of an existing OneSignal app
1931
2369
  require 'onesignal'
1932
2370
  # setup authorization
1933
2371
  OneSignal.configure do |config|
1934
- # Configure Bearer authorization: organization_api_key
1935
- config.organization_api_key = 'YOUR_BEARER_TOKEN'
2372
+ # Configure Bearer authorization: rest_api_key
2373
+ config.rest_api_key = 'YOUR_BEARER_TOKEN'
1936
2374
 
1937
2375
  end
1938
2376
 
1939
2377
  api_instance = OneSignal::DefaultApi.new
1940
- app_id = 'app_id_example' # String | An app id
1941
- app = OneSignal::App.new # App |
2378
+ app_id = 'app_id_example' # String |
2379
+ subscription_id = 'subscription_id_example' # String |
2380
+ transfer_subscription_request_body = OneSignal::TransferSubscriptionRequestBody.new # TransferSubscriptionRequestBody |
1942
2381
 
1943
2382
  begin
1944
- # Update an app
1945
- result = api_instance.update_app(app_id, app)
2383
+
2384
+ result = api_instance.transfer_subscription(app_id, subscription_id, transfer_subscription_request_body)
1946
2385
  p result
1947
2386
  rescue OneSignal::ApiError => e
1948
- puts "Error when calling DefaultApi->update_app: #{e}"
2387
+ puts "Error when calling DefaultApi->transfer_subscription: #{e}"
1949
2388
  end
1950
2389
  ```
1951
2390
 
1952
- #### Using the update_app_with_http_info variant
2391
+ #### Using the transfer_subscription_with_http_info variant
1953
2392
 
1954
2393
  This returns an Array which contains the response data, status code and headers.
1955
2394
 
1956
- > <Array(<App>, Integer, Hash)> update_app_with_http_info(app_id, app)
2395
+ > <Array(<UserIdentityBody>, Integer, Hash)> transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body)
1957
2396
 
1958
2397
  ```ruby
1959
2398
  begin
1960
- # Update an app
1961
- data, status_code, headers = api_instance.update_app_with_http_info(app_id, app)
2399
+
2400
+ data, status_code, headers = api_instance.transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body)
1962
2401
  p status_code # => 2xx
1963
2402
  p headers # => { ... }
1964
- p data # => <App>
2403
+ p data # => <UserIdentityBody>
1965
2404
  rescue OneSignal::ApiError => e
1966
- puts "Error when calling DefaultApi->update_app_with_http_info: #{e}"
2405
+ puts "Error when calling DefaultApi->transfer_subscription_with_http_info: #{e}"
1967
2406
  end
1968
2407
  ```
1969
2408
 
@@ -1971,16 +2410,17 @@ end
1971
2410
 
1972
2411
  | Name | Type | Description | Notes |
1973
2412
  | ---- | ---- | ----------- | ----- |
1974
- | **app_id** | **String** | An app id | |
1975
- | **app** | [**App**](App.md) | | |
2413
+ | **app_id** | **String** | | |
2414
+ | **subscription_id** | **String** | | |
2415
+ | **transfer_subscription_request_body** | [**TransferSubscriptionRequestBody**](TransferSubscriptionRequestBody.md) | | |
1976
2416
 
1977
2417
  ### Return type
1978
2418
 
1979
- [**App**](App.md)
2419
+ [**UserIdentityBody**](UserIdentityBody.md)
1980
2420
 
1981
2421
  ### Authorization
1982
2422
 
1983
- [organization_api_key](../README.md#organization_api_key)
2423
+ [rest_api_key](../README.md#rest_api_key)
1984
2424
 
1985
2425
  ### HTTP request headers
1986
2426
 
@@ -1988,13 +2428,13 @@ end
1988
2428
  - **Accept**: application/json
1989
2429
 
1990
2430
 
1991
- ## update_live_activity
2431
+ ## unsubscribe_email_with_token
1992
2432
 
1993
- > <UpdateLiveActivitySuccessResponse> update_live_activity(app_id, activity_id, update_live_activity_request)
2433
+ > <GenericSuccessBoolResponse> unsubscribe_email_with_token(app_id, notification_id, token)
1994
2434
 
1995
- Update a Live Activity via Push
2435
+ Unsubscribe with token
1996
2436
 
1997
- Updates a specified live activity.
2437
+ Unsubscribe an email with a token when using your own custom email unsubscribe landing page
1998
2438
 
1999
2439
  ### Examples
2000
2440
 
@@ -2009,33 +2449,33 @@ end
2009
2449
 
2010
2450
  api_instance = OneSignal::DefaultApi.new
2011
2451
  app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
2012
- activity_id = 'activity_id_example' # String | Live Activity record ID
2013
- update_live_activity_request = OneSignal::UpdateLiveActivityRequest.new({name: 'name_example', event: 'update', event_updates: 3.56}) # UpdateLiveActivityRequest |
2452
+ notification_id = 'notification_id_example' # String | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report.
2453
+ token = 'token_example' # String | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email.
2014
2454
 
2015
2455
  begin
2016
- # Update a Live Activity via Push
2017
- result = api_instance.update_live_activity(app_id, activity_id, update_live_activity_request)
2456
+ # Unsubscribe with token
2457
+ result = api_instance.unsubscribe_email_with_token(app_id, notification_id, token)
2018
2458
  p result
2019
2459
  rescue OneSignal::ApiError => e
2020
- puts "Error when calling DefaultApi->update_live_activity: #{e}"
2460
+ puts "Error when calling DefaultApi->unsubscribe_email_with_token: #{e}"
2021
2461
  end
2022
2462
  ```
2023
2463
 
2024
- #### Using the update_live_activity_with_http_info variant
2464
+ #### Using the unsubscribe_email_with_token_with_http_info variant
2025
2465
 
2026
2466
  This returns an Array which contains the response data, status code and headers.
2027
2467
 
2028
- > <Array(<UpdateLiveActivitySuccessResponse>, Integer, Hash)> update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request)
2468
+ > <Array(<GenericSuccessBoolResponse>, Integer, Hash)> unsubscribe_email_with_token_with_http_info(app_id, notification_id, token)
2029
2469
 
2030
2470
  ```ruby
2031
2471
  begin
2032
- # Update a Live Activity via Push
2033
- data, status_code, headers = api_instance.update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request)
2472
+ # Unsubscribe with token
2473
+ data, status_code, headers = api_instance.unsubscribe_email_with_token_with_http_info(app_id, notification_id, token)
2034
2474
  p status_code # => 2xx
2035
2475
  p headers # => { ... }
2036
- p data # => <UpdateLiveActivitySuccessResponse>
2476
+ p data # => <GenericSuccessBoolResponse>
2037
2477
  rescue OneSignal::ApiError => e
2038
- puts "Error when calling DefaultApi->update_live_activity_with_http_info: #{e}"
2478
+ puts "Error when calling DefaultApi->unsubscribe_email_with_token_with_http_info: #{e}"
2039
2479
  end
2040
2480
  ```
2041
2481
 
@@ -2044,8 +2484,225 @@ end
2044
2484
  | Name | Type | Description | Notes |
2045
2485
  | ---- | ---- | ----------- | ----- |
2046
2486
  | **app_id** | **String** | The OneSignal App ID for your app. Available in Keys &amp; IDs. | |
2047
- | **activity_id** | **String** | Live Activity record ID | |
2048
- | **update_live_activity_request** | [**UpdateLiveActivityRequest**](UpdateLiveActivityRequest.md) | | |
2487
+ | **notification_id** | **String** | The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report. | |
2488
+ | **token** | **String** | The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email. | |
2489
+
2490
+ ### Return type
2491
+
2492
+ [**GenericSuccessBoolResponse**](GenericSuccessBoolResponse.md)
2493
+
2494
+ ### Authorization
2495
+
2496
+ [rest_api_key](../README.md#rest_api_key)
2497
+
2498
+ ### HTTP request headers
2499
+
2500
+ - **Content-Type**: Not defined
2501
+ - **Accept**: application/json
2502
+
2503
+
2504
+ ## update_api_key
2505
+
2506
+ > Object update_api_key(app_id, token_id, update_api_key_request)
2507
+
2508
+ Update API key
2509
+
2510
+ Update a Rich Authentication Token (App API Key) for a OneSignal app.
2511
+
2512
+ ### Examples
2513
+
2514
+ ```ruby
2515
+ require 'onesignal'
2516
+ # setup authorization
2517
+ OneSignal.configure do |config|
2518
+ # Configure Bearer authorization: organization_api_key
2519
+ config.organization_api_key = 'YOUR_BEARER_TOKEN'
2520
+
2521
+ end
2522
+
2523
+ api_instance = OneSignal::DefaultApi.new
2524
+ app_id = 'app_id_example' # String |
2525
+ token_id = 'token_id_example' # String |
2526
+ update_api_key_request = OneSignal::UpdateApiKeyRequest.new # UpdateApiKeyRequest |
2527
+
2528
+ begin
2529
+ # Update API key
2530
+ result = api_instance.update_api_key(app_id, token_id, update_api_key_request)
2531
+ p result
2532
+ rescue OneSignal::ApiError => e
2533
+ puts "Error when calling DefaultApi->update_api_key: #{e}"
2534
+ end
2535
+ ```
2536
+
2537
+ #### Using the update_api_key_with_http_info variant
2538
+
2539
+ This returns an Array which contains the response data, status code and headers.
2540
+
2541
+ > <Array(Object, Integer, Hash)> update_api_key_with_http_info(app_id, token_id, update_api_key_request)
2542
+
2543
+ ```ruby
2544
+ begin
2545
+ # Update API key
2546
+ data, status_code, headers = api_instance.update_api_key_with_http_info(app_id, token_id, update_api_key_request)
2547
+ p status_code # => 2xx
2548
+ p headers # => { ... }
2549
+ p data # => Object
2550
+ rescue OneSignal::ApiError => e
2551
+ puts "Error when calling DefaultApi->update_api_key_with_http_info: #{e}"
2552
+ end
2553
+ ```
2554
+
2555
+ ### Parameters
2556
+
2557
+ | Name | Type | Description | Notes |
2558
+ | ---- | ---- | ----------- | ----- |
2559
+ | **app_id** | **String** | | |
2560
+ | **token_id** | **String** | | |
2561
+ | **update_api_key_request** | [**UpdateApiKeyRequest**](UpdateApiKeyRequest.md) | | |
2562
+
2563
+ ### Return type
2564
+
2565
+ **Object**
2566
+
2567
+ ### Authorization
2568
+
2569
+ [organization_api_key](../README.md#organization_api_key)
2570
+
2571
+ ### HTTP request headers
2572
+
2573
+ - **Content-Type**: application/json
2574
+ - **Accept**: application/json
2575
+
2576
+
2577
+ ## update_app
2578
+
2579
+ > <App> update_app(app_id, app)
2580
+
2581
+ Update an app
2582
+
2583
+ Updates the name or configuration settings of an existing OneSignal app
2584
+
2585
+ ### Examples
2586
+
2587
+ ```ruby
2588
+ require 'onesignal'
2589
+ # setup authorization
2590
+ OneSignal.configure do |config|
2591
+ # Configure Bearer authorization: organization_api_key
2592
+ config.organization_api_key = 'YOUR_BEARER_TOKEN'
2593
+
2594
+ end
2595
+
2596
+ api_instance = OneSignal::DefaultApi.new
2597
+ app_id = 'app_id_example' # String | An app id
2598
+ app = OneSignal::App.new # App |
2599
+
2600
+ begin
2601
+ # Update an app
2602
+ result = api_instance.update_app(app_id, app)
2603
+ p result
2604
+ rescue OneSignal::ApiError => e
2605
+ puts "Error when calling DefaultApi->update_app: #{e}"
2606
+ end
2607
+ ```
2608
+
2609
+ #### Using the update_app_with_http_info variant
2610
+
2611
+ This returns an Array which contains the response data, status code and headers.
2612
+
2613
+ > <Array(<App>, Integer, Hash)> update_app_with_http_info(app_id, app)
2614
+
2615
+ ```ruby
2616
+ begin
2617
+ # Update an app
2618
+ data, status_code, headers = api_instance.update_app_with_http_info(app_id, app)
2619
+ p status_code # => 2xx
2620
+ p headers # => { ... }
2621
+ p data # => <App>
2622
+ rescue OneSignal::ApiError => e
2623
+ puts "Error when calling DefaultApi->update_app_with_http_info: #{e}"
2624
+ end
2625
+ ```
2626
+
2627
+ ### Parameters
2628
+
2629
+ | Name | Type | Description | Notes |
2630
+ | ---- | ---- | ----------- | ----- |
2631
+ | **app_id** | **String** | An app id | |
2632
+ | **app** | [**App**](App.md) | | |
2633
+
2634
+ ### Return type
2635
+
2636
+ [**App**](App.md)
2637
+
2638
+ ### Authorization
2639
+
2640
+ [organization_api_key](../README.md#organization_api_key)
2641
+
2642
+ ### HTTP request headers
2643
+
2644
+ - **Content-Type**: application/json
2645
+ - **Accept**: application/json
2646
+
2647
+
2648
+ ## update_live_activity
2649
+
2650
+ > <UpdateLiveActivitySuccessResponse> update_live_activity(app_id, activity_id, update_live_activity_request)
2651
+
2652
+ Update a Live Activity via Push
2653
+
2654
+ Updates a specified live activity.
2655
+
2656
+ ### Examples
2657
+
2658
+ ```ruby
2659
+ require 'onesignal'
2660
+ # setup authorization
2661
+ OneSignal.configure do |config|
2662
+ # Configure Bearer authorization: rest_api_key
2663
+ config.rest_api_key = 'YOUR_BEARER_TOKEN'
2664
+
2665
+ end
2666
+
2667
+ api_instance = OneSignal::DefaultApi.new
2668
+ app_id = 'app_id_example' # String | The OneSignal App ID for your app. Available in Keys & IDs.
2669
+ activity_id = 'activity_id_example' # String | Live Activity record ID
2670
+ update_live_activity_request = OneSignal::UpdateLiveActivityRequest.new({name: 'name_example', event: 'update', event_updates: 3.56}) # UpdateLiveActivityRequest |
2671
+
2672
+ begin
2673
+ # Update a Live Activity via Push
2674
+ result = api_instance.update_live_activity(app_id, activity_id, update_live_activity_request)
2675
+ p result
2676
+ rescue OneSignal::ApiError => e
2677
+ puts "Error when calling DefaultApi->update_live_activity: #{e}"
2678
+ end
2679
+ ```
2680
+
2681
+ #### Using the update_live_activity_with_http_info variant
2682
+
2683
+ This returns an Array which contains the response data, status code and headers.
2684
+
2685
+ > <Array(<UpdateLiveActivitySuccessResponse>, Integer, Hash)> update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request)
2686
+
2687
+ ```ruby
2688
+ begin
2689
+ # Update a Live Activity via Push
2690
+ data, status_code, headers = api_instance.update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request)
2691
+ p status_code # => 2xx
2692
+ p headers # => { ... }
2693
+ p data # => <UpdateLiveActivitySuccessResponse>
2694
+ rescue OneSignal::ApiError => e
2695
+ puts "Error when calling DefaultApi->update_live_activity_with_http_info: #{e}"
2696
+ end
2697
+ ```
2698
+
2699
+ ### Parameters
2700
+
2701
+ | Name | Type | Description | Notes |
2702
+ | ---- | ---- | ----------- | ----- |
2703
+ | **app_id** | **String** | The OneSignal App ID for your app. Available in Keys &amp; IDs. | |
2704
+ | **activity_id** | **String** | Live Activity record ID | |
2705
+ | **update_live_activity_request** | [**UpdateLiveActivityRequest**](UpdateLiveActivityRequest.md) | | |
2049
2706
 
2050
2707
  ### Return type
2051
2708
 
@@ -2133,6 +2790,154 @@ nil (empty response body)
2133
2790
  - **Accept**: application/json
2134
2791
 
2135
2792
 
2793
+ ## update_subscription_by_token
2794
+
2795
+ > Object update_subscription_by_token(app_id, token_type, token, subscription_body)
2796
+
2797
+ Update subscription by token
2798
+
2799
+ Update properties on an existing OneSignal subscription using its token.
2800
+
2801
+ ### Examples
2802
+
2803
+ ```ruby
2804
+ require 'onesignal'
2805
+ # setup authorization
2806
+ OneSignal.configure do |config|
2807
+ # Configure Bearer authorization: rest_api_key
2808
+ config.rest_api_key = 'YOUR_BEARER_TOKEN'
2809
+
2810
+ end
2811
+
2812
+ api_instance = OneSignal::DefaultApi.new
2813
+ app_id = 'app_id_example' # String | Your OneSignal App ID in UUID v4 format.
2814
+ token_type = 'token_type_example' # String | The type of token to use when looking up the subscription. See Subscription Types.
2815
+ token = 'token_example' # String | The value of the token to lookup by (e.g., email address, phone number).
2816
+ subscription_body = OneSignal::SubscriptionBody.new # SubscriptionBody |
2817
+
2818
+ begin
2819
+ # Update subscription by token
2820
+ result = api_instance.update_subscription_by_token(app_id, token_type, token, subscription_body)
2821
+ p result
2822
+ rescue OneSignal::ApiError => e
2823
+ puts "Error when calling DefaultApi->update_subscription_by_token: #{e}"
2824
+ end
2825
+ ```
2826
+
2827
+ #### Using the update_subscription_by_token_with_http_info variant
2828
+
2829
+ This returns an Array which contains the response data, status code and headers.
2830
+
2831
+ > <Array(Object, Integer, Hash)> update_subscription_by_token_with_http_info(app_id, token_type, token, subscription_body)
2832
+
2833
+ ```ruby
2834
+ begin
2835
+ # Update subscription by token
2836
+ data, status_code, headers = api_instance.update_subscription_by_token_with_http_info(app_id, token_type, token, subscription_body)
2837
+ p status_code # => 2xx
2838
+ p headers # => { ... }
2839
+ p data # => Object
2840
+ rescue OneSignal::ApiError => e
2841
+ puts "Error when calling DefaultApi->update_subscription_by_token_with_http_info: #{e}"
2842
+ end
2843
+ ```
2844
+
2845
+ ### Parameters
2846
+
2847
+ | Name | Type | Description | Notes |
2848
+ | ---- | ---- | ----------- | ----- |
2849
+ | **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | |
2850
+ | **token_type** | **String** | The type of token to use when looking up the subscription. See Subscription Types. | |
2851
+ | **token** | **String** | The value of the token to lookup by (e.g., email address, phone number). | |
2852
+ | **subscription_body** | [**SubscriptionBody**](SubscriptionBody.md) | | |
2853
+
2854
+ ### Return type
2855
+
2856
+ **Object**
2857
+
2858
+ ### Authorization
2859
+
2860
+ [rest_api_key](../README.md#rest_api_key)
2861
+
2862
+ ### HTTP request headers
2863
+
2864
+ - **Content-Type**: application/json
2865
+ - **Accept**: application/json
2866
+
2867
+
2868
+ ## update_template
2869
+
2870
+ > <TemplateResource> update_template(template_id, app_id, update_template_request)
2871
+
2872
+ Update template
2873
+
2874
+ Update an existing template.
2875
+
2876
+ ### Examples
2877
+
2878
+ ```ruby
2879
+ require 'onesignal'
2880
+ # setup authorization
2881
+ OneSignal.configure do |config|
2882
+ # Configure Bearer authorization: rest_api_key
2883
+ config.rest_api_key = 'YOUR_BEARER_TOKEN'
2884
+
2885
+ end
2886
+
2887
+ api_instance = OneSignal::DefaultApi.new
2888
+ template_id = 'template_id_example' # String |
2889
+ app_id = 'app_id_example' # String |
2890
+ update_template_request = OneSignal::UpdateTemplateRequest.new # UpdateTemplateRequest |
2891
+
2892
+ begin
2893
+ # Update template
2894
+ result = api_instance.update_template(template_id, app_id, update_template_request)
2895
+ p result
2896
+ rescue OneSignal::ApiError => e
2897
+ puts "Error when calling DefaultApi->update_template: #{e}"
2898
+ end
2899
+ ```
2900
+
2901
+ #### Using the update_template_with_http_info variant
2902
+
2903
+ This returns an Array which contains the response data, status code and headers.
2904
+
2905
+ > <Array(<TemplateResource>, Integer, Hash)> update_template_with_http_info(template_id, app_id, update_template_request)
2906
+
2907
+ ```ruby
2908
+ begin
2909
+ # Update template
2910
+ data, status_code, headers = api_instance.update_template_with_http_info(template_id, app_id, update_template_request)
2911
+ p status_code # => 2xx
2912
+ p headers # => { ... }
2913
+ p data # => <TemplateResource>
2914
+ rescue OneSignal::ApiError => e
2915
+ puts "Error when calling DefaultApi->update_template_with_http_info: #{e}"
2916
+ end
2917
+ ```
2918
+
2919
+ ### Parameters
2920
+
2921
+ | Name | Type | Description | Notes |
2922
+ | ---- | ---- | ----------- | ----- |
2923
+ | **template_id** | **String** | | |
2924
+ | **app_id** | **String** | | |
2925
+ | **update_template_request** | [**UpdateTemplateRequest**](UpdateTemplateRequest.md) | | |
2926
+
2927
+ ### Return type
2928
+
2929
+ [**TemplateResource**](TemplateResource.md)
2930
+
2931
+ ### Authorization
2932
+
2933
+ [rest_api_key](../README.md#rest_api_key)
2934
+
2935
+ ### HTTP request headers
2936
+
2937
+ - **Content-Type**: application/json
2938
+ - **Accept**: application/json
2939
+
2940
+
2136
2941
  ## update_user
2137
2942
 
2138
2943
  > <PropertiesBody> update_user(app_id, alias_label, alias_id, update_user_request)
@@ -2207,3 +3012,220 @@ end
2207
3012
  - **Content-Type**: application/json
2208
3013
  - **Accept**: application/json
2209
3014
 
3015
+
3016
+ ## view_api_keys
3017
+
3018
+ > <ApiKeyTokensListResponse> view_api_keys(app_id)
3019
+
3020
+ View API keys
3021
+
3022
+ View the details of all of your current app API keys (Rich Authentication Token) for a single OneSignal app.
3023
+
3024
+ ### Examples
3025
+
3026
+ ```ruby
3027
+ require 'onesignal'
3028
+ # setup authorization
3029
+ OneSignal.configure do |config|
3030
+ # Configure Bearer authorization: organization_api_key
3031
+ config.organization_api_key = 'YOUR_BEARER_TOKEN'
3032
+
3033
+ end
3034
+
3035
+ api_instance = OneSignal::DefaultApi.new
3036
+ app_id = 'app_id_example' # String |
3037
+
3038
+ begin
3039
+ # View API keys
3040
+ result = api_instance.view_api_keys(app_id)
3041
+ p result
3042
+ rescue OneSignal::ApiError => e
3043
+ puts "Error when calling DefaultApi->view_api_keys: #{e}"
3044
+ end
3045
+ ```
3046
+
3047
+ #### Using the view_api_keys_with_http_info variant
3048
+
3049
+ This returns an Array which contains the response data, status code and headers.
3050
+
3051
+ > <Array(<ApiKeyTokensListResponse>, Integer, Hash)> view_api_keys_with_http_info(app_id)
3052
+
3053
+ ```ruby
3054
+ begin
3055
+ # View API keys
3056
+ data, status_code, headers = api_instance.view_api_keys_with_http_info(app_id)
3057
+ p status_code # => 2xx
3058
+ p headers # => { ... }
3059
+ p data # => <ApiKeyTokensListResponse>
3060
+ rescue OneSignal::ApiError => e
3061
+ puts "Error when calling DefaultApi->view_api_keys_with_http_info: #{e}"
3062
+ end
3063
+ ```
3064
+
3065
+ ### Parameters
3066
+
3067
+ | Name | Type | Description | Notes |
3068
+ | ---- | ---- | ----------- | ----- |
3069
+ | **app_id** | **String** | | |
3070
+
3071
+ ### Return type
3072
+
3073
+ [**ApiKeyTokensListResponse**](ApiKeyTokensListResponse.md)
3074
+
3075
+ ### Authorization
3076
+
3077
+ [organization_api_key](../README.md#organization_api_key)
3078
+
3079
+ ### HTTP request headers
3080
+
3081
+ - **Content-Type**: Not defined
3082
+ - **Accept**: application/json
3083
+
3084
+
3085
+ ## view_template
3086
+
3087
+ > <TemplateResource> view_template(template_id, app_id)
3088
+
3089
+ View template
3090
+
3091
+ Fetch a single template by id.
3092
+
3093
+ ### Examples
3094
+
3095
+ ```ruby
3096
+ require 'onesignal'
3097
+ # setup authorization
3098
+ OneSignal.configure do |config|
3099
+ # Configure Bearer authorization: rest_api_key
3100
+ config.rest_api_key = 'YOUR_BEARER_TOKEN'
3101
+
3102
+ end
3103
+
3104
+ api_instance = OneSignal::DefaultApi.new
3105
+ template_id = 'template_id_example' # String |
3106
+ app_id = 'app_id_example' # String |
3107
+
3108
+ begin
3109
+ # View template
3110
+ result = api_instance.view_template(template_id, app_id)
3111
+ p result
3112
+ rescue OneSignal::ApiError => e
3113
+ puts "Error when calling DefaultApi->view_template: #{e}"
3114
+ end
3115
+ ```
3116
+
3117
+ #### Using the view_template_with_http_info variant
3118
+
3119
+ This returns an Array which contains the response data, status code and headers.
3120
+
3121
+ > <Array(<TemplateResource>, Integer, Hash)> view_template_with_http_info(template_id, app_id)
3122
+
3123
+ ```ruby
3124
+ begin
3125
+ # View template
3126
+ data, status_code, headers = api_instance.view_template_with_http_info(template_id, app_id)
3127
+ p status_code # => 2xx
3128
+ p headers # => { ... }
3129
+ p data # => <TemplateResource>
3130
+ rescue OneSignal::ApiError => e
3131
+ puts "Error when calling DefaultApi->view_template_with_http_info: #{e}"
3132
+ end
3133
+ ```
3134
+
3135
+ ### Parameters
3136
+
3137
+ | Name | Type | Description | Notes |
3138
+ | ---- | ---- | ----------- | ----- |
3139
+ | **template_id** | **String** | | |
3140
+ | **app_id** | **String** | | |
3141
+
3142
+ ### Return type
3143
+
3144
+ [**TemplateResource**](TemplateResource.md)
3145
+
3146
+ ### Authorization
3147
+
3148
+ [rest_api_key](../README.md#rest_api_key)
3149
+
3150
+ ### HTTP request headers
3151
+
3152
+ - **Content-Type**: Not defined
3153
+ - **Accept**: application/json
3154
+
3155
+
3156
+ ## view_templates
3157
+
3158
+ > <TemplatesListResponse> view_templates(app_id, opts)
3159
+
3160
+ View templates
3161
+
3162
+ List templates for an app.
3163
+
3164
+ ### Examples
3165
+
3166
+ ```ruby
3167
+ require 'onesignal'
3168
+ # setup authorization
3169
+ OneSignal.configure do |config|
3170
+ # Configure Bearer authorization: rest_api_key
3171
+ config.rest_api_key = 'YOUR_BEARER_TOKEN'
3172
+
3173
+ end
3174
+
3175
+ api_instance = OneSignal::DefaultApi.new
3176
+ app_id = 'app_id_example' # String | Your OneSignal App ID in UUID v4 format.
3177
+ opts = {
3178
+ limit: 56, # Integer | Maximum number of templates. Default and max is 50.
3179
+ offset: 56, # Integer | Pagination offset.
3180
+ channel: 'push' # String | Filter by delivery channel.
3181
+ }
3182
+
3183
+ begin
3184
+ # View templates
3185
+ result = api_instance.view_templates(app_id, opts)
3186
+ p result
3187
+ rescue OneSignal::ApiError => e
3188
+ puts "Error when calling DefaultApi->view_templates: #{e}"
3189
+ end
3190
+ ```
3191
+
3192
+ #### Using the view_templates_with_http_info variant
3193
+
3194
+ This returns an Array which contains the response data, status code and headers.
3195
+
3196
+ > <Array(<TemplatesListResponse>, Integer, Hash)> view_templates_with_http_info(app_id, opts)
3197
+
3198
+ ```ruby
3199
+ begin
3200
+ # View templates
3201
+ data, status_code, headers = api_instance.view_templates_with_http_info(app_id, opts)
3202
+ p status_code # => 2xx
3203
+ p headers # => { ... }
3204
+ p data # => <TemplatesListResponse>
3205
+ rescue OneSignal::ApiError => e
3206
+ puts "Error when calling DefaultApi->view_templates_with_http_info: #{e}"
3207
+ end
3208
+ ```
3209
+
3210
+ ### Parameters
3211
+
3212
+ | Name | Type | Description | Notes |
3213
+ | ---- | ---- | ----------- | ----- |
3214
+ | **app_id** | **String** | Your OneSignal App ID in UUID v4 format. | |
3215
+ | **limit** | **Integer** | Maximum number of templates. Default and max is 50. | [optional][default to 50] |
3216
+ | **offset** | **Integer** | Pagination offset. | [optional][default to 0] |
3217
+ | **channel** | **String** | Filter by delivery channel. | [optional] |
3218
+
3219
+ ### Return type
3220
+
3221
+ [**TemplatesListResponse**](TemplatesListResponse.md)
3222
+
3223
+ ### Authorization
3224
+
3225
+ [rest_api_key](../README.md#rest_api_key)
3226
+
3227
+ ### HTTP request headers
3228
+
3229
+ - **Content-Type**: Not defined
3230
+ - **Accept**: application/json
3231
+