onesignal 5.10.0 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +2 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +3 -3
  5. data/docs/AuditLogActor.md +26 -0
  6. data/docs/AuditLogContext.md +24 -0
  7. data/docs/AuditLogEvent.md +36 -0
  8. data/docs/AuditLogTarget.md +24 -0
  9. data/docs/DefaultApi.md +267 -0
  10. data/docs/GetSegmentSuccessResponse.md +20 -0
  11. data/docs/ListAuditLogsSuccessResponse.md +22 -0
  12. data/docs/SegmentDetails.md +28 -0
  13. data/docs/UpdateSegmentRequest.md +22 -0
  14. data/docs/UpdateSegmentSuccessResponse.md +20 -0
  15. data/lib/onesignal/api/default_api.rb +273 -1
  16. data/lib/onesignal/api_client.rb +2 -2
  17. data/lib/onesignal/api_error.rb +1 -1
  18. data/lib/onesignal/configuration.rb +1 -1
  19. data/lib/onesignal/models/api_key_token.rb +1 -1
  20. data/lib/onesignal/models/api_key_tokens_list_response.rb +1 -1
  21. data/lib/onesignal/models/app.rb +1 -1
  22. data/lib/onesignal/models/audit_log_actor.rb +261 -0
  23. data/lib/onesignal/models/audit_log_context.rb +251 -0
  24. data/lib/onesignal/models/audit_log_event.rb +310 -0
  25. data/lib/onesignal/models/audit_log_target.rb +251 -0
  26. data/lib/onesignal/models/basic_notification.rb +1 -1
  27. data/lib/onesignal/models/basic_notification_all_of.rb +1 -1
  28. data/lib/onesignal/models/basic_notification_all_of_android_background_layout.rb +1 -1
  29. data/lib/onesignal/models/button.rb +1 -1
  30. data/lib/onesignal/models/copy_template_request.rb +1 -1
  31. data/lib/onesignal/models/create_api_key_request.rb +1 -1
  32. data/lib/onesignal/models/create_api_key_response.rb +1 -1
  33. data/lib/onesignal/models/create_notification_success_response.rb +1 -1
  34. data/lib/onesignal/models/create_segment_conflict_response.rb +1 -1
  35. data/lib/onesignal/models/create_segment_success_response.rb +1 -1
  36. data/lib/onesignal/models/create_template_request.rb +1 -1
  37. data/lib/onesignal/models/create_user_conflict_response.rb +1 -1
  38. data/lib/onesignal/models/create_user_conflict_response_errors_inner.rb +1 -1
  39. data/lib/onesignal/models/create_user_conflict_response_errors_items_meta.rb +1 -1
  40. data/lib/onesignal/models/custom_event.rb +1 -1
  41. data/lib/onesignal/models/custom_events_request.rb +1 -1
  42. data/lib/onesignal/models/delivery_data.rb +1 -1
  43. data/lib/onesignal/models/export_events_success_response.rb +1 -1
  44. data/lib/onesignal/models/export_subscriptions_request_body.rb +1 -1
  45. data/lib/onesignal/models/export_subscriptions_success_response.rb +1 -1
  46. data/lib/onesignal/models/filter.rb +1 -1
  47. data/lib/onesignal/models/filter_expression.rb +1 -1
  48. data/lib/onesignal/models/generic_error.rb +1 -1
  49. data/lib/onesignal/models/generic_success_bool_response.rb +1 -1
  50. data/lib/onesignal/models/get_notification_history_request_body.rb +1 -1
  51. data/lib/onesignal/models/get_segment_success_response.rb +229 -0
  52. data/lib/onesignal/models/get_segments_success_response.rb +1 -1
  53. data/lib/onesignal/models/language_string_map.rb +1 -1
  54. data/lib/onesignal/models/list_audit_logs_success_response.rb +242 -0
  55. data/lib/onesignal/models/notification.rb +1 -1
  56. data/lib/onesignal/models/notification_all_of.rb +1 -1
  57. data/lib/onesignal/models/notification_history_success_response.rb +1 -1
  58. data/lib/onesignal/models/notification_slice.rb +1 -1
  59. data/lib/onesignal/models/notification_target.rb +1 -1
  60. data/lib/onesignal/models/notification_with_meta.rb +1 -1
  61. data/lib/onesignal/models/notification_with_meta_all_of.rb +1 -1
  62. data/lib/onesignal/models/operator.rb +1 -1
  63. data/lib/onesignal/models/outcome_data.rb +1 -1
  64. data/lib/onesignal/models/outcomes_data.rb +1 -1
  65. data/lib/onesignal/models/platform_delivery_data.rb +1 -1
  66. data/lib/onesignal/models/platform_delivery_data_email_all_of.rb +1 -1
  67. data/lib/onesignal/models/platform_delivery_data_sms_all_of.rb +1 -1
  68. data/lib/onesignal/models/properties_body.rb +1 -1
  69. data/lib/onesignal/models/properties_deltas.rb +1 -1
  70. data/lib/onesignal/models/properties_object.rb +1 -1
  71. data/lib/onesignal/models/purchase.rb +1 -1
  72. data/lib/onesignal/models/rate_limit_error.rb +1 -1
  73. data/lib/onesignal/models/segment.rb +1 -1
  74. data/lib/onesignal/models/segment_data.rb +1 -1
  75. data/lib/onesignal/models/segment_details.rb +308 -0
  76. data/lib/onesignal/models/segment_notification_target.rb +1 -1
  77. data/lib/onesignal/models/start_live_activity_request.rb +1 -1
  78. data/lib/onesignal/models/start_live_activity_success_response.rb +1 -1
  79. data/lib/onesignal/models/subscription.rb +1 -1
  80. data/lib/onesignal/models/subscription_body.rb +1 -1
  81. data/lib/onesignal/models/subscription_notification_target.rb +1 -1
  82. data/lib/onesignal/models/template_resource.rb +1 -1
  83. data/lib/onesignal/models/templates_list_response.rb +1 -1
  84. data/lib/onesignal/models/transfer_subscription_request_body.rb +1 -1
  85. data/lib/onesignal/models/update_api_key_request.rb +1 -1
  86. data/lib/onesignal/models/update_live_activity_request.rb +1 -1
  87. data/lib/onesignal/models/update_live_activity_success_response.rb +1 -1
  88. data/lib/onesignal/models/update_segment_request.rb +281 -0
  89. data/lib/onesignal/models/update_segment_success_response.rb +230 -0
  90. data/lib/onesignal/models/update_template_request.rb +1 -1
  91. data/lib/onesignal/models/update_user_request.rb +1 -1
  92. data/lib/onesignal/models/user.rb +1 -1
  93. data/lib/onesignal/models/user_identity_body.rb +1 -1
  94. data/lib/onesignal/models/web_button.rb +1 -1
  95. data/lib/onesignal/version.rb +2 -2
  96. data/lib/onesignal.rb +10 -1
  97. data/onesignal.gemspec +1 -1
  98. data/spec/api/default_api_spec.rb +52 -1
  99. data/spec/api_client_spec.rb +1 -1
  100. data/spec/configuration_spec.rb +1 -1
  101. data/spec/models/api_key_token_spec.rb +1 -1
  102. data/spec/models/api_key_tokens_list_response_spec.rb +1 -1
  103. data/spec/models/app_spec.rb +1 -1
  104. data/spec/models/audit_log_actor_spec.rb +58 -0
  105. data/spec/models/audit_log_context_spec.rb +52 -0
  106. data/spec/models/audit_log_event_spec.rb +88 -0
  107. data/spec/models/audit_log_target_spec.rb +52 -0
  108. data/spec/models/basic_notification_all_of_android_background_layout_spec.rb +1 -1
  109. data/spec/models/basic_notification_all_of_spec.rb +1 -1
  110. data/spec/models/basic_notification_spec.rb +1 -1
  111. data/spec/models/button_spec.rb +1 -1
  112. data/spec/models/copy_template_request_spec.rb +1 -1
  113. data/spec/models/create_api_key_request_spec.rb +1 -1
  114. data/spec/models/create_api_key_response_spec.rb +1 -1
  115. data/spec/models/create_notification_success_response_spec.rb +1 -1
  116. data/spec/models/create_segment_conflict_response_spec.rb +1 -1
  117. data/spec/models/create_segment_success_response_spec.rb +1 -1
  118. data/spec/models/create_template_request_spec.rb +1 -1
  119. data/spec/models/create_user_conflict_response_errors_inner_spec.rb +1 -1
  120. data/spec/models/create_user_conflict_response_errors_items_meta_spec.rb +1 -1
  121. data/spec/models/create_user_conflict_response_spec.rb +1 -1
  122. data/spec/models/custom_event_spec.rb +1 -1
  123. data/spec/models/custom_events_request_spec.rb +1 -1
  124. data/spec/models/delivery_data_spec.rb +1 -1
  125. data/spec/models/export_events_success_response_spec.rb +1 -1
  126. data/spec/models/export_subscriptions_request_body_spec.rb +1 -1
  127. data/spec/models/export_subscriptions_success_response_spec.rb +1 -1
  128. data/spec/models/filter_expression_spec.rb +1 -1
  129. data/spec/models/filter_spec.rb +1 -1
  130. data/spec/models/generic_error_spec.rb +1 -1
  131. data/spec/models/generic_success_bool_response_spec.rb +1 -1
  132. data/spec/models/get_notification_history_request_body_spec.rb +1 -1
  133. data/spec/models/get_segment_success_response_spec.rb +40 -0
  134. data/spec/models/get_segments_success_response_spec.rb +1 -1
  135. data/spec/models/language_string_map_spec.rb +1 -1
  136. data/spec/models/list_audit_logs_success_response_spec.rb +46 -0
  137. data/spec/models/notification_all_of_spec.rb +1 -1
  138. data/spec/models/notification_history_success_response_spec.rb +1 -1
  139. data/spec/models/notification_slice_spec.rb +1 -1
  140. data/spec/models/notification_spec.rb +1 -1
  141. data/spec/models/notification_target_spec.rb +1 -1
  142. data/spec/models/notification_with_meta_all_of_spec.rb +1 -1
  143. data/spec/models/notification_with_meta_spec.rb +1 -1
  144. data/spec/models/operator_spec.rb +1 -1
  145. data/spec/models/outcome_data_spec.rb +1 -1
  146. data/spec/models/outcomes_data_spec.rb +1 -1
  147. data/spec/models/platform_delivery_data_email_all_of_spec.rb +1 -1
  148. data/spec/models/platform_delivery_data_sms_all_of_spec.rb +1 -1
  149. data/spec/models/platform_delivery_data_spec.rb +1 -1
  150. data/spec/models/properties_body_spec.rb +1 -1
  151. data/spec/models/properties_deltas_spec.rb +1 -1
  152. data/spec/models/properties_object_spec.rb +1 -1
  153. data/spec/models/purchase_spec.rb +1 -1
  154. data/spec/models/rate_limit_error_spec.rb +1 -1
  155. data/spec/models/segment_data_spec.rb +1 -1
  156. data/spec/models/segment_details_spec.rb +68 -0
  157. data/spec/models/segment_notification_target_spec.rb +1 -1
  158. data/spec/models/segment_spec.rb +1 -1
  159. data/spec/models/start_live_activity_request_spec.rb +1 -1
  160. data/spec/models/start_live_activity_success_response_spec.rb +1 -1
  161. data/spec/models/subscription_body_spec.rb +1 -1
  162. data/spec/models/subscription_notification_target_spec.rb +1 -1
  163. data/spec/models/subscription_spec.rb +1 -1
  164. data/spec/models/template_resource_spec.rb +1 -1
  165. data/spec/models/templates_list_response_spec.rb +1 -1
  166. data/spec/models/transfer_subscription_request_body_spec.rb +1 -1
  167. data/spec/models/update_api_key_request_spec.rb +1 -1
  168. data/spec/models/update_live_activity_request_spec.rb +1 -1
  169. data/spec/models/update_live_activity_success_response_spec.rb +1 -1
  170. data/spec/models/update_segment_request_spec.rb +46 -0
  171. data/spec/models/update_segment_success_response_spec.rb +40 -0
  172. data/spec/models/update_template_request_spec.rb +1 -1
  173. data/spec/models/update_user_request_spec.rb +1 -1
  174. data/spec/models/user_identity_body_spec.rb +1 -1
  175. data/spec/models/user_spec.rb +1 -1
  176. data/spec/models/web_button_spec.rb +1 -1
  177. data/spec/spec_helper.rb +1 -1
  178. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
  179. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
  180. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/gem_make.out +5 -5
  181. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.8.2/mkmf.log +3 -3
  182. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
  183. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.4.0/gem_make.out +5 -5
  184. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
  185. data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
  186. metadata +94 -58
@@ -0,0 +1,281 @@
1
+ =begin
2
+ #OneSignal
3
+
4
+ #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5
+
6
+ The version of the OpenAPI document: 5.11.0
7
+ Contact: devrel@onesignal.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OneSignal
17
+ class UpdateSegmentRequest
18
+ # Required. The segment name. Maximum 128 characters.
19
+ attr_accessor :name
20
+
21
+ # Optional human-readable description for the segment. Maximum 255 characters. Pass an empty string to clear; omit to leave unchanged.
22
+ attr_accessor :description
23
+
24
+ # Optional. When provided, replaces all existing filters. Filters define the segment based on user properties like tags, activity, or location using flexible AND/OR logic. Limited to 200 total entries, including fields and OR operators.
25
+ attr_accessor :filters
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'name' => :'name',
31
+ :'description' => :'description',
32
+ :'filters' => :'filters'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'name' => :'String',
45
+ :'description' => :'String',
46
+ :'filters' => :'Array<FilterExpression>'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::UpdateSegmentRequest` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::UpdateSegmentRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'name')
72
+ self.name = attributes[:'name']
73
+ end
74
+
75
+ if attributes.key?(:'description')
76
+ self.description = attributes[:'description']
77
+ end
78
+
79
+ if attributes.key?(:'filters')
80
+ if (value = attributes[:'filters']).is_a?(Array)
81
+ self.filters = value
82
+ end
83
+ end
84
+ end
85
+
86
+ # Show invalid properties with the reasons. Usually used together with valid?
87
+ # @return Array for valid properties with the reasons
88
+ def list_invalid_properties
89
+ invalid_properties = Array.new
90
+ if @name.nil?
91
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
92
+ end
93
+
94
+ if @name.to_s.length > 128
95
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 128.')
96
+ end
97
+
98
+ if !@description.nil? && @description.to_s.length > 255
99
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 255.')
100
+ end
101
+
102
+ invalid_properties
103
+ end
104
+
105
+ # Check to see if the all the properties in the model are valid
106
+ # @return true if the model is valid
107
+ def valid?
108
+ return false if @name.nil?
109
+ return false if @name.to_s.length > 128
110
+ return false if !@description.nil? && @description.to_s.length > 255
111
+ true
112
+ end
113
+
114
+ # Custom attribute writer method with validation
115
+ # @param [Object] name Value to be assigned
116
+ def name=(name)
117
+ if name.nil?
118
+ fail ArgumentError, 'name cannot be nil'
119
+ end
120
+
121
+ if name.to_s.length > 128
122
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 128.'
123
+ end
124
+
125
+ @name = name
126
+ end
127
+
128
+ # Custom attribute writer method with validation
129
+ # @param [Object] description Value to be assigned
130
+ def description=(description)
131
+ if !description.nil? && description.to_s.length > 255
132
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 255.'
133
+ end
134
+
135
+ @description = description
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ name == o.name &&
144
+ description == o.description &&
145
+ filters == o.filters
146
+ end
147
+
148
+ # @see the `==` method
149
+ # @param [Object] Object to be compared
150
+ def eql?(o)
151
+ self == o
152
+ end
153
+
154
+ # Calculates hash code according to all attributes.
155
+ # @return [Integer] Hash code
156
+ def hash
157
+ [name, description, filters].hash
158
+ end
159
+
160
+ # Builds the object from hash
161
+ # @param [Hash] attributes Model attributes in the form of hash
162
+ # @return [Object] Returns the model itself
163
+ def self.build_from_hash(attributes)
164
+ new.build_from_hash(attributes)
165
+ end
166
+
167
+ # Builds the object from hash
168
+ # @param [Hash] attributes Model attributes in the form of hash
169
+ # @return [Object] Returns the model itself
170
+ def build_from_hash(attributes)
171
+ return nil unless attributes.is_a?(Hash)
172
+ attributes = attributes.transform_keys(&:to_sym)
173
+ self.class.openapi_types.each_pair do |key, type|
174
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
175
+ self.send("#{key}=", nil)
176
+ elsif type =~ /\AArray<(.*)>/i
177
+ # check to ensure the input is an array given that the attribute
178
+ # is documented as an array but the input is not
179
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
180
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
181
+ end
182
+ elsif !attributes[self.class.attribute_map[key]].nil?
183
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
184
+ end
185
+ end
186
+
187
+ self
188
+ end
189
+
190
+ # Deserializes the data based on type
191
+ # @param string type Data type
192
+ # @param string value Value to be deserialized
193
+ # @return [Object] Deserialized data
194
+ def _deserialize(type, value)
195
+ case type.to_sym
196
+ when :Time
197
+ Time.parse(value)
198
+ when :Date
199
+ Date.parse(value)
200
+ when :String
201
+ value.to_s
202
+ when :Integer
203
+ value.to_i
204
+ when :Float
205
+ value.to_f
206
+ when :Boolean
207
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
208
+ true
209
+ else
210
+ false
211
+ end
212
+ when :Object
213
+ # generic object (usually a Hash), return directly
214
+ value
215
+ when /\AArray<(?<inner_type>.+)>\z/
216
+ inner_type = Regexp.last_match[:inner_type]
217
+ value.map { |v| _deserialize(inner_type, v) }
218
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
219
+ k_type = Regexp.last_match[:k_type]
220
+ v_type = Regexp.last_match[:v_type]
221
+ {}.tap do |hash|
222
+ value.each do |k, v|
223
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
224
+ end
225
+ end
226
+ else # model
227
+ # models (e.g. Pet) or oneOf
228
+ klass = OneSignal.const_get(type)
229
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
230
+ end
231
+ end
232
+
233
+ # Returns the string representation of the object
234
+ # @return [String] String presentation of the object
235
+ def to_s
236
+ to_hash.to_s
237
+ end
238
+
239
+ # to_body is an alias to to_hash (backward compatibility)
240
+ # @return [Hash] Returns the object in the form of hash
241
+ def to_body
242
+ to_hash
243
+ end
244
+
245
+ # Returns the object in the form of hash
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_hash
248
+ hash = {}
249
+ self.class.attribute_map.each_pair do |attr, param|
250
+ value = self.send(attr)
251
+ if value.nil?
252
+ is_nullable = self.class.openapi_nullable.include?(attr)
253
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
254
+ end
255
+
256
+ hash[param] = _to_hash(value)
257
+ end
258
+ hash
259
+ end
260
+
261
+ # Outputs non-array value in the form of hash
262
+ # For object, use to_hash. Otherwise, just return the value
263
+ # @param [Object] value Any valid value
264
+ # @return [Hash] Returns the value in the form of hash
265
+ def _to_hash(value)
266
+ if value.is_a?(Array)
267
+ value.compact.map { |v| _to_hash(v) }
268
+ elsif value.is_a?(Hash)
269
+ {}.tap do |hash|
270
+ value.each { |k, v| hash[k] = _to_hash(v) }
271
+ end
272
+ elsif value.respond_to? :to_hash
273
+ value.to_hash
274
+ else
275
+ value
276
+ end
277
+ end
278
+
279
+ end
280
+
281
+ end
@@ -0,0 +1,230 @@
1
+ =begin
2
+ #OneSignal
3
+
4
+ #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
5
+
6
+ The version of the OpenAPI document: 5.11.0
7
+ Contact: devrel@onesignal.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module OneSignal
17
+ class UpdateSegmentSuccessResponse
18
+ # true if the segment was updated successfully, false otherwise.
19
+ attr_accessor :success
20
+
21
+ # UUID of the updated segment.
22
+ attr_accessor :id
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'success' => :'success',
28
+ :'id' => :'id'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'success' => :'Boolean',
41
+ :'id' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::UpdateSegmentSuccessResponse` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::UpdateSegmentSuccessResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'success')
67
+ self.success = attributes[:'success']
68
+ end
69
+
70
+ if attributes.key?(:'id')
71
+ self.id = attributes[:'id']
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ invalid_properties = Array.new
79
+ invalid_properties
80
+ end
81
+
82
+ # Check to see if the all the properties in the model are valid
83
+ # @return true if the model is valid
84
+ def valid?
85
+ true
86
+ end
87
+
88
+ # Checks equality by comparing each attribute.
89
+ # @param [Object] Object to be compared
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ success == o.success &&
94
+ id == o.id
95
+ end
96
+
97
+ # @see the `==` method
98
+ # @param [Object] Object to be compared
99
+ def eql?(o)
100
+ self == o
101
+ end
102
+
103
+ # Calculates hash code according to all attributes.
104
+ # @return [Integer] Hash code
105
+ def hash
106
+ [success, id].hash
107
+ end
108
+
109
+ # Builds the object from hash
110
+ # @param [Hash] attributes Model attributes in the form of hash
111
+ # @return [Object] Returns the model itself
112
+ def self.build_from_hash(attributes)
113
+ new.build_from_hash(attributes)
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+ attributes = attributes.transform_keys(&:to_sym)
122
+ self.class.openapi_types.each_pair do |key, type|
123
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
124
+ self.send("#{key}=", nil)
125
+ elsif type =~ /\AArray<(.*)>/i
126
+ # check to ensure the input is an array given that the attribute
127
+ # is documented as an array but the input is not
128
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
129
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
130
+ end
131
+ elsif !attributes[self.class.attribute_map[key]].nil?
132
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
133
+ end
134
+ end
135
+
136
+ self
137
+ end
138
+
139
+ # Deserializes the data based on type
140
+ # @param string type Data type
141
+ # @param string value Value to be deserialized
142
+ # @return [Object] Deserialized data
143
+ def _deserialize(type, value)
144
+ case type.to_sym
145
+ when :Time
146
+ Time.parse(value)
147
+ when :Date
148
+ Date.parse(value)
149
+ when :String
150
+ value.to_s
151
+ when :Integer
152
+ value.to_i
153
+ when :Float
154
+ value.to_f
155
+ when :Boolean
156
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
157
+ true
158
+ else
159
+ false
160
+ end
161
+ when :Object
162
+ # generic object (usually a Hash), return directly
163
+ value
164
+ when /\AArray<(?<inner_type>.+)>\z/
165
+ inner_type = Regexp.last_match[:inner_type]
166
+ value.map { |v| _deserialize(inner_type, v) }
167
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
168
+ k_type = Regexp.last_match[:k_type]
169
+ v_type = Regexp.last_match[:v_type]
170
+ {}.tap do |hash|
171
+ value.each do |k, v|
172
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
173
+ end
174
+ end
175
+ else # model
176
+ # models (e.g. Pet) or oneOf
177
+ klass = OneSignal.const_get(type)
178
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
179
+ end
180
+ end
181
+
182
+ # Returns the string representation of the object
183
+ # @return [String] String presentation of the object
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_hash (backward compatibility)
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_body
191
+ to_hash
192
+ end
193
+
194
+ # Returns the object in the form of hash
195
+ # @return [Hash] Returns the object in the form of hash
196
+ def to_hash
197
+ hash = {}
198
+ self.class.attribute_map.each_pair do |attr, param|
199
+ value = self.send(attr)
200
+ if value.nil?
201
+ is_nullable = self.class.openapi_nullable.include?(attr)
202
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
203
+ end
204
+
205
+ hash[param] = _to_hash(value)
206
+ end
207
+ hash
208
+ end
209
+
210
+ # Outputs non-array value in the form of hash
211
+ # For object, use to_hash. Otherwise, just return the value
212
+ # @param [Object] value Any valid value
213
+ # @return [Hash] Returns the value in the form of hash
214
+ def _to_hash(value)
215
+ if value.is_a?(Array)
216
+ value.compact.map { |v| _to_hash(v) }
217
+ elsif value.is_a?(Hash)
218
+ {}.tap do |hash|
219
+ value.each { |k, v| hash[k] = _to_hash(v) }
220
+ end
221
+ elsif value.respond_to? :to_hash
222
+ value.to_hash
223
+ else
224
+ value
225
+ end
226
+ end
227
+
228
+ end
229
+
230
+ end
@@ -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: 5.10.0
6
+ The version of the OpenAPI document: 5.11.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: 5.10.0
6
+ The version of the OpenAPI document: 5.11.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: 5.10.0
6
+ The version of the OpenAPI document: 5.11.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: 5.10.0
6
+ The version of the OpenAPI document: 5.11.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: 5.10.0
6
+ The version of the OpenAPI document: 5.11.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: 5.10.0
6
+ The version of the OpenAPI document: 5.11.0
7
7
  Contact: devrel@onesignal.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 6.0.0-SNAPSHOT
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.0-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module OneSignal
14
- VERSION = '5.10.0'
14
+ VERSION = '5.11.0'
15
15
  end
data/lib/onesignal.rb CHANGED
@@ -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: 5.10.0
6
+ The version of the OpenAPI document: 5.11.0
7
7
  Contact: devrel@onesignal.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 6.0.0-SNAPSHOT
@@ -21,6 +21,10 @@ require 'onesignal/helpers'
21
21
  require 'onesignal/models/api_key_token'
22
22
  require 'onesignal/models/api_key_tokens_list_response'
23
23
  require 'onesignal/models/app'
24
+ require 'onesignal/models/audit_log_actor'
25
+ require 'onesignal/models/audit_log_context'
26
+ require 'onesignal/models/audit_log_event'
27
+ require 'onesignal/models/audit_log_target'
24
28
  require 'onesignal/models/basic_notification'
25
29
  require 'onesignal/models/basic_notification_all_of'
26
30
  require 'onesignal/models/basic_notification_all_of_android_background_layout'
@@ -46,8 +50,10 @@ require 'onesignal/models/filter_expression'
46
50
  require 'onesignal/models/generic_error'
47
51
  require 'onesignal/models/generic_success_bool_response'
48
52
  require 'onesignal/models/get_notification_history_request_body'
53
+ require 'onesignal/models/get_segment_success_response'
49
54
  require 'onesignal/models/get_segments_success_response'
50
55
  require 'onesignal/models/language_string_map'
56
+ require 'onesignal/models/list_audit_logs_success_response'
51
57
  require 'onesignal/models/notification'
52
58
  require 'onesignal/models/notification_all_of'
53
59
  require 'onesignal/models/notification_history_success_response'
@@ -68,6 +74,7 @@ require 'onesignal/models/purchase'
68
74
  require 'onesignal/models/rate_limit_error'
69
75
  require 'onesignal/models/segment'
70
76
  require 'onesignal/models/segment_data'
77
+ require 'onesignal/models/segment_details'
71
78
  require 'onesignal/models/segment_notification_target'
72
79
  require 'onesignal/models/start_live_activity_request'
73
80
  require 'onesignal/models/start_live_activity_success_response'
@@ -80,6 +87,8 @@ require 'onesignal/models/transfer_subscription_request_body'
80
87
  require 'onesignal/models/update_api_key_request'
81
88
  require 'onesignal/models/update_live_activity_request'
82
89
  require 'onesignal/models/update_live_activity_success_response'
90
+ require 'onesignal/models/update_segment_request'
91
+ require 'onesignal/models/update_segment_success_response'
83
92
  require 'onesignal/models/update_template_request'
84
93
  require 'onesignal/models/update_user_request'
85
94
  require 'onesignal/models/user'
data/onesignal.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  #A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
7
7
 
8
- The version of the OpenAPI document: 5.10.0
8
+ The version of the OpenAPI document: 5.11.0
9
9
  Contact: devrel@onesignal.com
10
10
  Generated by: https://openapi-generator.tech
11
11
  OpenAPI Generator version: 6.0.0-SNAPSHOT