onesignal 1.0.0.beta1 → 2.2.0

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 (230) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/Gemfile.lock +74 -0
  4. data/LICENSE +24 -0
  5. data/README.md +77 -23
  6. data/RELEASE_INSTRUCTIONS.md +11 -0
  7. data/docs/App.md +9 -1
  8. data/docs/BasicNotification.md +230 -0
  9. data/docs/BasicNotificationAllOf.md +202 -0
  10. data/docs/{NotificationAllOfAndroidBackgroundLayout.md → BasicNotificationAllOfAndroidBackgroundLayout.md} +2 -2
  11. data/docs/BeginLiveActivityRequest.md +20 -0
  12. data/docs/CancelNotificationSuccessResponse.md +18 -0
  13. data/docs/CreateNotificationSuccessResponse.md +24 -0
  14. data/docs/{InlineResponse2004.md → CreatePlayerSuccessResponse.md} +2 -2
  15. data/docs/{InlineResponse409.md → CreateSegmentConflictResponse.md} +2 -2
  16. data/docs/CreateSegmentSuccessResponse.md +20 -0
  17. data/docs/CreateSubscriptionRequestBody.md +20 -0
  18. data/docs/CreateUserConflictResponse.md +18 -0
  19. data/docs/CreateUserConflictResponseErrorsInner.md +22 -0
  20. data/docs/CreateUserConflictResponseErrorsItemsMeta.md +18 -0
  21. data/docs/DefaultApi.md +1629 -304
  22. data/docs/DeletePlayerNotFoundResponse.md +18 -0
  23. data/docs/{InlineResponse2001.md → DeletePlayerSuccessResponse.md} +3 -3
  24. data/docs/DeleteSegmentNotFoundResponse.md +18 -0
  25. data/docs/DeleteSegmentSuccessResponse.md +18 -0
  26. data/docs/DeliveryData.md +5 -5
  27. data/docs/{InlineResponse2005.md → ExportEventsSuccessResponse.md} +2 -2
  28. data/docs/ExportPlayersRequestBody.md +2 -2
  29. data/docs/ExportPlayersSuccessResponse.md +18 -0
  30. data/docs/Filter.md +1 -1
  31. data/docs/FilterExpressions.md +1 -1
  32. data/docs/GenericError.md +18 -0
  33. data/docs/GenericErrorErrorsInner.md +20 -0
  34. data/docs/InlineResponse200.md +2 -8
  35. data/docs/InlineResponse2003.md +2 -2
  36. data/docs/InlineResponse201.md +2 -4
  37. data/docs/InlineResponse202.md +18 -0
  38. data/docs/InvalidIdentifierError.md +20 -0
  39. data/docs/Notification.md +33 -41
  40. data/docs/Notification200Errors.md +49 -0
  41. data/docs/NotificationAllOf.md +2 -176
  42. data/docs/{InlineResponse2002.md → NotificationHistorySuccessResponse.md} +3 -3
  43. data/docs/NotificationSlice.md +1 -1
  44. data/docs/NotificationTarget.md +6 -26
  45. data/docs/NotificationWithMeta.md +252 -0
  46. data/docs/NotificationWithMetaAllOf.md +38 -0
  47. data/docs/OutcomesData.md +18 -0
  48. data/docs/PlatformDeliveryData.md +5 -1
  49. data/docs/PlatformDeliveryDataEmailAllOf.md +30 -0
  50. data/docs/PlatformDeliveryDataSmsAllOf.md +22 -0
  51. data/docs/Player.md +3 -3
  52. data/docs/PlayerNotificationTarget.md +6 -2
  53. data/docs/PlayerNotificationTargetIncludeAliases.md +18 -0
  54. data/docs/PropertiesDeltas.md +22 -0
  55. data/docs/PropertiesObject.md +38 -0
  56. data/docs/Purchase.md +4 -2
  57. data/docs/RateLimiterError.md +18 -0
  58. data/docs/StringMap.md +1 -1
  59. data/docs/SubscriptionObject.md +50 -0
  60. data/docs/TransferSubscriptionRequestBody.md +18 -0
  61. data/docs/UpdateLiveActivityRequest.md +24 -0
  62. data/docs/UpdateLiveActivitySuccessResponse.md +20 -0
  63. data/docs/UpdatePlayerSuccessResponse.md +18 -0
  64. data/docs/UpdatePlayerTagsSuccessResponse.md +18 -0
  65. data/docs/UpdateSubscriptionRequestBody.md +18 -0
  66. data/docs/UpdateUserRequest.md +22 -0
  67. data/docs/User.md +24 -0
  68. data/docs/UserIdentityRequestBody.md +18 -0
  69. data/docs/UserIdentityResponse.md +18 -0
  70. data/docs/UserSubscriptionOptions.md +18 -0
  71. data/lib/onesignal/api/default_api.rb +1657 -268
  72. data/lib/onesignal/api_client.rb +9 -7
  73. data/lib/onesignal/api_error.rb +2 -2
  74. data/lib/onesignal/configuration.rb +11 -8
  75. data/lib/onesignal/models/app.rb +59 -8
  76. data/lib/onesignal/models/basic_notification.rb +1442 -0
  77. data/lib/onesignal/models/basic_notification_all_of.rb +1252 -0
  78. data/lib/onesignal/models/{notification_all_of_android_background_layout.rb → basic_notification_all_of_android_background_layout.rb} +6 -5
  79. data/lib/onesignal/models/begin_live_activity_request.rb +238 -0
  80. data/lib/onesignal/models/button.rb +3 -2
  81. data/lib/onesignal/models/cancel_notification_success_response.rb +219 -0
  82. data/lib/onesignal/models/create_notification_success_response.rb +248 -0
  83. data/lib/onesignal/models/{inline_response2004.rb → create_player_success_response.rb} +6 -5
  84. data/lib/onesignal/models/{inline_response409.rb → create_segment_conflict_response.rb} +6 -5
  85. data/lib/onesignal/models/create_segment_success_response.rb +229 -0
  86. data/lib/onesignal/models/create_subscription_request_body.rb +228 -0
  87. data/lib/onesignal/models/{inline_response4001.rb → create_user_conflict_response.rb} +8 -16
  88. data/lib/onesignal/models/create_user_conflict_response_errors_inner.rb +237 -0
  89. data/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb +219 -0
  90. data/lib/onesignal/models/delete_player_not_found_response.rb +219 -0
  91. data/lib/onesignal/models/{inline_response2001.rb → delete_player_success_response.rb} +7 -6
  92. data/lib/onesignal/models/delete_segment_not_found_response.rb +219 -0
  93. data/lib/onesignal/models/delete_segment_success_response.rb +219 -0
  94. data/lib/onesignal/models/delivery_data.rb +13 -2
  95. data/lib/onesignal/models/{inline_response2005.rb → export_events_success_response.rb} +6 -5
  96. data/lib/onesignal/models/export_players_request_body.rb +5 -4
  97. data/lib/onesignal/models/export_players_success_response.rb +219 -0
  98. data/lib/onesignal/models/filter.rb +4 -3
  99. data/lib/onesignal/models/filter_expressions.rb +4 -3
  100. data/lib/onesignal/models/{inline_response400.rb → generic_error.rb} +7 -6
  101. data/lib/onesignal/models/generic_error_errors_inner.rb +228 -0
  102. data/lib/onesignal/models/get_notification_request_body.rb +3 -2
  103. data/lib/onesignal/models/inline_response200.rb +12 -47
  104. data/lib/onesignal/models/inline_response2003.rb +12 -9
  105. data/lib/onesignal/models/inline_response201.rb +10 -19
  106. data/lib/onesignal/models/{inline_response4002.rb → inline_response202.rb} +13 -14
  107. data/lib/onesignal/models/invalid_identifier_error.rb +234 -0
  108. data/lib/onesignal/models/notification.rb +209 -157
  109. data/lib/onesignal/models/notification200_errors.rb +105 -0
  110. data/lib/onesignal/models/notification_all_of.rb +8 -911
  111. data/lib/onesignal/models/{inline_response2002.rb → notification_history_success_response.rb} +7 -6
  112. data/lib/onesignal/models/notification_slice.rb +4 -3
  113. data/lib/onesignal/models/notification_target.rb +63 -128
  114. data/lib/onesignal/models/notification_with_meta.rb +1557 -0
  115. data/lib/onesignal/models/notification_with_meta_all_of.rb +323 -0
  116. data/lib/onesignal/models/operator.rb +3 -2
  117. data/lib/onesignal/models/outcome_data.rb +3 -2
  118. data/lib/onesignal/models/outcomes_data.rb +221 -0
  119. data/lib/onesignal/models/platform_delivery_data.rb +27 -6
  120. data/lib/onesignal/models/platform_delivery_data_email_all_of.rb +287 -0
  121. data/lib/onesignal/models/platform_delivery_data_sms_all_of.rb +243 -0
  122. data/lib/onesignal/models/player.rb +14 -13
  123. data/lib/onesignal/models/player_notification_target.rb +63 -7
  124. data/lib/onesignal/models/player_notification_target_include_aliases.rb +221 -0
  125. data/lib/onesignal/models/player_slice.rb +3 -2
  126. data/lib/onesignal/models/properties_deltas.rb +239 -0
  127. data/lib/onesignal/models/properties_object.rb +313 -0
  128. data/lib/onesignal/models/purchase.rb +17 -7
  129. data/lib/onesignal/models/rate_limiter_error.rb +221 -0
  130. data/lib/onesignal/models/segment.rb +3 -2
  131. data/lib/onesignal/models/segment_notification_target.rb +3 -2
  132. data/lib/onesignal/models/string_map.rb +3 -7
  133. data/lib/onesignal/models/{filter_notification_target.rb → subscription_object.rb} +147 -79
  134. data/lib/onesignal/models/transfer_subscription_request_body.rb +221 -0
  135. data/lib/onesignal/models/update_live_activity_request.rb +309 -0
  136. data/lib/onesignal/models/update_live_activity_success_response.rb +228 -0
  137. data/lib/onesignal/models/update_player_success_response.rb +219 -0
  138. data/lib/onesignal/models/update_player_tags_request_body.rb +3 -2
  139. data/lib/onesignal/models/update_player_tags_success_response.rb +219 -0
  140. data/lib/onesignal/models/update_subscription_request_body.rb +219 -0
  141. data/lib/onesignal/models/update_user_request.rb +239 -0
  142. data/lib/onesignal/models/user.rb +250 -0
  143. data/lib/onesignal/models/user_identity_request_body.rb +221 -0
  144. data/lib/onesignal/models/user_identity_response.rb +221 -0
  145. data/lib/onesignal/models/user_subscription_options.rb +219 -0
  146. data/lib/onesignal/version.rb +3 -3
  147. data/lib/onesignal.rb +111 -0
  148. data/onesignal.gemspec +5 -4
  149. data/spec/api/default_api_spec.rb +263 -26
  150. data/spec/api_client_spec.rb +4 -4
  151. data/spec/configuration_spec.rb +5 -5
  152. data/spec/models/app_spec.rb +26 -2
  153. data/spec/models/{notification_all_of_android_background_layout_spec.rb → basic_notification_all_of_android_background_layout_spec.rb} +8 -8
  154. data/spec/models/basic_notification_all_of_spec.rb +590 -0
  155. data/spec/models/basic_notification_spec.rb +678 -0
  156. data/spec/models/begin_live_activity_request_spec.rb +40 -0
  157. data/spec/models/button_spec.rb +2 -2
  158. data/spec/models/cancel_notification_success_response_spec.rb +34 -0
  159. data/spec/models/create_notification_success_response_spec.rb +52 -0
  160. data/spec/models/{inline_response2004_spec.rb → create_player_success_response_spec.rb} +8 -8
  161. data/spec/models/{inline_response4001_spec.rb → create_segment_conflict_response_spec.rb} +8 -8
  162. data/spec/models/{inline_response409_spec.rb → create_segment_success_response_spec.rb} +9 -9
  163. data/spec/models/create_subscription_request_body_spec.rb +40 -0
  164. data/spec/models/create_user_conflict_response_errors_inner_spec.rb +46 -0
  165. data/spec/models/create_user_conflict_response_errors_items_meta_spec.rb +34 -0
  166. data/spec/models/create_user_conflict_response_spec.rb +34 -0
  167. data/spec/models/delete_player_not_found_response_spec.rb +34 -0
  168. data/spec/models/{inline_response2001_spec.rb → delete_player_success_response_spec.rb} +8 -8
  169. data/spec/models/delete_segment_not_found_response_spec.rb +34 -0
  170. data/spec/models/delete_segment_success_response_spec.rb +34 -0
  171. data/spec/models/delivery_data_spec.rb +2 -2
  172. data/spec/models/{inline_response2005_spec.rb → export_events_success_response_spec.rb} +8 -8
  173. data/spec/models/export_players_request_body_spec.rb +2 -2
  174. data/spec/models/export_players_success_response_spec.rb +34 -0
  175. data/spec/models/filter_expressions_spec.rb +2 -2
  176. data/spec/models/filter_spec.rb +2 -2
  177. data/spec/models/generic_error_errors_inner_spec.rb +40 -0
  178. data/spec/models/{inline_response4002_spec.rb → generic_error_spec.rb} +9 -9
  179. data/spec/models/get_notification_request_body_spec.rb +2 -2
  180. data/spec/models/inline_response2003_spec.rb +3 -3
  181. data/spec/models/inline_response200_spec.rb +3 -21
  182. data/spec/models/inline_response201_spec.rb +3 -9
  183. data/spec/models/{inline_response400_spec.rb → inline_response202_spec.rb} +9 -9
  184. data/spec/models/invalid_identifier_error_spec.rb +40 -0
  185. data/spec/models/notification200_errors_spec.rb +31 -0
  186. data/spec/models/notification_all_of_spec.rb +2 -528
  187. data/spec/models/{inline_response2002_spec.rb → notification_history_success_response_spec.rb} +8 -8
  188. data/spec/models/notification_slice_spec.rb +2 -2
  189. data/spec/models/notification_spec.rb +58 -78
  190. data/spec/models/notification_target_spec.rb +18 -74
  191. data/spec/models/notification_with_meta_all_of_spec.rb +94 -0
  192. data/spec/models/notification_with_meta_spec.rb +744 -0
  193. data/spec/models/operator_spec.rb +2 -2
  194. data/spec/models/outcome_data_spec.rb +2 -2
  195. data/spec/models/outcomes_data_spec.rb +34 -0
  196. data/spec/models/platform_delivery_data_email_all_of_spec.rb +70 -0
  197. data/spec/models/platform_delivery_data_sms_all_of_spec.rb +46 -0
  198. data/spec/models/platform_delivery_data_spec.rb +14 -2
  199. data/spec/models/player_notification_target_include_aliases_spec.rb +34 -0
  200. data/spec/models/player_notification_target_spec.rb +18 -2
  201. data/spec/models/player_slice_spec.rb +2 -2
  202. data/spec/models/player_spec.rb +2 -2
  203. data/spec/models/properties_deltas_spec.rb +46 -0
  204. data/spec/models/{filter_notification_target_spec.rb → properties_object_spec.rb} +19 -25
  205. data/spec/models/purchase_spec.rb +8 -2
  206. data/spec/models/rate_limiter_error_spec.rb +34 -0
  207. data/spec/models/segment_notification_target_spec.rb +2 -2
  208. data/spec/models/segment_spec.rb +2 -2
  209. data/spec/models/string_map_spec.rb +2 -2
  210. data/spec/models/subscription_object_spec.rb +134 -0
  211. data/spec/models/transfer_subscription_request_body_spec.rb +34 -0
  212. data/spec/models/update_live_activity_request_spec.rb +60 -0
  213. data/spec/models/update_live_activity_success_response_spec.rb +40 -0
  214. data/spec/models/update_player_success_response_spec.rb +34 -0
  215. data/spec/models/update_player_tags_request_body_spec.rb +2 -2
  216. data/spec/models/update_player_tags_success_response_spec.rb +34 -0
  217. data/spec/models/update_subscription_request_body_spec.rb +34 -0
  218. data/spec/models/update_user_request_spec.rb +46 -0
  219. data/spec/models/user_identity_request_body_spec.rb +34 -0
  220. data/spec/models/user_identity_response_spec.rb +34 -0
  221. data/spec/models/user_spec.rb +52 -0
  222. data/spec/models/user_subscription_options_spec.rb +34 -0
  223. data/spec/spec_helper.rb +2 -2
  224. metadata +198 -51
  225. data/docs/FilterNotificationTarget.md +0 -40
  226. data/docs/InlineResponse400.md +0 -18
  227. data/docs/InlineResponse4001.md +0 -20
  228. data/docs/InlineResponse4002.md +0 -18
  229. data/git_push.sh +0 -58
  230. data/lib/OneSignal.rb +0 -75
@@ -3,10 +3,10 @@
3
3
 
4
4
  #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 1.4.0
7
7
  Contact: devrel@onesignal.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 5.2.0-SNAPSHOT
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -19,12 +19,92 @@ module OneSignal
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Start Live Activity
23
+ # Starts a Live Activity
24
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
25
+ # @param activity_id [String] Live Activity record ID
26
+ # @param begin_live_activity_request [BeginLiveActivityRequest]
27
+ # @param [Hash] opts the optional parameters
28
+ # @return [nil]
29
+ def begin_live_activity(app_id, activity_id, begin_live_activity_request, opts = {})
30
+ begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request, opts)
31
+ nil
32
+ end
33
+
34
+ # Start Live Activity
35
+ # Starts a Live Activity
36
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys & IDs.
37
+ # @param activity_id [String] Live Activity record ID
38
+ # @param begin_live_activity_request [BeginLiveActivityRequest]
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
41
+ def begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: DefaultApi.begin_live_activity ...'
44
+ end
45
+ # verify the required parameter 'app_id' is set
46
+ if @api_client.config.client_side_validation && app_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.begin_live_activity"
48
+ end
49
+ # verify the required parameter 'activity_id' is set
50
+ if @api_client.config.client_side_validation && activity_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.begin_live_activity"
52
+ end
53
+ # verify the required parameter 'begin_live_activity_request' is set
54
+ if @api_client.config.client_side_validation && begin_live_activity_request.nil?
55
+ fail ArgumentError, "Missing the required parameter 'begin_live_activity_request' when calling DefaultApi.begin_live_activity"
56
+ end
57
+ # resource path
58
+ local_var_path = '/apps/{app_id}/live_activities/{activity_id}/token'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_id' + '}', CGI.escape(activity_id.to_s))
59
+
60
+ # query parameters
61
+ query_params = opts[:query_params] || {}
62
+
63
+ # header parameters
64
+ header_params = opts[:header_params] || {}
65
+ # HTTP header 'Accept' (if needed)
66
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
67
+ # HTTP header 'Content-Type'
68
+ content_type = @api_client.select_header_content_type(['application/json'])
69
+ if !content_type.nil?
70
+ header_params['Content-Type'] = content_type
71
+ end
72
+
73
+ # form parameters
74
+ form_params = opts[:form_params] || {}
75
+
76
+ # http body (model)
77
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(begin_live_activity_request)
78
+
79
+ # return_type
80
+ return_type = opts[:debug_return_type]
81
+
82
+ # auth_names
83
+ auth_names = opts[:debug_auth_names] || ['app_key']
84
+
85
+ new_options = opts.merge(
86
+ :operation => :"DefaultApi.begin_live_activity",
87
+ :header_params => header_params,
88
+ :query_params => query_params,
89
+ :form_params => form_params,
90
+ :body => post_body,
91
+ :auth_names => auth_names,
92
+ :return_type => return_type
93
+ )
94
+
95
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
96
+ if @api_client.config.debugging
97
+ @api_client.config.logger.debug "API called: DefaultApi#begin_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
98
+ end
99
+ return data, status_code, headers
100
+ end
101
+
22
102
  # Stop a scheduled or currently outgoing notification
23
103
  # Used to stop a scheduled or currently outgoing notification
24
104
  # @param app_id [String]
25
105
  # @param notification_id [String]
26
106
  # @param [Hash] opts the optional parameters
27
- # @return [InlineResponse2001]
107
+ # @return [CancelNotificationSuccessResponse]
28
108
  def cancel_notification(app_id, notification_id, opts = {})
29
109
  data, _status_code, _headers = cancel_notification_with_http_info(app_id, notification_id, opts)
30
110
  data
@@ -35,7 +115,7 @@ module OneSignal
35
115
  # @param app_id [String]
36
116
  # @param notification_id [String]
37
117
  # @param [Hash] opts the optional parameters
38
- # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers
118
+ # @return [Array<(CancelNotificationSuccessResponse, Integer, Hash)>] CancelNotificationSuccessResponse data, response status code and response headers
39
119
  def cancel_notification_with_http_info(app_id, notification_id, opts = {})
40
120
  if @api_client.config.debugging
41
121
  @api_client.config.logger.debug 'Calling API: DefaultApi.cancel_notification ...'
@@ -67,7 +147,7 @@ module OneSignal
67
147
  post_body = opts[:debug_body]
68
148
 
69
149
  # return_type
70
- return_type = opts[:debug_return_type] || 'InlineResponse2001'
150
+ return_type = opts[:debug_return_type] || 'CancelNotificationSuccessResponse'
71
151
 
72
152
  # auth_names
73
153
  auth_names = opts[:debug_auth_names] || ['app_key']
@@ -123,7 +203,10 @@ module OneSignal
123
203
  # HTTP header 'Accept' (if needed)
124
204
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
125
205
  # HTTP header 'Content-Type'
126
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
206
+ content_type = @api_client.select_header_content_type(['application/json'])
207
+ if !content_type.nil?
208
+ header_params['Content-Type'] = content_type
209
+ end
127
210
 
128
211
  # form parameters
129
212
  form_params = opts[:form_params] || {}
@@ -158,7 +241,7 @@ module OneSignal
158
241
  # Sends notifications to your users
159
242
  # @param notification [Notification]
160
243
  # @param [Hash] opts the optional parameters
161
- # @return [InlineResponse200]
244
+ # @return [CreateNotificationSuccessResponse]
162
245
  def create_notification(notification, opts = {})
163
246
  data, _status_code, _headers = create_notification_with_http_info(notification, opts)
164
247
  data
@@ -168,7 +251,7 @@ module OneSignal
168
251
  # Sends notifications to your users
169
252
  # @param notification [Notification]
170
253
  # @param [Hash] opts the optional parameters
171
- # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
254
+ # @return [Array<(CreateNotificationSuccessResponse, Integer, Hash)>] CreateNotificationSuccessResponse data, response status code and response headers
172
255
  def create_notification_with_http_info(notification, opts = {})
173
256
  if @api_client.config.debugging
174
257
  @api_client.config.logger.debug 'Calling API: DefaultApi.create_notification ...'
@@ -188,7 +271,10 @@ module OneSignal
188
271
  # HTTP header 'Accept' (if needed)
189
272
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
190
273
  # HTTP header 'Content-Type'
191
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
274
+ content_type = @api_client.select_header_content_type(['application/json'])
275
+ if !content_type.nil?
276
+ header_params['Content-Type'] = content_type
277
+ end
192
278
 
193
279
  # form parameters
194
280
  form_params = opts[:form_params] || {}
@@ -197,7 +283,7 @@ module OneSignal
197
283
  post_body = opts[:debug_body] || @api_client.object_to_http_body(notification)
198
284
 
199
285
  # return_type
200
- return_type = opts[:debug_return_type] || 'InlineResponse200'
286
+ return_type = opts[:debug_return_type] || 'CreateNotificationSuccessResponse'
201
287
 
202
288
  # auth_names
203
289
  auth_names = opts[:debug_auth_names] || ['app_key']
@@ -220,20 +306,20 @@ module OneSignal
220
306
  end
221
307
 
222
308
  # Add a device
223
- # Register a new device to one of your OneSignal apps 🚧 Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds.
309
+ # Register a new device to one of your OneSignal apps &#x1F6A7; Don't use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won't work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds.
224
310
  # @param player [Player]
225
311
  # @param [Hash] opts the optional parameters
226
- # @return [InlineResponse2004]
312
+ # @return [CreatePlayerSuccessResponse]
227
313
  def create_player(player, opts = {})
228
314
  data, _status_code, _headers = create_player_with_http_info(player, opts)
229
315
  data
230
316
  end
231
317
 
232
318
  # Add a device
233
- # Register a new device to one of your OneSignal apps 🚧 Don&#39;t use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won&#39;t work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. 🚧 iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds.
319
+ # Register a new device to one of your OneSignal apps &amp;#x1F6A7; Don&#39;t use this This API endpoint is designed to be used from our open source Mobile and Web Push SDKs. It is not designed for developers to use it directly, unless instructed to do so by OneSignal support. If you use this method instead of our SDKs, many OneSignal features such as conversion tracking, timezone tracking, language detection, and rich-push won&#39;t work out of the box. It will also make it harder to identify possible setup issues. This method is used to register a new device with OneSignal. If a device is already registered with the specified identifier, then this will update the existing device record instead of creating a new one. The returned player is a player / user ID. Use the returned ID to send push notifications to this specific user later, or to include this player when sending to a set of users. &amp;#x1F6A7; iOS Must set test_type to 1 when building your iOS app as development. Omit this field in your production app builds.
234
320
  # @param player [Player]
235
321
  # @param [Hash] opts the optional parameters
236
- # @return [Array<(InlineResponse2004, Integer, Hash)>] InlineResponse2004 data, response status code and response headers
322
+ # @return [Array<(CreatePlayerSuccessResponse, Integer, Hash)>] CreatePlayerSuccessResponse data, response status code and response headers
237
323
  def create_player_with_http_info(player, opts = {})
238
324
  if @api_client.config.debugging
239
325
  @api_client.config.logger.debug 'Calling API: DefaultApi.create_player ...'
@@ -253,7 +339,10 @@ module OneSignal
253
339
  # HTTP header 'Accept' (if needed)
254
340
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
255
341
  # HTTP header 'Content-Type'
256
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
342
+ content_type = @api_client.select_header_content_type(['application/json'])
343
+ if !content_type.nil?
344
+ header_params['Content-Type'] = content_type
345
+ end
257
346
 
258
347
  # form parameters
259
348
  form_params = opts[:form_params] || {}
@@ -262,7 +351,7 @@ module OneSignal
262
351
  post_body = opts[:debug_body] || @api_client.object_to_http_body(player)
263
352
 
264
353
  # return_type
265
- return_type = opts[:debug_return_type] || 'InlineResponse2004'
354
+ return_type = opts[:debug_return_type] || 'CreatePlayerSuccessResponse'
266
355
 
267
356
  # auth_names
268
357
  auth_names = opts[:debug_auth_names] || ['app_key']
@@ -285,22 +374,22 @@ module OneSignal
285
374
  end
286
375
 
287
376
  # Create Segments
288
- # Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit.
377
+ # Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \"AND\" or \"OR\" operator's. &#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit.
289
378
  # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
290
379
  # @param [Hash] opts the optional parameters
291
380
  # @option opts [Segment] :segment
292
- # @return [InlineResponse201]
381
+ # @return [CreateSegmentSuccessResponse]
293
382
  def create_segments(app_id, opts = {})
294
383
  data, _status_code, _headers = create_segments_with_http_info(app_id, opts)
295
384
  data
296
385
  end
297
386
 
298
387
  # Create Segments
299
- # Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \&quot;AND\&quot; or \&quot;OR\&quot; operator&#39;s. 🚧 Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit.
388
+ # Create segments visible and usable in the dashboard and API - Required: OneSignal Paid Plan The Create Segment method is used when you want your server to programmatically create a segment instead of using the OneSignal Dashboard UI. Just like creating Segments from the dashboard you can pass in filters with multiple \&quot;AND\&quot; or \&quot;OR\&quot; operator&#39;s. &amp;#x1F6A7; Does Not Update Segments This endpoint will only create segments, it does not edit or update currently created Segments. You will need to use the Delete Segments endpoint and re-create it with this endpoint to edit.
300
389
  # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
301
390
  # @param [Hash] opts the optional parameters
302
391
  # @option opts [Segment] :segment
303
- # @return [Array<(InlineResponse201, Integer, Hash)>] InlineResponse201 data, response status code and response headers
392
+ # @return [Array<(CreateSegmentSuccessResponse, Integer, Hash)>] CreateSegmentSuccessResponse data, response status code and response headers
304
393
  def create_segments_with_http_info(app_id, opts = {})
305
394
  if @api_client.config.debugging
306
395
  @api_client.config.logger.debug 'Calling API: DefaultApi.create_segments ...'
@@ -320,7 +409,10 @@ module OneSignal
320
409
  # HTTP header 'Accept' (if needed)
321
410
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
322
411
  # HTTP header 'Content-Type'
323
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
412
+ content_type = @api_client.select_header_content_type(['application/json'])
413
+ if !content_type.nil?
414
+ header_params['Content-Type'] = content_type
415
+ end
324
416
 
325
417
  # form parameters
326
418
  form_params = opts[:form_params] || {}
@@ -329,7 +421,7 @@ module OneSignal
329
421
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'segment'])
330
422
 
331
423
  # return_type
332
- return_type = opts[:debug_return_type] || 'InlineResponse201'
424
+ return_type = opts[:debug_return_type] || 'CreateSegmentSuccessResponse'
333
425
 
334
426
  # auth_names
335
427
  auth_names = opts[:debug_auth_names] || ['app_key']
@@ -351,61 +443,75 @@ module OneSignal
351
443
  return data, status_code, headers
352
444
  end
353
445
 
354
- # Delete a user record
355
- # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app.
356
- # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
357
- # @param player_id [String] The OneSignal player_id
446
+ # Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.
447
+ # @param app_id [String]
448
+ # @param alias_label [String]
449
+ # @param alias_id [String]
450
+ # @param create_subscription_request_body [CreateSubscriptionRequestBody]
358
451
  # @param [Hash] opts the optional parameters
359
- # @return [InlineResponse2001]
360
- def delete_player(app_id, player_id, opts = {})
361
- data, _status_code, _headers = delete_player_with_http_info(app_id, player_id, opts)
452
+ # @return [InlineResponse201]
453
+ def create_subscription(app_id, alias_label, alias_id, create_subscription_request_body, opts = {})
454
+ data, _status_code, _headers = create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body, opts)
362
455
  data
363
456
  end
364
457
 
365
- # Delete a user record
366
- # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app.
367
- # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
368
- # @param player_id [String] The OneSignal player_id
458
+ # Creates a new Subscription under the User provided. Useful to add email addresses and SMS numbers to the User.
459
+ # @param app_id [String]
460
+ # @param alias_label [String]
461
+ # @param alias_id [String]
462
+ # @param create_subscription_request_body [CreateSubscriptionRequestBody]
369
463
  # @param [Hash] opts the optional parameters
370
- # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers
371
- def delete_player_with_http_info(app_id, player_id, opts = {})
464
+ # @return [Array<(InlineResponse201, Integer, Hash)>] InlineResponse201 data, response status code and response headers
465
+ def create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body, opts = {})
372
466
  if @api_client.config.debugging
373
- @api_client.config.logger.debug 'Calling API: DefaultApi.delete_player ...'
467
+ @api_client.config.logger.debug 'Calling API: DefaultApi.create_subscription ...'
374
468
  end
375
469
  # verify the required parameter 'app_id' is set
376
470
  if @api_client.config.client_side_validation && app_id.nil?
377
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_player"
471
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_subscription"
378
472
  end
379
- # verify the required parameter 'player_id' is set
380
- if @api_client.config.client_side_validation && player_id.nil?
381
- fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.delete_player"
473
+ # verify the required parameter 'alias_label' is set
474
+ if @api_client.config.client_side_validation && alias_label.nil?
475
+ fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.create_subscription"
476
+ end
477
+ # verify the required parameter 'alias_id' is set
478
+ if @api_client.config.client_side_validation && alias_id.nil?
479
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.create_subscription"
480
+ end
481
+ # verify the required parameter 'create_subscription_request_body' is set
482
+ if @api_client.config.client_side_validation && create_subscription_request_body.nil?
483
+ fail ArgumentError, "Missing the required parameter 'create_subscription_request_body' when calling DefaultApi.create_subscription"
382
484
  end
383
485
  # resource path
384
- local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s))
486
+ 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))
385
487
 
386
488
  # query parameters
387
489
  query_params = opts[:query_params] || {}
388
- query_params[:'app_id'] = app_id
389
490
 
390
491
  # header parameters
391
492
  header_params = opts[:header_params] || {}
392
493
  # HTTP header 'Accept' (if needed)
393
494
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
495
+ # HTTP header 'Content-Type'
496
+ content_type = @api_client.select_header_content_type(['application/json'])
497
+ if !content_type.nil?
498
+ header_params['Content-Type'] = content_type
499
+ end
394
500
 
395
501
  # form parameters
396
502
  form_params = opts[:form_params] || {}
397
503
 
398
504
  # http body (model)
399
- post_body = opts[:debug_body]
505
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_subscription_request_body)
400
506
 
401
507
  # return_type
402
- return_type = opts[:debug_return_type] || 'InlineResponse2001'
508
+ return_type = opts[:debug_return_type] || 'InlineResponse201'
403
509
 
404
510
  # auth_names
405
511
  auth_names = opts[:debug_auth_names] || ['app_key']
406
512
 
407
513
  new_options = opts.merge(
408
- :operation => :"DefaultApi.delete_player",
514
+ :operation => :"DefaultApi.create_subscription",
409
515
  :header_params => header_params,
410
516
  :query_params => query_params,
411
517
  :form_params => form_params,
@@ -414,44 +520,42 @@ module OneSignal
414
520
  :return_type => return_type
415
521
  )
416
522
 
417
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
523
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
418
524
  if @api_client.config.debugging
419
- @api_client.config.logger.debug "API called: DefaultApi#delete_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
525
+ @api_client.config.logger.debug "API called: DefaultApi#create_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
420
526
  end
421
527
  return data, status_code, headers
422
528
  end
423
529
 
424
- # Delete Segments
425
- # 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.
426
- # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
427
- # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard.
530
+ # 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.
531
+ # @param app_id [String]
532
+ # @param user [User]
428
533
  # @param [Hash] opts the optional parameters
429
- # @return [InlineResponse2003]
430
- def delete_segments(app_id, segment_id, opts = {})
431
- data, _status_code, _headers = delete_segments_with_http_info(app_id, segment_id, opts)
534
+ # @return [User]
535
+ def create_user(app_id, user, opts = {})
536
+ data, _status_code, _headers = create_user_with_http_info(app_id, user, opts)
432
537
  data
433
538
  end
434
539
 
435
- # Delete Segments
436
- # 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.
437
- # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
438
- # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard.
540
+ # 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.
541
+ # @param app_id [String]
542
+ # @param user [User]
439
543
  # @param [Hash] opts the optional parameters
440
- # @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers
441
- def delete_segments_with_http_info(app_id, segment_id, opts = {})
544
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
545
+ def create_user_with_http_info(app_id, user, opts = {})
442
546
  if @api_client.config.debugging
443
- @api_client.config.logger.debug 'Calling API: DefaultApi.delete_segments ...'
547
+ @api_client.config.logger.debug 'Calling API: DefaultApi.create_user ...'
444
548
  end
445
549
  # verify the required parameter 'app_id' is set
446
550
  if @api_client.config.client_side_validation && app_id.nil?
447
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_segments"
551
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_user"
448
552
  end
449
- # verify the required parameter 'segment_id' is set
450
- if @api_client.config.client_side_validation && segment_id.nil?
451
- fail ArgumentError, "Missing the required parameter 'segment_id' when calling DefaultApi.delete_segments"
553
+ # verify the required parameter 'user' is set
554
+ if @api_client.config.client_side_validation && user.nil?
555
+ fail ArgumentError, "Missing the required parameter 'user' when calling DefaultApi.create_user"
452
556
  end
453
557
  # resource path
454
- 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))
558
+ local_var_path = '/apps/{app_id}/users'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
455
559
 
456
560
  # query parameters
457
561
  query_params = opts[:query_params] || {}
@@ -460,21 +564,26 @@ module OneSignal
460
564
  header_params = opts[:header_params] || {}
461
565
  # HTTP header 'Accept' (if needed)
462
566
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
567
+ # HTTP header 'Content-Type'
568
+ content_type = @api_client.select_header_content_type(['application/json'])
569
+ if !content_type.nil?
570
+ header_params['Content-Type'] = content_type
571
+ end
463
572
 
464
573
  # form parameters
465
574
  form_params = opts[:form_params] || {}
466
575
 
467
576
  # http body (model)
468
- post_body = opts[:debug_body]
577
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
469
578
 
470
579
  # return_type
471
- return_type = opts[:debug_return_type] || 'InlineResponse2003'
580
+ return_type = opts[:debug_return_type] || 'User'
472
581
 
473
582
  # auth_names
474
583
  auth_names = opts[:debug_auth_names] || ['app_key']
475
584
 
476
585
  new_options = opts.merge(
477
- :operation => :"DefaultApi.delete_segments",
586
+ :operation => :"DefaultApi.create_user",
478
587
  :header_params => header_params,
479
588
  :query_params => query_params,
480
589
  :form_params => form_params,
@@ -483,40 +592,54 @@ module OneSignal
483
592
  :return_type => return_type
484
593
  )
485
594
 
486
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
595
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
487
596
  if @api_client.config.debugging
488
- @api_client.config.logger.debug "API called: DefaultApi#delete_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
597
+ @api_client.config.logger.debug "API called: DefaultApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
489
598
  end
490
599
  return data, status_code, headers
491
600
  end
492
601
 
493
- # CSV export
494
- # 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. |
495
- # @param app_id [String] The app ID that you want to export devices from
602
+ # Deletes an alias by alias label
603
+ # @param app_id [String]
604
+ # @param alias_label [String]
605
+ # @param alias_id [String]
606
+ # @param alias_label_to_delete [String]
496
607
  # @param [Hash] opts the optional parameters
497
- # @option opts [ExportPlayersRequestBody] :export_players_request_body
498
- # @return [InlineResponse2005]
499
- def export_players(app_id, opts = {})
500
- data, _status_code, _headers = export_players_with_http_info(app_id, opts)
608
+ # @return [InlineResponse200]
609
+ def delete_alias(app_id, alias_label, alias_id, alias_label_to_delete, opts = {})
610
+ data, _status_code, _headers = delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts)
501
611
  data
502
612
  end
503
613
 
504
- # CSV export
505
- # 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&#39;s REST API Key, available in Keys &amp; 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 &#x3D; Chrome 80, 9 &#x3D; Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have &#x60;Linux armv&#x60; | | 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 &#x3D; unsubscribed, f &#x3D; 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. |
506
- # @param app_id [String] The app ID that you want to export devices from
614
+ # Deletes an alias by alias label
615
+ # @param app_id [String]
616
+ # @param alias_label [String]
617
+ # @param alias_id [String]
618
+ # @param alias_label_to_delete [String]
507
619
  # @param [Hash] opts the optional parameters
508
- # @option opts [ExportPlayersRequestBody] :export_players_request_body
509
- # @return [Array<(InlineResponse2005, Integer, Hash)>] InlineResponse2005 data, response status code and response headers
510
- def export_players_with_http_info(app_id, opts = {})
620
+ # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
621
+ def delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts = {})
511
622
  if @api_client.config.debugging
512
- @api_client.config.logger.debug 'Calling API: DefaultApi.export_players ...'
623
+ @api_client.config.logger.debug 'Calling API: DefaultApi.delete_alias ...'
513
624
  end
514
625
  # verify the required parameter 'app_id' is set
515
626
  if @api_client.config.client_side_validation && app_id.nil?
516
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_players"
627
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_alias"
628
+ end
629
+ # verify the required parameter 'alias_label' is set
630
+ if @api_client.config.client_side_validation && alias_label.nil?
631
+ fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.delete_alias"
632
+ end
633
+ # verify the required parameter 'alias_id' is set
634
+ if @api_client.config.client_side_validation && alias_id.nil?
635
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.delete_alias"
636
+ end
637
+ # verify the required parameter 'alias_label_to_delete' is set
638
+ if @api_client.config.client_side_validation && alias_label_to_delete.nil?
639
+ fail ArgumentError, "Missing the required parameter 'alias_label_to_delete' when calling DefaultApi.delete_alias"
517
640
  end
518
641
  # resource path
519
- local_var_path = '/players/csv_export?app_id={app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
642
+ 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))
520
643
 
521
644
  # query parameters
522
645
  query_params = opts[:query_params] || {}
@@ -525,23 +648,21 @@ module OneSignal
525
648
  header_params = opts[:header_params] || {}
526
649
  # HTTP header 'Accept' (if needed)
527
650
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
528
- # HTTP header 'Content-Type'
529
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
530
651
 
531
652
  # form parameters
532
653
  form_params = opts[:form_params] || {}
533
654
 
534
655
  # http body (model)
535
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'export_players_request_body'])
656
+ post_body = opts[:debug_body]
536
657
 
537
658
  # return_type
538
- return_type = opts[:debug_return_type] || 'InlineResponse2005'
659
+ return_type = opts[:debug_return_type] || 'InlineResponse200'
539
660
 
540
661
  # auth_names
541
662
  auth_names = opts[:debug_auth_names] || ['app_key']
542
663
 
543
664
  new_options = opts.merge(
544
- :operation => :"DefaultApi.export_players",
665
+ :operation => :"DefaultApi.delete_alias",
545
666
  :header_params => header_params,
546
667
  :query_params => query_params,
547
668
  :form_params => form_params,
@@ -550,41 +671,48 @@ module OneSignal
550
671
  :return_type => return_type
551
672
  )
552
673
 
553
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
674
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
554
675
  if @api_client.config.debugging
555
- @api_client.config.logger.debug "API called: DefaultApi#export_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
676
+ @api_client.config.logger.debug "API called: DefaultApi#delete_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
556
677
  end
557
678
  return data, status_code, headers
558
679
  end
559
680
 
560
- # View an app
561
- # View the details of a single OneSignal app
562
- # @param app_id [String] An app id
681
+ # Delete a user record
682
+ # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app.
683
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
684
+ # @param player_id [String] The OneSignal player_id
563
685
  # @param [Hash] opts the optional parameters
564
- # @return [App]
565
- def get_app(app_id, opts = {})
566
- data, _status_code, _headers = get_app_with_http_info(app_id, opts)
686
+ # @return [DeletePlayerSuccessResponse]
687
+ def delete_player(app_id, player_id, opts = {})
688
+ data, _status_code, _headers = delete_player_with_http_info(app_id, player_id, opts)
567
689
  data
568
690
  end
569
691
 
570
- # View an app
571
- # View the details of a single OneSignal app
572
- # @param app_id [String] An app id
692
+ # Delete a user record
693
+ # Delete player - Required: Used to delete a single, specific Player ID record from a specific OneSignal app.
694
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
695
+ # @param player_id [String] The OneSignal player_id
573
696
  # @param [Hash] opts the optional parameters
574
- # @return [Array<(App, Integer, Hash)>] App data, response status code and response headers
575
- def get_app_with_http_info(app_id, opts = {})
697
+ # @return [Array<(DeletePlayerSuccessResponse, Integer, Hash)>] DeletePlayerSuccessResponse data, response status code and response headers
698
+ def delete_player_with_http_info(app_id, player_id, opts = {})
576
699
  if @api_client.config.debugging
577
- @api_client.config.logger.debug 'Calling API: DefaultApi.get_app ...'
700
+ @api_client.config.logger.debug 'Calling API: DefaultApi.delete_player ...'
578
701
  end
579
702
  # verify the required parameter 'app_id' is set
580
703
  if @api_client.config.client_side_validation && app_id.nil?
581
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_app"
704
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_player"
705
+ end
706
+ # verify the required parameter 'player_id' is set
707
+ if @api_client.config.client_side_validation && player_id.nil?
708
+ fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.delete_player"
582
709
  end
583
710
  # resource path
584
- local_var_path = '/apps/{app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
711
+ local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s))
585
712
 
586
713
  # query parameters
587
714
  query_params = opts[:query_params] || {}
715
+ query_params[:'app_id'] = app_id
588
716
 
589
717
  # header parameters
590
718
  header_params = opts[:header_params] || {}
@@ -598,13 +726,13 @@ module OneSignal
598
726
  post_body = opts[:debug_body]
599
727
 
600
728
  # return_type
601
- return_type = opts[:debug_return_type] || 'App'
729
+ return_type = opts[:debug_return_type] || 'DeletePlayerSuccessResponse'
602
730
 
603
731
  # auth_names
604
- auth_names = opts[:debug_auth_names] || ['user_key']
732
+ auth_names = opts[:debug_auth_names] || ['app_key']
605
733
 
606
734
  new_options = opts.merge(
607
- :operation => :"DefaultApi.get_app",
735
+ :operation => :"DefaultApi.delete_player",
608
736
  :header_params => header_params,
609
737
  :query_params => query_params,
610
738
  :form_params => form_params,
@@ -613,32 +741,44 @@ module OneSignal
613
741
  :return_type => return_type
614
742
  )
615
743
 
616
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
744
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
617
745
  if @api_client.config.debugging
618
- @api_client.config.logger.debug "API called: DefaultApi#get_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
746
+ @api_client.config.logger.debug "API called: DefaultApi#delete_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
619
747
  end
620
748
  return data, status_code, headers
621
749
  end
622
750
 
623
- # View apps
624
- # View the details of all of your current OneSignal apps
751
+ # Delete Segments
752
+ # 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.
753
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
754
+ # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard.
625
755
  # @param [Hash] opts the optional parameters
626
- # @return [String]
627
- def get_apps(opts = {})
628
- data, _status_code, _headers = get_apps_with_http_info(opts)
756
+ # @return [DeleteSegmentSuccessResponse]
757
+ def delete_segments(app_id, segment_id, opts = {})
758
+ data, _status_code, _headers = delete_segments_with_http_info(app_id, segment_id, opts)
629
759
  data
630
760
  end
631
761
 
632
- # View apps
633
- # View the details of all of your current OneSignal apps
762
+ # Delete Segments
763
+ # 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.
764
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
765
+ # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard.
634
766
  # @param [Hash] opts the optional parameters
635
- # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
636
- def get_apps_with_http_info(opts = {})
767
+ # @return [Array<(DeleteSegmentSuccessResponse, Integer, Hash)>] DeleteSegmentSuccessResponse data, response status code and response headers
768
+ def delete_segments_with_http_info(app_id, segment_id, opts = {})
637
769
  if @api_client.config.debugging
638
- @api_client.config.logger.debug 'Calling API: DefaultApi.get_apps ...'
770
+ @api_client.config.logger.debug 'Calling API: DefaultApi.delete_segments ...'
771
+ end
772
+ # verify the required parameter 'app_id' is set
773
+ if @api_client.config.client_side_validation && app_id.nil?
774
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_segments"
775
+ end
776
+ # verify the required parameter 'segment_id' is set
777
+ if @api_client.config.client_side_validation && segment_id.nil?
778
+ fail ArgumentError, "Missing the required parameter 'segment_id' when calling DefaultApi.delete_segments"
639
779
  end
640
780
  # resource path
641
- local_var_path = '/apps'
781
+ 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))
642
782
 
643
783
  # query parameters
644
784
  query_params = opts[:query_params] || {}
@@ -655,13 +795,13 @@ module OneSignal
655
795
  post_body = opts[:debug_body]
656
796
 
657
797
  # return_type
658
- return_type = opts[:debug_return_type] || 'String'
798
+ return_type = opts[:debug_return_type] || 'DeleteSegmentSuccessResponse'
659
799
 
660
800
  # auth_names
661
- auth_names = opts[:debug_auth_names] || ['user_key']
801
+ auth_names = opts[:debug_auth_names] || ['app_key']
662
802
 
663
803
  new_options = opts.merge(
664
- :operation => :"DefaultApi.get_apps",
804
+ :operation => :"DefaultApi.delete_segments",
665
805
  :header_params => header_params,
666
806
  :query_params => query_params,
667
807
  :form_params => form_params,
@@ -670,48 +810,45 @@ module OneSignal
670
810
  :return_type => return_type
671
811
  )
672
812
 
673
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
813
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
674
814
  if @api_client.config.debugging
675
- @api_client.config.logger.debug "API called: DefaultApi#get_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
815
+ @api_client.config.logger.debug "API called: DefaultApi#delete_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
676
816
  end
677
817
  return data, status_code, headers
678
818
  end
679
819
 
680
- # View notification
681
- # View the details of a single notification and outcomes associated with it
820
+ # Deletes the Subscription.
682
821
  # @param app_id [String]
683
- # @param notification_id [String]
822
+ # @param subscription_id [String]
684
823
  # @param [Hash] opts the optional parameters
685
- # @return [Notification]
686
- def get_notification(app_id, notification_id, opts = {})
687
- data, _status_code, _headers = get_notification_with_http_info(app_id, notification_id, opts)
688
- data
824
+ # @return [nil]
825
+ def delete_subscription(app_id, subscription_id, opts = {})
826
+ delete_subscription_with_http_info(app_id, subscription_id, opts)
827
+ nil
689
828
  end
690
829
 
691
- # View notification
692
- # View the details of a single notification and outcomes associated with it
830
+ # Deletes the Subscription.
693
831
  # @param app_id [String]
694
- # @param notification_id [String]
832
+ # @param subscription_id [String]
695
833
  # @param [Hash] opts the optional parameters
696
- # @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
697
- def get_notification_with_http_info(app_id, notification_id, opts = {})
834
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
835
+ def delete_subscription_with_http_info(app_id, subscription_id, opts = {})
698
836
  if @api_client.config.debugging
699
- @api_client.config.logger.debug 'Calling API: DefaultApi.get_notification ...'
837
+ @api_client.config.logger.debug 'Calling API: DefaultApi.delete_subscription ...'
700
838
  end
701
839
  # verify the required parameter 'app_id' is set
702
840
  if @api_client.config.client_side_validation && app_id.nil?
703
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_notification"
841
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_subscription"
704
842
  end
705
- # verify the required parameter 'notification_id' is set
706
- if @api_client.config.client_side_validation && notification_id.nil?
707
- fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.get_notification"
843
+ # verify the required parameter 'subscription_id' is set
844
+ if @api_client.config.client_side_validation && subscription_id.nil?
845
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.delete_subscription"
708
846
  end
709
847
  # resource path
710
- local_var_path = '/notifications/{notification_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))
848
+ 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))
711
849
 
712
850
  # query parameters
713
851
  query_params = opts[:query_params] || {}
714
- query_params[:'app_id'] = app_id
715
852
 
716
853
  # header parameters
717
854
  header_params = opts[:header_params] || {}
@@ -725,13 +862,13 @@ module OneSignal
725
862
  post_body = opts[:debug_body]
726
863
 
727
864
  # return_type
728
- return_type = opts[:debug_return_type] || 'Notification'
865
+ return_type = opts[:debug_return_type]
729
866
 
730
867
  # auth_names
731
868
  auth_names = opts[:debug_auth_names] || ['app_key']
732
869
 
733
870
  new_options = opts.merge(
734
- :operation => :"DefaultApi.get_notification",
871
+ :operation => :"DefaultApi.delete_subscription",
735
872
  :header_params => header_params,
736
873
  :query_params => query_params,
737
874
  :form_params => form_params,
@@ -740,30 +877,788 @@ module OneSignal
740
877
  :return_type => return_type
741
878
  )
742
879
 
743
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
880
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
744
881
  if @api_client.config.debugging
745
- @api_client.config.logger.debug "API called: DefaultApi#get_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
882
+ @api_client.config.logger.debug "API called: DefaultApi#delete_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
746
883
  end
747
884
  return data, status_code, headers
748
885
  end
749
886
 
750
- # Notification History
751
- # -> 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.
752
- # @param notification_id [String] The \&quot;id\&quot; of the message found in the Notification object
753
- # @param get_notification_request_body [GetNotificationRequestBody]
887
+ # Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
888
+ # @param app_id [String]
889
+ # @param alias_label [String]
890
+ # @param alias_id [String]
754
891
  # @param [Hash] opts the optional parameters
755
- # @return [InlineResponse2002]
756
- def get_notification_history(notification_id, get_notification_request_body, opts = {})
757
- data, _status_code, _headers = get_notification_history_with_http_info(notification_id, get_notification_request_body, opts)
758
- data
892
+ # @return [nil]
893
+ def delete_user(app_id, alias_label, alias_id, opts = {})
894
+ delete_user_with_http_info(app_id, alias_label, alias_id, opts)
895
+ nil
759
896
  end
760
897
 
761
- # Notification History
762
- # -&gt; 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 -&gt; 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 \&quot;sent\&quot; events recorded, but will show \&quot;clicked\&quot; events. Requires your OneSignal App&#39;s REST API Key, available in Keys &amp; IDs.
763
- # @param notification_id [String] The \&quot;id\&quot; of the message found in the Notification object
898
+ # Removes the User identified by (:alias_label, :alias_id), and all Subscriptions and Aliases
899
+ # @param app_id [String]
900
+ # @param alias_label [String]
901
+ # @param alias_id [String]
902
+ # @param [Hash] opts the optional parameters
903
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
904
+ def delete_user_with_http_info(app_id, alias_label, alias_id, opts = {})
905
+ if @api_client.config.debugging
906
+ @api_client.config.logger.debug 'Calling API: DefaultApi.delete_user ...'
907
+ end
908
+ # verify the required parameter 'app_id' is set
909
+ if @api_client.config.client_side_validation && app_id.nil?
910
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_user"
911
+ end
912
+ # verify the required parameter 'alias_label' is set
913
+ if @api_client.config.client_side_validation && alias_label.nil?
914
+ fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.delete_user"
915
+ end
916
+ # verify the required parameter 'alias_id' is set
917
+ if @api_client.config.client_side_validation && alias_id.nil?
918
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.delete_user"
919
+ end
920
+ # resource path
921
+ 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))
922
+
923
+ # query parameters
924
+ query_params = opts[:query_params] || {}
925
+
926
+ # header parameters
927
+ header_params = opts[:header_params] || {}
928
+ # HTTP header 'Accept' (if needed)
929
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
930
+
931
+ # form parameters
932
+ form_params = opts[:form_params] || {}
933
+
934
+ # http body (model)
935
+ post_body = opts[:debug_body]
936
+
937
+ # return_type
938
+ return_type = opts[:debug_return_type]
939
+
940
+ # auth_names
941
+ auth_names = opts[:debug_auth_names] || ['app_key']
942
+
943
+ new_options = opts.merge(
944
+ :operation => :"DefaultApi.delete_user",
945
+ :header_params => header_params,
946
+ :query_params => query_params,
947
+ :form_params => form_params,
948
+ :body => post_body,
949
+ :auth_names => auth_names,
950
+ :return_type => return_type
951
+ )
952
+
953
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
954
+ if @api_client.config.debugging
955
+ @api_client.config.logger.debug "API called: DefaultApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
956
+ end
957
+ return data, status_code, headers
958
+ end
959
+
960
+ # Stop Live Activity
961
+ # Stops a Live Activity
962
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
963
+ # @param activity_id [String] Live Activity record ID
964
+ # @param subscription_id [String] Subscription ID
965
+ # @param [Hash] opts the optional parameters
966
+ # @return [nil]
967
+ def end_live_activity(app_id, activity_id, subscription_id, opts = {})
968
+ end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts)
969
+ nil
970
+ end
971
+
972
+ # Stop Live Activity
973
+ # Stops a Live Activity
974
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
975
+ # @param activity_id [String] Live Activity record ID
976
+ # @param subscription_id [String] Subscription ID
977
+ # @param [Hash] opts the optional parameters
978
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
979
+ def end_live_activity_with_http_info(app_id, activity_id, subscription_id, opts = {})
980
+ if @api_client.config.debugging
981
+ @api_client.config.logger.debug 'Calling API: DefaultApi.end_live_activity ...'
982
+ end
983
+ # verify the required parameter 'app_id' is set
984
+ if @api_client.config.client_side_validation && app_id.nil?
985
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.end_live_activity"
986
+ end
987
+ # verify the required parameter 'activity_id' is set
988
+ if @api_client.config.client_side_validation && activity_id.nil?
989
+ fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.end_live_activity"
990
+ end
991
+ # verify the required parameter 'subscription_id' is set
992
+ if @api_client.config.client_side_validation && subscription_id.nil?
993
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.end_live_activity"
994
+ end
995
+ # resource path
996
+ 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))
997
+
998
+ # query parameters
999
+ query_params = opts[:query_params] || {}
1000
+
1001
+ # header parameters
1002
+ header_params = opts[:header_params] || {}
1003
+ # HTTP header 'Accept' (if needed)
1004
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1005
+
1006
+ # form parameters
1007
+ form_params = opts[:form_params] || {}
1008
+
1009
+ # http body (model)
1010
+ post_body = opts[:debug_body]
1011
+
1012
+ # return_type
1013
+ return_type = opts[:debug_return_type]
1014
+
1015
+ # auth_names
1016
+ auth_names = opts[:debug_auth_names] || ['app_key']
1017
+
1018
+ new_options = opts.merge(
1019
+ :operation => :"DefaultApi.end_live_activity",
1020
+ :header_params => header_params,
1021
+ :query_params => query_params,
1022
+ :form_params => form_params,
1023
+ :body => post_body,
1024
+ :auth_names => auth_names,
1025
+ :return_type => return_type
1026
+ )
1027
+
1028
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
1029
+ if @api_client.config.debugging
1030
+ @api_client.config.logger.debug "API called: DefaultApi#end_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1031
+ end
1032
+ return data, status_code, headers
1033
+ end
1034
+
1035
+ # Export CSV of Events
1036
+ # Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time.
1037
+ # @param notification_id [String] The ID of the notification to export events from.
1038
+ # @param app_id [String] The ID of the app that the notification belongs to.
1039
+ # @param [Hash] opts the optional parameters
1040
+ # @return [ExportEventsSuccessResponse]
1041
+ def export_events(notification_id, app_id, opts = {})
1042
+ data, _status_code, _headers = export_events_with_http_info(notification_id, app_id, opts)
1043
+ data
1044
+ end
1045
+
1046
+ # Export CSV of Events
1047
+ # Generate a compressed CSV report of all of the events data for a notification. This will return a URL immediately upon success but it may take several minutes for the CSV to become available at that URL depending on the volume of data. Only one export can be in-progress per OneSignal account at any given time.
1048
+ # @param notification_id [String] The ID of the notification to export events from.
1049
+ # @param app_id [String] The ID of the app that the notification belongs to.
1050
+ # @param [Hash] opts the optional parameters
1051
+ # @return [Array<(ExportEventsSuccessResponse, Integer, Hash)>] ExportEventsSuccessResponse data, response status code and response headers
1052
+ def export_events_with_http_info(notification_id, app_id, opts = {})
1053
+ if @api_client.config.debugging
1054
+ @api_client.config.logger.debug 'Calling API: DefaultApi.export_events ...'
1055
+ end
1056
+ # verify the required parameter 'notification_id' is set
1057
+ if @api_client.config.client_side_validation && notification_id.nil?
1058
+ fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.export_events"
1059
+ end
1060
+ # verify the required parameter 'app_id' is set
1061
+ if @api_client.config.client_side_validation && app_id.nil?
1062
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_events"
1063
+ end
1064
+ # resource path
1065
+ local_var_path = '/notifications/{notification_id}/export_events?app_id={app_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))
1066
+
1067
+ # query parameters
1068
+ query_params = opts[:query_params] || {}
1069
+ query_params[:'app_id'] = app_id
1070
+
1071
+ # header parameters
1072
+ header_params = opts[:header_params] || {}
1073
+ # HTTP header 'Accept' (if needed)
1074
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1075
+
1076
+ # form parameters
1077
+ form_params = opts[:form_params] || {}
1078
+
1079
+ # http body (model)
1080
+ post_body = opts[:debug_body]
1081
+
1082
+ # return_type
1083
+ return_type = opts[:debug_return_type] || 'ExportEventsSuccessResponse'
1084
+
1085
+ # auth_names
1086
+ auth_names = opts[:debug_auth_names] || ['app_key']
1087
+
1088
+ new_options = opts.merge(
1089
+ :operation => :"DefaultApi.export_events",
1090
+ :header_params => header_params,
1091
+ :query_params => query_params,
1092
+ :form_params => form_params,
1093
+ :body => post_body,
1094
+ :auth_names => auth_names,
1095
+ :return_type => return_type
1096
+ )
1097
+
1098
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1099
+ if @api_client.config.debugging
1100
+ @api_client.config.logger.debug "API called: DefaultApi#export_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1101
+ end
1102
+ return data, status_code, headers
1103
+ end
1104
+
1105
+ # Export CSV of Players
1106
+ # 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. |
1107
+ # @param app_id [String] The app ID that you want to export devices from
1108
+ # @param [Hash] opts the optional parameters
1109
+ # @option opts [ExportPlayersRequestBody] :export_players_request_body
1110
+ # @return [ExportPlayersSuccessResponse]
1111
+ def export_players(app_id, opts = {})
1112
+ data, _status_code, _headers = export_players_with_http_info(app_id, opts)
1113
+ data
1114
+ end
1115
+
1116
+ # Export CSV of Players
1117
+ # 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. &amp;#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. &amp;#x1F6A7; Requires Authentication Key Requires your OneSignal App&#39;s REST API Key, available in Keys &amp; IDs. &amp;#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 &#x3D; Chrome 80, 9 &#x3D; Android 9 | | device_type | Device Operating System Type | | device_model | Device Hardware String Code. Example: Mobile Web Subscribers will have &#x60;Linux armv&#x60; | | 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 &#x3D; unsubscribed, f &#x3D; 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. |
1118
+ # @param app_id [String] The app ID that you want to export devices from
1119
+ # @param [Hash] opts the optional parameters
1120
+ # @option opts [ExportPlayersRequestBody] :export_players_request_body
1121
+ # @return [Array<(ExportPlayersSuccessResponse, Integer, Hash)>] ExportPlayersSuccessResponse data, response status code and response headers
1122
+ def export_players_with_http_info(app_id, opts = {})
1123
+ if @api_client.config.debugging
1124
+ @api_client.config.logger.debug 'Calling API: DefaultApi.export_players ...'
1125
+ end
1126
+ # verify the required parameter 'app_id' is set
1127
+ if @api_client.config.client_side_validation && app_id.nil?
1128
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_players"
1129
+ end
1130
+ # resource path
1131
+ local_var_path = '/players/csv_export?app_id={app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
1132
+
1133
+ # query parameters
1134
+ query_params = opts[:query_params] || {}
1135
+
1136
+ # header parameters
1137
+ header_params = opts[:header_params] || {}
1138
+ # HTTP header 'Accept' (if needed)
1139
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1140
+ # HTTP header 'Content-Type'
1141
+ content_type = @api_client.select_header_content_type(['application/json'])
1142
+ if !content_type.nil?
1143
+ header_params['Content-Type'] = content_type
1144
+ end
1145
+
1146
+ # form parameters
1147
+ form_params = opts[:form_params] || {}
1148
+
1149
+ # http body (model)
1150
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'export_players_request_body'])
1151
+
1152
+ # return_type
1153
+ return_type = opts[:debug_return_type] || 'ExportPlayersSuccessResponse'
1154
+
1155
+ # auth_names
1156
+ auth_names = opts[:debug_auth_names] || ['app_key']
1157
+
1158
+ new_options = opts.merge(
1159
+ :operation => :"DefaultApi.export_players",
1160
+ :header_params => header_params,
1161
+ :query_params => query_params,
1162
+ :form_params => form_params,
1163
+ :body => post_body,
1164
+ :auth_names => auth_names,
1165
+ :return_type => return_type
1166
+ )
1167
+
1168
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1169
+ if @api_client.config.debugging
1170
+ @api_client.config.logger.debug "API called: DefaultApi#export_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1171
+ end
1172
+ return data, status_code, headers
1173
+ end
1174
+
1175
+ # Lists all Aliases for the User identified by :subscription_id.
1176
+ # @param app_id [String]
1177
+ # @param subscription_id [String]
1178
+ # @param [Hash] opts the optional parameters
1179
+ # @return [UserIdentityResponse]
1180
+ def fetch_aliases(app_id, subscription_id, opts = {})
1181
+ data, _status_code, _headers = fetch_aliases_with_http_info(app_id, subscription_id, opts)
1182
+ data
1183
+ end
1184
+
1185
+ # Lists all Aliases for the User identified by :subscription_id.
1186
+ # @param app_id [String]
1187
+ # @param subscription_id [String]
1188
+ # @param [Hash] opts the optional parameters
1189
+ # @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers
1190
+ def fetch_aliases_with_http_info(app_id, subscription_id, opts = {})
1191
+ if @api_client.config.debugging
1192
+ @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_aliases ...'
1193
+ end
1194
+ # verify the required parameter 'app_id' is set
1195
+ if @api_client.config.client_side_validation && app_id.nil?
1196
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_aliases"
1197
+ end
1198
+ # verify the required parameter 'subscription_id' is set
1199
+ if @api_client.config.client_side_validation && subscription_id.nil?
1200
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.fetch_aliases"
1201
+ end
1202
+ # resource path
1203
+ 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))
1204
+
1205
+ # query parameters
1206
+ query_params = opts[:query_params] || {}
1207
+
1208
+ # header parameters
1209
+ header_params = opts[:header_params] || {}
1210
+ # HTTP header 'Accept' (if needed)
1211
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1212
+
1213
+ # form parameters
1214
+ form_params = opts[:form_params] || {}
1215
+
1216
+ # http body (model)
1217
+ post_body = opts[:debug_body]
1218
+
1219
+ # return_type
1220
+ return_type = opts[:debug_return_type] || 'UserIdentityResponse'
1221
+
1222
+ # auth_names
1223
+ auth_names = opts[:debug_auth_names] || ['app_key']
1224
+
1225
+ new_options = opts.merge(
1226
+ :operation => :"DefaultApi.fetch_aliases",
1227
+ :header_params => header_params,
1228
+ :query_params => query_params,
1229
+ :form_params => form_params,
1230
+ :body => post_body,
1231
+ :auth_names => auth_names,
1232
+ :return_type => return_type
1233
+ )
1234
+
1235
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1236
+ if @api_client.config.debugging
1237
+ @api_client.config.logger.debug "API called: DefaultApi#fetch_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1238
+ end
1239
+ return data, status_code, headers
1240
+ end
1241
+
1242
+ # Returns the User’s properties, Aliases, and Subscriptions.
1243
+ # @param app_id [String]
1244
+ # @param alias_label [String]
1245
+ # @param alias_id [String]
1246
+ # @param [Hash] opts the optional parameters
1247
+ # @return [User]
1248
+ def fetch_user(app_id, alias_label, alias_id, opts = {})
1249
+ data, _status_code, _headers = fetch_user_with_http_info(app_id, alias_label, alias_id, opts)
1250
+ data
1251
+ end
1252
+
1253
+ # Returns the User’s properties, Aliases, and Subscriptions.
1254
+ # @param app_id [String]
1255
+ # @param alias_label [String]
1256
+ # @param alias_id [String]
1257
+ # @param [Hash] opts the optional parameters
1258
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
1259
+ def fetch_user_with_http_info(app_id, alias_label, alias_id, opts = {})
1260
+ if @api_client.config.debugging
1261
+ @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_user ...'
1262
+ end
1263
+ # verify the required parameter 'app_id' is set
1264
+ if @api_client.config.client_side_validation && app_id.nil?
1265
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_user"
1266
+ end
1267
+ # verify the required parameter 'alias_label' is set
1268
+ if @api_client.config.client_side_validation && alias_label.nil?
1269
+ fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.fetch_user"
1270
+ end
1271
+ # verify the required parameter 'alias_id' is set
1272
+ if @api_client.config.client_side_validation && alias_id.nil?
1273
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.fetch_user"
1274
+ end
1275
+ # resource path
1276
+ 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))
1277
+
1278
+ # query parameters
1279
+ query_params = opts[:query_params] || {}
1280
+
1281
+ # header parameters
1282
+ header_params = opts[:header_params] || {}
1283
+ # HTTP header 'Accept' (if needed)
1284
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1285
+
1286
+ # form parameters
1287
+ form_params = opts[:form_params] || {}
1288
+
1289
+ # http body (model)
1290
+ post_body = opts[:debug_body]
1291
+
1292
+ # return_type
1293
+ return_type = opts[:debug_return_type] || 'User'
1294
+
1295
+ # auth_names
1296
+ auth_names = opts[:debug_auth_names] || ['app_key']
1297
+
1298
+ new_options = opts.merge(
1299
+ :operation => :"DefaultApi.fetch_user",
1300
+ :header_params => header_params,
1301
+ :query_params => query_params,
1302
+ :form_params => form_params,
1303
+ :body => post_body,
1304
+ :auth_names => auth_names,
1305
+ :return_type => return_type
1306
+ )
1307
+
1308
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1309
+ if @api_client.config.debugging
1310
+ @api_client.config.logger.debug "API called: DefaultApi#fetch_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1311
+ end
1312
+ return data, status_code, headers
1313
+ end
1314
+
1315
+ # Lists all Aliases for the User identified by (:alias_label, :alias_id).
1316
+ # @param app_id [String]
1317
+ # @param alias_label [String]
1318
+ # @param alias_id [String]
1319
+ # @param [Hash] opts the optional parameters
1320
+ # @return [InlineResponse200]
1321
+ def fetch_user_identity(app_id, alias_label, alias_id, opts = {})
1322
+ data, _status_code, _headers = fetch_user_identity_with_http_info(app_id, alias_label, alias_id, opts)
1323
+ data
1324
+ end
1325
+
1326
+ # Lists all Aliases for the User identified by (:alias_label, :alias_id).
1327
+ # @param app_id [String]
1328
+ # @param alias_label [String]
1329
+ # @param alias_id [String]
1330
+ # @param [Hash] opts the optional parameters
1331
+ # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
1332
+ def fetch_user_identity_with_http_info(app_id, alias_label, alias_id, opts = {})
1333
+ if @api_client.config.debugging
1334
+ @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_user_identity ...'
1335
+ end
1336
+ # verify the required parameter 'app_id' is set
1337
+ if @api_client.config.client_side_validation && app_id.nil?
1338
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_user_identity"
1339
+ end
1340
+ # verify the required parameter 'alias_label' is set
1341
+ if @api_client.config.client_side_validation && alias_label.nil?
1342
+ fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.fetch_user_identity"
1343
+ end
1344
+ # verify the required parameter 'alias_id' is set
1345
+ if @api_client.config.client_side_validation && alias_id.nil?
1346
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.fetch_user_identity"
1347
+ end
1348
+ # resource path
1349
+ 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))
1350
+
1351
+ # query parameters
1352
+ query_params = opts[:query_params] || {}
1353
+
1354
+ # header parameters
1355
+ header_params = opts[:header_params] || {}
1356
+ # HTTP header 'Accept' (if needed)
1357
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1358
+
1359
+ # form parameters
1360
+ form_params = opts[:form_params] || {}
1361
+
1362
+ # http body (model)
1363
+ post_body = opts[:debug_body]
1364
+
1365
+ # return_type
1366
+ return_type = opts[:debug_return_type] || 'InlineResponse200'
1367
+
1368
+ # auth_names
1369
+ auth_names = opts[:debug_auth_names] || ['app_key']
1370
+
1371
+ new_options = opts.merge(
1372
+ :operation => :"DefaultApi.fetch_user_identity",
1373
+ :header_params => header_params,
1374
+ :query_params => query_params,
1375
+ :form_params => form_params,
1376
+ :body => post_body,
1377
+ :auth_names => auth_names,
1378
+ :return_type => return_type
1379
+ )
1380
+
1381
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1382
+ if @api_client.config.debugging
1383
+ @api_client.config.logger.debug "API called: DefaultApi#fetch_user_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1384
+ end
1385
+ return data, status_code, headers
1386
+ end
1387
+
1388
+ # View an app
1389
+ # View the details of a single OneSignal app
1390
+ # @param app_id [String] An app id
1391
+ # @param [Hash] opts the optional parameters
1392
+ # @return [App]
1393
+ def get_app(app_id, opts = {})
1394
+ data, _status_code, _headers = get_app_with_http_info(app_id, opts)
1395
+ data
1396
+ end
1397
+
1398
+ # View an app
1399
+ # View the details of a single OneSignal app
1400
+ # @param app_id [String] An app id
1401
+ # @param [Hash] opts the optional parameters
1402
+ # @return [Array<(App, Integer, Hash)>] App data, response status code and response headers
1403
+ def get_app_with_http_info(app_id, opts = {})
1404
+ if @api_client.config.debugging
1405
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_app ...'
1406
+ end
1407
+ # verify the required parameter 'app_id' is set
1408
+ if @api_client.config.client_side_validation && app_id.nil?
1409
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_app"
1410
+ end
1411
+ # resource path
1412
+ local_var_path = '/apps/{app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
1413
+
1414
+ # query parameters
1415
+ query_params = opts[:query_params] || {}
1416
+
1417
+ # header parameters
1418
+ header_params = opts[:header_params] || {}
1419
+ # HTTP header 'Accept' (if needed)
1420
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1421
+
1422
+ # form parameters
1423
+ form_params = opts[:form_params] || {}
1424
+
1425
+ # http body (model)
1426
+ post_body = opts[:debug_body]
1427
+
1428
+ # return_type
1429
+ return_type = opts[:debug_return_type] || 'App'
1430
+
1431
+ # auth_names
1432
+ auth_names = opts[:debug_auth_names] || ['user_key']
1433
+
1434
+ new_options = opts.merge(
1435
+ :operation => :"DefaultApi.get_app",
1436
+ :header_params => header_params,
1437
+ :query_params => query_params,
1438
+ :form_params => form_params,
1439
+ :body => post_body,
1440
+ :auth_names => auth_names,
1441
+ :return_type => return_type
1442
+ )
1443
+
1444
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1445
+ if @api_client.config.debugging
1446
+ @api_client.config.logger.debug "API called: DefaultApi#get_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1447
+ end
1448
+ return data, status_code, headers
1449
+ end
1450
+
1451
+ # View apps
1452
+ # View the details of all of your current OneSignal apps
1453
+ # @param [Hash] opts the optional parameters
1454
+ # @return [Array<App>]
1455
+ def get_apps(opts = {})
1456
+ data, _status_code, _headers = get_apps_with_http_info(opts)
1457
+ data
1458
+ end
1459
+
1460
+ # View apps
1461
+ # View the details of all of your current OneSignal apps
1462
+ # @param [Hash] opts the optional parameters
1463
+ # @return [Array<(Array<App>, Integer, Hash)>] Array<App> data, response status code and response headers
1464
+ def get_apps_with_http_info(opts = {})
1465
+ if @api_client.config.debugging
1466
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_apps ...'
1467
+ end
1468
+ # resource path
1469
+ local_var_path = '/apps'
1470
+
1471
+ # query parameters
1472
+ query_params = opts[:query_params] || {}
1473
+
1474
+ # header parameters
1475
+ header_params = opts[:header_params] || {}
1476
+ # HTTP header 'Accept' (if needed)
1477
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1478
+
1479
+ # form parameters
1480
+ form_params = opts[:form_params] || {}
1481
+
1482
+ # http body (model)
1483
+ post_body = opts[:debug_body]
1484
+
1485
+ # return_type
1486
+ return_type = opts[:debug_return_type] || 'Array<App>'
1487
+
1488
+ # auth_names
1489
+ auth_names = opts[:debug_auth_names] || ['user_key']
1490
+
1491
+ new_options = opts.merge(
1492
+ :operation => :"DefaultApi.get_apps",
1493
+ :header_params => header_params,
1494
+ :query_params => query_params,
1495
+ :form_params => form_params,
1496
+ :body => post_body,
1497
+ :auth_names => auth_names,
1498
+ :return_type => return_type
1499
+ )
1500
+
1501
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1502
+ if @api_client.config.debugging
1503
+ @api_client.config.logger.debug "API called: DefaultApi#get_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1504
+ end
1505
+ return data, status_code, headers
1506
+ end
1507
+
1508
+ # Manifest of In-App Messages the Subscription is eligible to display by the SDK.
1509
+ # @param app_id [String]
1510
+ # @param subscription_id [String]
1511
+ # @param [Hash] opts the optional parameters
1512
+ # @return [InlineResponse2003]
1513
+ def get_eligible_iams(app_id, subscription_id, opts = {})
1514
+ data, _status_code, _headers = get_eligible_iams_with_http_info(app_id, subscription_id, opts)
1515
+ data
1516
+ end
1517
+
1518
+ # Manifest of In-App Messages the Subscription is eligible to display by the SDK.
1519
+ # @param app_id [String]
1520
+ # @param subscription_id [String]
1521
+ # @param [Hash] opts the optional parameters
1522
+ # @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers
1523
+ def get_eligible_iams_with_http_info(app_id, subscription_id, opts = {})
1524
+ if @api_client.config.debugging
1525
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_eligible_iams ...'
1526
+ end
1527
+ # verify the required parameter 'app_id' is set
1528
+ if @api_client.config.client_side_validation && app_id.nil?
1529
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_eligible_iams"
1530
+ end
1531
+ # verify the required parameter 'subscription_id' is set
1532
+ if @api_client.config.client_side_validation && subscription_id.nil?
1533
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.get_eligible_iams"
1534
+ end
1535
+ # resource path
1536
+ 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))
1537
+
1538
+ # query parameters
1539
+ query_params = opts[:query_params] || {}
1540
+
1541
+ # header parameters
1542
+ header_params = opts[:header_params] || {}
1543
+ # HTTP header 'Accept' (if needed)
1544
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1545
+
1546
+ # form parameters
1547
+ form_params = opts[:form_params] || {}
1548
+
1549
+ # http body (model)
1550
+ post_body = opts[:debug_body]
1551
+
1552
+ # return_type
1553
+ return_type = opts[:debug_return_type] || 'InlineResponse2003'
1554
+
1555
+ # auth_names
1556
+ auth_names = opts[:debug_auth_names] || ['app_key']
1557
+
1558
+ new_options = opts.merge(
1559
+ :operation => :"DefaultApi.get_eligible_iams",
1560
+ :header_params => header_params,
1561
+ :query_params => query_params,
1562
+ :form_params => form_params,
1563
+ :body => post_body,
1564
+ :auth_names => auth_names,
1565
+ :return_type => return_type
1566
+ )
1567
+
1568
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1569
+ if @api_client.config.debugging
1570
+ @api_client.config.logger.debug "API called: DefaultApi#get_eligible_iams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1571
+ end
1572
+ return data, status_code, headers
1573
+ end
1574
+
1575
+ # View notification
1576
+ # View the details of a single notification and outcomes associated with it
1577
+ # @param app_id [String]
1578
+ # @param notification_id [String]
1579
+ # @param [Hash] opts the optional parameters
1580
+ # @return [NotificationWithMeta]
1581
+ def get_notification(app_id, notification_id, opts = {})
1582
+ data, _status_code, _headers = get_notification_with_http_info(app_id, notification_id, opts)
1583
+ data
1584
+ end
1585
+
1586
+ # View notification
1587
+ # View the details of a single notification and outcomes associated with it
1588
+ # @param app_id [String]
1589
+ # @param notification_id [String]
1590
+ # @param [Hash] opts the optional parameters
1591
+ # @return [Array<(NotificationWithMeta, Integer, Hash)>] NotificationWithMeta data, response status code and response headers
1592
+ def get_notification_with_http_info(app_id, notification_id, opts = {})
1593
+ if @api_client.config.debugging
1594
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_notification ...'
1595
+ end
1596
+ # verify the required parameter 'app_id' is set
1597
+ if @api_client.config.client_side_validation && app_id.nil?
1598
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_notification"
1599
+ end
1600
+ # verify the required parameter 'notification_id' is set
1601
+ if @api_client.config.client_side_validation && notification_id.nil?
1602
+ fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.get_notification"
1603
+ end
1604
+ # resource path
1605
+ local_var_path = '/notifications/{notification_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))
1606
+
1607
+ # query parameters
1608
+ query_params = opts[:query_params] || {}
1609
+ query_params[:'app_id'] = app_id
1610
+
1611
+ # header parameters
1612
+ header_params = opts[:header_params] || {}
1613
+ # HTTP header 'Accept' (if needed)
1614
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1615
+
1616
+ # form parameters
1617
+ form_params = opts[:form_params] || {}
1618
+
1619
+ # http body (model)
1620
+ post_body = opts[:debug_body]
1621
+
1622
+ # return_type
1623
+ return_type = opts[:debug_return_type] || 'NotificationWithMeta'
1624
+
1625
+ # auth_names
1626
+ auth_names = opts[:debug_auth_names] || ['app_key']
1627
+
1628
+ new_options = opts.merge(
1629
+ :operation => :"DefaultApi.get_notification",
1630
+ :header_params => header_params,
1631
+ :query_params => query_params,
1632
+ :form_params => form_params,
1633
+ :body => post_body,
1634
+ :auth_names => auth_names,
1635
+ :return_type => return_type
1636
+ )
1637
+
1638
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1639
+ if @api_client.config.debugging
1640
+ @api_client.config.logger.debug "API called: DefaultApi#get_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1641
+ end
1642
+ return data, status_code, headers
1643
+ end
1644
+
1645
+ # Notification History
1646
+ # -> 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. &#x1F6A7; 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.
1647
+ # @param notification_id [String] The \&quot;id\&quot; of the message found in the Notification object
1648
+ # @param get_notification_request_body [GetNotificationRequestBody]
1649
+ # @param [Hash] opts the optional parameters
1650
+ # @return [NotificationHistorySuccessResponse]
1651
+ def get_notification_history(notification_id, get_notification_request_body, opts = {})
1652
+ data, _status_code, _headers = get_notification_history_with_http_info(notification_id, get_notification_request_body, opts)
1653
+ data
1654
+ end
1655
+
1656
+ # Notification History
1657
+ # -&gt; 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. &amp;#x1F6A7; Requirements A OneSignal Paid Plan. Turn on Send History via OneSignal API in Settings -&gt; 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 \&quot;sent\&quot; events recorded, but will show \&quot;clicked\&quot; events. Requires your OneSignal App&#39;s REST API Key, available in Keys &amp; IDs.
1658
+ # @param notification_id [String] The \&quot;id\&quot; of the message found in the Notification object
764
1659
  # @param get_notification_request_body [GetNotificationRequestBody]
765
1660
  # @param [Hash] opts the optional parameters
766
- # @return [Array<(InlineResponse2002, Integer, Hash)>] InlineResponse2002 data, response status code and response headers
1661
+ # @return [Array<(NotificationHistorySuccessResponse, Integer, Hash)>] NotificationHistorySuccessResponse data, response status code and response headers
767
1662
  def get_notification_history_with_http_info(notification_id, get_notification_request_body, opts = {})
768
1663
  if @api_client.config.debugging
769
1664
  @api_client.config.logger.debug 'Calling API: DefaultApi.get_notification_history ...'
@@ -787,7 +1682,10 @@ module OneSignal
787
1682
  # HTTP header 'Accept' (if needed)
788
1683
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
789
1684
  # HTTP header 'Content-Type'
790
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1685
+ content_type = @api_client.select_header_content_type(['application/json'])
1686
+ if !content_type.nil?
1687
+ header_params['Content-Type'] = content_type
1688
+ end
791
1689
 
792
1690
  # form parameters
793
1691
  form_params = opts[:form_params] || {}
@@ -796,7 +1694,7 @@ module OneSignal
796
1694
  post_body = opts[:debug_body] || @api_client.object_to_http_body(get_notification_request_body)
797
1695
 
798
1696
  # return_type
799
- return_type = opts[:debug_return_type] || 'InlineResponse2002'
1697
+ return_type = opts[:debug_return_type] || 'NotificationHistorySuccessResponse'
800
1698
 
801
1699
  # auth_names
802
1700
  auth_names = opts[:debug_auth_names] || ['app_key']
@@ -822,7 +1720,7 @@ module OneSignal
822
1720
  # View the details of multiple notifications
823
1721
  # @param app_id [String] The app ID that you want to view notifications from
824
1722
  # @param [Hash] opts the optional parameters
825
- # @option opts [String] :limit How many notifications to return. Max is 50. Default is 50.
1723
+ # @option opts [Integer] :limit How many notifications to return. Max is 50. Default is 50.
826
1724
  # @option opts [Integer] :offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at.
827
1725
  # @option opts [Integer] :kind Kind of notifications returned: * unset - All notification types (default) * &#x60;0&#x60; - Dashboard only * &#x60;1&#x60; - API only * &#x60;3&#x60; - Automated only
828
1726
  # @return [NotificationSlice]
@@ -835,7 +1733,7 @@ module OneSignal
835
1733
  # View the details of multiple notifications
836
1734
  # @param app_id [String] The app ID that you want to view notifications from
837
1735
  # @param [Hash] opts the optional parameters
838
- # @option opts [String] :limit How many notifications to return. Max is 50. Default is 50.
1736
+ # @option opts [Integer] :limit How many notifications to return. Max is 50. Default is 50.
839
1737
  # @option opts [Integer] :offset Page offset. Default is 0. Results are sorted by queued_at in descending order. queued_at is a representation of the time that the notification was queued at.
840
1738
  # @option opts [Integer] :kind Kind of notifications returned: * unset - All notification types (default) * &#x60;0&#x60; - Dashboard only * &#x60;1&#x60; - API only * &#x60;3&#x60; - Automated only
841
1739
  # @return [Array<(NotificationSlice, Integer, Hash)>] NotificationSlice data, response status code and response headers
@@ -896,72 +1794,299 @@ module OneSignal
896
1794
  end
897
1795
 
898
1796
  # View Outcomes
899
- # 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.
1797
+ # 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.
1798
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
1799
+ # @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 \&quot;os\&quot; 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
1800
+ # @param [Hash] opts the optional parameters
1801
+ # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]&#x3D;os__click.count&amp;outcome_names[]&#x3D;Sales, Purchase.count where \&quot;Sales, Purchase\&quot; is the custom outcomes with a comma in the name.
1802
+ # @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.
1803
+ # @option opts [String] :outcome_platforms Optional Platform id. Refer device&#39;s platform ids for values. Example: outcome_platform&#x3D;0 for iOS outcome_platform&#x3D;7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted.
1804
+ # @option opts [String] :outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution&#x3D;direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.
1805
+ # @return [OutcomesData]
1806
+ def get_outcomes(app_id, outcome_names, opts = {})
1807
+ data, _status_code, _headers = get_outcomes_with_http_info(app_id, outcome_names, opts)
1808
+ data
1809
+ end
1810
+
1811
+ # View Outcomes
1812
+ # View the details of all the outcomes associated with your app &amp;#x1F6A7; Requires Authentication Key Requires your OneSignal App&#39;s REST API Key, available in Keys &amp; IDs. &amp;#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.
900
1813
  # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
901
- # @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
1814
+ # @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 \&quot;os\&quot; 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
1815
+ # @param [Hash] opts the optional parameters
1816
+ # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]&#x3D;os__click.count&amp;outcome_names[]&#x3D;Sales, Purchase.count where \&quot;Sales, Purchase\&quot; is the custom outcomes with a comma in the name.
1817
+ # @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.
1818
+ # @option opts [String] :outcome_platforms Optional Platform id. Refer device&#39;s platform ids for values. Example: outcome_platform&#x3D;0 for iOS outcome_platform&#x3D;7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted.
1819
+ # @option opts [String] :outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution&#x3D;direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.
1820
+ # @return [Array<(OutcomesData, Integer, Hash)>] OutcomesData data, response status code and response headers
1821
+ def get_outcomes_with_http_info(app_id, outcome_names, opts = {})
1822
+ if @api_client.config.debugging
1823
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_outcomes ...'
1824
+ end
1825
+ # verify the required parameter 'app_id' is set
1826
+ if @api_client.config.client_side_validation && app_id.nil?
1827
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_outcomes"
1828
+ end
1829
+ # verify the required parameter 'outcome_names' is set
1830
+ if @api_client.config.client_side_validation && outcome_names.nil?
1831
+ fail ArgumentError, "Missing the required parameter 'outcome_names' when calling DefaultApi.get_outcomes"
1832
+ end
1833
+ # resource path
1834
+ local_var_path = '/apps/{app_id}/outcomes'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
1835
+
1836
+ # query parameters
1837
+ query_params = opts[:query_params] || {}
1838
+ query_params[:'outcome_names'] = outcome_names
1839
+ query_params[:'outcome_names[]'] = opts[:'outcome_names2'] if !opts[:'outcome_names2'].nil?
1840
+ query_params[:'outcome_time_range'] = opts[:'outcome_time_range'] if !opts[:'outcome_time_range'].nil?
1841
+ query_params[:'outcome_platforms'] = opts[:'outcome_platforms'] if !opts[:'outcome_platforms'].nil?
1842
+ query_params[:'outcome_attribution'] = opts[:'outcome_attribution'] if !opts[:'outcome_attribution'].nil?
1843
+
1844
+ # header parameters
1845
+ header_params = opts[:header_params] || {}
1846
+ # HTTP header 'Accept' (if needed)
1847
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1848
+
1849
+ # form parameters
1850
+ form_params = opts[:form_params] || {}
1851
+
1852
+ # http body (model)
1853
+ post_body = opts[:debug_body]
1854
+
1855
+ # return_type
1856
+ return_type = opts[:debug_return_type] || 'OutcomesData'
1857
+
1858
+ # auth_names
1859
+ auth_names = opts[:debug_auth_names] || ['app_key']
1860
+
1861
+ new_options = opts.merge(
1862
+ :operation => :"DefaultApi.get_outcomes",
1863
+ :header_params => header_params,
1864
+ :query_params => query_params,
1865
+ :form_params => form_params,
1866
+ :body => post_body,
1867
+ :auth_names => auth_names,
1868
+ :return_type => return_type
1869
+ )
1870
+
1871
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1872
+ if @api_client.config.debugging
1873
+ @api_client.config.logger.debug "API called: DefaultApi#get_outcomes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1874
+ end
1875
+ return data, status_code, headers
1876
+ end
1877
+
1878
+ # View device
1879
+ # View the details of an existing device in one of your OneSignal apps
1880
+ # @param app_id [String] Your app_id for this device
1881
+ # @param player_id [String] Player&#39;s OneSignal ID
1882
+ # @param [Hash] opts the optional parameters
1883
+ # @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11).
1884
+ # @return [Player]
1885
+ def get_player(app_id, player_id, opts = {})
1886
+ data, _status_code, _headers = get_player_with_http_info(app_id, player_id, opts)
1887
+ data
1888
+ end
1889
+
1890
+ # View device
1891
+ # View the details of an existing device in one of your OneSignal apps
1892
+ # @param app_id [String] Your app_id for this device
1893
+ # @param player_id [String] Player&#39;s OneSignal ID
1894
+ # @param [Hash] opts the optional parameters
1895
+ # @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11).
1896
+ # @return [Array<(Player, Integer, Hash)>] Player data, response status code and response headers
1897
+ def get_player_with_http_info(app_id, player_id, opts = {})
1898
+ if @api_client.config.debugging
1899
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_player ...'
1900
+ end
1901
+ # verify the required parameter 'app_id' is set
1902
+ if @api_client.config.client_side_validation && app_id.nil?
1903
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_player"
1904
+ end
1905
+ # verify the required parameter 'player_id' is set
1906
+ if @api_client.config.client_side_validation && player_id.nil?
1907
+ fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.get_player"
1908
+ end
1909
+ # resource path
1910
+ local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s))
1911
+
1912
+ # query parameters
1913
+ query_params = opts[:query_params] || {}
1914
+ query_params[:'app_id'] = app_id
1915
+ query_params[:'email_auth_hash'] = opts[:'email_auth_hash'] if !opts[:'email_auth_hash'].nil?
1916
+
1917
+ # header parameters
1918
+ header_params = opts[:header_params] || {}
1919
+ # HTTP header 'Accept' (if needed)
1920
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1921
+
1922
+ # form parameters
1923
+ form_params = opts[:form_params] || {}
1924
+
1925
+ # http body (model)
1926
+ post_body = opts[:debug_body]
1927
+
1928
+ # return_type
1929
+ return_type = opts[:debug_return_type] || 'Player'
1930
+
1931
+ # auth_names
1932
+ auth_names = opts[:debug_auth_names] || ['app_key']
1933
+
1934
+ new_options = opts.merge(
1935
+ :operation => :"DefaultApi.get_player",
1936
+ :header_params => header_params,
1937
+ :query_params => query_params,
1938
+ :form_params => form_params,
1939
+ :body => post_body,
1940
+ :auth_names => auth_names,
1941
+ :return_type => return_type
1942
+ )
1943
+
1944
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1945
+ if @api_client.config.debugging
1946
+ @api_client.config.logger.debug "API called: DefaultApi#get_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1947
+ end
1948
+ return data, status_code, headers
1949
+ end
1950
+
1951
+ # View devices
1952
+ # 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.
1953
+ # @param app_id [String] The app ID that you want to view players from
1954
+ # @param [Hash] opts the optional parameters
1955
+ # @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300
1956
+ # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id;
1957
+ # @return [PlayerSlice]
1958
+ def get_players(app_id, opts = {})
1959
+ data, _status_code, _headers = get_players_with_http_info(app_id, opts)
1960
+ data
1961
+ end
1962
+
1963
+ # View devices
1964
+ # 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.
1965
+ # @param app_id [String] The app ID that you want to view players from
1966
+ # @param [Hash] opts the optional parameters
1967
+ # @option opts [Integer] :limit How many devices to return. Max is 300. Default is 300
1968
+ # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id;
1969
+ # @return [Array<(PlayerSlice, Integer, Hash)>] PlayerSlice data, response status code and response headers
1970
+ def get_players_with_http_info(app_id, opts = {})
1971
+ if @api_client.config.debugging
1972
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_players ...'
1973
+ end
1974
+ # verify the required parameter 'app_id' is set
1975
+ if @api_client.config.client_side_validation && app_id.nil?
1976
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_players"
1977
+ end
1978
+ # resource path
1979
+ local_var_path = '/players'
1980
+
1981
+ # query parameters
1982
+ query_params = opts[:query_params] || {}
1983
+ query_params[:'app_id'] = app_id
1984
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1985
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1986
+
1987
+ # header parameters
1988
+ header_params = opts[:header_params] || {}
1989
+ # HTTP header 'Accept' (if needed)
1990
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1991
+
1992
+ # form parameters
1993
+ form_params = opts[:form_params] || {}
1994
+
1995
+ # http body (model)
1996
+ post_body = opts[:debug_body]
1997
+
1998
+ # return_type
1999
+ return_type = opts[:debug_return_type] || 'PlayerSlice'
2000
+
2001
+ # auth_names
2002
+ auth_names = opts[:debug_auth_names] || ['app_key']
2003
+
2004
+ new_options = opts.merge(
2005
+ :operation => :"DefaultApi.get_players",
2006
+ :header_params => header_params,
2007
+ :query_params => query_params,
2008
+ :form_params => form_params,
2009
+ :body => post_body,
2010
+ :auth_names => auth_names,
2011
+ :return_type => return_type
2012
+ )
2013
+
2014
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2015
+ if @api_client.config.debugging
2016
+ @api_client.config.logger.debug "API called: DefaultApi#get_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2017
+ end
2018
+ return data, status_code, headers
2019
+ end
2020
+
2021
+ # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
2022
+ # @param app_id [String]
2023
+ # @param alias_label [String]
2024
+ # @param alias_id [String]
2025
+ # @param user_identity_request_body [UserIdentityRequestBody]
902
2026
  # @param [Hash] opts the optional parameters
903
- # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]&#x3D;os__click.count&amp;outcome_names[]&#x3D;Sales, Purchase.count where “Sales, Purchase” is the custom outcomes with a comma in the name.
904
- # @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.
905
- # @option opts [String] :outcome_platforms Optional Platform id. Refer device&#39;s platform ids for values. Example: outcome_platform&#x3D;0 for iOS outcome_platform&#x3D;7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted.
906
- # @option opts [String] :outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution&#x3D;direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.
907
- # @return [Array<OutcomeData>]
908
- def get_outcomes(app_id, outcome_names, opts = {})
909
- data, _status_code, _headers = get_outcomes_with_http_info(app_id, outcome_names, opts)
2027
+ # @return [InlineResponse200]
2028
+ def identify_user_by_alias(app_id, alias_label, alias_id, user_identity_request_body, opts = {})
2029
+ data, _status_code, _headers = identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body, opts)
910
2030
  data
911
2031
  end
912
2032
 
913
- # View Outcomes
914
- # View the details of all the outcomes associated with your app 🚧 Requires Authentication Key Requires your OneSignal App&#39;s REST API Key, available in Keys &amp; 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.
915
- # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
916
- # @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
2033
+ # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
2034
+ # @param app_id [String]
2035
+ # @param alias_label [String]
2036
+ # @param alias_id [String]
2037
+ # @param user_identity_request_body [UserIdentityRequestBody]
917
2038
  # @param [Hash] opts the optional parameters
918
- # @option opts [String] :outcome_names2 Optional If outcome names contain any commas, then please specify only one value at a time. Example: outcome_names[]&#x3D;os__click.count&amp;outcome_names[]&#x3D;Sales, Purchase.count where “Sales, Purchase” is the custom outcomes with a comma in the name.
919
- # @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.
920
- # @option opts [String] :outcome_platforms Optional Platform id. Refer device&#39;s platform ids for values. Example: outcome_platform&#x3D;0 for iOS outcome_platform&#x3D;7,8 for Safari and Firefox Default is data from all platforms if the parameter is omitted.
921
- # @option opts [String] :outcome_attribution Optional Attribution type for the outcomes. The values can be direct or influenced or unattributed. Example: outcome_attribution&#x3D;direct Default is total (returns direct+influenced+unattributed) if the parameter is omitted.
922
- # @return [Array<(Array<OutcomeData>, Integer, Hash)>] Array<OutcomeData> data, response status code and response headers
923
- def get_outcomes_with_http_info(app_id, outcome_names, opts = {})
2039
+ # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
2040
+ def identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body, opts = {})
924
2041
  if @api_client.config.debugging
925
- @api_client.config.logger.debug 'Calling API: DefaultApi.get_outcomes ...'
2042
+ @api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_alias ...'
926
2043
  end
927
2044
  # verify the required parameter 'app_id' is set
928
2045
  if @api_client.config.client_side_validation && app_id.nil?
929
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_outcomes"
2046
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.identify_user_by_alias"
930
2047
  end
931
- # verify the required parameter 'outcome_names' is set
932
- if @api_client.config.client_side_validation && outcome_names.nil?
933
- fail ArgumentError, "Missing the required parameter 'outcome_names' when calling DefaultApi.get_outcomes"
2048
+ # verify the required parameter 'alias_label' is set
2049
+ if @api_client.config.client_side_validation && alias_label.nil?
2050
+ fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.identify_user_by_alias"
2051
+ end
2052
+ # verify the required parameter 'alias_id' is set
2053
+ if @api_client.config.client_side_validation && alias_id.nil?
2054
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.identify_user_by_alias"
2055
+ end
2056
+ # verify the required parameter 'user_identity_request_body' is set
2057
+ if @api_client.config.client_side_validation && user_identity_request_body.nil?
2058
+ fail ArgumentError, "Missing the required parameter 'user_identity_request_body' when calling DefaultApi.identify_user_by_alias"
934
2059
  end
935
2060
  # resource path
936
- local_var_path = '/apps/{app_id}/outcomes'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
2061
+ 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))
937
2062
 
938
2063
  # query parameters
939
2064
  query_params = opts[:query_params] || {}
940
- query_params[:'outcome_names'] = outcome_names
941
- query_params[:'outcome_names[]'] = opts[:'outcome_names2'] if !opts[:'outcome_names2'].nil?
942
- query_params[:'outcome_time_range'] = opts[:'outcome_time_range'] if !opts[:'outcome_time_range'].nil?
943
- query_params[:'outcome_platforms'] = opts[:'outcome_platforms'] if !opts[:'outcome_platforms'].nil?
944
- query_params[:'outcome_attribution'] = opts[:'outcome_attribution'] if !opts[:'outcome_attribution'].nil?
945
2065
 
946
2066
  # header parameters
947
2067
  header_params = opts[:header_params] || {}
948
2068
  # HTTP header 'Accept' (if needed)
949
2069
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2070
+ # HTTP header 'Content-Type'
2071
+ content_type = @api_client.select_header_content_type(['application/json'])
2072
+ if !content_type.nil?
2073
+ header_params['Content-Type'] = content_type
2074
+ end
950
2075
 
951
2076
  # form parameters
952
2077
  form_params = opts[:form_params] || {}
953
2078
 
954
2079
  # http body (model)
955
- post_body = opts[:debug_body]
2080
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_request_body)
956
2081
 
957
2082
  # return_type
958
- return_type = opts[:debug_return_type] || 'Array<OutcomeData>'
2083
+ return_type = opts[:debug_return_type] || 'InlineResponse200'
959
2084
 
960
2085
  # auth_names
961
2086
  auth_names = opts[:debug_auth_names] || ['app_key']
962
2087
 
963
2088
  new_options = opts.merge(
964
- :operation => :"DefaultApi.get_outcomes",
2089
+ :operation => :"DefaultApi.identify_user_by_alias",
965
2090
  :header_params => header_params,
966
2091
  :query_params => query_params,
967
2092
  :form_params => form_params,
@@ -970,71 +2095,76 @@ module OneSignal
970
2095
  :return_type => return_type
971
2096
  )
972
2097
 
973
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2098
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
974
2099
  if @api_client.config.debugging
975
- @api_client.config.logger.debug "API called: DefaultApi#get_outcomes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2100
+ @api_client.config.logger.debug "API called: DefaultApi#identify_user_by_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
976
2101
  end
977
2102
  return data, status_code, headers
978
2103
  end
979
2104
 
980
- # View device
981
- # View the details of an existing device in one of your OneSignal apps
982
- # @param app_id [String] Your app_id for this device
983
- # @param player_id [String] Player&#39;s OneSignal ID
2105
+ # Upserts one or more Aliases for the User identified by :subscription_id.
2106
+ # @param app_id [String]
2107
+ # @param subscription_id [String]
2108
+ # @param user_identity_request_body [UserIdentityRequestBody]
984
2109
  # @param [Hash] opts the optional parameters
985
- # @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11).
986
- # @return [Player]
987
- def get_player(app_id, player_id, opts = {})
988
- data, _status_code, _headers = get_player_with_http_info(app_id, player_id, opts)
2110
+ # @return [UserIdentityResponse]
2111
+ def identify_user_by_subscription_id(app_id, subscription_id, user_identity_request_body, opts = {})
2112
+ data, _status_code, _headers = identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body, opts)
989
2113
  data
990
2114
  end
991
2115
 
992
- # View device
993
- # View the details of an existing device in one of your OneSignal apps
994
- # @param app_id [String] Your app_id for this device
995
- # @param player_id [String] Player&#39;s OneSignal ID
2116
+ # Upserts one or more Aliases for the User identified by :subscription_id.
2117
+ # @param app_id [String]
2118
+ # @param subscription_id [String]
2119
+ # @param user_identity_request_body [UserIdentityRequestBody]
996
2120
  # @param [Hash] opts the optional parameters
997
- # @option opts [String] :email_auth_hash Email - Only required if you have enabled Identity Verification and device_type is email (11).
998
- # @return [Array<(Player, Integer, Hash)>] Player data, response status code and response headers
999
- def get_player_with_http_info(app_id, player_id, opts = {})
2121
+ # @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers
2122
+ def identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body, opts = {})
1000
2123
  if @api_client.config.debugging
1001
- @api_client.config.logger.debug 'Calling API: DefaultApi.get_player ...'
2124
+ @api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_subscription_id ...'
1002
2125
  end
1003
2126
  # verify the required parameter 'app_id' is set
1004
2127
  if @api_client.config.client_side_validation && app_id.nil?
1005
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_player"
2128
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.identify_user_by_subscription_id"
1006
2129
  end
1007
- # verify the required parameter 'player_id' is set
1008
- if @api_client.config.client_side_validation && player_id.nil?
1009
- fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.get_player"
2130
+ # verify the required parameter 'subscription_id' is set
2131
+ if @api_client.config.client_side_validation && subscription_id.nil?
2132
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.identify_user_by_subscription_id"
2133
+ end
2134
+ # verify the required parameter 'user_identity_request_body' is set
2135
+ if @api_client.config.client_side_validation && user_identity_request_body.nil?
2136
+ fail ArgumentError, "Missing the required parameter 'user_identity_request_body' when calling DefaultApi.identify_user_by_subscription_id"
1010
2137
  end
1011
2138
  # resource path
1012
- local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s))
2139
+ 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))
1013
2140
 
1014
2141
  # query parameters
1015
2142
  query_params = opts[:query_params] || {}
1016
- query_params[:'app_id'] = app_id
1017
- query_params[:'email_auth_hash'] = opts[:'email_auth_hash'] if !opts[:'email_auth_hash'].nil?
1018
2143
 
1019
2144
  # header parameters
1020
2145
  header_params = opts[:header_params] || {}
1021
2146
  # HTTP header 'Accept' (if needed)
1022
2147
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2148
+ # HTTP header 'Content-Type'
2149
+ content_type = @api_client.select_header_content_type(['application/json'])
2150
+ if !content_type.nil?
2151
+ header_params['Content-Type'] = content_type
2152
+ end
1023
2153
 
1024
2154
  # form parameters
1025
2155
  form_params = opts[:form_params] || {}
1026
2156
 
1027
2157
  # http body (model)
1028
- post_body = opts[:debug_body]
2158
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_request_body)
1029
2159
 
1030
2160
  # return_type
1031
- return_type = opts[:debug_return_type] || 'Player'
2161
+ return_type = opts[:debug_return_type] || 'UserIdentityResponse'
1032
2162
 
1033
2163
  # auth_names
1034
2164
  auth_names = opts[:debug_auth_names] || ['app_key']
1035
2165
 
1036
2166
  new_options = opts.merge(
1037
- :operation => :"DefaultApi.get_player",
2167
+ :operation => :"DefaultApi.identify_user_by_subscription_id",
1038
2168
  :header_params => header_params,
1039
2169
  :query_params => query_params,
1040
2170
  :form_params => form_params,
@@ -1043,68 +2173,76 @@ module OneSignal
1043
2173
  :return_type => return_type
1044
2174
  )
1045
2175
 
1046
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2176
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1047
2177
  if @api_client.config.debugging
1048
- @api_client.config.logger.debug "API called: DefaultApi#get_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2178
+ @api_client.config.logger.debug "API called: DefaultApi#identify_user_by_subscription_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1049
2179
  end
1050
2180
  return data, status_code, headers
1051
2181
  end
1052
2182
 
1053
- # View devices
1054
- # 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.
1055
- # @param app_id [String] The app ID that you want to view players from
2183
+ # Transfers this Subscription to the User identified by the identity in the payload.
2184
+ # @param app_id [String]
2185
+ # @param subscription_id [String]
2186
+ # @param transfer_subscription_request_body [TransferSubscriptionRequestBody]
1056
2187
  # @param [Hash] opts the optional parameters
1057
- # @option opts [String] :limit How many devices to return. Max is 300. Default is 300
1058
- # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id;
1059
- # @return [PlayerSlice]
1060
- def get_players(app_id, opts = {})
1061
- data, _status_code, _headers = get_players_with_http_info(app_id, opts)
2188
+ # @return [UserIdentityResponse]
2189
+ def transfer_subscription(app_id, subscription_id, transfer_subscription_request_body, opts = {})
2190
+ data, _status_code, _headers = transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts)
1062
2191
  data
1063
2192
  end
1064
2193
 
1065
- # View devices
1066
- # 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.
1067
- # @param app_id [String] The app ID that you want to view players from
2194
+ # Transfers this Subscription to the User identified by the identity in the payload.
2195
+ # @param app_id [String]
2196
+ # @param subscription_id [String]
2197
+ # @param transfer_subscription_request_body [TransferSubscriptionRequestBody]
1068
2198
  # @param [Hash] opts the optional parameters
1069
- # @option opts [String] :limit How many devices to return. Max is 300. Default is 300
1070
- # @option opts [Integer] :offset Result offset. Default is 0. Results are sorted by id;
1071
- # @return [Array<(PlayerSlice, Integer, Hash)>] PlayerSlice data, response status code and response headers
1072
- def get_players_with_http_info(app_id, opts = {})
2199
+ # @return [Array<(UserIdentityResponse, Integer, Hash)>] UserIdentityResponse data, response status code and response headers
2200
+ def transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts = {})
1073
2201
  if @api_client.config.debugging
1074
- @api_client.config.logger.debug 'Calling API: DefaultApi.get_players ...'
2202
+ @api_client.config.logger.debug 'Calling API: DefaultApi.transfer_subscription ...'
1075
2203
  end
1076
2204
  # verify the required parameter 'app_id' is set
1077
2205
  if @api_client.config.client_side_validation && app_id.nil?
1078
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_players"
2206
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.transfer_subscription"
2207
+ end
2208
+ # verify the required parameter 'subscription_id' is set
2209
+ if @api_client.config.client_side_validation && subscription_id.nil?
2210
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.transfer_subscription"
2211
+ end
2212
+ # verify the required parameter 'transfer_subscription_request_body' is set
2213
+ if @api_client.config.client_side_validation && transfer_subscription_request_body.nil?
2214
+ fail ArgumentError, "Missing the required parameter 'transfer_subscription_request_body' when calling DefaultApi.transfer_subscription"
1079
2215
  end
1080
2216
  # resource path
1081
- local_var_path = '/players'
2217
+ 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))
1082
2218
 
1083
2219
  # query parameters
1084
2220
  query_params = opts[:query_params] || {}
1085
- query_params[:'app_id'] = app_id
1086
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1087
- query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1088
2221
 
1089
2222
  # header parameters
1090
2223
  header_params = opts[:header_params] || {}
1091
2224
  # HTTP header 'Accept' (if needed)
1092
2225
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2226
+ # HTTP header 'Content-Type'
2227
+ content_type = @api_client.select_header_content_type(['application/json'])
2228
+ if !content_type.nil?
2229
+ header_params['Content-Type'] = content_type
2230
+ end
1093
2231
 
1094
2232
  # form parameters
1095
2233
  form_params = opts[:form_params] || {}
1096
2234
 
1097
2235
  # http body (model)
1098
- post_body = opts[:debug_body]
2236
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_subscription_request_body)
1099
2237
 
1100
2238
  # return_type
1101
- return_type = opts[:debug_return_type] || 'PlayerSlice'
2239
+ return_type = opts[:debug_return_type] || 'UserIdentityResponse'
1102
2240
 
1103
2241
  # auth_names
1104
2242
  auth_names = opts[:debug_auth_names] || ['app_key']
1105
2243
 
1106
2244
  new_options = opts.merge(
1107
- :operation => :"DefaultApi.get_players",
2245
+ :operation => :"DefaultApi.transfer_subscription",
1108
2246
  :header_params => header_params,
1109
2247
  :query_params => query_params,
1110
2248
  :form_params => form_params,
@@ -1113,9 +2251,9 @@ module OneSignal
1113
2251
  :return_type => return_type
1114
2252
  )
1115
2253
 
1116
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2254
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1117
2255
  if @api_client.config.debugging
1118
- @api_client.config.logger.debug "API called: DefaultApi#get_players\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2256
+ @api_client.config.logger.debug "API called: DefaultApi#transfer_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1119
2257
  end
1120
2258
  return data, status_code, headers
1121
2259
  end
@@ -1160,7 +2298,10 @@ module OneSignal
1160
2298
  # HTTP header 'Accept' (if needed)
1161
2299
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1162
2300
  # HTTP header 'Content-Type'
1163
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
2301
+ content_type = @api_client.select_header_content_type(['application/json'])
2302
+ if !content_type.nil?
2303
+ header_params['Content-Type'] = content_type
2304
+ end
1164
2305
 
1165
2306
  # form parameters
1166
2307
  form_params = opts[:form_params] || {}
@@ -1191,12 +2332,92 @@ module OneSignal
1191
2332
  return data, status_code, headers
1192
2333
  end
1193
2334
 
2335
+ # Update a Live Activity via Push
2336
+ # Updates a specified live activity.
2337
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
2338
+ # @param activity_id [String] Live Activity record ID
2339
+ # @param update_live_activity_request [UpdateLiveActivityRequest]
2340
+ # @param [Hash] opts the optional parameters
2341
+ # @return [UpdateLiveActivitySuccessResponse]
2342
+ def update_live_activity(app_id, activity_id, update_live_activity_request, opts = {})
2343
+ data, _status_code, _headers = update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request, opts)
2344
+ data
2345
+ end
2346
+
2347
+ # Update a Live Activity via Push
2348
+ # Updates a specified live activity.
2349
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
2350
+ # @param activity_id [String] Live Activity record ID
2351
+ # @param update_live_activity_request [UpdateLiveActivityRequest]
2352
+ # @param [Hash] opts the optional parameters
2353
+ # @return [Array<(UpdateLiveActivitySuccessResponse, Integer, Hash)>] UpdateLiveActivitySuccessResponse data, response status code and response headers
2354
+ def update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request, opts = {})
2355
+ if @api_client.config.debugging
2356
+ @api_client.config.logger.debug 'Calling API: DefaultApi.update_live_activity ...'
2357
+ end
2358
+ # verify the required parameter 'app_id' is set
2359
+ if @api_client.config.client_side_validation && app_id.nil?
2360
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_live_activity"
2361
+ end
2362
+ # verify the required parameter 'activity_id' is set
2363
+ if @api_client.config.client_side_validation && activity_id.nil?
2364
+ fail ArgumentError, "Missing the required parameter 'activity_id' when calling DefaultApi.update_live_activity"
2365
+ end
2366
+ # verify the required parameter 'update_live_activity_request' is set
2367
+ if @api_client.config.client_side_validation && update_live_activity_request.nil?
2368
+ fail ArgumentError, "Missing the required parameter 'update_live_activity_request' when calling DefaultApi.update_live_activity"
2369
+ end
2370
+ # resource path
2371
+ local_var_path = '/apps/{app_id}/live_activities/{activity_id}/notifications'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'activity_id' + '}', CGI.escape(activity_id.to_s))
2372
+
2373
+ # query parameters
2374
+ query_params = opts[:query_params] || {}
2375
+
2376
+ # header parameters
2377
+ header_params = opts[:header_params] || {}
2378
+ # HTTP header 'Accept' (if needed)
2379
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2380
+ # HTTP header 'Content-Type'
2381
+ content_type = @api_client.select_header_content_type(['application/json'])
2382
+ if !content_type.nil?
2383
+ header_params['Content-Type'] = content_type
2384
+ end
2385
+
2386
+ # form parameters
2387
+ form_params = opts[:form_params] || {}
2388
+
2389
+ # http body (model)
2390
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_live_activity_request)
2391
+
2392
+ # return_type
2393
+ return_type = opts[:debug_return_type] || 'UpdateLiveActivitySuccessResponse'
2394
+
2395
+ # auth_names
2396
+ auth_names = opts[:debug_auth_names] || ['app_key']
2397
+
2398
+ new_options = opts.merge(
2399
+ :operation => :"DefaultApi.update_live_activity",
2400
+ :header_params => header_params,
2401
+ :query_params => query_params,
2402
+ :form_params => form_params,
2403
+ :body => post_body,
2404
+ :auth_names => auth_names,
2405
+ :return_type => return_type
2406
+ )
2407
+
2408
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2409
+ if @api_client.config.debugging
2410
+ @api_client.config.logger.debug "API called: DefaultApi#update_live_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2411
+ end
2412
+ return data, status_code, headers
2413
+ end
2414
+
1194
2415
  # Edit device
1195
2416
  # Update an existing device in one of your OneSignal apps
1196
2417
  # @param player_id [String] Player&#39;s OneSignal ID
1197
2418
  # @param player [Player]
1198
2419
  # @param [Hash] opts the optional parameters
1199
- # @return [InlineResponse2001]
2420
+ # @return [UpdatePlayerSuccessResponse]
1200
2421
  def update_player(player_id, player, opts = {})
1201
2422
  data, _status_code, _headers = update_player_with_http_info(player_id, player, opts)
1202
2423
  data
@@ -1207,7 +2428,7 @@ module OneSignal
1207
2428
  # @param player_id [String] Player&#39;s OneSignal ID
1208
2429
  # @param player [Player]
1209
2430
  # @param [Hash] opts the optional parameters
1210
- # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers
2431
+ # @return [Array<(UpdatePlayerSuccessResponse, Integer, Hash)>] UpdatePlayerSuccessResponse data, response status code and response headers
1211
2432
  def update_player_with_http_info(player_id, player, opts = {})
1212
2433
  if @api_client.config.debugging
1213
2434
  @api_client.config.logger.debug 'Calling API: DefaultApi.update_player ...'
@@ -1231,7 +2452,10 @@ module OneSignal
1231
2452
  # HTTP header 'Accept' (if needed)
1232
2453
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1233
2454
  # HTTP header 'Content-Type'
1234
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
2455
+ content_type = @api_client.select_header_content_type(['application/json'])
2456
+ if !content_type.nil?
2457
+ header_params['Content-Type'] = content_type
2458
+ end
1235
2459
 
1236
2460
  # form parameters
1237
2461
  form_params = opts[:form_params] || {}
@@ -1240,7 +2464,7 @@ module OneSignal
1240
2464
  post_body = opts[:debug_body] || @api_client.object_to_http_body(player)
1241
2465
 
1242
2466
  # return_type
1243
- return_type = opts[:debug_return_type] || 'InlineResponse2001'
2467
+ return_type = opts[:debug_return_type] || 'UpdatePlayerSuccessResponse'
1244
2468
 
1245
2469
  # auth_names
1246
2470
  auth_names = opts[:debug_auth_names] || ['app_key']
@@ -1263,24 +2487,24 @@ module OneSignal
1263
2487
  end
1264
2488
 
1265
2489
  # Edit tags with external user id
1266
- # Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. 📘 Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" }
2490
+ # Update an existing device's tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\"key\", \"value1\") then update the tag value to \"value2\" with this API endpoint. You will not be able to set the value back to \"value1\" through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device's tags. This is only applicable on the Android Mobile App SDKs. &#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \"tags\": { \"rank\": \"\", \"category\": \"\", \"class\": \"my_new_value\" }
1267
2491
  # @param app_id [String] The OneSignal App ID the user record is found under.
1268
2492
  # @param external_user_id [String] The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated.
1269
2493
  # @param [Hash] opts the optional parameters
1270
2494
  # @option opts [UpdatePlayerTagsRequestBody] :update_player_tags_request_body
1271
- # @return [InlineResponse2003]
2495
+ # @return [UpdatePlayerTagsSuccessResponse]
1272
2496
  def update_player_tags(app_id, external_user_id, opts = {})
1273
2497
  data, _status_code, _headers = update_player_tags_with_http_info(app_id, external_user_id, opts)
1274
2498
  data
1275
2499
  end
1276
2500
 
1277
2501
  # Edit tags with external user id
1278
- # Update an existing device&#39;s tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\&quot;key\&quot;, \&quot;value1\&quot;) then update the tag value to \&quot;value2\&quot; with this API endpoint. You will not be able to set the value back to \&quot;value1\&quot; through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device&#39;s tags. This is only applicable on the Android Mobile App SDKs. 📘 Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \&quot;tags\&quot;: { \&quot;rank\&quot;: \&quot;\&quot;, \&quot;category\&quot;: \&quot;\&quot;, \&quot;class\&quot;: \&quot;my_new_value\&quot; }
2502
+ # Update an existing device&#39;s tags in one of your OneSignal apps using the External User ID. Warning - Android SDK Data Synchronization Tags added through the Android SDK tagging methods may not update if using the API to change or update the same tag. For example, if you use SDK method sendTag(\&quot;key\&quot;, \&quot;value1\&quot;) then update the tag value to \&quot;value2\&quot; with this API endpoint. You will not be able to set the value back to \&quot;value1\&quot; through the SDK, you will need to change it to something different through the SDK to be reset. Recommendations if using this Endpoint on Android Mobile Apps: 1 - Do not use the same tag keys for SDK and API updates 2 - If you want to use the same key for both SDK and API updates, call the SDK getTags method first to update the device&#39;s tags. This is only applicable on the Android Mobile App SDKs. &amp;#128216; Deleting Tags To delete a tag, include its key and set its value to blank. Omitting a key/value will not delete it. For example, if I wanted to delete two existing tags rank and category while simultaneously adding a new tag class, the tags JSON would look like the following: \&quot;tags\&quot;: { \&quot;rank\&quot;: \&quot;\&quot;, \&quot;category\&quot;: \&quot;\&quot;, \&quot;class\&quot;: \&quot;my_new_value\&quot; }
1279
2503
  # @param app_id [String] The OneSignal App ID the user record is found under.
1280
2504
  # @param external_user_id [String] The External User ID mapped to teh device record in OneSignal. Must be actively set on the device to be updated.
1281
2505
  # @param [Hash] opts the optional parameters
1282
2506
  # @option opts [UpdatePlayerTagsRequestBody] :update_player_tags_request_body
1283
- # @return [Array<(InlineResponse2003, Integer, Hash)>] InlineResponse2003 data, response status code and response headers
2507
+ # @return [Array<(UpdatePlayerTagsSuccessResponse, Integer, Hash)>] UpdatePlayerTagsSuccessResponse data, response status code and response headers
1284
2508
  def update_player_tags_with_http_info(app_id, external_user_id, opts = {})
1285
2509
  if @api_client.config.debugging
1286
2510
  @api_client.config.logger.debug 'Calling API: DefaultApi.update_player_tags ...'
@@ -1304,7 +2528,10 @@ module OneSignal
1304
2528
  # HTTP header 'Accept' (if needed)
1305
2529
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1306
2530
  # HTTP header 'Content-Type'
1307
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
2531
+ content_type = @api_client.select_header_content_type(['application/json'])
2532
+ if !content_type.nil?
2533
+ header_params['Content-Type'] = content_type
2534
+ end
1308
2535
 
1309
2536
  # form parameters
1310
2537
  form_params = opts[:form_params] || {}
@@ -1313,7 +2540,7 @@ module OneSignal
1313
2540
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_player_tags_request_body'])
1314
2541
 
1315
2542
  # return_type
1316
- return_type = opts[:debug_return_type] || 'InlineResponse2003'
2543
+ return_type = opts[:debug_return_type] || 'UpdatePlayerTagsSuccessResponse'
1317
2544
 
1318
2545
  # auth_names
1319
2546
  auth_names = opts[:debug_auth_names] || ['app_key']
@@ -1334,5 +2561,167 @@ module OneSignal
1334
2561
  end
1335
2562
  return data, status_code, headers
1336
2563
  end
2564
+
2565
+ # Updates an existing Subscription’s properties.
2566
+ # @param app_id [String]
2567
+ # @param subscription_id [String]
2568
+ # @param update_subscription_request_body [UpdateSubscriptionRequestBody]
2569
+ # @param [Hash] opts the optional parameters
2570
+ # @return [nil]
2571
+ def update_subscription(app_id, subscription_id, update_subscription_request_body, opts = {})
2572
+ update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body, opts)
2573
+ nil
2574
+ end
2575
+
2576
+ # Updates an existing Subscription’s properties.
2577
+ # @param app_id [String]
2578
+ # @param subscription_id [String]
2579
+ # @param update_subscription_request_body [UpdateSubscriptionRequestBody]
2580
+ # @param [Hash] opts the optional parameters
2581
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
2582
+ def update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body, opts = {})
2583
+ if @api_client.config.debugging
2584
+ @api_client.config.logger.debug 'Calling API: DefaultApi.update_subscription ...'
2585
+ end
2586
+ # verify the required parameter 'app_id' is set
2587
+ if @api_client.config.client_side_validation && app_id.nil?
2588
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_subscription"
2589
+ end
2590
+ # verify the required parameter 'subscription_id' is set
2591
+ if @api_client.config.client_side_validation && subscription_id.nil?
2592
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.update_subscription"
2593
+ end
2594
+ # verify the required parameter 'update_subscription_request_body' is set
2595
+ if @api_client.config.client_side_validation && update_subscription_request_body.nil?
2596
+ fail ArgumentError, "Missing the required parameter 'update_subscription_request_body' when calling DefaultApi.update_subscription"
2597
+ end
2598
+ # resource path
2599
+ 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))
2600
+
2601
+ # query parameters
2602
+ query_params = opts[:query_params] || {}
2603
+
2604
+ # header parameters
2605
+ header_params = opts[:header_params] || {}
2606
+ # HTTP header 'Accept' (if needed)
2607
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2608
+ # HTTP header 'Content-Type'
2609
+ content_type = @api_client.select_header_content_type(['application/json'])
2610
+ if !content_type.nil?
2611
+ header_params['Content-Type'] = content_type
2612
+ end
2613
+
2614
+ # form parameters
2615
+ form_params = opts[:form_params] || {}
2616
+
2617
+ # http body (model)
2618
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_subscription_request_body)
2619
+
2620
+ # return_type
2621
+ return_type = opts[:debug_return_type]
2622
+
2623
+ # auth_names
2624
+ auth_names = opts[:debug_auth_names] || ['app_key']
2625
+
2626
+ new_options = opts.merge(
2627
+ :operation => :"DefaultApi.update_subscription",
2628
+ :header_params => header_params,
2629
+ :query_params => query_params,
2630
+ :form_params => form_params,
2631
+ :body => post_body,
2632
+ :auth_names => auth_names,
2633
+ :return_type => return_type
2634
+ )
2635
+
2636
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
2637
+ if @api_client.config.debugging
2638
+ @api_client.config.logger.debug "API called: DefaultApi#update_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2639
+ end
2640
+ return data, status_code, headers
2641
+ end
2642
+
2643
+ # Updates an existing User’s properties.
2644
+ # @param app_id [String]
2645
+ # @param alias_label [String]
2646
+ # @param alias_id [String]
2647
+ # @param update_user_request [UpdateUserRequest]
2648
+ # @param [Hash] opts the optional parameters
2649
+ # @return [InlineResponse202]
2650
+ def update_user(app_id, alias_label, alias_id, update_user_request, opts = {})
2651
+ data, _status_code, _headers = update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts)
2652
+ data
2653
+ end
2654
+
2655
+ # Updates an existing User’s properties.
2656
+ # @param app_id [String]
2657
+ # @param alias_label [String]
2658
+ # @param alias_id [String]
2659
+ # @param update_user_request [UpdateUserRequest]
2660
+ # @param [Hash] opts the optional parameters
2661
+ # @return [Array<(InlineResponse202, Integer, Hash)>] InlineResponse202 data, response status code and response headers
2662
+ def update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts = {})
2663
+ if @api_client.config.debugging
2664
+ @api_client.config.logger.debug 'Calling API: DefaultApi.update_user ...'
2665
+ end
2666
+ # verify the required parameter 'app_id' is set
2667
+ if @api_client.config.client_side_validation && app_id.nil?
2668
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_user"
2669
+ end
2670
+ # verify the required parameter 'alias_label' is set
2671
+ if @api_client.config.client_side_validation && alias_label.nil?
2672
+ fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.update_user"
2673
+ end
2674
+ # verify the required parameter 'alias_id' is set
2675
+ if @api_client.config.client_side_validation && alias_id.nil?
2676
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.update_user"
2677
+ end
2678
+ # verify the required parameter 'update_user_request' is set
2679
+ if @api_client.config.client_side_validation && update_user_request.nil?
2680
+ fail ArgumentError, "Missing the required parameter 'update_user_request' when calling DefaultApi.update_user"
2681
+ end
2682
+ # resource path
2683
+ 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))
2684
+
2685
+ # query parameters
2686
+ query_params = opts[:query_params] || {}
2687
+
2688
+ # header parameters
2689
+ header_params = opts[:header_params] || {}
2690
+ # HTTP header 'Accept' (if needed)
2691
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2692
+ # HTTP header 'Content-Type'
2693
+ content_type = @api_client.select_header_content_type(['application/json'])
2694
+ if !content_type.nil?
2695
+ header_params['Content-Type'] = content_type
2696
+ end
2697
+
2698
+ # form parameters
2699
+ form_params = opts[:form_params] || {}
2700
+
2701
+ # http body (model)
2702
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(update_user_request)
2703
+
2704
+ # return_type
2705
+ return_type = opts[:debug_return_type] || 'InlineResponse202'
2706
+
2707
+ # auth_names
2708
+ auth_names = opts[:debug_auth_names] || ['app_key']
2709
+
2710
+ new_options = opts.merge(
2711
+ :operation => :"DefaultApi.update_user",
2712
+ :header_params => header_params,
2713
+ :query_params => query_params,
2714
+ :form_params => form_params,
2715
+ :body => post_body,
2716
+ :auth_names => auth_names,
2717
+ :return_type => return_type
2718
+ )
2719
+
2720
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
2721
+ if @api_client.config.debugging
2722
+ @api_client.config.logger.debug "API called: DefaultApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2723
+ end
2724
+ return data, status_code, headers
2725
+ end
1337
2726
  end
1338
2727
  end