onesignal 5.16.0 → 5.17.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 +7 -0
- data/Gemfile.lock +2 -2
- data/README.md +3 -3
- data/docs/DefaultApi.md +89 -6
- data/docs/DuplicateJourneyOverrides.md +30 -0
- data/docs/DuplicateJourneyRequest.md +18 -0
- data/docs/JourneyNode.md +2 -2
- data/docs/UpdateJourneyNodeRequest.md +2 -2
- data/lib/onesignal/api/default_api.rb +82 -6
- data/lib/onesignal/api_client.rb +1 -1
- data/lib/onesignal/models/duplicate_journey_overrides.rb +282 -0
- data/lib/onesignal/models/duplicate_journey_request.rb +219 -0
- data/lib/onesignal/models/journey.rb +1 -1
- data/lib/onesignal/models/journey_node.rb +2 -2
- data/lib/onesignal/models/update_journey_node_request.rb +2 -2
- data/lib/onesignal/version.rb +1 -1
- data/lib/onesignal.rb +2 -0
- data/spec/api/default_api_spec.rb +17 -3
- data/spec/models/duplicate_journey_overrides_spec.rb +69 -0
- data/spec/models/duplicate_journey_request_spec.rb +33 -0
- data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.4.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/byebug-13.0.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/date-3.5.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.4}/gem_make.out +12 -10
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.4/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.4}/mkmf.log +33 -6
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/jaro_winkler-1.5.6/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/psych-5.5.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/racc-1.8.1/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/stringio-3.2.0/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.4}/ext/io/console/Makefile +3 -3
- data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.4}/ext/io/console/console.c +101 -13
- data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.4}/ext/io/console/extconf.rb +27 -2
- data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.4}/lib/io/console/size.rb +4 -2
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.4/lib/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/specifications/{io-console-0.9.2.gemspec → io-console-0.9.4.gemspec} +3 -3
- metadata +117 -109
- data/vendor/bundle/ruby/3.2.0/cache/io-console-0.9.2.gem +0 -0
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/io/console.so +0 -0
- data/vendor/bundle/ruby/3.2.0/gems/io-console-0.9.2/lib/io/console.so +0 -0
- /data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/{io-console-0.9.2 → io-console-0.9.4}/gem.build_complete +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.4}/.document +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.4}/BSDL +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.4}/COPYING +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.4}/README.md +0 -0
- /data/vendor/bundle/ruby/3.2.0/gems/{io-console-0.9.2 → io-console-0.9.4}/ext/io/console/win32_vk.inc +0 -0
|
@@ -0,0 +1,282 @@
|
|
|
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
|
+
# Journey fields to apply over the copy as a JSON Merge Patch (RFC 7396). Accepts the same writable fields as Create journey, and none of them are required. The patch merges into the copy, not the source. The copy starts without a schedule, so an omitted schedule leaves the copy unscheduled. An object merges key by key. A null value clears a nullable field. An array such as nodes replaces the copied array. Server-controlled fields such as id or state are rejected.
|
|
17
|
+
class DuplicateJourneyOverrides
|
|
18
|
+
# Name for the copy, up to 300 characters. If you omit it, the copy takes the name of the source plus \" (Copy)\".
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# Optional journey description, up to 1024 characters. If you omit it, the copy takes the description of the source. Send null to clear it.
|
|
22
|
+
attr_accessor :description
|
|
23
|
+
|
|
24
|
+
attr_accessor :audience
|
|
25
|
+
|
|
26
|
+
attr_accessor :early_exit
|
|
27
|
+
|
|
28
|
+
attr_accessor :reentry_rules
|
|
29
|
+
|
|
30
|
+
attr_accessor :schedule
|
|
31
|
+
|
|
32
|
+
# Full ordered list of nodes. Replaces the copied graph. Server-assigned id fields are rejected.
|
|
33
|
+
attr_accessor :nodes
|
|
34
|
+
|
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
36
|
+
def self.attribute_map
|
|
37
|
+
{
|
|
38
|
+
:'name' => :'name',
|
|
39
|
+
:'description' => :'description',
|
|
40
|
+
:'audience' => :'audience',
|
|
41
|
+
:'early_exit' => :'early_exit',
|
|
42
|
+
:'reentry_rules' => :'reentry_rules',
|
|
43
|
+
:'schedule' => :'schedule',
|
|
44
|
+
:'nodes' => :'nodes'
|
|
45
|
+
}
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Returns all the JSON keys this model knows about
|
|
49
|
+
def self.acceptable_attributes
|
|
50
|
+
attribute_map.values
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
# Attribute type mapping.
|
|
54
|
+
def self.openapi_types
|
|
55
|
+
{
|
|
56
|
+
:'name' => :'String',
|
|
57
|
+
:'description' => :'String',
|
|
58
|
+
:'audience' => :'JourneyAudience',
|
|
59
|
+
:'early_exit' => :'JourneyEarlyExit',
|
|
60
|
+
:'reentry_rules' => :'JourneyReentryRules',
|
|
61
|
+
:'schedule' => :'JourneySchedule',
|
|
62
|
+
:'nodes' => :'Array<JourneyNode>'
|
|
63
|
+
}
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# List of attributes with nullable: true
|
|
67
|
+
def self.openapi_nullable
|
|
68
|
+
Set.new([
|
|
69
|
+
:'description',
|
|
70
|
+
:'early_exit',
|
|
71
|
+
:'reentry_rules',
|
|
72
|
+
:'schedule',
|
|
73
|
+
])
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# Initializes the object
|
|
77
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
78
|
+
def initialize(attributes = {})
|
|
79
|
+
if (!attributes.is_a?(Hash))
|
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::DuplicateJourneyOverrides` initialize method"
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
84
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
85
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::DuplicateJourneyOverrides`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
87
|
+
end
|
|
88
|
+
h[k.to_sym] = v
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'name')
|
|
92
|
+
self.name = attributes[:'name']
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if attributes.key?(:'description')
|
|
96
|
+
self.description = attributes[:'description']
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
if attributes.key?(:'audience')
|
|
100
|
+
self.audience = attributes[:'audience']
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'early_exit')
|
|
104
|
+
self.early_exit = attributes[:'early_exit']
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
if attributes.key?(:'reentry_rules')
|
|
108
|
+
self.reentry_rules = attributes[:'reentry_rules']
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
if attributes.key?(:'schedule')
|
|
112
|
+
self.schedule = attributes[:'schedule']
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'nodes')
|
|
116
|
+
if (value = attributes[:'nodes']).is_a?(Array)
|
|
117
|
+
self.nodes = value
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
123
|
+
# @return Array for valid properties with the reasons
|
|
124
|
+
def list_invalid_properties
|
|
125
|
+
invalid_properties = Array.new
|
|
126
|
+
invalid_properties
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Check to see if the all the properties in the model are valid
|
|
130
|
+
# @return true if the model is valid
|
|
131
|
+
def valid?
|
|
132
|
+
true
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Checks equality by comparing each attribute.
|
|
136
|
+
# @param [Object] Object to be compared
|
|
137
|
+
def ==(o)
|
|
138
|
+
return true if self.equal?(o)
|
|
139
|
+
self.class == o.class &&
|
|
140
|
+
name == o.name &&
|
|
141
|
+
description == o.description &&
|
|
142
|
+
audience == o.audience &&
|
|
143
|
+
early_exit == o.early_exit &&
|
|
144
|
+
reentry_rules == o.reentry_rules &&
|
|
145
|
+
schedule == o.schedule &&
|
|
146
|
+
nodes == o.nodes
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# @see the `==` method
|
|
150
|
+
# @param [Object] Object to be compared
|
|
151
|
+
def eql?(o)
|
|
152
|
+
self == o
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Calculates hash code according to all attributes.
|
|
156
|
+
# @return [Integer] Hash code
|
|
157
|
+
def hash
|
|
158
|
+
[name, description, audience, early_exit, reentry_rules, schedule, nodes].hash
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Builds the object from hash
|
|
162
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
163
|
+
# @return [Object] Returns the model itself
|
|
164
|
+
def self.build_from_hash(attributes)
|
|
165
|
+
new.build_from_hash(attributes)
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Builds the object from hash
|
|
169
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
170
|
+
# @return [Object] Returns the model itself
|
|
171
|
+
def build_from_hash(attributes)
|
|
172
|
+
return nil unless attributes.is_a?(Hash)
|
|
173
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
174
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
175
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
176
|
+
self.send("#{key}=", nil)
|
|
177
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
178
|
+
# check to ensure the input is an array given that the attribute
|
|
179
|
+
# is documented as an array but the input is not
|
|
180
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
181
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
182
|
+
end
|
|
183
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
184
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
185
|
+
end
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
self
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
# Deserializes the data based on type
|
|
192
|
+
# @param string type Data type
|
|
193
|
+
# @param string value Value to be deserialized
|
|
194
|
+
# @return [Object] Deserialized data
|
|
195
|
+
def _deserialize(type, value)
|
|
196
|
+
case type.to_sym
|
|
197
|
+
when :Time
|
|
198
|
+
Time.parse(value)
|
|
199
|
+
when :Date
|
|
200
|
+
Date.parse(value)
|
|
201
|
+
when :String
|
|
202
|
+
value.to_s
|
|
203
|
+
when :Integer
|
|
204
|
+
value.to_i
|
|
205
|
+
when :Float
|
|
206
|
+
value.to_f
|
|
207
|
+
when :Boolean
|
|
208
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
209
|
+
true
|
|
210
|
+
else
|
|
211
|
+
false
|
|
212
|
+
end
|
|
213
|
+
when :Object
|
|
214
|
+
# generic object (usually a Hash), return directly
|
|
215
|
+
value
|
|
216
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
217
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
218
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
219
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
220
|
+
k_type = Regexp.last_match[:k_type]
|
|
221
|
+
v_type = Regexp.last_match[:v_type]
|
|
222
|
+
{}.tap do |hash|
|
|
223
|
+
value.each do |k, v|
|
|
224
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
else # model
|
|
228
|
+
# models (e.g. Pet) or oneOf
|
|
229
|
+
klass = OneSignal.const_get(type)
|
|
230
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
231
|
+
end
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
# Returns the string representation of the object
|
|
235
|
+
# @return [String] String presentation of the object
|
|
236
|
+
def to_s
|
|
237
|
+
to_hash.to_s
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
241
|
+
# @return [Hash] Returns the object in the form of hash
|
|
242
|
+
def to_body
|
|
243
|
+
to_hash
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Returns the object in the form of hash
|
|
247
|
+
# @return [Hash] Returns the object in the form of hash
|
|
248
|
+
def to_hash
|
|
249
|
+
hash = {}
|
|
250
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
251
|
+
value = self.send(attr)
|
|
252
|
+
if value.nil?
|
|
253
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
254
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
hash[param] = _to_hash(value)
|
|
258
|
+
end
|
|
259
|
+
hash
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
# Outputs non-array value in the form of hash
|
|
263
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
264
|
+
# @param [Object] value Any valid value
|
|
265
|
+
# @return [Hash] Returns the value in the form of hash
|
|
266
|
+
def _to_hash(value)
|
|
267
|
+
if value.is_a?(Array)
|
|
268
|
+
value.compact.map { |v| _to_hash(v) }
|
|
269
|
+
elsif value.is_a?(Hash)
|
|
270
|
+
{}.tap do |hash|
|
|
271
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
272
|
+
end
|
|
273
|
+
elsif value.respond_to? :to_hash
|
|
274
|
+
value.to_hash
|
|
275
|
+
else
|
|
276
|
+
value
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
end
|
|
@@ -0,0 +1,219 @@
|
|
|
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
|
+
# Optional body for Duplicate journey. Only overrides is applied. A journey field sent at the top level is ignored.
|
|
17
|
+
class DuplicateJourneyRequest
|
|
18
|
+
attr_accessor :overrides
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'overrides' => :'overrides'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns all the JSON keys this model knows about
|
|
28
|
+
def self.acceptable_attributes
|
|
29
|
+
attribute_map.values
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Attribute type mapping.
|
|
33
|
+
def self.openapi_types
|
|
34
|
+
{
|
|
35
|
+
:'overrides' => :'DuplicateJourneyOverrides'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# List of attributes with nullable: true
|
|
40
|
+
def self.openapi_nullable
|
|
41
|
+
Set.new([
|
|
42
|
+
])
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# Initializes the object
|
|
46
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
47
|
+
def initialize(attributes = {})
|
|
48
|
+
if (!attributes.is_a?(Hash))
|
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::DuplicateJourneyRequest` initialize method"
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
53
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
54
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
55
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::DuplicateJourneyRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
56
|
+
end
|
|
57
|
+
h[k.to_sym] = v
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if attributes.key?(:'overrides')
|
|
61
|
+
self.overrides = attributes[:'overrides']
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
66
|
+
# @return Array for valid properties with the reasons
|
|
67
|
+
def list_invalid_properties
|
|
68
|
+
invalid_properties = Array.new
|
|
69
|
+
invalid_properties
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Check to see if the all the properties in the model are valid
|
|
73
|
+
# @return true if the model is valid
|
|
74
|
+
def valid?
|
|
75
|
+
true
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Checks equality by comparing each attribute.
|
|
79
|
+
# @param [Object] Object to be compared
|
|
80
|
+
def ==(o)
|
|
81
|
+
return true if self.equal?(o)
|
|
82
|
+
self.class == o.class &&
|
|
83
|
+
overrides == o.overrides
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# @see the `==` method
|
|
87
|
+
# @param [Object] Object to be compared
|
|
88
|
+
def eql?(o)
|
|
89
|
+
self == o
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Calculates hash code according to all attributes.
|
|
93
|
+
# @return [Integer] Hash code
|
|
94
|
+
def hash
|
|
95
|
+
[overrides].hash
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Builds the object from hash
|
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
100
|
+
# @return [Object] Returns the model itself
|
|
101
|
+
def self.build_from_hash(attributes)
|
|
102
|
+
new.build_from_hash(attributes)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
# Builds the object from hash
|
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
107
|
+
# @return [Object] Returns the model itself
|
|
108
|
+
def build_from_hash(attributes)
|
|
109
|
+
return nil unless attributes.is_a?(Hash)
|
|
110
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
111
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
112
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
113
|
+
self.send("#{key}=", nil)
|
|
114
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
115
|
+
# check to ensure the input is an array given that the attribute
|
|
116
|
+
# is documented as an array but the input is not
|
|
117
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
118
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
119
|
+
end
|
|
120
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
121
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
self
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Deserializes the data based on type
|
|
129
|
+
# @param string type Data type
|
|
130
|
+
# @param string value Value to be deserialized
|
|
131
|
+
# @return [Object] Deserialized data
|
|
132
|
+
def _deserialize(type, value)
|
|
133
|
+
case type.to_sym
|
|
134
|
+
when :Time
|
|
135
|
+
Time.parse(value)
|
|
136
|
+
when :Date
|
|
137
|
+
Date.parse(value)
|
|
138
|
+
when :String
|
|
139
|
+
value.to_s
|
|
140
|
+
when :Integer
|
|
141
|
+
value.to_i
|
|
142
|
+
when :Float
|
|
143
|
+
value.to_f
|
|
144
|
+
when :Boolean
|
|
145
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
146
|
+
true
|
|
147
|
+
else
|
|
148
|
+
false
|
|
149
|
+
end
|
|
150
|
+
when :Object
|
|
151
|
+
# generic object (usually a Hash), return directly
|
|
152
|
+
value
|
|
153
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
154
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
155
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
156
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
157
|
+
k_type = Regexp.last_match[:k_type]
|
|
158
|
+
v_type = Regexp.last_match[:v_type]
|
|
159
|
+
{}.tap do |hash|
|
|
160
|
+
value.each do |k, v|
|
|
161
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
else # model
|
|
165
|
+
# models (e.g. Pet) or oneOf
|
|
166
|
+
klass = OneSignal.const_get(type)
|
|
167
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Returns the string representation of the object
|
|
172
|
+
# @return [String] String presentation of the object
|
|
173
|
+
def to_s
|
|
174
|
+
to_hash.to_s
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
|
179
|
+
def to_body
|
|
180
|
+
to_hash
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
# Returns the object in the form of hash
|
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
|
185
|
+
def to_hash
|
|
186
|
+
hash = {}
|
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
188
|
+
value = self.send(attr)
|
|
189
|
+
if value.nil?
|
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
hash[param] = _to_hash(value)
|
|
195
|
+
end
|
|
196
|
+
hash
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Outputs non-array value in the form of hash
|
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
201
|
+
# @param [Object] value Any valid value
|
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
|
203
|
+
def _to_hash(value)
|
|
204
|
+
if value.is_a?(Array)
|
|
205
|
+
value.compact.map { |v| _to_hash(v) }
|
|
206
|
+
elsif value.is_a?(Hash)
|
|
207
|
+
{}.tap do |hash|
|
|
208
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
209
|
+
end
|
|
210
|
+
elsif value.respond_to? :to_hash
|
|
211
|
+
value.to_hash
|
|
212
|
+
else
|
|
213
|
+
value
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
end
|
|
@@ -13,7 +13,7 @@ require 'date'
|
|
|
13
13
|
require 'time'
|
|
14
14
|
|
|
15
15
|
module OneSignal
|
|
16
|
-
# Full journey representation returned by the detail, create, and
|
|
16
|
+
# Full journey representation returned by the detail, create, update, and duplicate endpoints.
|
|
17
17
|
class Journey
|
|
18
18
|
# Journey UUID. Read-only.
|
|
19
19
|
attr_accessor :id
|
|
@@ -24,7 +24,7 @@ module OneSignal
|
|
|
24
24
|
# Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads.
|
|
25
25
|
attr_accessor :client_node_id
|
|
26
26
|
|
|
27
|
-
# Optional free-text label, up to
|
|
27
|
+
# Optional free-text label, up to 1024 characters. Stored and returned as-is with no effect on journey behavior.
|
|
28
28
|
attr_accessor :annotation
|
|
29
29
|
|
|
30
30
|
# wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year).
|
|
@@ -60,7 +60,7 @@ module OneSignal
|
|
|
60
60
|
# split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false.
|
|
61
61
|
attr_accessor :randomize_on_entry
|
|
62
62
|
|
|
63
|
-
# Branching nodes: nested branches. split_range requires 2-
|
|
63
|
+
# Branching nodes: nested branches. split_range requires 2-25 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-25 condition branches.
|
|
64
64
|
attr_accessor :branches
|
|
65
65
|
|
|
66
66
|
attr_accessor :expiration
|
|
@@ -18,7 +18,7 @@ module OneSignal
|
|
|
18
18
|
# Optional client-assigned identifier, unique within the journey. Use it to reference this node from elsewhere in the same request. Persisted and returned on reads.
|
|
19
19
|
attr_accessor :client_node_id
|
|
20
20
|
|
|
21
|
-
# Optional free-text label, up to
|
|
21
|
+
# Optional free-text label, up to 1024 characters. Stored and returned as-is with no effect on journey behavior.
|
|
22
22
|
attr_accessor :annotation
|
|
23
23
|
|
|
24
24
|
# wait nodes: seconds to hold the user. Minimum 60, maximum 31556952 (1 year).
|
|
@@ -54,7 +54,7 @@ module OneSignal
|
|
|
54
54
|
# split_range nodes: when true, assigns each user to a branch at random on entry. Defaults to false.
|
|
55
55
|
attr_accessor :randomize_on_entry
|
|
56
56
|
|
|
57
|
-
# Branching nodes: nested branches. split_range requires 2-
|
|
57
|
+
# Branching nodes: nested branches. split_range requires 2-25 weighted branches that sum to 100. yes_no requires exactly 2 branches. wait_until requires 1-25 condition branches.
|
|
58
58
|
attr_accessor :branches
|
|
59
59
|
|
|
60
60
|
attr_accessor :expiration
|
data/lib/onesignal/version.rb
CHANGED
data/lib/onesignal.rb
CHANGED
|
@@ -42,6 +42,8 @@ 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/duplicate_journey_overrides'
|
|
46
|
+
require 'onesignal/models/duplicate_journey_request'
|
|
45
47
|
require 'onesignal/models/email_reputation_response'
|
|
46
48
|
require 'onesignal/models/email_reputation_window'
|
|
47
49
|
require 'onesignal/models/email_warm_up'
|
|
@@ -243,7 +243,7 @@ describe 'DefaultApi' do
|
|
|
243
243
|
# Delete Segment
|
|
244
244
|
# Delete a segment (not user devices) - Required: OneSignal Paid Plan You can delete a segment under your app by calling this API. You must provide an API key in the Authorization header that has admin access on the app. The segment_id can be found in the URL of the segment when viewing it in the dashboard.
|
|
245
245
|
# @param app_id The OneSignal App ID for your app. Available in Keys & IDs.
|
|
246
|
-
# @param segment_id The
|
|
246
|
+
# @param segment_id The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard.
|
|
247
247
|
# @param [Hash] opts the optional parameters
|
|
248
248
|
# @return [GenericSuccessBoolResponse]
|
|
249
249
|
describe 'delete_segment test' do
|
|
@@ -290,6 +290,20 @@ describe 'DefaultApi' do
|
|
|
290
290
|
end
|
|
291
291
|
end
|
|
292
292
|
|
|
293
|
+
# unit tests for duplicate_journey
|
|
294
|
+
# Duplicate journey
|
|
295
|
+
# The Journeys API is in beta. Endpoints and response fields can still change. Copy an existing journey into a new draft. The source does not change. The copy is always a draft, and started_at and archived_at are null. If you omit the body, or omit overrides, the copy keeps the source description, audience, nodes, early_exit, and reentry_rules. The copy takes the source name plus \" (Copy)\". The copy does not keep schedule. Send schedule under overrides to set it. Server-controlled fields are rejected with 400. The authenticated App API key must have permission to create journeys.
|
|
296
|
+
# @param app_id Your OneSignal App ID in UUID v4 format.
|
|
297
|
+
# @param journey_id UUID of the journey to copy.
|
|
298
|
+
# @param [Hash] opts the optional parameters
|
|
299
|
+
# @option opts [DuplicateJourneyRequest] :duplicate_journey_request
|
|
300
|
+
# @return [Journey]
|
|
301
|
+
describe 'duplicate_journey test' do
|
|
302
|
+
it 'should work' do
|
|
303
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
304
|
+
end
|
|
305
|
+
end
|
|
306
|
+
|
|
293
307
|
# unit tests for estimate_notification_recipients
|
|
294
308
|
# Estimate notification recipients
|
|
295
309
|
# Returns the estimated number of recipients for a notification's targeting, without creating or sending anything. The returned `count` reflects the same audience-size estimate you would see under \"Choose your target audience\" when composing a message. It is based on the user targeting method you've set and the specific platforms the message is targeted to send to. This endpoint only supports a subset of targeting parameters: `included_segments` is required (its `\"All\"` shorthand targets every subscriber), and `excluded_segments`, `filters`, `include_aliases`, and `target_channel` narrow that audience further. Use `target_channel` to select platforms. `include_subscription_ids` and the other raw subscription id/token fields, and the individual `isIos` / `isAndroid` / etc. platform flags, are not supported. All other notification fields (content, delivery options, and so on) are accepted, but ignored.
|
|
@@ -451,7 +465,7 @@ describe 'DefaultApi' do
|
|
|
451
465
|
# View Segment
|
|
452
466
|
# Retrieve details for a single segment by its ID, including subscriber count and optionally segment metadata and filters.
|
|
453
467
|
# @param app_id The OneSignal App ID for your app. Available in Keys & IDs.
|
|
454
|
-
# @param segment_id The segment's unique identifier.
|
|
468
|
+
# @param segment_id The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard.
|
|
455
469
|
# @param [Hash] opts the optional parameters
|
|
456
470
|
# @option opts [Boolean] :include_segment_detail Set to true to include segment metadata and filters in the response.
|
|
457
471
|
# @return [GetSegmentSuccessResponse]
|
|
@@ -639,7 +653,7 @@ describe 'DefaultApi' do
|
|
|
639
653
|
# Update Segment
|
|
640
654
|
# Update an existing segment's name and/or filters. The name parameter is always required. When filters are provided, all existing filters are replaced with the new ones.
|
|
641
655
|
# @param app_id The OneSignal App ID for your app. Available in Keys & IDs.
|
|
642
|
-
# @param segment_id The segment's unique identifier.
|
|
656
|
+
# @param segment_id The segment's unique identifier. In the dashboard, go to Audience > Segments, open the segment's options menu, and select Copy segment ID. You can also get it from the View Segments API or the segment's URL in the dashboard.
|
|
643
657
|
# @param [Hash] opts the optional parameters
|
|
644
658
|
# @option opts [UpdateSegmentRequest] :update_segment_request
|
|
645
659
|
# @return [UpdateSegmentSuccessResponse]
|
|
@@ -0,0 +1,69 @@
|
|
|
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 'spec_helper'
|
|
13
|
+
require 'json'
|
|
14
|
+
require 'date'
|
|
15
|
+
|
|
16
|
+
# Unit tests for OneSignal::DuplicateJourneyOverrides
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe OneSignal::DuplicateJourneyOverrides do
|
|
20
|
+
let(:instance) { OneSignal::DuplicateJourneyOverrides.new }
|
|
21
|
+
|
|
22
|
+
describe 'test an instance of DuplicateJourneyOverrides' do
|
|
23
|
+
it 'should create an instance of DuplicateJourneyOverrides' do
|
|
24
|
+
expect(instance).to be_instance_of(OneSignal::DuplicateJourneyOverrides)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
describe 'test attribute "name"' do
|
|
28
|
+
it 'should work' do
|
|
29
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
describe 'test attribute "description"' do
|
|
34
|
+
it 'should work' do
|
|
35
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
describe 'test attribute "audience"' do
|
|
40
|
+
it 'should work' do
|
|
41
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
describe 'test attribute "early_exit"' do
|
|
46
|
+
it 'should work' do
|
|
47
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
describe 'test attribute "reentry_rules"' do
|
|
52
|
+
it 'should work' do
|
|
53
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
describe 'test attribute "schedule"' do
|
|
58
|
+
it 'should work' do
|
|
59
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
describe 'test attribute "nodes"' do
|
|
64
|
+
it 'should work' do
|
|
65
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
end
|