onesignal 2.2.1 → 5.1.0.pre.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +42 -67
  3. data/docs/BasicNotification.md +18 -18
  4. data/docs/BasicNotificationAllOf.md +9 -7
  5. data/docs/CreateNotificationSuccessResponse.md +1 -3
  6. data/docs/DefaultApi.md +364 -948
  7. data/docs/{ExportPlayersRequestBody.md → ExportSubscriptionsRequestBody.md} +2 -2
  8. data/docs/{ExportPlayersSuccessResponse.md → ExportSubscriptionsSuccessResponse.md} +2 -2
  9. data/docs/Filter.md +10 -2
  10. data/docs/{Notification200Errors.md → FilterExpression.md} +9 -9
  11. data/docs/GenericError.md +6 -2
  12. data/docs/{DeletePlayerSuccessResponse.md → GenericSuccessBoolResponse.md} +2 -2
  13. data/docs/{GetNotificationRequestBody.md → GetNotificationHistoryRequestBody.md} +2 -2
  14. data/docs/GetSegmentsSuccessResponse.md +24 -0
  15. data/docs/{StringMap.md → LanguageStringMap.md} +2 -2
  16. data/docs/Notification.md +18 -18
  17. data/docs/NotificationTarget.md +9 -11
  18. data/docs/NotificationWithMeta.md +18 -18
  19. data/docs/{InlineResponse202.md → PropertiesBody.md} +2 -2
  20. data/docs/PropertiesDeltas.md +2 -2
  21. data/docs/PropertiesObject.md +2 -2
  22. data/docs/Purchase.md +1 -1
  23. data/docs/RateLimitError.md +20 -0
  24. data/docs/Segment.md +1 -1
  25. data/docs/SegmentData.md +30 -0
  26. data/docs/{SubscriptionObject.md → Subscription.md} +6 -6
  27. data/docs/SubscriptionBody.md +18 -0
  28. data/docs/SubscriptionNotificationTarget.md +38 -0
  29. data/docs/TransferSubscriptionRequestBody.md +1 -1
  30. data/docs/UpdateLiveActivityRequest.md +14 -4
  31. data/docs/UpdateLiveActivitySuccessResponse.md +2 -4
  32. data/docs/User.md +3 -5
  33. data/docs/{InlineResponse200.md → UserIdentityBody.md} +3 -3
  34. data/docs/WebButton.md +24 -0
  35. data/lib/onesignal/api/default_api.rb +382 -890
  36. data/lib/onesignal/api_client.rb +2 -2
  37. data/lib/onesignal/api_error.rb +1 -1
  38. data/lib/onesignal/configuration.rb +5 -5
  39. data/lib/onesignal/models/app.rb +1 -1
  40. data/lib/onesignal/models/basic_notification.rb +49 -47
  41. data/lib/onesignal/models/basic_notification_all_of.rb +29 -17
  42. data/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb +1 -1
  43. data/lib/onesignal/models/button.rb +1 -1
  44. data/lib/onesignal/models/create_notification_success_response.rb +5 -13
  45. data/lib/onesignal/models/create_segment_conflict_response.rb +1 -1
  46. data/lib/onesignal/models/create_segment_success_response.rb +1 -1
  47. data/lib/onesignal/models/create_user_conflict_response.rb +1 -1
  48. data/lib/onesignal/models/create_user_conflict_response_errors_inner.rb +1 -1
  49. data/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb +1 -1
  50. data/lib/onesignal/models/delivery_data.rb +1 -1
  51. data/lib/onesignal/models/export_events_success_response.rb +1 -1
  52. data/lib/onesignal/models/{export_players_request_body.rb → export_subscriptions_request_body.rb} +4 -4
  53. data/lib/onesignal/models/{export_players_success_response.rb → export_subscriptions_success_response.rb} +4 -4
  54. data/lib/onesignal/models/filter.rb +44 -14
  55. data/lib/onesignal/models/{notification200_errors.rb → filter_expression.rb} +4 -4
  56. data/lib/onesignal/models/generic_error.rb +26 -8
  57. data/lib/onesignal/models/{update_player_success_response.rb → generic_success_bool_response.rb} +4 -4
  58. data/lib/onesignal/models/{get_notification_request_body.rb → get_notification_history_request_body.rb} +4 -4
  59. data/lib/onesignal/models/{player_slice.rb → get_segments_success_response.rb} +16 -12
  60. data/lib/onesignal/models/{string_map.rb → language_string_map.rb} +4 -4
  61. data/lib/onesignal/models/notification.rb +49 -47
  62. data/lib/onesignal/models/notification_all_of.rb +1 -1
  63. data/lib/onesignal/models/notification_history_success_response.rb +1 -1
  64. data/lib/onesignal/models/notification_slice.rb +1 -1
  65. data/lib/onesignal/models/notification_target.rb +24 -34
  66. data/lib/onesignal/models/notification_with_meta.rb +49 -47
  67. data/lib/onesignal/models/notification_with_meta_all_of.rb +1 -1
  68. data/lib/onesignal/models/operator.rb +1 -1
  69. data/lib/onesignal/models/outcome_data.rb +1 -1
  70. data/lib/onesignal/models/outcomes_data.rb +1 -1
  71. data/lib/onesignal/models/platform_delivery_data.rb +1 -1
  72. data/lib/onesignal/models/platform_delivery_data_email_all_of.rb +1 -1
  73. data/lib/onesignal/models/platform_delivery_data_sms_all_of.rb +1 -1
  74. data/lib/onesignal/models/{inline_response202.rb → properties_body.rb} +4 -4
  75. data/lib/onesignal/models/properties_deltas.rb +3 -3
  76. data/lib/onesignal/models/properties_object.rb +3 -3
  77. data/lib/onesignal/models/purchase.rb +2 -2
  78. data/lib/onesignal/models/{rate_limiter_error.rb → rate_limit_error.rb} +17 -8
  79. data/lib/onesignal/models/segment.rb +2 -2
  80. data/lib/onesignal/models/{begin_live_activity_request.rb → segment_data.rb} +69 -27
  81. data/lib/onesignal/models/segment_notification_target.rb +1 -1
  82. data/lib/onesignal/models/{subscription_object.rb → subscription.rb} +8 -8
  83. data/lib/onesignal/models/{inline_response201.rb → subscription_body.rb} +5 -5
  84. data/lib/onesignal/models/{player_notification_target.rb → subscription_notification_target.rb} +25 -35
  85. data/lib/onesignal/models/transfer_subscription_request_body.rb +26 -2
  86. data/lib/onesignal/models/update_live_activity_request.rb +59 -22
  87. data/lib/onesignal/models/update_live_activity_success_response.rb +8 -17
  88. data/lib/onesignal/models/update_user_request.rb +1 -1
  89. data/lib/onesignal/models/user.rb +6 -15
  90. data/lib/onesignal/models/{inline_response200.rb → user_identity_body.rb} +5 -5
  91. data/lib/onesignal/models/{create_player_success_response.rb → web_button.rb} +40 -17
  92. data/lib/onesignal/version.rb +2 -2
  93. data/lib/onesignal.rb +16 -34
  94. data/onesignal.gemspec +1 -1
  95. data/spec/api/default_api_spec.rb +82 -174
  96. data/spec/api_client_spec.rb +1 -1
  97. data/spec/configuration_spec.rb +1 -1
  98. data/spec/models/app_spec.rb +1 -1
  99. data/spec/models/basic_notification_all_of_android_background_layout_spec.rb +1 -1
  100. data/spec/models/basic_notification_all_of_spec.rb +13 -7
  101. data/spec/models/basic_notification_spec.rb +14 -14
  102. data/spec/models/button_spec.rb +1 -1
  103. data/spec/models/create_notification_success_response_spec.rb +1 -7
  104. data/spec/models/create_segment_conflict_response_spec.rb +1 -1
  105. data/spec/models/create_segment_success_response_spec.rb +1 -1
  106. data/spec/models/create_user_conflict_response_errors_inner_spec.rb +1 -1
  107. data/spec/models/create_user_conflict_response_errors_items_meta_spec.rb +1 -1
  108. data/spec/models/create_user_conflict_response_spec.rb +1 -1
  109. data/spec/models/delivery_data_spec.rb +1 -1
  110. data/spec/models/export_events_success_response_spec.rb +1 -1
  111. data/spec/models/{export_players_request_body_spec.rb → export_subscriptions_request_body_spec.rb} +7 -7
  112. data/spec/models/{export_players_success_response_spec.rb → export_subscriptions_success_response_spec.rb} +7 -7
  113. data/spec/models/{notification200_errors_spec.rb → filter_expression_spec.rb} +3 -3
  114. data/spec/models/filter_spec.rb +25 -1
  115. data/spec/models/generic_error_spec.rb +13 -1
  116. data/spec/models/{delete_player_success_response_spec.rb → generic_success_bool_response_spec.rb} +7 -7
  117. data/spec/models/{get_notification_request_body_spec.rb → get_notification_history_request_body_spec.rb} +7 -7
  118. data/spec/models/{player_slice_spec.rb → get_segments_success_response_spec.rb} +8 -8
  119. data/spec/models/{string_map_spec.rb → language_string_map_spec.rb} +7 -7
  120. data/spec/models/notification_all_of_spec.rb +1 -1
  121. data/spec/models/notification_history_success_response_spec.rb +1 -1
  122. data/spec/models/notification_slice_spec.rb +1 -1
  123. data/spec/models/notification_spec.rb +14 -14
  124. data/spec/models/notification_target_spec.rb +2 -8
  125. data/spec/models/notification_with_meta_all_of_spec.rb +1 -1
  126. data/spec/models/notification_with_meta_spec.rb +14 -14
  127. data/spec/models/operator_spec.rb +1 -1
  128. data/spec/models/outcome_data_spec.rb +1 -1
  129. data/spec/models/outcomes_data_spec.rb +1 -1
  130. data/spec/models/platform_delivery_data_email_all_of_spec.rb +1 -1
  131. data/spec/models/platform_delivery_data_sms_all_of_spec.rb +1 -1
  132. data/spec/models/platform_delivery_data_spec.rb +1 -1
  133. data/spec/models/{inline_response202_spec.rb → properties_body_spec.rb} +7 -7
  134. data/spec/models/properties_deltas_spec.rb +1 -1
  135. data/spec/models/properties_object_spec.rb +1 -1
  136. data/spec/models/purchase_spec.rb +1 -1
  137. data/spec/models/{generic_error_errors_inner_spec.rb → rate_limit_error_spec.rb} +9 -9
  138. data/spec/models/{filter_expressions_spec.rb → segment_data_spec.rb} +24 -20
  139. data/spec/models/segment_notification_target_spec.rb +1 -1
  140. data/spec/models/segment_spec.rb +1 -1
  141. data/spec/models/{inline_response201_spec.rb → subscription_body_spec.rb} +7 -7
  142. data/spec/models/{player_notification_target_spec.rb → subscription_notification_target_spec.rb} +8 -14
  143. data/spec/models/{subscription_object_spec.rb → subscription_spec.rb} +7 -7
  144. data/spec/models/transfer_subscription_request_body_spec.rb +1 -1
  145. data/spec/models/update_live_activity_request_spec.rb +32 -6
  146. data/spec/models/update_live_activity_success_response_spec.rb +2 -8
  147. data/spec/models/update_user_request_spec.rb +1 -1
  148. data/spec/models/{user_identity_response_spec.rb → user_identity_body_spec.rb} +7 -7
  149. data/spec/models/user_spec.rb +1 -7
  150. data/spec/models/{create_player_success_response_spec.rb → web_button_spec.rb} +21 -9
  151. data/spec/spec_helper.rb +1 -1
  152. metadata +61 -131
  153. data/docs/BeginLiveActivityRequest.md +0 -20
  154. data/docs/CancelNotificationSuccessResponse.md +0 -18
  155. data/docs/CreatePlayerSuccessResponse.md +0 -20
  156. data/docs/CreateSubscriptionRequestBody.md +0 -20
  157. data/docs/DeletePlayerNotFoundResponse.md +0 -18
  158. data/docs/DeleteSegmentNotFoundResponse.md +0 -18
  159. data/docs/DeleteSegmentSuccessResponse.md +0 -18
  160. data/docs/FilterExpressions.md +0 -26
  161. data/docs/InlineResponse2003.md +0 -18
  162. data/docs/InlineResponse201.md +0 -18
  163. data/docs/InvalidIdentifierError.md +0 -20
  164. data/docs/Player.md +0 -70
  165. data/docs/PlayerNotificationTarget.md +0 -40
  166. data/docs/PlayerNotificationTargetIncludeAliases.md +0 -18
  167. data/docs/PlayerSlice.md +0 -24
  168. data/docs/UpdatePlayerSuccessResponse.md +0 -18
  169. data/docs/UpdatePlayerTagsRequestBody.md +0 -18
  170. data/docs/UpdatePlayerTagsSuccessResponse.md +0 -18
  171. data/docs/UpdateSubscriptionRequestBody.md +0 -18
  172. data/docs/UserIdentityRequestBody.md +0 -18
  173. data/docs/UserIdentityResponse.md +0 -18
  174. data/docs/UserSubscriptionOptions.md +0 -18
  175. data/lib/onesignal/models/cancel_notification_success_response.rb +0 -219
  176. data/lib/onesignal/models/create_subscription_request_body.rb +0 -228
  177. data/lib/onesignal/models/delete_player_not_found_response.rb +0 -219
  178. data/lib/onesignal/models/delete_player_success_response.rb +0 -219
  179. data/lib/onesignal/models/delete_segment_not_found_response.rb +0 -219
  180. data/lib/onesignal/models/delete_segment_success_response.rb +0 -219
  181. data/lib/onesignal/models/filter_expressions.rb +0 -336
  182. data/lib/onesignal/models/generic_error_errors_inner.rb +0 -228
  183. data/lib/onesignal/models/inline_response2003.rb +0 -221
  184. data/lib/onesignal/models/invalid_identifier_error.rb +0 -234
  185. data/lib/onesignal/models/player.rb +0 -494
  186. data/lib/onesignal/models/player_notification_target_include_aliases.rb +0 -221
  187. data/lib/onesignal/models/update_player_tags_request_body.rb +0 -220
  188. data/lib/onesignal/models/update_player_tags_success_response.rb +0 -219
  189. data/lib/onesignal/models/update_subscription_request_body.rb +0 -219
  190. data/lib/onesignal/models/user_identity_request_body.rb +0 -221
  191. data/lib/onesignal/models/user_identity_response.rb +0 -221
  192. data/lib/onesignal/models/user_subscription_options.rb +0 -219
  193. data/spec/models/begin_live_activity_request_spec.rb +0 -40
  194. data/spec/models/cancel_notification_success_response_spec.rb +0 -34
  195. data/spec/models/create_subscription_request_body_spec.rb +0 -40
  196. data/spec/models/delete_player_not_found_response_spec.rb +0 -34
  197. data/spec/models/delete_segment_not_found_response_spec.rb +0 -34
  198. data/spec/models/delete_segment_success_response_spec.rb +0 -34
  199. data/spec/models/inline_response2003_spec.rb +0 -34
  200. data/spec/models/inline_response200_spec.rb +0 -34
  201. data/spec/models/invalid_identifier_error_spec.rb +0 -40
  202. data/spec/models/player_notification_target_include_aliases_spec.rb +0 -34
  203. data/spec/models/player_spec.rb +0 -190
  204. data/spec/models/rate_limiter_error_spec.rb +0 -34
  205. data/spec/models/update_player_success_response_spec.rb +0 -34
  206. data/spec/models/update_player_tags_request_body_spec.rb +0 -34
  207. data/spec/models/update_player_tags_success_response_spec.rb +0 -34
  208. data/spec/models/update_subscription_request_body_spec.rb +0 -34
  209. data/spec/models/user_identity_request_body_spec.rb +0 -34
  210. data/spec/models/user_subscription_options_spec.rb +0 -34
@@ -3,7 +3,7 @@
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.4.1
6
+ The version of the OpenAPI document: 5.1.0
7
7
  Contact: devrel@onesignal.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 6.0.0-SNAPSHOT
@@ -19,71 +19,61 @@ 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]
22
+ # Stop a scheduled or currently outgoing notification
23
+ # Used to stop a scheduled or currently outgoing notification
24
+ # @param app_id [String]
25
+ # @param notification_id [String]
27
26
  # @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
27
+ # @return [GenericSuccessBoolResponse]
28
+ def cancel_notification(app_id, notification_id, opts = {})
29
+ data, _status_code, _headers = cancel_notification_with_http_info(app_id, notification_id, opts)
30
+ data
32
31
  end
33
32
 
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]
33
+ # Stop a scheduled or currently outgoing notification
34
+ # Used to stop a scheduled or currently outgoing notification
35
+ # @param app_id [String]
36
+ # @param notification_id [String]
39
37
  # @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 = {})
38
+ # @return [Array<(GenericSuccessBoolResponse, Integer, Hash)>] GenericSuccessBoolResponse data, response status code and response headers
39
+ def cancel_notification_with_http_info(app_id, notification_id, opts = {})
42
40
  if @api_client.config.debugging
43
- @api_client.config.logger.debug 'Calling API: DefaultApi.begin_live_activity ...'
41
+ @api_client.config.logger.debug 'Calling API: DefaultApi.cancel_notification ...'
44
42
  end
45
43
  # verify the required parameter 'app_id' is set
46
44
  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"
45
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.cancel_notification"
52
46
  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"
47
+ # verify the required parameter 'notification_id' is set
48
+ if @api_client.config.client_side_validation && notification_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.cancel_notification"
56
50
  end
57
51
  # 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))
52
+ local_var_path = '/notifications/{notification_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))
59
53
 
60
54
  # query parameters
61
55
  query_params = opts[:query_params] || {}
56
+ query_params[:'app_id'] = app_id
62
57
 
63
58
  # header parameters
64
59
  header_params = opts[:header_params] || {}
65
60
  # HTTP header 'Accept' (if needed)
66
61
  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
62
 
73
63
  # form parameters
74
64
  form_params = opts[:form_params] || {}
75
65
 
76
66
  # http body (model)
77
- post_body = opts[:debug_body] || @api_client.object_to_http_body(begin_live_activity_request)
67
+ post_body = opts[:debug_body]
78
68
 
79
69
  # return_type
80
- return_type = opts[:debug_return_type]
70
+ return_type = opts[:debug_return_type] || 'GenericSuccessBoolResponse'
81
71
 
82
72
  # auth_names
83
- auth_names = opts[:debug_auth_names] || ['app_key']
73
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
84
74
 
85
75
  new_options = opts.merge(
86
- :operation => :"DefaultApi.begin_live_activity",
76
+ :operation => :"DefaultApi.cancel_notification",
87
77
  :header_params => header_params,
88
78
  :query_params => query_params,
89
79
  :form_params => form_params,
@@ -92,68 +82,82 @@ module OneSignal
92
82
  :return_type => return_type
93
83
  )
94
84
 
95
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
85
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
96
86
  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}"
87
+ @api_client.config.logger.debug "API called: DefaultApi#cancel_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
98
88
  end
99
89
  return data, status_code, headers
100
90
  end
101
91
 
102
- # Stop a scheduled or currently outgoing notification
103
- # Used to stop a scheduled or currently outgoing notification
92
+ # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
104
93
  # @param app_id [String]
105
- # @param notification_id [String]
94
+ # @param alias_label [String]
95
+ # @param alias_id [String]
96
+ # @param user_identity_body [UserIdentityBody]
106
97
  # @param [Hash] opts the optional parameters
107
- # @return [CancelNotificationSuccessResponse]
108
- def cancel_notification(app_id, notification_id, opts = {})
109
- data, _status_code, _headers = cancel_notification_with_http_info(app_id, notification_id, opts)
98
+ # @return [UserIdentityBody]
99
+ def create_alias(app_id, alias_label, alias_id, user_identity_body, opts = {})
100
+ data, _status_code, _headers = create_alias_with_http_info(app_id, alias_label, alias_id, user_identity_body, opts)
110
101
  data
111
102
  end
112
103
 
113
- # Stop a scheduled or currently outgoing notification
114
- # Used to stop a scheduled or currently outgoing notification
104
+ # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
115
105
  # @param app_id [String]
116
- # @param notification_id [String]
106
+ # @param alias_label [String]
107
+ # @param alias_id [String]
108
+ # @param user_identity_body [UserIdentityBody]
117
109
  # @param [Hash] opts the optional parameters
118
- # @return [Array<(CancelNotificationSuccessResponse, Integer, Hash)>] CancelNotificationSuccessResponse data, response status code and response headers
119
- def cancel_notification_with_http_info(app_id, notification_id, opts = {})
110
+ # @return [Array<(UserIdentityBody, Integer, Hash)>] UserIdentityBody data, response status code and response headers
111
+ def create_alias_with_http_info(app_id, alias_label, alias_id, user_identity_body, opts = {})
120
112
  if @api_client.config.debugging
121
- @api_client.config.logger.debug 'Calling API: DefaultApi.cancel_notification ...'
113
+ @api_client.config.logger.debug 'Calling API: DefaultApi.create_alias ...'
122
114
  end
123
115
  # verify the required parameter 'app_id' is set
124
116
  if @api_client.config.client_side_validation && app_id.nil?
125
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.cancel_notification"
117
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_alias"
126
118
  end
127
- # verify the required parameter 'notification_id' is set
128
- if @api_client.config.client_side_validation && notification_id.nil?
129
- fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.cancel_notification"
119
+ # verify the required parameter 'alias_label' is set
120
+ if @api_client.config.client_side_validation && alias_label.nil?
121
+ fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.create_alias"
122
+ end
123
+ # verify the required parameter 'alias_id' is set
124
+ if @api_client.config.client_side_validation && alias_id.nil?
125
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.create_alias"
126
+ end
127
+ # verify the required parameter 'user_identity_body' is set
128
+ if @api_client.config.client_side_validation && user_identity_body.nil?
129
+ fail ArgumentError, "Missing the required parameter 'user_identity_body' when calling DefaultApi.create_alias"
130
130
  end
131
131
  # resource path
132
- local_var_path = '/notifications/{notification_id}'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))
132
+ 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))
133
133
 
134
134
  # query parameters
135
135
  query_params = opts[:query_params] || {}
136
- query_params[:'app_id'] = app_id
137
136
 
138
137
  # header parameters
139
138
  header_params = opts[:header_params] || {}
140
139
  # HTTP header 'Accept' (if needed)
141
140
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
141
+ # HTTP header 'Content-Type'
142
+ content_type = @api_client.select_header_content_type(['application/json'])
143
+ if !content_type.nil?
144
+ header_params['Content-Type'] = content_type
145
+ end
142
146
 
143
147
  # form parameters
144
148
  form_params = opts[:form_params] || {}
145
149
 
146
150
  # http body (model)
147
- post_body = opts[:debug_body]
151
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_body)
148
152
 
149
153
  # return_type
150
- return_type = opts[:debug_return_type] || 'CancelNotificationSuccessResponse'
154
+ return_type = opts[:debug_return_type] || 'UserIdentityBody'
151
155
 
152
156
  # auth_names
153
- auth_names = opts[:debug_auth_names] || ['app_key']
157
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
154
158
 
155
159
  new_options = opts.merge(
156
- :operation => :"DefaultApi.cancel_notification",
160
+ :operation => :"DefaultApi.create_alias",
157
161
  :header_params => header_params,
158
162
  :query_params => query_params,
159
163
  :form_params => form_params,
@@ -162,38 +166,48 @@ module OneSignal
162
166
  :return_type => return_type
163
167
  )
164
168
 
165
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
169
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
166
170
  if @api_client.config.debugging
167
- @api_client.config.logger.debug "API called: DefaultApi#cancel_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
171
+ @api_client.config.logger.debug "API called: DefaultApi#create_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
168
172
  end
169
173
  return data, status_code, headers
170
174
  end
171
175
 
172
- # Create an app
173
- # Creates a new OneSignal app
174
- # @param app [App]
176
+ # Upserts one or more Aliases for the User identified by :subscription_id.
177
+ # @param app_id [String]
178
+ # @param subscription_id [String]
179
+ # @param user_identity_body [UserIdentityBody]
175
180
  # @param [Hash] opts the optional parameters
176
- # @return [App]
177
- def create_app(app, opts = {})
178
- data, _status_code, _headers = create_app_with_http_info(app, opts)
181
+ # @return [UserIdentityBody]
182
+ def create_alias_by_subscription(app_id, subscription_id, user_identity_body, opts = {})
183
+ data, _status_code, _headers = create_alias_by_subscription_with_http_info(app_id, subscription_id, user_identity_body, opts)
179
184
  data
180
185
  end
181
186
 
182
- # Create an app
183
- # Creates a new OneSignal app
184
- # @param app [App]
187
+ # Upserts one or more Aliases for the User identified by :subscription_id.
188
+ # @param app_id [String]
189
+ # @param subscription_id [String]
190
+ # @param user_identity_body [UserIdentityBody]
185
191
  # @param [Hash] opts the optional parameters
186
- # @return [Array<(App, Integer, Hash)>] App data, response status code and response headers
187
- def create_app_with_http_info(app, opts = {})
192
+ # @return [Array<(UserIdentityBody, Integer, Hash)>] UserIdentityBody data, response status code and response headers
193
+ def create_alias_by_subscription_with_http_info(app_id, subscription_id, user_identity_body, opts = {})
188
194
  if @api_client.config.debugging
189
- @api_client.config.logger.debug 'Calling API: DefaultApi.create_app ...'
195
+ @api_client.config.logger.debug 'Calling API: DefaultApi.create_alias_by_subscription ...'
190
196
  end
191
- # verify the required parameter 'app' is set
192
- if @api_client.config.client_side_validation && app.nil?
193
- fail ArgumentError, "Missing the required parameter 'app' when calling DefaultApi.create_app"
197
+ # verify the required parameter 'app_id' is set
198
+ if @api_client.config.client_side_validation && app_id.nil?
199
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_alias_by_subscription"
200
+ end
201
+ # verify the required parameter 'subscription_id' is set
202
+ if @api_client.config.client_side_validation && subscription_id.nil?
203
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.create_alias_by_subscription"
204
+ end
205
+ # verify the required parameter 'user_identity_body' is set
206
+ if @api_client.config.client_side_validation && user_identity_body.nil?
207
+ fail ArgumentError, "Missing the required parameter 'user_identity_body' when calling DefaultApi.create_alias_by_subscription"
194
208
  end
195
209
  # resource path
196
- local_var_path = '/apps'
210
+ 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))
197
211
 
198
212
  # query parameters
199
213
  query_params = opts[:query_params] || {}
@@ -212,16 +226,16 @@ module OneSignal
212
226
  form_params = opts[:form_params] || {}
213
227
 
214
228
  # http body (model)
215
- post_body = opts[:debug_body] || @api_client.object_to_http_body(app)
229
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_body)
216
230
 
217
231
  # return_type
218
- return_type = opts[:debug_return_type] || 'App'
232
+ return_type = opts[:debug_return_type] || 'UserIdentityBody'
219
233
 
220
234
  # auth_names
221
- auth_names = opts[:debug_auth_names] || ['user_key']
235
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
222
236
 
223
237
  new_options = opts.merge(
224
- :operation => :"DefaultApi.create_app",
238
+ :operation => :"DefaultApi.create_alias_by_subscription",
225
239
  :header_params => header_params,
226
240
  :query_params => query_params,
227
241
  :form_params => form_params,
@@ -230,38 +244,38 @@ module OneSignal
230
244
  :return_type => return_type
231
245
  )
232
246
 
233
- data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
247
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
234
248
  if @api_client.config.debugging
235
- @api_client.config.logger.debug "API called: DefaultApi#create_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
249
+ @api_client.config.logger.debug "API called: DefaultApi#create_alias_by_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
236
250
  end
237
251
  return data, status_code, headers
238
252
  end
239
253
 
240
- # Create notification
241
- # Sends notifications to your users
242
- # @param notification [Notification]
254
+ # Create an app
255
+ # Creates a new OneSignal app
256
+ # @param app [App]
243
257
  # @param [Hash] opts the optional parameters
244
- # @return [CreateNotificationSuccessResponse]
245
- def create_notification(notification, opts = {})
246
- data, _status_code, _headers = create_notification_with_http_info(notification, opts)
258
+ # @return [App]
259
+ def create_app(app, opts = {})
260
+ data, _status_code, _headers = create_app_with_http_info(app, opts)
247
261
  data
248
262
  end
249
263
 
250
- # Create notification
251
- # Sends notifications to your users
252
- # @param notification [Notification]
264
+ # Create an app
265
+ # Creates a new OneSignal app
266
+ # @param app [App]
253
267
  # @param [Hash] opts the optional parameters
254
- # @return [Array<(CreateNotificationSuccessResponse, Integer, Hash)>] CreateNotificationSuccessResponse data, response status code and response headers
255
- def create_notification_with_http_info(notification, opts = {})
268
+ # @return [Array<(App, Integer, Hash)>] App data, response status code and response headers
269
+ def create_app_with_http_info(app, opts = {})
256
270
  if @api_client.config.debugging
257
- @api_client.config.logger.debug 'Calling API: DefaultApi.create_notification ...'
271
+ @api_client.config.logger.debug 'Calling API: DefaultApi.create_app ...'
258
272
  end
259
- # verify the required parameter 'notification' is set
260
- if @api_client.config.client_side_validation && notification.nil?
261
- fail ArgumentError, "Missing the required parameter 'notification' when calling DefaultApi.create_notification"
273
+ # verify the required parameter 'app' is set
274
+ if @api_client.config.client_side_validation && app.nil?
275
+ fail ArgumentError, "Missing the required parameter 'app' when calling DefaultApi.create_app"
262
276
  end
263
277
  # resource path
264
- local_var_path = '/notifications'
278
+ local_var_path = '/apps'
265
279
 
266
280
  # query parameters
267
281
  query_params = opts[:query_params] || {}
@@ -280,16 +294,16 @@ module OneSignal
280
294
  form_params = opts[:form_params] || {}
281
295
 
282
296
  # http body (model)
283
- post_body = opts[:debug_body] || @api_client.object_to_http_body(notification)
297
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(app)
284
298
 
285
299
  # return_type
286
- return_type = opts[:debug_return_type] || 'CreateNotificationSuccessResponse'
300
+ return_type = opts[:debug_return_type] || 'App'
287
301
 
288
302
  # auth_names
289
- auth_names = opts[:debug_auth_names] || ['app_key']
303
+ auth_names = opts[:debug_auth_names] || ['organization_api_key']
290
304
 
291
305
  new_options = opts.merge(
292
- :operation => :"DefaultApi.create_notification",
306
+ :operation => :"DefaultApi.create_app",
293
307
  :header_params => header_params,
294
308
  :query_params => query_params,
295
309
  :form_params => form_params,
@@ -300,36 +314,36 @@ module OneSignal
300
314
 
301
315
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
302
316
  if @api_client.config.debugging
303
- @api_client.config.logger.debug "API called: DefaultApi#create_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
317
+ @api_client.config.logger.debug "API called: DefaultApi#create_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
304
318
  end
305
319
  return data, status_code, headers
306
320
  end
307
321
 
308
- # Add a device
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.
310
- # @param player [Player]
322
+ # Create notification
323
+ # Sends notifications to your users
324
+ # @param notification [Notification]
311
325
  # @param [Hash] opts the optional parameters
312
- # @return [CreatePlayerSuccessResponse]
313
- def create_player(player, opts = {})
314
- data, _status_code, _headers = create_player_with_http_info(player, opts)
326
+ # @return [CreateNotificationSuccessResponse]
327
+ def create_notification(notification, opts = {})
328
+ data, _status_code, _headers = create_notification_with_http_info(notification, opts)
315
329
  data
316
330
  end
317
331
 
318
- # Add a device
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.
320
- # @param player [Player]
332
+ # Create notification
333
+ # Sends notifications to your users
334
+ # @param notification [Notification]
321
335
  # @param [Hash] opts the optional parameters
322
- # @return [Array<(CreatePlayerSuccessResponse, Integer, Hash)>] CreatePlayerSuccessResponse data, response status code and response headers
323
- def create_player_with_http_info(player, opts = {})
336
+ # @return [Array<(CreateNotificationSuccessResponse, Integer, Hash)>] CreateNotificationSuccessResponse data, response status code and response headers
337
+ def create_notification_with_http_info(notification, opts = {})
324
338
  if @api_client.config.debugging
325
- @api_client.config.logger.debug 'Calling API: DefaultApi.create_player ...'
339
+ @api_client.config.logger.debug 'Calling API: DefaultApi.create_notification ...'
326
340
  end
327
- # verify the required parameter 'player' is set
328
- if @api_client.config.client_side_validation && player.nil?
329
- fail ArgumentError, "Missing the required parameter 'player' when calling DefaultApi.create_player"
341
+ # verify the required parameter 'notification' is set
342
+ if @api_client.config.client_side_validation && notification.nil?
343
+ fail ArgumentError, "Missing the required parameter 'notification' when calling DefaultApi.create_notification"
330
344
  end
331
345
  # resource path
332
- local_var_path = '/players'
346
+ local_var_path = '/notifications'
333
347
 
334
348
  # query parameters
335
349
  query_params = opts[:query_params] || {}
@@ -348,16 +362,16 @@ module OneSignal
348
362
  form_params = opts[:form_params] || {}
349
363
 
350
364
  # http body (model)
351
- post_body = opts[:debug_body] || @api_client.object_to_http_body(player)
365
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(notification)
352
366
 
353
367
  # return_type
354
- return_type = opts[:debug_return_type] || 'CreatePlayerSuccessResponse'
368
+ return_type = opts[:debug_return_type] || 'CreateNotificationSuccessResponse'
355
369
 
356
370
  # auth_names
357
- auth_names = opts[:debug_auth_names] || ['app_key']
371
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
358
372
 
359
373
  new_options = opts.merge(
360
- :operation => :"DefaultApi.create_player",
374
+ :operation => :"DefaultApi.create_notification",
361
375
  :header_params => header_params,
362
376
  :query_params => query_params,
363
377
  :form_params => form_params,
@@ -368,35 +382,35 @@ module OneSignal
368
382
 
369
383
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
370
384
  if @api_client.config.debugging
371
- @api_client.config.logger.debug "API called: DefaultApi#create_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
385
+ @api_client.config.logger.debug "API called: DefaultApi#create_notification\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
372
386
  end
373
387
  return data, status_code, headers
374
388
  end
375
389
 
376
- # Create Segments
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.
390
+ # Create Segment
391
+ # Create a segment 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 Segment endpoint and re-create it with this endpoint to edit.
378
392
  # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
379
393
  # @param [Hash] opts the optional parameters
380
394
  # @option opts [Segment] :segment
381
395
  # @return [CreateSegmentSuccessResponse]
382
- def create_segments(app_id, opts = {})
383
- data, _status_code, _headers = create_segments_with_http_info(app_id, opts)
396
+ def create_segment(app_id, opts = {})
397
+ data, _status_code, _headers = create_segment_with_http_info(app_id, opts)
384
398
  data
385
399
  end
386
400
 
387
- # Create Segments
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.
401
+ # Create Segment
402
+ # Create a segment 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 Segment endpoint and re-create it with this endpoint to edit.
389
403
  # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
390
404
  # @param [Hash] opts the optional parameters
391
405
  # @option opts [Segment] :segment
392
406
  # @return [Array<(CreateSegmentSuccessResponse, Integer, Hash)>] CreateSegmentSuccessResponse data, response status code and response headers
393
- def create_segments_with_http_info(app_id, opts = {})
407
+ def create_segment_with_http_info(app_id, opts = {})
394
408
  if @api_client.config.debugging
395
- @api_client.config.logger.debug 'Calling API: DefaultApi.create_segments ...'
409
+ @api_client.config.logger.debug 'Calling API: DefaultApi.create_segment ...'
396
410
  end
397
411
  # verify the required parameter 'app_id' is set
398
412
  if @api_client.config.client_side_validation && app_id.nil?
399
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_segments"
413
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.create_segment"
400
414
  end
401
415
  # resource path
402
416
  local_var_path = '/apps/{app_id}/segments'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
@@ -424,10 +438,10 @@ module OneSignal
424
438
  return_type = opts[:debug_return_type] || 'CreateSegmentSuccessResponse'
425
439
 
426
440
  # auth_names
427
- auth_names = opts[:debug_auth_names] || ['app_key']
441
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
428
442
 
429
443
  new_options = opts.merge(
430
- :operation => :"DefaultApi.create_segments",
444
+ :operation => :"DefaultApi.create_segment",
431
445
  :header_params => header_params,
432
446
  :query_params => query_params,
433
447
  :form_params => form_params,
@@ -438,7 +452,7 @@ module OneSignal
438
452
 
439
453
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
440
454
  if @api_client.config.debugging
441
- @api_client.config.logger.debug "API called: DefaultApi#create_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
455
+ @api_client.config.logger.debug "API called: DefaultApi#create_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
442
456
  end
443
457
  return data, status_code, headers
444
458
  end
@@ -447,11 +461,11 @@ module OneSignal
447
461
  # @param app_id [String]
448
462
  # @param alias_label [String]
449
463
  # @param alias_id [String]
450
- # @param create_subscription_request_body [CreateSubscriptionRequestBody]
464
+ # @param subscription_body [SubscriptionBody]
451
465
  # @param [Hash] opts the optional parameters
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)
466
+ # @return [SubscriptionBody]
467
+ def create_subscription(app_id, alias_label, alias_id, subscription_body, opts = {})
468
+ data, _status_code, _headers = create_subscription_with_http_info(app_id, alias_label, alias_id, subscription_body, opts)
455
469
  data
456
470
  end
457
471
 
@@ -459,10 +473,10 @@ module OneSignal
459
473
  # @param app_id [String]
460
474
  # @param alias_label [String]
461
475
  # @param alias_id [String]
462
- # @param create_subscription_request_body [CreateSubscriptionRequestBody]
476
+ # @param subscription_body [SubscriptionBody]
463
477
  # @param [Hash] opts the optional parameters
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 = {})
478
+ # @return [Array<(SubscriptionBody, Integer, Hash)>] SubscriptionBody data, response status code and response headers
479
+ def create_subscription_with_http_info(app_id, alias_label, alias_id, subscription_body, opts = {})
466
480
  if @api_client.config.debugging
467
481
  @api_client.config.logger.debug 'Calling API: DefaultApi.create_subscription ...'
468
482
  end
@@ -478,9 +492,9 @@ module OneSignal
478
492
  if @api_client.config.client_side_validation && alias_id.nil?
479
493
  fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.create_subscription"
480
494
  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"
495
+ # verify the required parameter 'subscription_body' is set
496
+ if @api_client.config.client_side_validation && subscription_body.nil?
497
+ fail ArgumentError, "Missing the required parameter 'subscription_body' when calling DefaultApi.create_subscription"
484
498
  end
485
499
  # resource path
486
500
  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))
@@ -502,13 +516,13 @@ module OneSignal
502
516
  form_params = opts[:form_params] || {}
503
517
 
504
518
  # http body (model)
505
- post_body = opts[:debug_body] || @api_client.object_to_http_body(create_subscription_request_body)
519
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_body)
506
520
 
507
521
  # return_type
508
- return_type = opts[:debug_return_type] || 'InlineResponse201'
522
+ return_type = opts[:debug_return_type] || 'SubscriptionBody'
509
523
 
510
524
  # auth_names
511
- auth_names = opts[:debug_auth_names] || ['app_key']
525
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
512
526
 
513
527
  new_options = opts.merge(
514
528
  :operation => :"DefaultApi.create_subscription",
@@ -580,7 +594,7 @@ module OneSignal
580
594
  return_type = opts[:debug_return_type] || 'User'
581
595
 
582
596
  # auth_names
583
- auth_names = opts[:debug_auth_names] || ['app_key']
597
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
584
598
 
585
599
  new_options = opts.merge(
586
600
  :operation => :"DefaultApi.create_user",
@@ -605,7 +619,7 @@ module OneSignal
605
619
  # @param alias_id [String]
606
620
  # @param alias_label_to_delete [String]
607
621
  # @param [Hash] opts the optional parameters
608
- # @return [InlineResponse200]
622
+ # @return [UserIdentityBody]
609
623
  def delete_alias(app_id, alias_label, alias_id, alias_label_to_delete, opts = {})
610
624
  data, _status_code, _headers = delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts)
611
625
  data
@@ -617,7 +631,7 @@ module OneSignal
617
631
  # @param alias_id [String]
618
632
  # @param alias_label_to_delete [String]
619
633
  # @param [Hash] opts the optional parameters
620
- # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
634
+ # @return [Array<(UserIdentityBody, Integer, Hash)>] UserIdentityBody data, response status code and response headers
621
635
  def delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts = {})
622
636
  if @api_client.config.debugging
623
637
  @api_client.config.logger.debug 'Calling API: DefaultApi.delete_alias ...'
@@ -656,10 +670,10 @@ module OneSignal
656
670
  post_body = opts[:debug_body]
657
671
 
658
672
  # return_type
659
- return_type = opts[:debug_return_type] || 'InlineResponse200'
673
+ return_type = opts[:debug_return_type] || 'UserIdentityBody'
660
674
 
661
675
  # auth_names
662
- auth_names = opts[:debug_auth_names] || ['app_key']
676
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
663
677
 
664
678
  new_options = opts.merge(
665
679
  :operation => :"DefaultApi.delete_alias",
@@ -678,104 +692,34 @@ module OneSignal
678
692
  return data, status_code, headers
679
693
  end
680
694
 
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
685
- # @param [Hash] opts the optional parameters
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)
689
- data
690
- end
691
-
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
696
- # @param [Hash] opts the optional parameters
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 = {})
699
- if @api_client.config.debugging
700
- @api_client.config.logger.debug 'Calling API: DefaultApi.delete_player ...'
701
- end
702
- # verify the required parameter 'app_id' is set
703
- if @api_client.config.client_side_validation && app_id.nil?
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"
709
- end
710
- # resource path
711
- local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s))
712
-
713
- # query parameters
714
- query_params = opts[:query_params] || {}
715
- query_params[:'app_id'] = app_id
716
-
717
- # header parameters
718
- header_params = opts[:header_params] || {}
719
- # HTTP header 'Accept' (if needed)
720
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
721
-
722
- # form parameters
723
- form_params = opts[:form_params] || {}
724
-
725
- # http body (model)
726
- post_body = opts[:debug_body]
727
-
728
- # return_type
729
- return_type = opts[:debug_return_type] || 'DeletePlayerSuccessResponse'
730
-
731
- # auth_names
732
- auth_names = opts[:debug_auth_names] || ['app_key']
733
-
734
- new_options = opts.merge(
735
- :operation => :"DefaultApi.delete_player",
736
- :header_params => header_params,
737
- :query_params => query_params,
738
- :form_params => form_params,
739
- :body => post_body,
740
- :auth_names => auth_names,
741
- :return_type => return_type
742
- )
743
-
744
- data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
745
- if @api_client.config.debugging
746
- @api_client.config.logger.debug "API called: DefaultApi#delete_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
747
- end
748
- return data, status_code, headers
749
- end
750
-
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.
695
+ # Delete Segment
696
+ # Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard.
753
697
  # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
754
698
  # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard.
755
699
  # @param [Hash] opts the optional parameters
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)
700
+ # @return [GenericSuccessBoolResponse]
701
+ def delete_segment(app_id, segment_id, opts = {})
702
+ data, _status_code, _headers = delete_segment_with_http_info(app_id, segment_id, opts)
759
703
  data
760
704
  end
761
705
 
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.
706
+ # Delete Segment
707
+ # Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard.
764
708
  # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
765
709
  # @param segment_id [String] The segment_id can be found in the URL of the segment when viewing it in the dashboard.
766
710
  # @param [Hash] opts the optional parameters
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 = {})
711
+ # @return [Array<(GenericSuccessBoolResponse, Integer, Hash)>] GenericSuccessBoolResponse data, response status code and response headers
712
+ def delete_segment_with_http_info(app_id, segment_id, opts = {})
769
713
  if @api_client.config.debugging
770
- @api_client.config.logger.debug 'Calling API: DefaultApi.delete_segments ...'
714
+ @api_client.config.logger.debug 'Calling API: DefaultApi.delete_segment ...'
771
715
  end
772
716
  # verify the required parameter 'app_id' is set
773
717
  if @api_client.config.client_side_validation && app_id.nil?
774
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_segments"
718
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.delete_segment"
775
719
  end
776
720
  # verify the required parameter 'segment_id' is set
777
721
  if @api_client.config.client_side_validation && segment_id.nil?
778
- fail ArgumentError, "Missing the required parameter 'segment_id' when calling DefaultApi.delete_segments"
722
+ fail ArgumentError, "Missing the required parameter 'segment_id' when calling DefaultApi.delete_segment"
779
723
  end
780
724
  # resource path
781
725
  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))
@@ -795,13 +739,13 @@ module OneSignal
795
739
  post_body = opts[:debug_body]
796
740
 
797
741
  # return_type
798
- return_type = opts[:debug_return_type] || 'DeleteSegmentSuccessResponse'
742
+ return_type = opts[:debug_return_type] || 'GenericSuccessBoolResponse'
799
743
 
800
744
  # auth_names
801
- auth_names = opts[:debug_auth_names] || ['app_key']
745
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
802
746
 
803
747
  new_options = opts.merge(
804
- :operation => :"DefaultApi.delete_segments",
748
+ :operation => :"DefaultApi.delete_segment",
805
749
  :header_params => header_params,
806
750
  :query_params => query_params,
807
751
  :form_params => form_params,
@@ -812,7 +756,7 @@ module OneSignal
812
756
 
813
757
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
814
758
  if @api_client.config.debugging
815
- @api_client.config.logger.debug "API called: DefaultApi#delete_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
759
+ @api_client.config.logger.debug "API called: DefaultApi#delete_segment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
816
760
  end
817
761
  return data, status_code, headers
818
762
  end
@@ -865,7 +809,7 @@ module OneSignal
865
809
  return_type = opts[:debug_return_type]
866
810
 
867
811
  # auth_names
868
- auth_names = opts[:debug_auth_names] || ['app_key']
812
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
869
813
 
870
814
  new_options = opts.merge(
871
815
  :operation => :"DefaultApi.delete_subscription",
@@ -938,7 +882,7 @@ module OneSignal
938
882
  return_type = opts[:debug_return_type]
939
883
 
940
884
  # auth_names
941
- auth_names = opts[:debug_auth_names] || ['app_key']
885
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
942
886
 
943
887
  new_options = opts.merge(
944
888
  :operation => :"DefaultApi.delete_user",
@@ -957,81 +901,6 @@ module OneSignal
957
901
  return data, status_code, headers
958
902
  end
959
903
 
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
904
  # Export CSV of Events
1036
905
  # 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
906
  # @param notification_id [String] The ID of the notification to export events from.
@@ -1083,7 +952,7 @@ module OneSignal
1083
952
  return_type = opts[:debug_return_type] || 'ExportEventsSuccessResponse'
1084
953
 
1085
954
  # auth_names
1086
- auth_names = opts[:debug_auth_names] || ['app_key']
955
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
1087
956
 
1088
957
  new_options = opts.merge(
1089
958
  :operation => :"DefaultApi.export_events",
@@ -1102,30 +971,30 @@ module OneSignal
1102
971
  return data, status_code, headers
1103
972
  end
1104
973
 
1105
- # Export CSV of Players
974
+ # Export CSV of Subscriptions
1106
975
  # 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
976
  # @param app_id [String] The app ID that you want to export devices from
1108
977
  # @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)
978
+ # @option opts [ExportSubscriptionsRequestBody] :export_subscriptions_request_body
979
+ # @return [ExportSubscriptionsSuccessResponse]
980
+ def export_subscriptions(app_id, opts = {})
981
+ data, _status_code, _headers = export_subscriptions_with_http_info(app_id, opts)
1113
982
  data
1114
983
  end
1115
984
 
1116
- # Export CSV of Players
985
+ # Export CSV of Subscriptions
1117
986
  # 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
987
  # @param app_id [String] The app ID that you want to export devices from
1119
988
  # @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 = {})
989
+ # @option opts [ExportSubscriptionsRequestBody] :export_subscriptions_request_body
990
+ # @return [Array<(ExportSubscriptionsSuccessResponse, Integer, Hash)>] ExportSubscriptionsSuccessResponse data, response status code and response headers
991
+ def export_subscriptions_with_http_info(app_id, opts = {})
1123
992
  if @api_client.config.debugging
1124
- @api_client.config.logger.debug 'Calling API: DefaultApi.export_players ...'
993
+ @api_client.config.logger.debug 'Calling API: DefaultApi.export_subscriptions ...'
1125
994
  end
1126
995
  # verify the required parameter 'app_id' is set
1127
996
  if @api_client.config.client_side_validation && app_id.nil?
1128
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_players"
997
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.export_subscriptions"
1129
998
  end
1130
999
  # resource path
1131
1000
  local_var_path = '/players/csv_export?app_id={app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
@@ -1147,16 +1016,16 @@ module OneSignal
1147
1016
  form_params = opts[:form_params] || {}
1148
1017
 
1149
1018
  # http body (model)
1150
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'export_players_request_body'])
1019
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'export_subscriptions_request_body'])
1151
1020
 
1152
1021
  # return_type
1153
- return_type = opts[:debug_return_type] || 'ExportPlayersSuccessResponse'
1022
+ return_type = opts[:debug_return_type] || 'ExportSubscriptionsSuccessResponse'
1154
1023
 
1155
1024
  # auth_names
1156
- auth_names = opts[:debug_auth_names] || ['app_key']
1025
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
1157
1026
 
1158
1027
  new_options = opts.merge(
1159
- :operation => :"DefaultApi.export_players",
1028
+ :operation => :"DefaultApi.export_subscriptions",
1160
1029
  :header_params => header_params,
1161
1030
  :query_params => query_params,
1162
1031
  :form_params => form_params,
@@ -1167,113 +1036,46 @@ module OneSignal
1167
1036
 
1168
1037
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1169
1038
  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}"
1039
+ @api_client.config.logger.debug "API called: DefaultApi#export_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1238
1040
  end
1239
1041
  return data, status_code, headers
1240
1042
  end
1241
1043
 
1242
- # Returns the User’s properties, Aliases, and Subscriptions.
1044
+ # Lists all Aliases for the User identified by (:alias_label, :alias_id).
1243
1045
  # @param app_id [String]
1244
1046
  # @param alias_label [String]
1245
1047
  # @param alias_id [String]
1246
1048
  # @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)
1049
+ # @return [UserIdentityBody]
1050
+ def get_aliases(app_id, alias_label, alias_id, opts = {})
1051
+ data, _status_code, _headers = get_aliases_with_http_info(app_id, alias_label, alias_id, opts)
1250
1052
  data
1251
1053
  end
1252
1054
 
1253
- # Returns the User’s properties, Aliases, and Subscriptions.
1055
+ # Lists all Aliases for the User identified by (:alias_label, :alias_id).
1254
1056
  # @param app_id [String]
1255
1057
  # @param alias_label [String]
1256
1058
  # @param alias_id [String]
1257
1059
  # @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 = {})
1060
+ # @return [Array<(UserIdentityBody, Integer, Hash)>] UserIdentityBody data, response status code and response headers
1061
+ def get_aliases_with_http_info(app_id, alias_label, alias_id, opts = {})
1260
1062
  if @api_client.config.debugging
1261
- @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_user ...'
1063
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_aliases ...'
1262
1064
  end
1263
1065
  # verify the required parameter 'app_id' is set
1264
1066
  if @api_client.config.client_side_validation && app_id.nil?
1265
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.fetch_user"
1067
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_aliases"
1266
1068
  end
1267
1069
  # verify the required parameter 'alias_label' is set
1268
1070
  if @api_client.config.client_side_validation && alias_label.nil?
1269
- fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.fetch_user"
1071
+ fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.get_aliases"
1270
1072
  end
1271
1073
  # verify the required parameter 'alias_id' is set
1272
1074
  if @api_client.config.client_side_validation && alias_id.nil?
1273
- fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.fetch_user"
1075
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.get_aliases"
1274
1076
  end
1275
1077
  # 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))
1078
+ 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))
1277
1079
 
1278
1080
  # query parameters
1279
1081
  query_params = opts[:query_params] || {}
@@ -1290,13 +1092,13 @@ module OneSignal
1290
1092
  post_body = opts[:debug_body]
1291
1093
 
1292
1094
  # return_type
1293
- return_type = opts[:debug_return_type] || 'User'
1095
+ return_type = opts[:debug_return_type] || 'UserIdentityBody'
1294
1096
 
1295
1097
  # auth_names
1296
- auth_names = opts[:debug_auth_names] || ['app_key']
1098
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
1297
1099
 
1298
1100
  new_options = opts.merge(
1299
- :operation => :"DefaultApi.fetch_user",
1101
+ :operation => :"DefaultApi.get_aliases",
1300
1102
  :header_params => header_params,
1301
1103
  :query_params => query_params,
1302
1104
  :form_params => form_params,
@@ -1307,46 +1109,40 @@ module OneSignal
1307
1109
 
1308
1110
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1309
1111
  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}"
1112
+ @api_client.config.logger.debug "API called: DefaultApi#get_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1311
1113
  end
1312
1114
  return data, status_code, headers
1313
1115
  end
1314
1116
 
1315
- # Lists all Aliases for the User identified by (:alias_label, :alias_id).
1117
+ # Lists all Aliases for the User identified by :subscription_id.
1316
1118
  # @param app_id [String]
1317
- # @param alias_label [String]
1318
- # @param alias_id [String]
1119
+ # @param subscription_id [String]
1319
1120
  # @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)
1121
+ # @return [UserIdentityBody]
1122
+ def get_aliases_by_subscription(app_id, subscription_id, opts = {})
1123
+ data, _status_code, _headers = get_aliases_by_subscription_with_http_info(app_id, subscription_id, opts)
1323
1124
  data
1324
1125
  end
1325
1126
 
1326
- # Lists all Aliases for the User identified by (:alias_label, :alias_id).
1127
+ # Lists all Aliases for the User identified by :subscription_id.
1327
1128
  # @param app_id [String]
1328
- # @param alias_label [String]
1329
- # @param alias_id [String]
1129
+ # @param subscription_id [String]
1330
1130
  # @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 = {})
1131
+ # @return [Array<(UserIdentityBody, Integer, Hash)>] UserIdentityBody data, response status code and response headers
1132
+ def get_aliases_by_subscription_with_http_info(app_id, subscription_id, opts = {})
1333
1133
  if @api_client.config.debugging
1334
- @api_client.config.logger.debug 'Calling API: DefaultApi.fetch_user_identity ...'
1134
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_aliases_by_subscription ...'
1335
1135
  end
1336
1136
  # verify the required parameter 'app_id' is set
1337
1137
  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"
1138
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_aliases_by_subscription"
1339
1139
  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"
1140
+ # verify the required parameter 'subscription_id' is set
1141
+ if @api_client.config.client_side_validation && subscription_id.nil?
1142
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.get_aliases_by_subscription"
1347
1143
  end
1348
1144
  # 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))
1145
+ 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))
1350
1146
 
1351
1147
  # query parameters
1352
1148
  query_params = opts[:query_params] || {}
@@ -1363,13 +1159,13 @@ module OneSignal
1363
1159
  post_body = opts[:debug_body]
1364
1160
 
1365
1161
  # return_type
1366
- return_type = opts[:debug_return_type] || 'InlineResponse200'
1162
+ return_type = opts[:debug_return_type] || 'UserIdentityBody'
1367
1163
 
1368
1164
  # auth_names
1369
- auth_names = opts[:debug_auth_names] || ['app_key']
1165
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
1370
1166
 
1371
1167
  new_options = opts.merge(
1372
- :operation => :"DefaultApi.fetch_user_identity",
1168
+ :operation => :"DefaultApi.get_aliases_by_subscription",
1373
1169
  :header_params => header_params,
1374
1170
  :query_params => query_params,
1375
1171
  :form_params => form_params,
@@ -1380,7 +1176,7 @@ module OneSignal
1380
1176
 
1381
1177
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1382
1178
  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}"
1179
+ @api_client.config.logger.debug "API called: DefaultApi#get_aliases_by_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1384
1180
  end
1385
1181
  return data, status_code, headers
1386
1182
  end
@@ -1409,64 +1205,7 @@ module OneSignal
1409
1205
  fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_app"
1410
1206
  end
1411
1207
  # 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'
1208
+ local_var_path = '/apps/{app_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
1470
1209
 
1471
1210
  # query parameters
1472
1211
  query_params = opts[:query_params] || {}
@@ -1483,13 +1222,13 @@ module OneSignal
1483
1222
  post_body = opts[:debug_body]
1484
1223
 
1485
1224
  # return_type
1486
- return_type = opts[:debug_return_type] || 'Array<App>'
1225
+ return_type = opts[:debug_return_type] || 'App'
1487
1226
 
1488
1227
  # auth_names
1489
- auth_names = opts[:debug_auth_names] || ['user_key']
1228
+ auth_names = opts[:debug_auth_names] || ['organization_api_key']
1490
1229
 
1491
1230
  new_options = opts.merge(
1492
- :operation => :"DefaultApi.get_apps",
1231
+ :operation => :"DefaultApi.get_app",
1493
1232
  :header_params => header_params,
1494
1233
  :query_params => query_params,
1495
1234
  :form_params => form_params,
@@ -1500,40 +1239,30 @@ module OneSignal
1500
1239
 
1501
1240
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1502
1241
  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}"
1242
+ @api_client.config.logger.debug "API called: DefaultApi#get_app\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1504
1243
  end
1505
1244
  return data, status_code, headers
1506
1245
  end
1507
1246
 
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]
1247
+ # View apps
1248
+ # View the details of all of your current OneSignal apps
1511
1249
  # @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)
1250
+ # @return [Array<App>]
1251
+ def get_apps(opts = {})
1252
+ data, _status_code, _headers = get_apps_with_http_info(opts)
1515
1253
  data
1516
1254
  end
1517
1255
 
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]
1256
+ # View apps
1257
+ # View the details of all of your current OneSignal apps
1521
1258
  # @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 = {})
1259
+ # @return [Array<(Array<App>, Integer, Hash)>] Array<App> data, response status code and response headers
1260
+ def get_apps_with_http_info(opts = {})
1524
1261
  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"
1262
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_apps ...'
1534
1263
  end
1535
1264
  # 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))
1265
+ local_var_path = '/apps'
1537
1266
 
1538
1267
  # query parameters
1539
1268
  query_params = opts[:query_params] || {}
@@ -1550,13 +1279,13 @@ module OneSignal
1550
1279
  post_body = opts[:debug_body]
1551
1280
 
1552
1281
  # return_type
1553
- return_type = opts[:debug_return_type] || 'InlineResponse2003'
1282
+ return_type = opts[:debug_return_type] || 'Array<App>'
1554
1283
 
1555
1284
  # auth_names
1556
- auth_names = opts[:debug_auth_names] || ['app_key']
1285
+ auth_names = opts[:debug_auth_names] || ['organization_api_key']
1557
1286
 
1558
1287
  new_options = opts.merge(
1559
- :operation => :"DefaultApi.get_eligible_iams",
1288
+ :operation => :"DefaultApi.get_apps",
1560
1289
  :header_params => header_params,
1561
1290
  :query_params => query_params,
1562
1291
  :form_params => form_params,
@@ -1567,7 +1296,7 @@ module OneSignal
1567
1296
 
1568
1297
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
1569
1298
  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}"
1299
+ @api_client.config.logger.debug "API called: DefaultApi#get_apps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1571
1300
  end
1572
1301
  return data, status_code, headers
1573
1302
  end
@@ -1623,7 +1352,7 @@ module OneSignal
1623
1352
  return_type = opts[:debug_return_type] || 'NotificationWithMeta'
1624
1353
 
1625
1354
  # auth_names
1626
- auth_names = opts[:debug_auth_names] || ['app_key']
1355
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
1627
1356
 
1628
1357
  new_options = opts.merge(
1629
1358
  :operation => :"DefaultApi.get_notification",
@@ -1645,21 +1374,21 @@ module OneSignal
1645
1374
  # Notification History
1646
1375
  # -> 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
1376
  # @param notification_id [String] The \&quot;id\&quot; of the message found in the Notification object
1648
- # @param get_notification_request_body [GetNotificationRequestBody]
1377
+ # @param get_notification_history_request_body [GetNotificationHistoryRequestBody]
1649
1378
  # @param [Hash] opts the optional parameters
1650
1379
  # @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)
1380
+ def get_notification_history(notification_id, get_notification_history_request_body, opts = {})
1381
+ data, _status_code, _headers = get_notification_history_with_http_info(notification_id, get_notification_history_request_body, opts)
1653
1382
  data
1654
1383
  end
1655
1384
 
1656
1385
  # Notification History
1657
1386
  # -&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
1387
  # @param notification_id [String] The \&quot;id\&quot; of the message found in the Notification object
1659
- # @param get_notification_request_body [GetNotificationRequestBody]
1388
+ # @param get_notification_history_request_body [GetNotificationHistoryRequestBody]
1660
1389
  # @param [Hash] opts the optional parameters
1661
1390
  # @return [Array<(NotificationHistorySuccessResponse, Integer, Hash)>] NotificationHistorySuccessResponse data, response status code and response headers
1662
- def get_notification_history_with_http_info(notification_id, get_notification_request_body, opts = {})
1391
+ def get_notification_history_with_http_info(notification_id, get_notification_history_request_body, opts = {})
1663
1392
  if @api_client.config.debugging
1664
1393
  @api_client.config.logger.debug 'Calling API: DefaultApi.get_notification_history ...'
1665
1394
  end
@@ -1667,9 +1396,9 @@ module OneSignal
1667
1396
  if @api_client.config.client_side_validation && notification_id.nil?
1668
1397
  fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.get_notification_history"
1669
1398
  end
1670
- # verify the required parameter 'get_notification_request_body' is set
1671
- if @api_client.config.client_side_validation && get_notification_request_body.nil?
1672
- fail ArgumentError, "Missing the required parameter 'get_notification_request_body' when calling DefaultApi.get_notification_history"
1399
+ # verify the required parameter 'get_notification_history_request_body' is set
1400
+ if @api_client.config.client_side_validation && get_notification_history_request_body.nil?
1401
+ fail ArgumentError, "Missing the required parameter 'get_notification_history_request_body' when calling DefaultApi.get_notification_history"
1673
1402
  end
1674
1403
  # resource path
1675
1404
  local_var_path = '/notifications/{notification_id}/history'.sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))
@@ -1691,13 +1420,13 @@ module OneSignal
1691
1420
  form_params = opts[:form_params] || {}
1692
1421
 
1693
1422
  # http body (model)
1694
- post_body = opts[:debug_body] || @api_client.object_to_http_body(get_notification_request_body)
1423
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(get_notification_history_request_body)
1695
1424
 
1696
1425
  # return_type
1697
1426
  return_type = opts[:debug_return_type] || 'NotificationHistorySuccessResponse'
1698
1427
 
1699
1428
  # auth_names
1700
- auth_names = opts[:debug_auth_names] || ['app_key']
1429
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
1701
1430
 
1702
1431
  new_options = opts.merge(
1703
1432
  :operation => :"DefaultApi.get_notification_history",
@@ -1774,7 +1503,7 @@ module OneSignal
1774
1503
  return_type = opts[:debug_return_type] || 'NotificationSlice'
1775
1504
 
1776
1505
  # auth_names
1777
- auth_names = opts[:debug_auth_names] || ['app_key']
1506
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
1778
1507
 
1779
1508
  new_options = opts.merge(
1780
1509
  :operation => :"DefaultApi.get_notifications",
@@ -1856,7 +1585,7 @@ module OneSignal
1856
1585
  return_type = opts[:debug_return_type] || 'OutcomesData'
1857
1586
 
1858
1587
  # auth_names
1859
- auth_names = opts[:debug_auth_names] || ['app_key']
1588
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
1860
1589
 
1861
1590
  new_options = opts.merge(
1862
1591
  :operation => :"DefaultApi.get_outcomes",
@@ -1875,114 +1604,40 @@ module OneSignal
1875
1604
  return data, status_code, headers
1876
1605
  end
1877
1606
 
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
1607
+ # Get Segments
1608
+ # Returns an array of segments from an app.
1609
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
1954
1610
  # @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)
1611
+ # @option opts [Integer] :offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments.
1612
+ # @option opts [Integer] :limit The amount of Segments in the response. Maximum 300.
1613
+ # @return [GetSegmentsSuccessResponse]
1614
+ def get_segments(app_id, opts = {})
1615
+ data, _status_code, _headers = get_segments_with_http_info(app_id, opts)
1960
1616
  data
1961
1617
  end
1962
1618
 
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
1619
+ # Get Segments
1620
+ # Returns an array of segments from an app.
1621
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
1966
1622
  # @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 = {})
1623
+ # @option opts [Integer] :offset Segments are listed in ascending order of created_at date. offset will omit that number of segments from the beginning of the list. Eg offset 5, will remove the 5 earliest created Segments.
1624
+ # @option opts [Integer] :limit The amount of Segments in the response. Maximum 300.
1625
+ # @return [Array<(GetSegmentsSuccessResponse, Integer, Hash)>] GetSegmentsSuccessResponse data, response status code and response headers
1626
+ def get_segments_with_http_info(app_id, opts = {})
1971
1627
  if @api_client.config.debugging
1972
- @api_client.config.logger.debug 'Calling API: DefaultApi.get_players ...'
1628
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_segments ...'
1973
1629
  end
1974
1630
  # verify the required parameter 'app_id' is set
1975
1631
  if @api_client.config.client_side_validation && app_id.nil?
1976
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_players"
1632
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_segments"
1977
1633
  end
1978
1634
  # resource path
1979
- local_var_path = '/players'
1635
+ local_var_path = '/apps/{app_id}/segments'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
1980
1636
 
1981
1637
  # query parameters
1982
1638
  query_params = opts[:query_params] || {}
1983
- query_params[:'app_id'] = app_id
1984
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1985
1639
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
1640
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
1986
1641
 
1987
1642
  # header parameters
1988
1643
  header_params = opts[:header_params] || {}
@@ -1996,13 +1651,13 @@ module OneSignal
1996
1651
  post_body = opts[:debug_body]
1997
1652
 
1998
1653
  # return_type
1999
- return_type = opts[:debug_return_type] || 'PlayerSlice'
1654
+ return_type = opts[:debug_return_type] || 'GetSegmentsSuccessResponse'
2000
1655
 
2001
1656
  # auth_names
2002
- auth_names = opts[:debug_auth_names] || ['app_key']
1657
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
2003
1658
 
2004
1659
  new_options = opts.merge(
2005
- :operation => :"DefaultApi.get_players",
1660
+ :operation => :"DefaultApi.get_segments",
2006
1661
  :header_params => header_params,
2007
1662
  :query_params => query_params,
2008
1663
  :form_params => form_params,
@@ -2013,52 +1668,46 @@ module OneSignal
2013
1668
 
2014
1669
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2015
1670
  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}"
1671
+ @api_client.config.logger.debug "API called: DefaultApi#get_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2017
1672
  end
2018
1673
  return data, status_code, headers
2019
1674
  end
2020
1675
 
2021
- # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
1676
+ # Returns the User’s properties, Aliases, and Subscriptions.
2022
1677
  # @param app_id [String]
2023
1678
  # @param alias_label [String]
2024
1679
  # @param alias_id [String]
2025
- # @param user_identity_request_body [UserIdentityRequestBody]
2026
1680
  # @param [Hash] opts the optional parameters
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)
1681
+ # @return [User]
1682
+ def get_user(app_id, alias_label, alias_id, opts = {})
1683
+ data, _status_code, _headers = get_user_with_http_info(app_id, alias_label, alias_id, opts)
2030
1684
  data
2031
1685
  end
2032
1686
 
2033
- # Upserts one or more Aliases to an existing User identified by (:alias_label, :alias_id).
1687
+ # Returns the User’s properties, Aliases, and Subscriptions.
2034
1688
  # @param app_id [String]
2035
1689
  # @param alias_label [String]
2036
1690
  # @param alias_id [String]
2037
- # @param user_identity_request_body [UserIdentityRequestBody]
2038
1691
  # @param [Hash] opts the optional parameters
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 = {})
1692
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
1693
+ def get_user_with_http_info(app_id, alias_label, alias_id, opts = {})
2041
1694
  if @api_client.config.debugging
2042
- @api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_alias ...'
1695
+ @api_client.config.logger.debug 'Calling API: DefaultApi.get_user ...'
2043
1696
  end
2044
1697
  # verify the required parameter 'app_id' is set
2045
1698
  if @api_client.config.client_side_validation && app_id.nil?
2046
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.identify_user_by_alias"
1699
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.get_user"
2047
1700
  end
2048
1701
  # verify the required parameter 'alias_label' is set
2049
1702
  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"
1703
+ fail ArgumentError, "Missing the required parameter 'alias_label' when calling DefaultApi.get_user"
2051
1704
  end
2052
1705
  # verify the required parameter 'alias_id' is set
2053
1706
  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"
1707
+ fail ArgumentError, "Missing the required parameter 'alias_id' when calling DefaultApi.get_user"
2059
1708
  end
2060
1709
  # resource path
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))
1710
+ 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))
2062
1711
 
2063
1712
  # query parameters
2064
1713
  query_params = opts[:query_params] || {}
@@ -2067,26 +1716,21 @@ module OneSignal
2067
1716
  header_params = opts[:header_params] || {}
2068
1717
  # HTTP header 'Accept' (if needed)
2069
1718
  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
2075
1719
 
2076
1720
  # form parameters
2077
1721
  form_params = opts[:form_params] || {}
2078
1722
 
2079
1723
  # http body (model)
2080
- post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_request_body)
1724
+ post_body = opts[:debug_body]
2081
1725
 
2082
1726
  # return_type
2083
- return_type = opts[:debug_return_type] || 'InlineResponse200'
1727
+ return_type = opts[:debug_return_type] || 'User'
2084
1728
 
2085
1729
  # auth_names
2086
- auth_names = opts[:debug_auth_names] || ['app_key']
1730
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
2087
1731
 
2088
1732
  new_options = opts.merge(
2089
- :operation => :"DefaultApi.identify_user_by_alias",
1733
+ :operation => :"DefaultApi.get_user",
2090
1734
  :header_params => header_params,
2091
1735
  :query_params => query_params,
2092
1736
  :form_params => form_params,
@@ -2095,48 +1739,48 @@ module OneSignal
2095
1739
  :return_type => return_type
2096
1740
  )
2097
1741
 
2098
- data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1742
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
2099
1743
  if @api_client.config.debugging
2100
- @api_client.config.logger.debug "API called: DefaultApi#identify_user_by_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1744
+ @api_client.config.logger.debug "API called: DefaultApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2101
1745
  end
2102
1746
  return data, status_code, headers
2103
1747
  end
2104
1748
 
2105
- # Upserts one or more Aliases for the User identified by :subscription_id.
1749
+ # Transfers this Subscription to the User identified by the identity in the payload.
2106
1750
  # @param app_id [String]
2107
1751
  # @param subscription_id [String]
2108
- # @param user_identity_request_body [UserIdentityRequestBody]
1752
+ # @param transfer_subscription_request_body [TransferSubscriptionRequestBody]
2109
1753
  # @param [Hash] opts the optional parameters
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)
1754
+ # @return [UserIdentityBody]
1755
+ def transfer_subscription(app_id, subscription_id, transfer_subscription_request_body, opts = {})
1756
+ data, _status_code, _headers = transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts)
2113
1757
  data
2114
1758
  end
2115
1759
 
2116
- # Upserts one or more Aliases for the User identified by :subscription_id.
1760
+ # Transfers this Subscription to the User identified by the identity in the payload.
2117
1761
  # @param app_id [String]
2118
1762
  # @param subscription_id [String]
2119
- # @param user_identity_request_body [UserIdentityRequestBody]
1763
+ # @param transfer_subscription_request_body [TransferSubscriptionRequestBody]
2120
1764
  # @param [Hash] opts the optional parameters
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 = {})
1765
+ # @return [Array<(UserIdentityBody, Integer, Hash)>] UserIdentityBody data, response status code and response headers
1766
+ def transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts = {})
2123
1767
  if @api_client.config.debugging
2124
- @api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_subscription_id ...'
1768
+ @api_client.config.logger.debug 'Calling API: DefaultApi.transfer_subscription ...'
2125
1769
  end
2126
1770
  # verify the required parameter 'app_id' is set
2127
1771
  if @api_client.config.client_side_validation && app_id.nil?
2128
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.identify_user_by_subscription_id"
1772
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.transfer_subscription"
2129
1773
  end
2130
1774
  # verify the required parameter 'subscription_id' is set
2131
1775
  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"
1776
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.transfer_subscription"
2133
1777
  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"
1778
+ # verify the required parameter 'transfer_subscription_request_body' is set
1779
+ if @api_client.config.client_side_validation && transfer_subscription_request_body.nil?
1780
+ fail ArgumentError, "Missing the required parameter 'transfer_subscription_request_body' when calling DefaultApi.transfer_subscription"
2137
1781
  end
2138
1782
  # resource path
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))
1783
+ 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))
2140
1784
 
2141
1785
  # query parameters
2142
1786
  query_params = opts[:query_params] || {}
@@ -2155,16 +1799,16 @@ module OneSignal
2155
1799
  form_params = opts[:form_params] || {}
2156
1800
 
2157
1801
  # http body (model)
2158
- post_body = opts[:debug_body] || @api_client.object_to_http_body(user_identity_request_body)
1802
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_subscription_request_body)
2159
1803
 
2160
1804
  # return_type
2161
- return_type = opts[:debug_return_type] || 'UserIdentityResponse'
1805
+ return_type = opts[:debug_return_type] || 'UserIdentityBody'
2162
1806
 
2163
1807
  # auth_names
2164
- auth_names = opts[:debug_auth_names] || ['app_key']
1808
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
2165
1809
 
2166
1810
  new_options = opts.merge(
2167
- :operation => :"DefaultApi.identify_user_by_subscription_id",
1811
+ :operation => :"DefaultApi.transfer_subscription",
2168
1812
  :header_params => header_params,
2169
1813
  :query_params => query_params,
2170
1814
  :form_params => form_params,
@@ -2175,74 +1819,72 @@ module OneSignal
2175
1819
 
2176
1820
  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
2177
1821
  if @api_client.config.debugging
2178
- @api_client.config.logger.debug "API called: DefaultApi#identify_user_by_subscription_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1822
+ @api_client.config.logger.debug "API called: DefaultApi#transfer_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2179
1823
  end
2180
1824
  return data, status_code, headers
2181
1825
  end
2182
1826
 
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]
1827
+ # Unsubscribe with token
1828
+ # Unsubscribe an email with a token when using your own custom email unsubscribe landing page
1829
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
1830
+ # @param notification_id [String] The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report.
1831
+ # @param token [String] The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email.
2187
1832
  # @param [Hash] opts the optional parameters
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)
1833
+ # @return [GenericSuccessBoolResponse]
1834
+ def unsubscribe_email_with_token(app_id, notification_id, token, opts = {})
1835
+ data, _status_code, _headers = unsubscribe_email_with_token_with_http_info(app_id, notification_id, token, opts)
2191
1836
  data
2192
1837
  end
2193
1838
 
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]
1839
+ # Unsubscribe with token
1840
+ # Unsubscribe an email with a token when using your own custom email unsubscribe landing page
1841
+ # @param app_id [String] The OneSignal App ID for your app. Available in Keys &amp; IDs.
1842
+ # @param notification_id [String] The id of the message found in the creation notification POST response, View Notifications GET response, or URL within the Message Report.
1843
+ # @param token [String] The unsubscribe token that is generated via liquid syntax in {{subscription.unsubscribe_token}} when personalizing an email.
2198
1844
  # @param [Hash] opts the optional parameters
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 = {})
1845
+ # @return [Array<(GenericSuccessBoolResponse, Integer, Hash)>] GenericSuccessBoolResponse data, response status code and response headers
1846
+ def unsubscribe_email_with_token_with_http_info(app_id, notification_id, token, opts = {})
2201
1847
  if @api_client.config.debugging
2202
- @api_client.config.logger.debug 'Calling API: DefaultApi.transfer_subscription ...'
1848
+ @api_client.config.logger.debug 'Calling API: DefaultApi.unsubscribe_email_with_token ...'
2203
1849
  end
2204
1850
  # verify the required parameter 'app_id' is set
2205
1851
  if @api_client.config.client_side_validation && app_id.nil?
2206
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.transfer_subscription"
1852
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.unsubscribe_email_with_token"
2207
1853
  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"
1854
+ # verify the required parameter 'notification_id' is set
1855
+ if @api_client.config.client_side_validation && notification_id.nil?
1856
+ fail ArgumentError, "Missing the required parameter 'notification_id' when calling DefaultApi.unsubscribe_email_with_token"
2211
1857
  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"
1858
+ # verify the required parameter 'token' is set
1859
+ if @api_client.config.client_side_validation && token.nil?
1860
+ fail ArgumentError, "Missing the required parameter 'token' when calling DefaultApi.unsubscribe_email_with_token"
2215
1861
  end
2216
1862
  # resource path
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))
1863
+ local_var_path = '/apps/{app_id}/notifications/{notification_id}/unsubscribe'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'notification_id' + '}', CGI.escape(notification_id.to_s))
2218
1864
 
2219
1865
  # query parameters
2220
1866
  query_params = opts[:query_params] || {}
1867
+ query_params[:'token'] = token
2221
1868
 
2222
1869
  # header parameters
2223
1870
  header_params = opts[:header_params] || {}
2224
1871
  # HTTP header 'Accept' (if needed)
2225
1872
  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
2231
1873
 
2232
1874
  # form parameters
2233
1875
  form_params = opts[:form_params] || {}
2234
1876
 
2235
1877
  # http body (model)
2236
- post_body = opts[:debug_body] || @api_client.object_to_http_body(transfer_subscription_request_body)
1878
+ post_body = opts[:debug_body]
2237
1879
 
2238
1880
  # return_type
2239
- return_type = opts[:debug_return_type] || 'UserIdentityResponse'
1881
+ return_type = opts[:debug_return_type] || 'GenericSuccessBoolResponse'
2240
1882
 
2241
1883
  # auth_names
2242
- auth_names = opts[:debug_auth_names] || ['app_key']
1884
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
2243
1885
 
2244
1886
  new_options = opts.merge(
2245
- :operation => :"DefaultApi.transfer_subscription",
1887
+ :operation => :"DefaultApi.unsubscribe_email_with_token",
2246
1888
  :header_params => header_params,
2247
1889
  :query_params => query_params,
2248
1890
  :form_params => form_params,
@@ -2251,9 +1893,9 @@ module OneSignal
2251
1893
  :return_type => return_type
2252
1894
  )
2253
1895
 
2254
- data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
1896
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
2255
1897
  if @api_client.config.debugging
2256
- @api_client.config.logger.debug "API called: DefaultApi#transfer_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1898
+ @api_client.config.logger.debug "API called: DefaultApi#unsubscribe_email_with_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2257
1899
  end
2258
1900
  return data, status_code, headers
2259
1901
  end
@@ -2313,7 +1955,7 @@ module OneSignal
2313
1955
  return_type = opts[:debug_return_type] || 'App'
2314
1956
 
2315
1957
  # auth_names
2316
- auth_names = opts[:debug_auth_names] || ['user_key']
1958
+ auth_names = opts[:debug_auth_names] || ['organization_api_key']
2317
1959
 
2318
1960
  new_options = opts.merge(
2319
1961
  :operation => :"DefaultApi.update_app",
@@ -2393,7 +2035,7 @@ module OneSignal
2393
2035
  return_type = opts[:debug_return_type] || 'UpdateLiveActivitySuccessResponse'
2394
2036
 
2395
2037
  # auth_names
2396
- auth_names = opts[:debug_auth_names] || ['app_key']
2038
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
2397
2039
 
2398
2040
  new_options = opts.merge(
2399
2041
  :operation => :"DefaultApi.update_live_activity",
@@ -2412,174 +2054,24 @@ module OneSignal
2412
2054
  return data, status_code, headers
2413
2055
  end
2414
2056
 
2415
- # Edit device
2416
- # Update an existing device in one of your OneSignal apps
2417
- # @param player_id [String] Player&#39;s OneSignal ID
2418
- # @param player [Player]
2419
- # @param [Hash] opts the optional parameters
2420
- # @return [UpdatePlayerSuccessResponse]
2421
- def update_player(player_id, player, opts = {})
2422
- data, _status_code, _headers = update_player_with_http_info(player_id, player, opts)
2423
- data
2424
- end
2425
-
2426
- # Edit device
2427
- # Update an existing device in one of your OneSignal apps
2428
- # @param player_id [String] Player&#39;s OneSignal ID
2429
- # @param player [Player]
2430
- # @param [Hash] opts the optional parameters
2431
- # @return [Array<(UpdatePlayerSuccessResponse, Integer, Hash)>] UpdatePlayerSuccessResponse data, response status code and response headers
2432
- def update_player_with_http_info(player_id, player, opts = {})
2433
- if @api_client.config.debugging
2434
- @api_client.config.logger.debug 'Calling API: DefaultApi.update_player ...'
2435
- end
2436
- # verify the required parameter 'player_id' is set
2437
- if @api_client.config.client_side_validation && player_id.nil?
2438
- fail ArgumentError, "Missing the required parameter 'player_id' when calling DefaultApi.update_player"
2439
- end
2440
- # verify the required parameter 'player' is set
2441
- if @api_client.config.client_side_validation && player.nil?
2442
- fail ArgumentError, "Missing the required parameter 'player' when calling DefaultApi.update_player"
2443
- end
2444
- # resource path
2445
- local_var_path = '/players/{player_id}'.sub('{' + 'player_id' + '}', CGI.escape(player_id.to_s))
2446
-
2447
- # query parameters
2448
- query_params = opts[:query_params] || {}
2449
-
2450
- # header parameters
2451
- header_params = opts[:header_params] || {}
2452
- # HTTP header 'Accept' (if needed)
2453
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2454
- # HTTP header 'Content-Type'
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
2459
-
2460
- # form parameters
2461
- form_params = opts[:form_params] || {}
2462
-
2463
- # http body (model)
2464
- post_body = opts[:debug_body] || @api_client.object_to_http_body(player)
2465
-
2466
- # return_type
2467
- return_type = opts[:debug_return_type] || 'UpdatePlayerSuccessResponse'
2468
-
2469
- # auth_names
2470
- auth_names = opts[:debug_auth_names] || ['app_key']
2471
-
2472
- new_options = opts.merge(
2473
- :operation => :"DefaultApi.update_player",
2474
- :header_params => header_params,
2475
- :query_params => query_params,
2476
- :form_params => form_params,
2477
- :body => post_body,
2478
- :auth_names => auth_names,
2479
- :return_type => return_type
2480
- )
2481
-
2482
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
2483
- if @api_client.config.debugging
2484
- @api_client.config.logger.debug "API called: DefaultApi#update_player\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2485
- end
2486
- return data, status_code, headers
2487
- end
2488
-
2489
- # Edit tags with external user id
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\" }
2491
- # @param app_id [String] The OneSignal App ID the user record is found under.
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.
2493
- # @param [Hash] opts the optional parameters
2494
- # @option opts [UpdatePlayerTagsRequestBody] :update_player_tags_request_body
2495
- # @return [UpdatePlayerTagsSuccessResponse]
2496
- def update_player_tags(app_id, external_user_id, opts = {})
2497
- data, _status_code, _headers = update_player_tags_with_http_info(app_id, external_user_id, opts)
2498
- data
2499
- end
2500
-
2501
- # Edit tags with external user id
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; }
2503
- # @param app_id [String] The OneSignal App ID the user record is found under.
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.
2505
- # @param [Hash] opts the optional parameters
2506
- # @option opts [UpdatePlayerTagsRequestBody] :update_player_tags_request_body
2507
- # @return [Array<(UpdatePlayerTagsSuccessResponse, Integer, Hash)>] UpdatePlayerTagsSuccessResponse data, response status code and response headers
2508
- def update_player_tags_with_http_info(app_id, external_user_id, opts = {})
2509
- if @api_client.config.debugging
2510
- @api_client.config.logger.debug 'Calling API: DefaultApi.update_player_tags ...'
2511
- end
2512
- # verify the required parameter 'app_id' is set
2513
- if @api_client.config.client_side_validation && app_id.nil?
2514
- fail ArgumentError, "Missing the required parameter 'app_id' when calling DefaultApi.update_player_tags"
2515
- end
2516
- # verify the required parameter 'external_user_id' is set
2517
- if @api_client.config.client_side_validation && external_user_id.nil?
2518
- fail ArgumentError, "Missing the required parameter 'external_user_id' when calling DefaultApi.update_player_tags"
2519
- end
2520
- # resource path
2521
- local_var_path = '/apps/{app_id}/users/{external_user_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'external_user_id' + '}', CGI.escape(external_user_id.to_s))
2522
-
2523
- # query parameters
2524
- query_params = opts[:query_params] || {}
2525
-
2526
- # header parameters
2527
- header_params = opts[:header_params] || {}
2528
- # HTTP header 'Accept' (if needed)
2529
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
2530
- # HTTP header 'Content-Type'
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
2535
-
2536
- # form parameters
2537
- form_params = opts[:form_params] || {}
2538
-
2539
- # http body (model)
2540
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_player_tags_request_body'])
2541
-
2542
- # return_type
2543
- return_type = opts[:debug_return_type] || 'UpdatePlayerTagsSuccessResponse'
2544
-
2545
- # auth_names
2546
- auth_names = opts[:debug_auth_names] || ['app_key']
2547
-
2548
- new_options = opts.merge(
2549
- :operation => :"DefaultApi.update_player_tags",
2550
- :header_params => header_params,
2551
- :query_params => query_params,
2552
- :form_params => form_params,
2553
- :body => post_body,
2554
- :auth_names => auth_names,
2555
- :return_type => return_type
2556
- )
2557
-
2558
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
2559
- if @api_client.config.debugging
2560
- @api_client.config.logger.debug "API called: DefaultApi#update_player_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
2561
- end
2562
- return data, status_code, headers
2563
- end
2564
-
2565
2057
  # Updates an existing Subscription’s properties.
2566
2058
  # @param app_id [String]
2567
2059
  # @param subscription_id [String]
2568
- # @param update_subscription_request_body [UpdateSubscriptionRequestBody]
2060
+ # @param subscription_body [SubscriptionBody]
2569
2061
  # @param [Hash] opts the optional parameters
2570
2062
  # @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)
2063
+ def update_subscription(app_id, subscription_id, subscription_body, opts = {})
2064
+ update_subscription_with_http_info(app_id, subscription_id, subscription_body, opts)
2573
2065
  nil
2574
2066
  end
2575
2067
 
2576
2068
  # Updates an existing Subscription’s properties.
2577
2069
  # @param app_id [String]
2578
2070
  # @param subscription_id [String]
2579
- # @param update_subscription_request_body [UpdateSubscriptionRequestBody]
2071
+ # @param subscription_body [SubscriptionBody]
2580
2072
  # @param [Hash] opts the optional parameters
2581
2073
  # @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 = {})
2074
+ def update_subscription_with_http_info(app_id, subscription_id, subscription_body, opts = {})
2583
2075
  if @api_client.config.debugging
2584
2076
  @api_client.config.logger.debug 'Calling API: DefaultApi.update_subscription ...'
2585
2077
  end
@@ -2591,9 +2083,9 @@ module OneSignal
2591
2083
  if @api_client.config.client_side_validation && subscription_id.nil?
2592
2084
  fail ArgumentError, "Missing the required parameter 'subscription_id' when calling DefaultApi.update_subscription"
2593
2085
  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"
2086
+ # verify the required parameter 'subscription_body' is set
2087
+ if @api_client.config.client_side_validation && subscription_body.nil?
2088
+ fail ArgumentError, "Missing the required parameter 'subscription_body' when calling DefaultApi.update_subscription"
2597
2089
  end
2598
2090
  # resource path
2599
2091
  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))
@@ -2615,13 +2107,13 @@ module OneSignal
2615
2107
  form_params = opts[:form_params] || {}
2616
2108
 
2617
2109
  # http body (model)
2618
- post_body = opts[:debug_body] || @api_client.object_to_http_body(update_subscription_request_body)
2110
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_body)
2619
2111
 
2620
2112
  # return_type
2621
2113
  return_type = opts[:debug_return_type]
2622
2114
 
2623
2115
  # auth_names
2624
- auth_names = opts[:debug_auth_names] || ['app_key']
2116
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
2625
2117
 
2626
2118
  new_options = opts.merge(
2627
2119
  :operation => :"DefaultApi.update_subscription",
@@ -2646,7 +2138,7 @@ module OneSignal
2646
2138
  # @param alias_id [String]
2647
2139
  # @param update_user_request [UpdateUserRequest]
2648
2140
  # @param [Hash] opts the optional parameters
2649
- # @return [InlineResponse202]
2141
+ # @return [PropertiesBody]
2650
2142
  def update_user(app_id, alias_label, alias_id, update_user_request, opts = {})
2651
2143
  data, _status_code, _headers = update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts)
2652
2144
  data
@@ -2658,7 +2150,7 @@ module OneSignal
2658
2150
  # @param alias_id [String]
2659
2151
  # @param update_user_request [UpdateUserRequest]
2660
2152
  # @param [Hash] opts the optional parameters
2661
- # @return [Array<(InlineResponse202, Integer, Hash)>] InlineResponse202 data, response status code and response headers
2153
+ # @return [Array<(PropertiesBody, Integer, Hash)>] PropertiesBody data, response status code and response headers
2662
2154
  def update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts = {})
2663
2155
  if @api_client.config.debugging
2664
2156
  @api_client.config.logger.debug 'Calling API: DefaultApi.update_user ...'
@@ -2702,10 +2194,10 @@ module OneSignal
2702
2194
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_user_request)
2703
2195
 
2704
2196
  # return_type
2705
- return_type = opts[:debug_return_type] || 'InlineResponse202'
2197
+ return_type = opts[:debug_return_type] || 'PropertiesBody'
2706
2198
 
2707
2199
  # auth_names
2708
- auth_names = opts[:debug_auth_names] || ['app_key']
2200
+ auth_names = opts[:debug_auth_names] || ['rest_api_key']
2709
2201
 
2710
2202
  new_options = opts.merge(
2711
2203
  :operation => :"DefaultApi.update_user",