onesignal 5.13.0 → 5.15.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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +3 -3
  5. data/docs/BasicNotification.md +6 -2
  6. data/docs/BasicNotificationAllOf.md +5 -1
  7. data/docs/DefaultApi.md +77 -0
  8. data/docs/EmailWarmUp.md +24 -0
  9. data/docs/EmailWarmUpRequest.md +20 -0
  10. data/docs/EmailWarmUpStage.md +24 -0
  11. data/docs/EstimateNotificationRecipientsRequest.md +28 -0
  12. data/docs/EstimateNotificationRecipientsRequestAllOf.md +24 -0
  13. data/docs/EstimateNotificationRecipientsSuccessResponse.md +26 -0
  14. data/docs/Notification.md +6 -2
  15. data/docs/NotificationTarget.md +1 -1
  16. data/docs/NotificationWithMeta.md +6 -2
  17. data/docs/NotificationWithMetaAllOf.md +3 -1
  18. data/docs/SegmentNotificationTarget.md +1 -1
  19. data/lib/onesignal/api/default_api.rb +68 -0
  20. data/lib/onesignal/api_client.rb +1 -1
  21. data/lib/onesignal/models/basic_notification.rb +36 -3
  22. data/lib/onesignal/models/basic_notification_all_of.rb +35 -2
  23. data/lib/onesignal/models/email_warm_up.rb +298 -0
  24. data/lib/onesignal/models/email_warm_up_request.rb +272 -0
  25. data/lib/onesignal/models/email_warm_up_stage.rb +284 -0
  26. data/lib/onesignal/models/estimate_notification_recipients_request.rb +326 -0
  27. data/lib/onesignal/models/estimate_notification_recipients_request_all_of.rb +288 -0
  28. data/lib/onesignal/models/estimate_notification_recipients_success_response.rb +260 -0
  29. data/lib/onesignal/models/notification.rb +36 -3
  30. data/lib/onesignal/models/notification_target.rb +1 -1
  31. data/lib/onesignal/models/notification_with_meta.rb +35 -3
  32. data/lib/onesignal/models/notification_with_meta_all_of.rb +14 -5
  33. data/lib/onesignal/models/segment_notification_target.rb +1 -1
  34. data/lib/onesignal/version.rb +1 -1
  35. data/lib/onesignal.rb +6 -0
  36. data/spec/api/default_api_spec.rb +12 -0
  37. data/spec/models/basic_notification_all_of_spec.rb +16 -0
  38. data/spec/models/basic_notification_spec.rb +16 -0
  39. data/spec/models/email_warm_up_request_spec.rb +43 -0
  40. data/spec/models/email_warm_up_spec.rb +59 -0
  41. data/spec/models/email_warm_up_stage_spec.rb +51 -0
  42. data/spec/models/estimate_notification_recipients_request_all_of_spec.rb +55 -0
  43. data/spec/models/estimate_notification_recipients_request_spec.rb +67 -0
  44. data/spec/models/estimate_notification_recipients_success_response_spec.rb +57 -0
  45. data/spec/models/notification_spec.rb +16 -0
  46. data/spec/models/notification_with_meta_all_of_spec.rb +6 -0
  47. data/spec/models/notification_with_meta_spec.rb +16 -0
  48. metadata +26 -2
@@ -0,0 +1,260 @@
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
+ Contact: devrel@onesignal.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 6.0.0-SNAPSHOT
9
+
10
+ =end
11
+
12
+ require 'date'
13
+ require 'time'
14
+
15
+ module OneSignal
16
+ class EstimateNotificationRecipientsSuccessResponse
17
+ # The estimated audience size based on the user targeting method you've set on the message, and the specific platforms the message is targeted to send to.
18
+ attr_accessor :count
19
+
20
+ # The estimated audience size before the plan's web push subscriber cap is applied. Present only when `cap_applied` is `true`; `null` otherwise.
21
+ attr_accessor :uncapped_count
22
+
23
+ # Whether `count` was reduced because the app is on a plan that caps the number of web push subscribers it can send to.
24
+ attr_accessor :cap_applied
25
+
26
+ # The mobile equivalent of `cap_applied`. Whether mobile push deliveries will be dropped for this send because the org is over its plan's mobile push subscriber cap. `false` when the notification doesn't target any mobile push platforms.
27
+ attr_accessor :mobile_suppressed
28
+
29
+ # How many mobile push recipients the `count` excludes due to the plan's mobile push subscriber cap. `0` when `mobile_suppressed` is `false`.
30
+ attr_accessor :mobile_excluded_count
31
+
32
+ # Attribute mapping from ruby-style variable name to JSON key.
33
+ def self.attribute_map
34
+ {
35
+ :'count' => :'count',
36
+ :'uncapped_count' => :'uncapped_count',
37
+ :'cap_applied' => :'cap_applied',
38
+ :'mobile_suppressed' => :'mobile_suppressed',
39
+ :'mobile_excluded_count' => :'mobile_excluded_count'
40
+ }
41
+ end
42
+
43
+ # Returns all the JSON keys this model knows about
44
+ def self.acceptable_attributes
45
+ attribute_map.values
46
+ end
47
+
48
+ # Attribute type mapping.
49
+ def self.openapi_types
50
+ {
51
+ :'count' => :'Integer',
52
+ :'uncapped_count' => :'Integer',
53
+ :'cap_applied' => :'Boolean',
54
+ :'mobile_suppressed' => :'Boolean',
55
+ :'mobile_excluded_count' => :'Integer'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ :'uncapped_count',
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::EstimateNotificationRecipientsSuccessResponse` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::EstimateNotificationRecipientsSuccessResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'count')
82
+ self.count = attributes[:'count']
83
+ end
84
+
85
+ if attributes.key?(:'uncapped_count')
86
+ self.uncapped_count = attributes[:'uncapped_count']
87
+ end
88
+
89
+ if attributes.key?(:'cap_applied')
90
+ self.cap_applied = attributes[:'cap_applied']
91
+ end
92
+
93
+ if attributes.key?(:'mobile_suppressed')
94
+ self.mobile_suppressed = attributes[:'mobile_suppressed']
95
+ end
96
+
97
+ if attributes.key?(:'mobile_excluded_count')
98
+ self.mobile_excluded_count = attributes[:'mobile_excluded_count']
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ invalid_properties = Array.new
106
+ invalid_properties
107
+ end
108
+
109
+ # Check to see if the all the properties in the model are valid
110
+ # @return true if the model is valid
111
+ def valid?
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ count == o.count &&
121
+ uncapped_count == o.uncapped_count &&
122
+ cap_applied == o.cap_applied &&
123
+ mobile_suppressed == o.mobile_suppressed &&
124
+ mobile_excluded_count == o.mobile_excluded_count
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [count, uncapped_count, cap_applied, mobile_suppressed, mobile_excluded_count].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ new.build_from_hash(attributes)
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ attributes = attributes.transform_keys(&:to_sym)
152
+ self.class.openapi_types.each_pair do |key, type|
153
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
154
+ self.send("#{key}=", nil)
155
+ elsif type =~ /\AArray<(.*)>/i
156
+ # check to ensure the input is an array given that the attribute
157
+ # is documented as an array but the input is not
158
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
159
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
160
+ end
161
+ elsif !attributes[self.class.attribute_map[key]].nil?
162
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
163
+ end
164
+ end
165
+
166
+ self
167
+ end
168
+
169
+ # Deserializes the data based on type
170
+ # @param string type Data type
171
+ # @param string value Value to be deserialized
172
+ # @return [Object] Deserialized data
173
+ def _deserialize(type, value)
174
+ case type.to_sym
175
+ when :Time
176
+ Time.parse(value)
177
+ when :Date
178
+ Date.parse(value)
179
+ when :String
180
+ value.to_s
181
+ when :Integer
182
+ value.to_i
183
+ when :Float
184
+ value.to_f
185
+ when :Boolean
186
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
187
+ true
188
+ else
189
+ false
190
+ end
191
+ when :Object
192
+ # generic object (usually a Hash), return directly
193
+ value
194
+ when /\AArray<(?<inner_type>.+)>\z/
195
+ inner_type = Regexp.last_match[:inner_type]
196
+ value.map { |v| _deserialize(inner_type, v) }
197
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
198
+ k_type = Regexp.last_match[:k_type]
199
+ v_type = Regexp.last_match[:v_type]
200
+ {}.tap do |hash|
201
+ value.each do |k, v|
202
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
203
+ end
204
+ end
205
+ else # model
206
+ # models (e.g. Pet) or oneOf
207
+ klass = OneSignal.const_get(type)
208
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
209
+ end
210
+ end
211
+
212
+ # Returns the string representation of the object
213
+ # @return [String] String presentation of the object
214
+ def to_s
215
+ to_hash.to_s
216
+ end
217
+
218
+ # to_body is an alias to to_hash (backward compatibility)
219
+ # @return [Hash] Returns the object in the form of hash
220
+ def to_body
221
+ to_hash
222
+ end
223
+
224
+ # Returns the object in the form of hash
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_hash
227
+ hash = {}
228
+ self.class.attribute_map.each_pair do |attr, param|
229
+ value = self.send(attr)
230
+ if value.nil?
231
+ is_nullable = self.class.openapi_nullable.include?(attr)
232
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
233
+ end
234
+
235
+ hash[param] = _to_hash(value)
236
+ end
237
+ hash
238
+ end
239
+
240
+ # Outputs non-array value in the form of hash
241
+ # For object, use to_hash. Otherwise, just return the value
242
+ # @param [Object] value Any valid value
243
+ # @return [Hash] Returns the value in the form of hash
244
+ def _to_hash(value)
245
+ if value.is_a?(Array)
246
+ value.compact.map { |v| _to_hash(v) }
247
+ elsif value.is_a?(Hash)
248
+ {}.tap do |hash|
249
+ value.each { |k, v| hash[k] = _to_hash(v) }
250
+ end
251
+ elsif value.respond_to? :to_hash
252
+ value.to_hash
253
+ else
254
+ value
255
+ end
256
+ end
257
+
258
+ end
259
+
260
+ end
@@ -14,7 +14,7 @@ require 'time'
14
14
 
15
15
  module OneSignal
16
16
  class Notification
17
- # The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"]
17
+ # The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup.
18
18
  attr_accessor :included_segments
19
19
 
20
20
  # Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"]
@@ -303,7 +303,7 @@ module OneSignal
303
303
  # Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active.
304
304
  attr_accessor :ios_interruption_level
305
305
 
306
- # Channel: Email Required. The subject of the email.
306
+ # Channel: Email Required. The subject of the email.
307
307
  attr_accessor :email_subject
308
308
 
309
309
  # Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid.
@@ -333,6 +333,11 @@ module OneSignal
333
333
  # Channel: Email Sender domain to use for the email message. Overrides the default sender domain configured for the app. Only supported when the email service provider is OneSignal Email.
334
334
  attr_accessor :email_sender_domain
335
335
 
336
+ # Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications.
337
+ attr_accessor :kind
338
+
339
+ attr_accessor :email_warm_up
340
+
336
341
  # Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format.
337
342
  attr_accessor :sms_from
338
343
 
@@ -496,6 +501,8 @@ module OneSignal
496
501
  :'include_unsubscribed' => :'include_unsubscribed',
497
502
  :'email_bcc' => :'email_bcc',
498
503
  :'email_sender_domain' => :'email_sender_domain',
504
+ :'kind' => :'kind',
505
+ :'email_warm_up' => :'email_warm_up',
499
506
  :'sms_from' => :'sms_from',
500
507
  :'sms_media_urls' => :'sms_media_urls',
501
508
  :'filters' => :'filters',
@@ -626,6 +633,8 @@ module OneSignal
626
633
  :'include_unsubscribed' => :'Boolean',
627
634
  :'email_bcc' => :'Array<String>',
628
635
  :'email_sender_domain' => :'String',
636
+ :'kind' => :'String',
637
+ :'email_warm_up' => :'EmailWarmUpRequest',
629
638
  :'sms_from' => :'String',
630
639
  :'sms_media_urls' => :'Array<String>',
631
640
  :'filters' => :'Array<FilterExpression>',
@@ -728,6 +737,8 @@ module OneSignal
728
737
  :'include_unsubscribed',
729
738
  :'email_bcc',
730
739
  :'email_sender_domain',
740
+ :'kind',
741
+ :'email_warm_up',
731
742
  :'sms_from',
732
743
  :'sms_media_urls',
733
744
  :'filters',
@@ -1232,6 +1243,14 @@ module OneSignal
1232
1243
  self.email_sender_domain = attributes[:'email_sender_domain']
1233
1244
  end
1234
1245
 
1246
+ if attributes.key?(:'kind')
1247
+ self.kind = attributes[:'kind']
1248
+ end
1249
+
1250
+ if attributes.key?(:'email_warm_up')
1251
+ self.email_warm_up = attributes[:'email_warm_up']
1252
+ end
1253
+
1235
1254
  if attributes.key?(:'sms_from')
1236
1255
  self.sms_from = attributes[:'sms_from']
1237
1256
  end
@@ -1301,6 +1320,8 @@ module OneSignal
1301
1320
  return false unless aggregation_validator.valid?(@aggregation)
1302
1321
  return false if @app_id.nil?
1303
1322
  return false if !@email_bcc.nil? && @email_bcc.length > 5
1323
+ kind_validator = EnumAttributeValidator.new('String', ["warmup"])
1324
+ return false unless kind_validator.valid?(@kind)
1304
1325
  huawei_category_validator = EnumAttributeValidator.new('String', ["IM", "VOIP", "SUBSCRIPTION", "TRAVEL", "HEALTH", "WORK", "ACCOUNT", "EXPRESS", "FINANCE", "DEVICE_REMINDER", "MAIL", "MARKETING"])
1305
1326
  return false unless huawei_category_validator.valid?(@huawei_category)
1306
1327
  true
@@ -1336,6 +1357,16 @@ module OneSignal
1336
1357
  @email_bcc = email_bcc
1337
1358
  end
1338
1359
 
1360
+ # Custom attribute writer method checking allowed values (enum).
1361
+ # @param [Object] kind Object to be assigned
1362
+ def kind=(kind)
1363
+ validator = EnumAttributeValidator.new('String', ["warmup"])
1364
+ unless validator.valid?(kind)
1365
+ fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}."
1366
+ end
1367
+ @kind = kind
1368
+ end
1369
+
1339
1370
  # Custom attribute writer method checking allowed values (enum).
1340
1371
  # @param [Object] huawei_category Object to be assigned
1341
1372
  def huawei_category=(huawei_category)
@@ -1460,6 +1491,8 @@ module OneSignal
1460
1491
  include_unsubscribed == o.include_unsubscribed &&
1461
1492
  email_bcc == o.email_bcc &&
1462
1493
  email_sender_domain == o.email_sender_domain &&
1494
+ kind == o.kind &&
1495
+ email_warm_up == o.email_warm_up &&
1463
1496
  sms_from == o.sms_from &&
1464
1497
  sms_media_urls == o.sms_media_urls &&
1465
1498
  filters == o.filters &&
@@ -1481,7 +1514,7 @@ module OneSignal
1481
1514
  # Calculates hash code according to all attributes.
1482
1515
  # @return [Integer] Hash code
1483
1516
  def hash
1484
- [included_segments, excluded_segments, include_subscription_ids, include_email_tokens, email_to, 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, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, app_id, external_id, idempotency_key, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, global_image, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, ios_relevance_score, ios_interruption_level, email_subject, email_body, email_from_name, email_from_address, email_reply_to_address, email_preheader, disable_email_click_tracking, include_unsubscribed, email_bcc, email_sender_domain, sms_from, sms_media_urls, filters, custom_data, huawei_badge_class, huawei_badge_add_num, huawei_badge_set_num, huawei_category, huawei_bi_tag, send_after].hash
1517
+ [included_segments, excluded_segments, include_subscription_ids, include_email_tokens, email_to, 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, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, app_id, external_id, idempotency_key, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, global_image, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, ios_relevance_score, ios_interruption_level, email_subject, email_body, email_from_name, email_from_address, email_reply_to_address, email_preheader, disable_email_click_tracking, include_unsubscribed, email_bcc, email_sender_domain, kind, email_warm_up, sms_from, sms_media_urls, filters, custom_data, huawei_badge_class, huawei_badge_add_num, huawei_badge_set_num, huawei_category, huawei_bi_tag, send_after].hash
1485
1518
  end
1486
1519
 
1487
1520
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'time'
14
14
 
15
15
  module OneSignal
16
16
  class NotificationTarget
17
- # The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"]
17
+ # The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup.
18
18
  attr_accessor :included_segments
19
19
 
20
20
  # Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"]
@@ -14,7 +14,7 @@ require 'time'
14
14
 
15
15
  module OneSignal
16
16
  class NotificationWithMeta
17
- # The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"]
17
+ # The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup.
18
18
  attr_accessor :included_segments
19
19
 
20
20
  # Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"]
@@ -303,7 +303,7 @@ module OneSignal
303
303
  # Channel: Push Notifications Platform: iOS 15+ Focus Modes and Interruption Levels indicate the priority and delivery timing of a notification, to \"interrupt\" the user. Can choose from options: ['active', 'passive', 'time_sensitive', 'critical']. Default is active.
304
304
  attr_accessor :ios_interruption_level
305
305
 
306
- # Channel: Email Required. The subject of the email.
306
+ # Channel: Email Required. The subject of the email.
307
307
  attr_accessor :email_subject
308
308
 
309
309
  # Channel: Email Required unless template_id is set. HTML suported The body of the email you wish to send. Typically, customers include their own HTML templates here. Must include [unsubscribe_url] in an <a> tag somewhere in the email. Note: any malformed HTML content will be sent to users. Please double-check your HTML is valid.
@@ -333,6 +333,11 @@ module OneSignal
333
333
  # Channel: Email Sender domain to use for the email message. Overrides the default sender domain configured for the app. Only supported when the email service provider is OneSignal Email.
334
334
  attr_accessor :email_sender_domain
335
335
 
336
+ # Channel: Email Set to \"warmup\" to send this as an Auto Warm Up campaign: a single campaign delivered gradually to your audience over several days, so you don't have to pace sends manually. OneSignal generates a sending schedule based on your past delivery volumes, scheduled Auto Warm Up emails, and the size of your current audience. When set, `email_warm_up` is required and describes the campaign's stages and (optionally) its scheduling strategy. `send_after` cannot be combined with `kind: \"warmup\"`. The campaign will be scheduled to begin at its first stage's `start` time. Only supported for Email notifications.
337
+ attr_accessor :kind
338
+
339
+ attr_accessor :email_warm_up
340
+
336
341
  # Channel: SMS Phone Number used to send SMS. Should be a registered Twilio phone number in E.164 format.
337
342
  attr_accessor :sms_from
338
343
 
@@ -530,6 +535,8 @@ module OneSignal
530
535
  :'include_unsubscribed' => :'include_unsubscribed',
531
536
  :'email_bcc' => :'email_bcc',
532
537
  :'email_sender_domain' => :'email_sender_domain',
538
+ :'kind' => :'kind',
539
+ :'email_warm_up' => :'email_warm_up',
533
540
  :'sms_from' => :'sms_from',
534
541
  :'sms_media_urls' => :'sms_media_urls',
535
542
  :'filters' => :'filters',
@@ -672,6 +679,8 @@ module OneSignal
672
679
  :'include_unsubscribed' => :'Boolean',
673
680
  :'email_bcc' => :'Array<String>',
674
681
  :'email_sender_domain' => :'String',
682
+ :'kind' => :'String',
683
+ :'email_warm_up' => :'EmailWarmUp',
675
684
  :'sms_from' => :'String',
676
685
  :'sms_media_urls' => :'Array<String>',
677
686
  :'filters' => :'Array<FilterExpression>',
@@ -786,6 +795,7 @@ module OneSignal
786
795
  :'include_unsubscribed',
787
796
  :'email_bcc',
788
797
  :'email_sender_domain',
798
+ :'kind',
789
799
  :'sms_from',
790
800
  :'sms_media_urls',
791
801
  :'filters',
@@ -1295,6 +1305,14 @@ module OneSignal
1295
1305
  self.email_sender_domain = attributes[:'email_sender_domain']
1296
1306
  end
1297
1307
 
1308
+ if attributes.key?(:'kind')
1309
+ self.kind = attributes[:'kind']
1310
+ end
1311
+
1312
+ if attributes.key?(:'email_warm_up')
1313
+ self.email_warm_up = attributes[:'email_warm_up']
1314
+ end
1315
+
1298
1316
  if attributes.key?(:'sms_from')
1299
1317
  self.sms_from = attributes[:'sms_from']
1300
1318
  end
@@ -1409,6 +1427,8 @@ module OneSignal
1409
1427
  aggregation_validator = EnumAttributeValidator.new('String', ["sum", "count"])
1410
1428
  return false unless aggregation_validator.valid?(@aggregation)
1411
1429
  return false if @app_id.nil?
1430
+ kind_validator = EnumAttributeValidator.new('String', ["warmup"])
1431
+ return false unless kind_validator.valid?(@kind)
1412
1432
  huawei_category_validator = EnumAttributeValidator.new('String', ["IM", "VOIP", "SUBSCRIPTION", "TRAVEL", "HEALTH", "WORK", "ACCOUNT", "EXPRESS", "FINANCE", "DEVICE_REMINDER", "MAIL", "MARKETING"])
1413
1433
  return false unless huawei_category_validator.valid?(@huawei_category)
1414
1434
  true
@@ -1434,6 +1454,16 @@ module OneSignal
1434
1454
  @aggregation = aggregation
1435
1455
  end
1436
1456
 
1457
+ # Custom attribute writer method checking allowed values (enum).
1458
+ # @param [Object] kind Object to be assigned
1459
+ def kind=(kind)
1460
+ validator = EnumAttributeValidator.new('String', ["warmup"])
1461
+ unless validator.valid?(kind)
1462
+ fail ArgumentError, "invalid value for \"kind\", must be one of #{validator.allowable_values}."
1463
+ end
1464
+ @kind = kind
1465
+ end
1466
+
1437
1467
  # Custom attribute writer method checking allowed values (enum).
1438
1468
  # @param [Object] huawei_category Object to be assigned
1439
1469
  def huawei_category=(huawei_category)
@@ -1558,6 +1588,8 @@ module OneSignal
1558
1588
  include_unsubscribed == o.include_unsubscribed &&
1559
1589
  email_bcc == o.email_bcc &&
1560
1590
  email_sender_domain == o.email_sender_domain &&
1591
+ kind == o.kind &&
1592
+ email_warm_up == o.email_warm_up &&
1561
1593
  sms_from == o.sms_from &&
1562
1594
  sms_media_urls == o.sms_media_urls &&
1563
1595
  filters == o.filters &&
@@ -1591,7 +1623,7 @@ module OneSignal
1591
1623
  # Calculates hash code according to all attributes.
1592
1624
  # @return [Integer] Hash code
1593
1625
  def hash
1594
- [included_segments, excluded_segments, include_subscription_ids, include_email_tokens, email_to, 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, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, app_id, external_id, idempotency_key, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, global_image, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, ios_relevance_score, ios_interruption_level, email_subject, email_body, email_from_name, email_from_address, email_reply_to_address, email_preheader, disable_email_click_tracking, include_unsubscribed, email_bcc, email_sender_domain, sms_from, sms_media_urls, filters, custom_data, huawei_badge_class, huawei_badge_add_num, huawei_badge_set_num, huawei_category, huawei_bi_tag, successful, failed, errored, converted, received, outcomes, remaining, queued_at, send_after, completed_at, platform_delivery_stats, canceled, bcc_sent].hash
1626
+ [included_segments, excluded_segments, include_subscription_ids, include_email_tokens, email_to, 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, id, value, name, aggregation, is_ios, is_android, is_huawei, is_any_web, is_chrome_web, is_firefox, is_safari, is_wp_wns, is_adm, is_chrome, app_id, external_id, idempotency_key, contents, headings, subtitle, data, huawei_msg_type, url, web_url, app_url, ios_attachments, template_id, content_available, mutable_content, target_content_identifier, big_picture, global_image, huawei_big_picture, adm_big_picture, chrome_big_picture, chrome_web_image, buttons, web_buttons, ios_category, android_channel_id, huawei_channel_id, existing_android_channel_id, huawei_existing_channel_id, android_background_layout, small_icon, huawei_small_icon, large_icon, huawei_large_icon, adm_small_icon, adm_large_icon, chrome_web_icon, chrome_web_badge, firefox_icon, chrome_icon, ios_sound, android_sound, huawei_sound, adm_sound, wp_wns_sound, android_led_color, huawei_led_color, android_accent_color, huawei_accent_color, android_visibility, huawei_visibility, ios_badge_type, ios_badge_count, collapse_id, web_push_topic, apns_alert, delayed_option, delivery_time_of_day, ttl, priority, apns_push_type_override, throttle_rate_per_minute, android_group, android_group_message, adm_group, adm_group_message, thread_id, summary_arg, summary_arg_count, ios_relevance_score, ios_interruption_level, email_subject, email_body, email_from_name, email_from_address, email_reply_to_address, email_preheader, disable_email_click_tracking, include_unsubscribed, email_bcc, email_sender_domain, kind, email_warm_up, sms_from, sms_media_urls, filters, custom_data, huawei_badge_class, huawei_badge_add_num, huawei_badge_set_num, huawei_category, huawei_bi_tag, successful, failed, errored, converted, received, outcomes, remaining, queued_at, send_after, completed_at, platform_delivery_stats, canceled, bcc_sent].hash
1595
1627
  end
1596
1628
 
1597
1629
  # Builds the object from hash
@@ -55,6 +55,8 @@ module OneSignal
55
55
  # Number of BCC copies successfully sent for this notification.
56
56
  attr_accessor :bcc_sent
57
57
 
58
+ attr_accessor :email_warm_up
59
+
58
60
  # Attribute mapping from ruby-style variable name to JSON key.
59
61
  def self.attribute_map
60
62
  {
@@ -71,7 +73,8 @@ module OneSignal
71
73
  :'throttle_rate_per_minute' => :'throttle_rate_per_minute',
72
74
  :'canceled' => :'canceled',
73
75
  :'email_bcc' => :'email_bcc',
74
- :'bcc_sent' => :'bcc_sent'
76
+ :'bcc_sent' => :'bcc_sent',
77
+ :'email_warm_up' => :'email_warm_up'
75
78
  }
76
79
  end
77
80
 
@@ -96,7 +99,8 @@ module OneSignal
96
99
  :'throttle_rate_per_minute' => :'Integer',
97
100
  :'canceled' => :'Boolean',
98
101
  :'email_bcc' => :'Array<String>',
99
- :'bcc_sent' => :'Integer'
102
+ :'bcc_sent' => :'Integer',
103
+ :'email_warm_up' => :'EmailWarmUp'
100
104
  }
101
105
  end
102
106
 
@@ -108,7 +112,7 @@ module OneSignal
108
112
  :'received',
109
113
  :'throttle_rate_per_minute',
110
114
  :'email_bcc',
111
- :'bcc_sent'
115
+ :'bcc_sent',
112
116
  ])
113
117
  end
114
118
 
@@ -184,6 +188,10 @@ module OneSignal
184
188
  if attributes.key?(:'bcc_sent')
185
189
  self.bcc_sent = attributes[:'bcc_sent']
186
190
  end
191
+
192
+ if attributes.key?(:'email_warm_up')
193
+ self.email_warm_up = attributes[:'email_warm_up']
194
+ end
187
195
  end
188
196
 
189
197
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -217,7 +225,8 @@ module OneSignal
217
225
  throttle_rate_per_minute == o.throttle_rate_per_minute &&
218
226
  canceled == o.canceled &&
219
227
  email_bcc == o.email_bcc &&
220
- bcc_sent == o.bcc_sent
228
+ bcc_sent == o.bcc_sent &&
229
+ email_warm_up == o.email_warm_up
221
230
  end
222
231
 
223
232
  # @see the `==` method
@@ -229,7 +238,7 @@ module OneSignal
229
238
  # Calculates hash code according to all attributes.
230
239
  # @return [Integer] Hash code
231
240
  def hash
232
- [remaining, successful, failed, errored, converted, queued_at, send_after, completed_at, platform_delivery_stats, received, throttle_rate_per_minute, canceled, email_bcc, bcc_sent].hash
241
+ [remaining, successful, failed, errored, converted, queued_at, send_after, completed_at, platform_delivery_stats, received, throttle_rate_per_minute, canceled, email_bcc, bcc_sent, email_warm_up].hash
233
242
  end
234
243
 
235
244
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'time'
14
14
 
15
15
  module OneSignal
16
16
  class SegmentNotificationTarget
17
- # The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"]
17
+ # The segment names you want to target. Users in these segments will receive a notification. This targeting parameter is only compatible with excluded_segments. Example: [\"Active Users\", \"Inactive Users\"] `\"All\"` is a shorthand for every subscribed user: if the array includes the string `\"All\"` and the app has no segment actually named `All`, it targets all subscribers instead of a literal segment lookup.
18
18
  attr_accessor :included_segments
19
19
 
20
20
  # Segment that will be excluded when sending. Users in these segments will not receive a notification, even if they were included in included_segments. This targeting parameter is only compatible with included_segments. Example: [\"Active Users\", \"Inactive Users\"]
@@ -10,5 +10,5 @@ OpenAPI Generator version: 6.0.0-SNAPSHOT
10
10
  =end
11
11
 
12
12
  module OneSignal
13
- VERSION = '5.13.0'
13
+ VERSION = '5.15.0'
14
14
  end
data/lib/onesignal.rb CHANGED
@@ -42,6 +42,12 @@ require 'onesignal/models/create_user_conflict_response_errors_items_meta'
42
42
  require 'onesignal/models/custom_event'
43
43
  require 'onesignal/models/custom_events_request'
44
44
  require 'onesignal/models/delivery_data'
45
+ require 'onesignal/models/email_warm_up'
46
+ require 'onesignal/models/email_warm_up_request'
47
+ require 'onesignal/models/email_warm_up_stage'
48
+ require 'onesignal/models/estimate_notification_recipients_request'
49
+ require 'onesignal/models/estimate_notification_recipients_request_all_of'
50
+ require 'onesignal/models/estimate_notification_recipients_success_response'
45
51
  require 'onesignal/models/export_events_success_response'
46
52
  require 'onesignal/models/export_subscriptions_request_body'
47
53
  require 'onesignal/models/export_subscriptions_success_response'
@@ -290,6 +290,18 @@ describe 'DefaultApi' do
290
290
  end
291
291
  end
292
292
 
293
+ # unit tests for estimate_notification_recipients
294
+ # Estimate notification recipients
295
+ # Returns the estimated number of recipients for a notification&#39;s targeting, without creating or sending anything. The returned &#x60;count&#x60; reflects the same audience-size estimate you would see under \&quot;Choose your target audience\&quot; when composing a message. It is based on the user targeting method you&#39;ve set and the specific platforms the message is targeted to send to. This endpoint only supports a subset of targeting parameters: &#x60;included_segments&#x60; is required (its &#x60;\&quot;All\&quot;&#x60; shorthand targets every subscriber), and &#x60;excluded_segments&#x60;, &#x60;filters&#x60;, &#x60;include_aliases&#x60;, and &#x60;target_channel&#x60; narrow that audience further. Use &#x60;target_channel&#x60; to select platforms. &#x60;include_subscription_ids&#x60; and the other raw subscription id/token fields, and the individual &#x60;isIos&#x60; / &#x60;isAndroid&#x60; / etc. platform flags, are not supported. All other notification fields (content, delivery options, and so on) are accepted, but ignored.
296
+ # @param estimate_notification_recipients_request
297
+ # @param [Hash] opts the optional parameters
298
+ # @return [EstimateNotificationRecipientsSuccessResponse]
299
+ describe 'estimate_notification_recipients test' do
300
+ it 'should work' do
301
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
302
+ end
303
+ end
304
+
293
305
  # unit tests for export_events
294
306
  # Export CSV of Events
295
307
  # 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.
@@ -598,6 +598,22 @@ describe OneSignal::BasicNotificationAllOf do
598
598
  end
599
599
  end
600
600
 
601
+ describe 'test attribute "kind"' do
602
+ it 'should work' do
603
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
604
+ # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["warmup"])
605
+ # validator.allowable_values.each do |value|
606
+ # expect { instance.kind = value }.not_to raise_error
607
+ # end
608
+ end
609
+ end
610
+
611
+ describe 'test attribute "email_warm_up"' do
612
+ it 'should work' do
613
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
614
+ end
615
+ end
616
+
601
617
  describe 'test attribute "sms_from"' do
602
618
  it 'should work' do
603
619
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers