onesignal 5.13.0 → 5.14.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/docs/BasicNotification.md +5 -1
- data/docs/BasicNotificationAllOf.md +5 -1
- data/docs/EmailWarmUp.md +24 -0
- data/docs/EmailWarmUpRequest.md +20 -0
- data/docs/EmailWarmUpStage.md +24 -0
- data/docs/Notification.md +5 -1
- data/docs/NotificationWithMeta.md +5 -1
- data/docs/NotificationWithMetaAllOf.md +3 -1
- data/lib/onesignal/api_client.rb +1 -1
- data/lib/onesignal/models/basic_notification.rb +35 -2
- data/lib/onesignal/models/basic_notification_all_of.rb +35 -2
- data/lib/onesignal/models/email_warm_up.rb +298 -0
- data/lib/onesignal/models/email_warm_up_request.rb +272 -0
- data/lib/onesignal/models/email_warm_up_stage.rb +284 -0
- data/lib/onesignal/models/notification.rb +35 -2
- data/lib/onesignal/models/notification_with_meta.rb +34 -2
- data/lib/onesignal/models/notification_with_meta_all_of.rb +14 -5
- data/lib/onesignal/version.rb +1 -1
- data/lib/onesignal.rb +3 -0
- data/spec/models/basic_notification_all_of_spec.rb +16 -0
- data/spec/models/basic_notification_spec.rb +16 -0
- data/spec/models/email_warm_up_request_spec.rb +43 -0
- data/spec/models/email_warm_up_spec.rb +59 -0
- data/spec/models/email_warm_up_stage_spec.rb +51 -0
- data/spec/models/notification_spec.rb +16 -0
- data/spec/models/notification_with_meta_all_of_spec.rb +6 -0
- data/spec/models/notification_with_meta_spec.rb +16 -0
- metadata +14 -2
|
@@ -0,0 +1,284 @@
|
|
|
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
|
+
# Channel: Email One stage of an Auto Warm Up campaign's sending schedule.
|
|
17
|
+
class EmailWarmUpStage
|
|
18
|
+
# ISO 8601 timestamp for the start of this stage. Sending for this stage will not begin before this time.
|
|
19
|
+
attr_accessor :start
|
|
20
|
+
|
|
21
|
+
# ISO 8601 timestamp for the end of this stage. This stage's quota is expected to be sent by this time.
|
|
22
|
+
attr_accessor :_end
|
|
23
|
+
|
|
24
|
+
# Number of emails to send during this stage.
|
|
25
|
+
attr_accessor :quota
|
|
26
|
+
|
|
27
|
+
# Whether this stage has been picked up and acknowledged by the warm-up scheduler. Not accepted on create. This is only present when reading back a campaign.
|
|
28
|
+
attr_accessor :acked
|
|
29
|
+
|
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
31
|
+
def self.attribute_map
|
|
32
|
+
{
|
|
33
|
+
:'start' => :'start',
|
|
34
|
+
:'_end' => :'end',
|
|
35
|
+
:'quota' => :'quota',
|
|
36
|
+
:'acked' => :'acked'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Returns all the JSON keys this model knows about
|
|
41
|
+
def self.acceptable_attributes
|
|
42
|
+
attribute_map.values
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Attribute type mapping.
|
|
46
|
+
def self.openapi_types
|
|
47
|
+
{
|
|
48
|
+
:'start' => :'Time',
|
|
49
|
+
:'_end' => :'Time',
|
|
50
|
+
:'quota' => :'Integer',
|
|
51
|
+
:'acked' => :'Boolean'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List of attributes with nullable: true
|
|
56
|
+
def self.openapi_nullable
|
|
57
|
+
Set.new([
|
|
58
|
+
])
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Initializes the object
|
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
63
|
+
def initialize(attributes = {})
|
|
64
|
+
if (!attributes.is_a?(Hash))
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::EmailWarmUpStage` initialize method"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
70
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::EmailWarmUpStage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
72
|
+
end
|
|
73
|
+
h[k.to_sym] = v
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'start')
|
|
77
|
+
self.start = attributes[:'start']
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'_end')
|
|
81
|
+
self._end = attributes[:'_end']
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'quota')
|
|
85
|
+
self.quota = attributes[:'quota']
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'acked')
|
|
89
|
+
self.acked = attributes[:'acked']
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
94
|
+
# @return Array for valid properties with the reasons
|
|
95
|
+
def list_invalid_properties
|
|
96
|
+
invalid_properties = Array.new
|
|
97
|
+
if @start.nil?
|
|
98
|
+
invalid_properties.push('invalid value for "start", start cannot be nil.')
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
if @_end.nil?
|
|
102
|
+
invalid_properties.push('invalid value for "_end", _end cannot be nil.')
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if @quota.nil?
|
|
106
|
+
invalid_properties.push('invalid value for "quota", quota cannot be nil.')
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if @quota < 0
|
|
110
|
+
invalid_properties.push('invalid value for "quota", must be greater than or equal to 0.')
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
invalid_properties
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Check to see if the all the properties in the model are valid
|
|
117
|
+
# @return true if the model is valid
|
|
118
|
+
def valid?
|
|
119
|
+
return false if @start.nil?
|
|
120
|
+
return false if @_end.nil?
|
|
121
|
+
return false if @quota.nil?
|
|
122
|
+
return false if @quota < 0
|
|
123
|
+
true
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Custom attribute writer method with validation
|
|
127
|
+
# @param [Object] quota Value to be assigned
|
|
128
|
+
def quota=(quota)
|
|
129
|
+
if quota.nil?
|
|
130
|
+
fail ArgumentError, 'quota cannot be nil'
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if quota < 0
|
|
134
|
+
fail ArgumentError, 'invalid value for "quota", must be greater than or equal to 0.'
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
@quota = quota
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Checks equality by comparing each attribute.
|
|
141
|
+
# @param [Object] Object to be compared
|
|
142
|
+
def ==(o)
|
|
143
|
+
return true if self.equal?(o)
|
|
144
|
+
self.class == o.class &&
|
|
145
|
+
start == o.start &&
|
|
146
|
+
_end == o._end &&
|
|
147
|
+
quota == o.quota &&
|
|
148
|
+
acked == o.acked
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# @see the `==` method
|
|
152
|
+
# @param [Object] Object to be compared
|
|
153
|
+
def eql?(o)
|
|
154
|
+
self == o
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Calculates hash code according to all attributes.
|
|
158
|
+
# @return [Integer] Hash code
|
|
159
|
+
def hash
|
|
160
|
+
[start, _end, quota, acked].hash
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Builds the object from hash
|
|
164
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
165
|
+
# @return [Object] Returns the model itself
|
|
166
|
+
def self.build_from_hash(attributes)
|
|
167
|
+
new.build_from_hash(attributes)
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Builds the object from hash
|
|
171
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
172
|
+
# @return [Object] Returns the model itself
|
|
173
|
+
def build_from_hash(attributes)
|
|
174
|
+
return nil unless attributes.is_a?(Hash)
|
|
175
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
176
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
177
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
178
|
+
self.send("#{key}=", nil)
|
|
179
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
180
|
+
# check to ensure the input is an array given that the attribute
|
|
181
|
+
# is documented as an array but the input is not
|
|
182
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
183
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
184
|
+
end
|
|
185
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
186
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
187
|
+
end
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
self
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Deserializes the data based on type
|
|
194
|
+
# @param string type Data type
|
|
195
|
+
# @param string value Value to be deserialized
|
|
196
|
+
# @return [Object] Deserialized data
|
|
197
|
+
def _deserialize(type, value)
|
|
198
|
+
case type.to_sym
|
|
199
|
+
when :Time
|
|
200
|
+
Time.parse(value)
|
|
201
|
+
when :Date
|
|
202
|
+
Date.parse(value)
|
|
203
|
+
when :String
|
|
204
|
+
value.to_s
|
|
205
|
+
when :Integer
|
|
206
|
+
value.to_i
|
|
207
|
+
when :Float
|
|
208
|
+
value.to_f
|
|
209
|
+
when :Boolean
|
|
210
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
211
|
+
true
|
|
212
|
+
else
|
|
213
|
+
false
|
|
214
|
+
end
|
|
215
|
+
when :Object
|
|
216
|
+
# generic object (usually a Hash), return directly
|
|
217
|
+
value
|
|
218
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
219
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
220
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
221
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
222
|
+
k_type = Regexp.last_match[:k_type]
|
|
223
|
+
v_type = Regexp.last_match[:v_type]
|
|
224
|
+
{}.tap do |hash|
|
|
225
|
+
value.each do |k, v|
|
|
226
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
else # model
|
|
230
|
+
# models (e.g. Pet) or oneOf
|
|
231
|
+
klass = OneSignal.const_get(type)
|
|
232
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
233
|
+
end
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Returns the string representation of the object
|
|
237
|
+
# @return [String] String presentation of the object
|
|
238
|
+
def to_s
|
|
239
|
+
to_hash.to_s
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
243
|
+
# @return [Hash] Returns the object in the form of hash
|
|
244
|
+
def to_body
|
|
245
|
+
to_hash
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Returns the object in the form of hash
|
|
249
|
+
# @return [Hash] Returns the object in the form of hash
|
|
250
|
+
def to_hash
|
|
251
|
+
hash = {}
|
|
252
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
253
|
+
value = self.send(attr)
|
|
254
|
+
if value.nil?
|
|
255
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
256
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
hash[param] = _to_hash(value)
|
|
260
|
+
end
|
|
261
|
+
hash
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
# Outputs non-array value in the form of hash
|
|
265
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
266
|
+
# @param [Object] value Any valid value
|
|
267
|
+
# @return [Hash] Returns the value in the form of hash
|
|
268
|
+
def _to_hash(value)
|
|
269
|
+
if value.is_a?(Array)
|
|
270
|
+
value.compact.map { |v| _to_hash(v) }
|
|
271
|
+
elsif value.is_a?(Hash)
|
|
272
|
+
{}.tap do |hash|
|
|
273
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
274
|
+
end
|
|
275
|
+
elsif value.respond_to? :to_hash
|
|
276
|
+
value.to_hash
|
|
277
|
+
else
|
|
278
|
+
value
|
|
279
|
+
end
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
end
|
|
@@ -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.
|
|
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
|
|
@@ -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.
|
|
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
|
data/lib/onesignal/version.rb
CHANGED
data/lib/onesignal.rb
CHANGED
|
@@ -42,6 +42,9 @@ 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'
|
|
45
48
|
require 'onesignal/models/export_events_success_response'
|
|
46
49
|
require 'onesignal/models/export_subscriptions_request_body'
|
|
47
50
|
require 'onesignal/models/export_subscriptions_success_response'
|
|
@@ -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
|
|
@@ -686,6 +686,22 @@ describe OneSignal::BasicNotification do
|
|
|
686
686
|
end
|
|
687
687
|
end
|
|
688
688
|
|
|
689
|
+
describe 'test attribute "kind"' do
|
|
690
|
+
it 'should work' do
|
|
691
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
692
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["warmup"])
|
|
693
|
+
# validator.allowable_values.each do |value|
|
|
694
|
+
# expect { instance.kind = value }.not_to raise_error
|
|
695
|
+
# end
|
|
696
|
+
end
|
|
697
|
+
end
|
|
698
|
+
|
|
699
|
+
describe 'test attribute "email_warm_up"' do
|
|
700
|
+
it 'should work' do
|
|
701
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
702
|
+
end
|
|
703
|
+
end
|
|
704
|
+
|
|
689
705
|
describe 'test attribute "sms_from"' do
|
|
690
706
|
it 'should work' do
|
|
691
707
|
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|