onesignal 2.2.0 → 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 (211) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +42 -65
  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 -874
  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} +7 -7
  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} +9 -9
  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 +97 -171
  153. data/Gemfile.lock +0 -74
  154. data/docs/BeginLiveActivityRequest.md +0 -20
  155. data/docs/CancelNotificationSuccessResponse.md +0 -18
  156. data/docs/CreatePlayerSuccessResponse.md +0 -20
  157. data/docs/CreateSubscriptionRequestBody.md +0 -20
  158. data/docs/DeletePlayerNotFoundResponse.md +0 -18
  159. data/docs/DeleteSegmentNotFoundResponse.md +0 -18
  160. data/docs/DeleteSegmentSuccessResponse.md +0 -18
  161. data/docs/FilterExpressions.md +0 -26
  162. data/docs/InlineResponse2003.md +0 -18
  163. data/docs/InlineResponse201.md +0 -18
  164. data/docs/InvalidIdentifierError.md +0 -20
  165. data/docs/Player.md +0 -70
  166. data/docs/PlayerNotificationTarget.md +0 -40
  167. data/docs/PlayerNotificationTargetIncludeAliases.md +0 -18
  168. data/docs/PlayerSlice.md +0 -24
  169. data/docs/UpdatePlayerSuccessResponse.md +0 -18
  170. data/docs/UpdatePlayerTagsRequestBody.md +0 -18
  171. data/docs/UpdatePlayerTagsSuccessResponse.md +0 -18
  172. data/docs/UpdateSubscriptionRequestBody.md +0 -18
  173. data/docs/UserIdentityRequestBody.md +0 -18
  174. data/docs/UserIdentityResponse.md +0 -18
  175. data/docs/UserSubscriptionOptions.md +0 -18
  176. data/lib/onesignal/models/cancel_notification_success_response.rb +0 -219
  177. data/lib/onesignal/models/create_subscription_request_body.rb +0 -228
  178. data/lib/onesignal/models/delete_player_not_found_response.rb +0 -219
  179. data/lib/onesignal/models/delete_player_success_response.rb +0 -219
  180. data/lib/onesignal/models/delete_segment_not_found_response.rb +0 -219
  181. data/lib/onesignal/models/delete_segment_success_response.rb +0 -219
  182. data/lib/onesignal/models/filter_expressions.rb +0 -336
  183. data/lib/onesignal/models/generic_error_errors_inner.rb +0 -228
  184. data/lib/onesignal/models/inline_response2003.rb +0 -221
  185. data/lib/onesignal/models/invalid_identifier_error.rb +0 -234
  186. data/lib/onesignal/models/player.rb +0 -494
  187. data/lib/onesignal/models/player_notification_target_include_aliases.rb +0 -221
  188. data/lib/onesignal/models/update_player_tags_request_body.rb +0 -220
  189. data/lib/onesignal/models/update_player_tags_success_response.rb +0 -219
  190. data/lib/onesignal/models/update_subscription_request_body.rb +0 -219
  191. data/lib/onesignal/models/user_identity_request_body.rb +0 -221
  192. data/lib/onesignal/models/user_identity_response.rb +0 -221
  193. data/lib/onesignal/models/user_subscription_options.rb +0 -219
  194. data/spec/models/begin_live_activity_request_spec.rb +0 -40
  195. data/spec/models/cancel_notification_success_response_spec.rb +0 -34
  196. data/spec/models/create_subscription_request_body_spec.rb +0 -40
  197. data/spec/models/delete_player_not_found_response_spec.rb +0 -34
  198. data/spec/models/delete_segment_not_found_response_spec.rb +0 -34
  199. data/spec/models/delete_segment_success_response_spec.rb +0 -34
  200. data/spec/models/inline_response2003_spec.rb +0 -34
  201. data/spec/models/inline_response200_spec.rb +0 -34
  202. data/spec/models/invalid_identifier_error_spec.rb +0 -40
  203. data/spec/models/player_notification_target_include_aliases_spec.rb +0 -34
  204. data/spec/models/player_spec.rb +0 -190
  205. data/spec/models/rate_limiter_error_spec.rb +0 -34
  206. data/spec/models/update_player_success_response_spec.rb +0 -34
  207. data/spec/models/update_player_tags_request_body_spec.rb +0 -34
  208. data/spec/models/update_player_tags_success_response_spec.rb +0 -34
  209. data/spec/models/update_subscription_request_body_spec.rb +0 -34
  210. data/spec/models/user_identity_request_body_spec.rb +0 -34
  211. 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.0
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
@@ -14,16 +14,38 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OneSignal
17
- class BeginLiveActivityRequest
18
- attr_accessor :push_token
17
+ class SegmentData
18
+ # The segment ID
19
+ attr_accessor :id
19
20
 
20
- attr_accessor :subscription_id
21
+ # The segment name
22
+ attr_accessor :name
23
+
24
+ # Date segment created
25
+ attr_accessor :created_at
26
+
27
+ # Date segment last updated
28
+ attr_accessor :updated_at
29
+
30
+ # The app id
31
+ attr_accessor :app_id
32
+
33
+ # Is the segment read only?
34
+ attr_accessor :read_only
35
+
36
+ # Is the segment active?
37
+ attr_accessor :is_active
21
38
 
22
39
  # Attribute mapping from ruby-style variable name to JSON key.
23
40
  def self.attribute_map
24
41
  {
25
- :'push_token' => :'push_token',
26
- :'subscription_id' => :'subscription_id'
42
+ :'id' => :'id',
43
+ :'name' => :'name',
44
+ :'created_at' => :'created_at',
45
+ :'updated_at' => :'updated_at',
46
+ :'app_id' => :'app_id',
47
+ :'read_only' => :'read_only',
48
+ :'is_active' => :'is_active'
27
49
  }
28
50
  end
29
51
 
@@ -35,8 +57,13 @@ module OneSignal
35
57
  # Attribute type mapping.
36
58
  def self.openapi_types
37
59
  {
38
- :'push_token' => :'String',
39
- :'subscription_id' => :'String'
60
+ :'id' => :'String',
61
+ :'name' => :'String',
62
+ :'created_at' => :'String',
63
+ :'updated_at' => :'String',
64
+ :'app_id' => :'String',
65
+ :'read_only' => :'Boolean',
66
+ :'is_active' => :'Boolean'
40
67
  }
41
68
  end
42
69
 
@@ -50,23 +77,43 @@ module OneSignal
50
77
  # @param [Hash] attributes Model attributes in the form of hash
51
78
  def initialize(attributes = {})
52
79
  if (!attributes.is_a?(Hash))
53
- fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::BeginLiveActivityRequest` initialize method"
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::SegmentData` initialize method"
54
81
  end
55
82
 
56
83
  # check to see if the attribute exists and convert string to symbol for hash key
57
84
  attributes = attributes.each_with_object({}) { |(k, v), h|
58
85
  if (!self.class.attribute_map.key?(k.to_sym))
59
- fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::BeginLiveActivityRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::SegmentData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
87
  end
61
88
  h[k.to_sym] = v
62
89
  }
63
90
 
64
- if attributes.key?(:'push_token')
65
- self.push_token = attributes[:'push_token']
91
+ if attributes.key?(:'id')
92
+ self.id = attributes[:'id']
66
93
  end
67
94
 
68
- if attributes.key?(:'subscription_id')
69
- self.subscription_id = attributes[:'subscription_id']
95
+ if attributes.key?(:'name')
96
+ self.name = attributes[:'name']
97
+ end
98
+
99
+ if attributes.key?(:'created_at')
100
+ self.created_at = attributes[:'created_at']
101
+ end
102
+
103
+ if attributes.key?(:'updated_at')
104
+ self.updated_at = attributes[:'updated_at']
105
+ end
106
+
107
+ if attributes.key?(:'app_id')
108
+ self.app_id = attributes[:'app_id']
109
+ end
110
+
111
+ if attributes.key?(:'read_only')
112
+ self.read_only = attributes[:'read_only']
113
+ end
114
+
115
+ if attributes.key?(:'is_active')
116
+ self.is_active = attributes[:'is_active']
70
117
  end
71
118
  end
72
119
 
@@ -74,22 +121,12 @@ module OneSignal
74
121
  # @return Array for valid properties with the reasons
75
122
  def list_invalid_properties
76
123
  invalid_properties = Array.new
77
- if @push_token.nil?
78
- invalid_properties.push('invalid value for "push_token", push_token cannot be nil.')
79
- end
80
-
81
- if @subscription_id.nil?
82
- invalid_properties.push('invalid value for "subscription_id", subscription_id cannot be nil.')
83
- end
84
-
85
124
  invalid_properties
86
125
  end
87
126
 
88
127
  # Check to see if the all the properties in the model are valid
89
128
  # @return true if the model is valid
90
129
  def valid?
91
- return false if @push_token.nil?
92
- return false if @subscription_id.nil?
93
130
  true
94
131
  end
95
132
 
@@ -98,8 +135,13 @@ module OneSignal
98
135
  def ==(o)
99
136
  return true if self.equal?(o)
100
137
  self.class == o.class &&
101
- push_token == o.push_token &&
102
- subscription_id == o.subscription_id
138
+ id == o.id &&
139
+ name == o.name &&
140
+ created_at == o.created_at &&
141
+ updated_at == o.updated_at &&
142
+ app_id == o.app_id &&
143
+ read_only == o.read_only &&
144
+ is_active == o.is_active
103
145
  end
104
146
 
105
147
  # @see the `==` method
@@ -111,7 +153,7 @@ module OneSignal
111
153
  # Calculates hash code according to all attributes.
112
154
  # @return [Integer] Hash code
113
155
  def hash
114
- [push_token, subscription_id].hash
156
+ [id, name, created_at, updated_at, app_id, read_only, is_active].hash
115
157
  end
116
158
 
117
159
  # Builds the object from hash
@@ -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.0
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
@@ -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.0
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
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OneSignal
17
- class SubscriptionObject
17
+ class Subscription
18
18
  attr_accessor :id
19
19
 
20
20
  attr_accessor :type
@@ -106,16 +106,16 @@ module OneSignal
106
106
  :'type' => :'String',
107
107
  :'token' => :'String',
108
108
  :'enabled' => :'Boolean',
109
- :'notification_types' => :'Float',
110
- :'session_time' => :'Float',
111
- :'session_count' => :'Float',
109
+ :'notification_types' => :'Integer',
110
+ :'session_time' => :'Integer',
111
+ :'session_count' => :'Integer',
112
112
  :'sdk' => :'String',
113
113
  :'device_model' => :'String',
114
114
  :'device_os' => :'String',
115
115
  :'rooted' => :'Boolean',
116
- :'test_type' => :'Float',
116
+ :'test_type' => :'Integer',
117
117
  :'app_version' => :'String',
118
- :'net_type' => :'Float',
118
+ :'net_type' => :'Integer',
119
119
  :'carrier' => :'String',
120
120
  :'web_auth' => :'String',
121
121
  :'web_p256' => :'String'
@@ -132,13 +132,13 @@ module OneSignal
132
132
  # @param [Hash] attributes Model attributes in the form of hash
133
133
  def initialize(attributes = {})
134
134
  if (!attributes.is_a?(Hash))
135
- fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::SubscriptionObject` initialize method"
135
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::Subscription` initialize method"
136
136
  end
137
137
 
138
138
  # check to see if the attribute exists and convert string to symbol for hash key
139
139
  attributes = attributes.each_with_object({}) { |(k, v), h|
140
140
  if (!self.class.attribute_map.key?(k.to_sym))
141
- fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::SubscriptionObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
141
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::Subscription`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
142
142
  end
143
143
  h[k.to_sym] = v
144
144
  }
@@ -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.0
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
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OneSignal
17
- class InlineResponse201
17
+ class SubscriptionBody
18
18
  attr_accessor :subscription
19
19
 
20
20
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -32,7 +32,7 @@ module OneSignal
32
32
  # Attribute type mapping.
33
33
  def self.openapi_types
34
34
  {
35
- :'subscription' => :'SubscriptionObject'
35
+ :'subscription' => :'Subscription'
36
36
  }
37
37
  end
38
38
 
@@ -46,13 +46,13 @@ module OneSignal
46
46
  # @param [Hash] attributes Model attributes in the form of hash
47
47
  def initialize(attributes = {})
48
48
  if (!attributes.is_a?(Hash))
49
- fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::InlineResponse201` initialize method"
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::SubscriptionBody` initialize method"
50
50
  end
51
51
 
52
52
  # check to see if the attribute exists and convert string to symbol for hash key
53
53
  attributes = attributes.each_with_object({}) { |(k, v), h|
54
54
  if (!self.class.attribute_map.key?(k.to_sym))
55
- fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::InlineResponse201`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::SubscriptionBody`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
56
  end
57
57
  h[k.to_sym] = v
58
58
  }
@@ -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.0
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
@@ -14,12 +14,9 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module OneSignal
17
- class PlayerNotificationTarget
18
- # Specific playerids to send your notification to. _Does not require API Auth Key. Do not combine with other targeting parameters. Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call
19
- attr_accessor :include_player_ids
20
-
21
- # Target specific devices by custom user IDs assigned via API. Not compatible with any other targeting parameters Example: [\"custom-id-assigned-by-api\"] REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call. Note: If targeting push, email, or sms subscribers with same ids, use with channel_for_external_user_ids to indicate you are sending a push or email or sms.
22
- attr_accessor :include_external_user_ids
17
+ class SubscriptionNotificationTarget
18
+ # Specific subscription ids to send your notification to. _Does not require API Auth Key._ Not compatible with any other targeting parameters. Example: [\"1dd608f2-c6a1-11e3-851d-000c2940e62c\"] Limit of 2,000 entries per REST API call
19
+ attr_accessor :include_subscription_ids
23
20
 
24
21
  # Recommended for Sending Emails - Target specific email addresses. If an email does not correspond to an existing user, a new user will be created. Example: nick@catfac.ts Limit of 2,000 entries per REST API call
25
22
  attr_accessor :include_email_tokens
@@ -27,24 +24,25 @@ module OneSignal
27
24
  # Recommended for Sending SMS - Target specific phone numbers. The phone number should be in the E.164 format. Phone number should be an existing subscriber on OneSignal. Refer our docs to learn how to add phone numbers to OneSignal. Example phone number: +1999999999 Limit of 2,000 entries per REST API call
28
25
  attr_accessor :include_phone_numbers
29
26
 
30
- # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call
27
+ # Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using iOS device tokens. Warning: Only works with Production tokens. All non-alphanumeric characters must be removed from each token. If a token does not correspond to an existing user, a new user will be created. Example: ce777617da7f548fe7a9ab6febb56cf39fba6d38203... Limit of 2,000 entries per REST API call
31
28
  attr_accessor :include_ios_tokens
32
29
 
33
- # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call
30
+ # Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Windows URIs. If a token does not correspond to an existing user, a new user will be created. Example: http://s.notify.live.net/u/1/bn1/HmQAAACPaLDr-... Limit of 2,000 entries per REST API call
34
31
  attr_accessor :include_wp_wns_uris
35
32
 
36
- # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call
33
+ # Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Amazon ADM registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: amzn1.adm-registration.v1.XpvSSUk0Rc3hTVVV... Limit of 2,000 entries per REST API call
37
34
  attr_accessor :include_amazon_reg_ids
38
35
 
39
- # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call
36
+ # Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome App registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call
40
37
  attr_accessor :include_chrome_reg_ids
41
38
 
42
- # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call
39
+ # Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Chrome Web Push registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call
43
40
  attr_accessor :include_chrome_web_reg_ids
44
41
 
45
- # Not Recommended: Please consider using include_player_ids or include_external_user_ids instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call
42
+ # Not Recommended: Please consider using include_subscription_ids or include_aliases instead. Target using Android device registration IDs. If a token does not correspond to an existing user, a new user will be created. Example: APA91bEeiUeSukAAUdnw3O2RB45FWlSpgJ7Ji_... Limit of 2,000 entries per REST API call
46
43
  attr_accessor :include_android_reg_ids
47
44
 
45
+ # Target specific users by aliases assigned via API. An alias can be an external_id, onesignal_id, or a custom alias. Accepts an object where keys are alias labels and values are arrays of alias IDs to include Example usage: { \"external_id\": [\"exId1\", \"extId2\"], \"internal_label\": [\"id1\", \"id2\"] } Not compatible with any other targeting parameters. REQUIRED: REST API Key Authentication Limit of 2,000 entries per REST API call Note: If targeting push, email, or sms subscribers with same ids, use with target_channel to indicate you are sending a push or email or sms.
48
46
  attr_accessor :include_aliases
49
47
 
50
48
  attr_accessor :target_channel
@@ -74,8 +72,7 @@ module OneSignal
74
72
  # Attribute mapping from ruby-style variable name to JSON key.
75
73
  def self.attribute_map
76
74
  {
77
- :'include_player_ids' => :'include_player_ids',
78
- :'include_external_user_ids' => :'include_external_user_ids',
75
+ :'include_subscription_ids' => :'include_subscription_ids',
79
76
  :'include_email_tokens' => :'include_email_tokens',
80
77
  :'include_phone_numbers' => :'include_phone_numbers',
81
78
  :'include_ios_tokens' => :'include_ios_tokens',
@@ -97,8 +94,7 @@ module OneSignal
97
94
  # Attribute type mapping.
98
95
  def self.openapi_types
99
96
  {
100
- :'include_player_ids' => :'Array<String>',
101
- :'include_external_user_ids' => :'Array<String>',
97
+ :'include_subscription_ids' => :'Array<String>',
102
98
  :'include_email_tokens' => :'Array<String>',
103
99
  :'include_phone_numbers' => :'Array<String>',
104
100
  :'include_ios_tokens' => :'Array<String>',
@@ -107,7 +103,7 @@ module OneSignal
107
103
  :'include_chrome_reg_ids' => :'Array<String>',
108
104
  :'include_chrome_web_reg_ids' => :'Array<String>',
109
105
  :'include_android_reg_ids' => :'Array<String>',
110
- :'include_aliases' => :'PlayerNotificationTargetIncludeAliases',
106
+ :'include_aliases' => :'Hash<String, Array<String>>',
111
107
  :'target_channel' => :'String'
112
108
  }
113
109
  end
@@ -115,8 +111,7 @@ module OneSignal
115
111
  # List of attributes with nullable: true
116
112
  def self.openapi_nullable
117
113
  Set.new([
118
- :'include_player_ids',
119
- :'include_external_user_ids',
114
+ :'include_subscription_ids',
120
115
  :'include_aliases',
121
116
  ])
122
117
  end
@@ -125,26 +120,20 @@ module OneSignal
125
120
  # @param [Hash] attributes Model attributes in the form of hash
126
121
  def initialize(attributes = {})
127
122
  if (!attributes.is_a?(Hash))
128
- fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::PlayerNotificationTarget` initialize method"
123
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::SubscriptionNotificationTarget` initialize method"
129
124
  end
130
125
 
131
126
  # check to see if the attribute exists and convert string to symbol for hash key
132
127
  attributes = attributes.each_with_object({}) { |(k, v), h|
133
128
  if (!self.class.attribute_map.key?(k.to_sym))
134
- fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::PlayerNotificationTarget`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
129
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::SubscriptionNotificationTarget`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
135
130
  end
136
131
  h[k.to_sym] = v
137
132
  }
138
133
 
139
- if attributes.key?(:'include_player_ids')
140
- if (value = attributes[:'include_player_ids']).is_a?(Array)
141
- self.include_player_ids = value
142
- end
143
- end
144
-
145
- if attributes.key?(:'include_external_user_ids')
146
- if (value = attributes[:'include_external_user_ids']).is_a?(Array)
147
- self.include_external_user_ids = value
134
+ if attributes.key?(:'include_subscription_ids')
135
+ if (value = attributes[:'include_subscription_ids']).is_a?(Array)
136
+ self.include_subscription_ids = value
148
137
  end
149
138
  end
150
139
 
@@ -197,7 +186,9 @@ module OneSignal
197
186
  end
198
187
 
199
188
  if attributes.key?(:'include_aliases')
200
- self.include_aliases = attributes[:'include_aliases']
189
+ if (value = attributes[:'include_aliases']).is_a?(Hash)
190
+ self.include_aliases = value
191
+ end
201
192
  end
202
193
 
203
194
  if attributes.key?(:'target_channel')
@@ -235,8 +226,7 @@ module OneSignal
235
226
  def ==(o)
236
227
  return true if self.equal?(o)
237
228
  self.class == o.class &&
238
- include_player_ids == o.include_player_ids &&
239
- include_external_user_ids == o.include_external_user_ids &&
229
+ include_subscription_ids == o.include_subscription_ids &&
240
230
  include_email_tokens == o.include_email_tokens &&
241
231
  include_phone_numbers == o.include_phone_numbers &&
242
232
  include_ios_tokens == o.include_ios_tokens &&
@@ -258,7 +248,7 @@ module OneSignal
258
248
  # Calculates hash code according to all attributes.
259
249
  # @return [Integer] Hash code
260
250
  def hash
261
- [include_player_ids, include_external_user_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, include_aliases, target_channel].hash
251
+ [include_subscription_ids, include_email_tokens, include_phone_numbers, include_ios_tokens, include_wp_wns_uris, include_amazon_reg_ids, include_chrome_reg_ids, include_chrome_web_reg_ids, include_android_reg_ids, include_aliases, target_channel].hash
262
252
  end
263
253
 
264
254
  # Builds the object from hash
@@ -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.0
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
@@ -32,7 +32,7 @@ module OneSignal
32
32
  # Attribute type mapping.
33
33
  def self.openapi_types
34
34
  {
35
- :'identity' => :'Hash<String, Object>'
35
+ :'identity' => :'Hash<String, String>'
36
36
  }
37
37
  end
38
38
 
@@ -68,15 +68,39 @@ module OneSignal
68
68
  # @return Array for valid properties with the reasons
69
69
  def list_invalid_properties
70
70
  invalid_properties = Array.new
71
+ if !@identity.nil? && @identity.length > 1
72
+ invalid_properties.push('invalid value for "identity", number of items must be less than or equal to 1.')
73
+ end
74
+
75
+ if !@identity.nil? && @identity.length < 1
76
+ invalid_properties.push('invalid value for "identity", number of items must be greater than or equal to 1.')
77
+ end
78
+
71
79
  invalid_properties
72
80
  end
73
81
 
74
82
  # Check to see if the all the properties in the model are valid
75
83
  # @return true if the model is valid
76
84
  def valid?
85
+ return false if !@identity.nil? && @identity.length > 1
86
+ return false if !@identity.nil? && @identity.length < 1
77
87
  true
78
88
  end
79
89
 
90
+ # Custom attribute writer method with validation
91
+ # @param [Object] identity Value to be assigned
92
+ def identity=(identity)
93
+ if !identity.nil? && identity.length > 1
94
+ fail ArgumentError, 'invalid value for "identity", number of items must be less than or equal to 1.'
95
+ end
96
+
97
+ if !identity.nil? && identity.length < 1
98
+ fail ArgumentError, 'invalid value for "identity", number of items must be greater than or equal to 1.'
99
+ end
100
+
101
+ @identity = identity
102
+ end
103
+
80
104
  # Checks equality by comparing each attribute.
81
105
  # @param [Object] Object to be compared
82
106
  def ==(o)
@@ -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.0
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
@@ -15,15 +15,29 @@ require 'time'
15
15
 
16
16
  module OneSignal
17
17
  class UpdateLiveActivityRequest
18
- # Type of live activity
18
+ # An internal name to assist with your campaign organization. This does not get displayed in the message itself.
19
19
  attr_accessor :name
20
20
 
21
21
  attr_accessor :event
22
22
 
23
+ # This must match the ContentState interface you have defined within your Live Activity in your app.
23
24
  attr_accessor :event_updates
24
25
 
25
- # Timestamp; only allowed if event is \"end\"
26
- attr_accessor :dismiss_at
26
+ attr_accessor :contents
27
+
28
+ attr_accessor :headings
29
+
30
+ # Sound file that is included in your app to play instead of the default device notification sound. Omit to disable vibration and sound for the notification.
31
+ attr_accessor :sound
32
+
33
+ # Accepts Unix timestamp in seconds. When time reaches the configured stale date, the system considers the Live Activity out of date, and the ActivityState of the Live Activity changes to ActivityState.stale.
34
+ attr_accessor :stale_date
35
+
36
+ # Accepts Unix timestamp in seconds; only allowed if event is \"end\"
37
+ attr_accessor :dismissal_date
38
+
39
+ # Delivery priority through the the push provider (APNs). Pass 10 for higher priority notifications, or 5 for lower priority notifications. Lower priority notifications are sent based on the power considerations of the end user's device. If not set, defaults to 10. Some providers (APNs) allow for a limited budget of high priority notifications per hour, and if that budget is exceeded, the provider may throttle notification delivery.
40
+ attr_accessor :priority
27
41
 
28
42
  class EnumAttributeValidator
29
43
  attr_reader :datatype
@@ -53,7 +67,12 @@ module OneSignal
53
67
  :'name' => :'name',
54
68
  :'event' => :'event',
55
69
  :'event_updates' => :'event_updates',
56
- :'dismiss_at' => :'dismiss_at'
70
+ :'contents' => :'contents',
71
+ :'headings' => :'headings',
72
+ :'sound' => :'sound',
73
+ :'stale_date' => :'stale_date',
74
+ :'dismissal_date' => :'dismissal_date',
75
+ :'priority' => :'priority'
57
76
  }
58
77
  end
59
78
 
@@ -68,7 +87,12 @@ module OneSignal
68
87
  :'name' => :'String',
69
88
  :'event' => :'String',
70
89
  :'event_updates' => :'Object',
71
- :'dismiss_at' => :'Float'
90
+ :'contents' => :'LanguageStringMap',
91
+ :'headings' => :'LanguageStringMap',
92
+ :'sound' => :'String',
93
+ :'stale_date' => :'Integer',
94
+ :'dismissal_date' => :'Integer',
95
+ :'priority' => :'Integer'
72
96
  }
73
97
  end
74
98
 
@@ -105,8 +129,28 @@ module OneSignal
105
129
  self.event_updates = attributes[:'event_updates']
106
130
  end
107
131
 
108
- if attributes.key?(:'dismiss_at')
109
- self.dismiss_at = attributes[:'dismiss_at']
132
+ if attributes.key?(:'contents')
133
+ self.contents = attributes[:'contents']
134
+ end
135
+
136
+ if attributes.key?(:'headings')
137
+ self.headings = attributes[:'headings']
138
+ end
139
+
140
+ if attributes.key?(:'sound')
141
+ self.sound = attributes[:'sound']
142
+ end
143
+
144
+ if attributes.key?(:'stale_date')
145
+ self.stale_date = attributes[:'stale_date']
146
+ end
147
+
148
+ if attributes.key?(:'dismissal_date')
149
+ self.dismissal_date = attributes[:'dismissal_date']
150
+ end
151
+
152
+ if attributes.key?(:'priority')
153
+ self.priority = attributes[:'priority']
110
154
  end
111
155
  end
112
156
 
@@ -133,8 +177,6 @@ module OneSignal
133
177
  # @return true if the model is valid
134
178
  def valid?
135
179
  return false if @name.nil?
136
- name_validator = EnumAttributeValidator.new('String', ["headings", "contents", "ios_sound", "priority_level"])
137
- return false unless name_validator.valid?(@name)
138
180
  return false if @event.nil?
139
181
  event_validator = EnumAttributeValidator.new('String', ["update", "end"])
140
182
  return false unless event_validator.valid?(@event)
@@ -142,16 +184,6 @@ module OneSignal
142
184
  true
143
185
  end
144
186
 
145
- # Custom attribute writer method checking allowed values (enum).
146
- # @param [Object] name Object to be assigned
147
- def name=(name)
148
- validator = EnumAttributeValidator.new('String', ["headings", "contents", "ios_sound", "priority_level"])
149
- unless validator.valid?(name)
150
- fail ArgumentError, "invalid value for \"name\", must be one of #{validator.allowable_values}."
151
- end
152
- @name = name
153
- end
154
-
155
187
  # Custom attribute writer method checking allowed values (enum).
156
188
  # @param [Object] event Object to be assigned
157
189
  def event=(event)
@@ -170,7 +202,12 @@ module OneSignal
170
202
  name == o.name &&
171
203
  event == o.event &&
172
204
  event_updates == o.event_updates &&
173
- dismiss_at == o.dismiss_at
205
+ contents == o.contents &&
206
+ headings == o.headings &&
207
+ sound == o.sound &&
208
+ stale_date == o.stale_date &&
209
+ dismissal_date == o.dismissal_date &&
210
+ priority == o.priority
174
211
  end
175
212
 
176
213
  # @see the `==` method
@@ -182,7 +219,7 @@ module OneSignal
182
219
  # Calculates hash code according to all attributes.
183
220
  # @return [Integer] Hash code
184
221
  def hash
185
- [name, event, event_updates, dismiss_at].hash
222
+ [name, event, event_updates, contents, headings, sound, stale_date, dismissal_date, priority].hash
186
223
  end
187
224
 
188
225
  # Builds the object from hash