onesignal 5.11.2 → 5.12.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 +2 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/docs/CreateJourneyRequest.md +30 -0
- data/docs/DefaultApi.md +563 -0
- data/docs/Journey.md +48 -0
- data/docs/JourneyAudience.md +28 -0
- data/docs/JourneyBranch.md +24 -0
- data/docs/JourneyBranchStats.md +18 -0
- data/docs/JourneyCondition.md +34 -0
- data/docs/JourneyEarlyExit.md +20 -0
- data/docs/JourneyEarlyExitRules.md +24 -0
- data/docs/JourneyEarlyExitRulesOnEvent.md +18 -0
- data/docs/JourneyEarlyExitRulesOnSegment.md +18 -0
- data/docs/JourneyEventAttribute.md +22 -0
- data/docs/JourneyListAudience.md +18 -0
- data/docs/JourneyListItem.md +40 -0
- data/docs/JourneyListResponse.md +22 -0
- data/docs/JourneyMessageStats.md +18 -0
- data/docs/JourneyNode.md +50 -0
- data/docs/JourneyNodeStats.md +26 -0
- data/docs/JourneyReentryRules.md +18 -0
- data/docs/JourneySchedule.md +22 -0
- data/docs/JourneyStats.md +28 -0
- data/docs/JourneyTimePoint.md +20 -0
- data/docs/JourneyTimeWindow.md +22 -0
- data/docs/JourneyWaitUntilExpiration.md +20 -0
- data/docs/UpdateJourneyNodeRequest.md +48 -0
- data/docs/UpdateJourneyRequest.md +34 -0
- data/lib/onesignal/api/default_api.rb +524 -0
- data/lib/onesignal/api_client.rb +1 -1
- data/lib/onesignal/models/create_journey_request.rb +287 -0
- data/lib/onesignal/models/journey.rb +409 -0
- data/lib/onesignal/models/journey_audience.rb +316 -0
- data/lib/onesignal/models/journey_branch.rb +250 -0
- data/lib/onesignal/models/journey_branch_stats.rb +220 -0
- data/lib/onesignal/models/journey_condition.rb +360 -0
- data/lib/onesignal/models/journey_early_exit.rb +231 -0
- data/lib/onesignal/models/journey_early_exit_rules.rb +251 -0
- data/lib/onesignal/models/journey_early_exit_rules_on_event.rb +224 -0
- data/lib/onesignal/models/journey_early_exit_rules_on_segment.rb +221 -0
- data/lib/onesignal/models/journey_event_attribute.rb +283 -0
- data/lib/onesignal/models/journey_list_audience.rb +254 -0
- data/lib/onesignal/models/journey_list_item.rb +366 -0
- data/lib/onesignal/models/journey_list_response.rb +241 -0
- data/lib/onesignal/models/journey_message_stats.rb +222 -0
- data/lib/onesignal/models/journey_node.rb +480 -0
- data/lib/onesignal/models/journey_node_stats.rb +293 -0
- data/lib/onesignal/models/journey_reentry_rules.rb +236 -0
- data/lib/onesignal/models/journey_schedule.rb +243 -0
- data/lib/onesignal/models/journey_stats.rb +274 -0
- data/lib/onesignal/models/journey_time_point.rb +277 -0
- data/lib/onesignal/models/journey_time_window.rb +266 -0
- data/lib/onesignal/models/journey_wait_until_expiration.rb +256 -0
- data/lib/onesignal/models/update_journey_node_request.rb +454 -0
- data/lib/onesignal/models/update_journey_request.rb +337 -0
- data/lib/onesignal/version.rb +1 -1
- data/lib/onesignal.rb +25 -0
- data/spec/api/default_api_spec.rb +95 -0
- data/spec/models/create_journey_request_spec.rb +69 -0
- data/spec/models/journey_audience_spec.rb +67 -0
- data/spec/models/journey_branch_spec.rb +51 -0
- data/spec/models/journey_branch_stats_spec.rb +33 -0
- data/spec/models/journey_condition_spec.rb +89 -0
- data/spec/models/journey_early_exit_rules_on_event_spec.rb +33 -0
- data/spec/models/journey_early_exit_rules_on_segment_spec.rb +33 -0
- data/spec/models/journey_early_exit_rules_spec.rb +51 -0
- data/spec/models/journey_early_exit_spec.rb +39 -0
- data/spec/models/journey_event_attribute_spec.rb +49 -0
- data/spec/models/journey_list_audience_spec.rb +37 -0
- data/spec/models/journey_list_item_spec.rb +103 -0
- data/spec/models/journey_list_response_spec.rb +45 -0
- data/spec/models/journey_message_stats_spec.rb +33 -0
- data/spec/models/journey_node_spec.rb +137 -0
- data/spec/models/journey_node_stats_spec.rb +61 -0
- data/spec/models/journey_reentry_rules_spec.rb +33 -0
- data/spec/models/journey_schedule_spec.rb +45 -0
- data/spec/models/journey_spec.rb +127 -0
- data/spec/models/journey_stats_spec.rb +63 -0
- data/spec/models/journey_time_point_spec.rb +39 -0
- data/spec/models/journey_time_window_spec.rb +45 -0
- data/spec/models/journey_wait_until_expiration_spec.rb +39 -0
- data/spec/models/update_journey_node_request_spec.rb +127 -0
- data/spec/models/update_journey_request_spec.rb +85 -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/gem_make.out +5 -5
- data/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/io-console-0.9.2/mkmf.log +3 -3
- 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.4.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
- metadata +102 -2
|
@@ -0,0 +1,337 @@
|
|
|
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
|
+
# Partial update applied with JSON Merge Patch (RFC 7396). Send only the fields you want to change. A null value clears a nullable field. Arrays such as nodes are replaced wholesale.
|
|
17
|
+
class UpdateJourneyRequest
|
|
18
|
+
# Journey name.
|
|
19
|
+
attr_accessor :name
|
|
20
|
+
|
|
21
|
+
# Journey description. 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, which replaces the existing graph wholesale. Preserve each node's server-assigned id from a prior fetch to keep in-flight users on that node; omit id to add a new node.
|
|
33
|
+
attr_accessor :nodes
|
|
34
|
+
|
|
35
|
+
# Target state. Set active to activate a draft journey, or scheduled together with a future schedule.start_at to activate it later. Set archived to stop a running journey; archiving is permanent. Only scheduled and processing journeys can return to draft.
|
|
36
|
+
attr_accessor :state
|
|
37
|
+
|
|
38
|
+
# Optional optimistic-concurrency token. Pass the concurrency_key from a prior fetch to reject the update with 409 if the journey changed. Omit to skip the check.
|
|
39
|
+
attr_accessor :concurrency_key
|
|
40
|
+
|
|
41
|
+
class EnumAttributeValidator
|
|
42
|
+
attr_reader :datatype
|
|
43
|
+
attr_reader :allowable_values
|
|
44
|
+
|
|
45
|
+
def initialize(datatype, allowable_values)
|
|
46
|
+
@allowable_values = allowable_values.map do |value|
|
|
47
|
+
case datatype.to_s
|
|
48
|
+
when /Integer/i
|
|
49
|
+
value.to_i
|
|
50
|
+
when /Float/i
|
|
51
|
+
value.to_f
|
|
52
|
+
else
|
|
53
|
+
value
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def valid?(value)
|
|
59
|
+
!value || allowable_values.include?(value)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
64
|
+
def self.attribute_map
|
|
65
|
+
{
|
|
66
|
+
:'name' => :'name',
|
|
67
|
+
:'description' => :'description',
|
|
68
|
+
:'audience' => :'audience',
|
|
69
|
+
:'early_exit' => :'early_exit',
|
|
70
|
+
:'reentry_rules' => :'reentry_rules',
|
|
71
|
+
:'schedule' => :'schedule',
|
|
72
|
+
:'nodes' => :'nodes',
|
|
73
|
+
:'state' => :'state',
|
|
74
|
+
:'concurrency_key' => :'concurrency_key'
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Returns all the JSON keys this model knows about
|
|
79
|
+
def self.acceptable_attributes
|
|
80
|
+
attribute_map.values
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Attribute type mapping.
|
|
84
|
+
def self.openapi_types
|
|
85
|
+
{
|
|
86
|
+
:'name' => :'String',
|
|
87
|
+
:'description' => :'String',
|
|
88
|
+
:'audience' => :'JourneyAudience',
|
|
89
|
+
:'early_exit' => :'JourneyEarlyExit',
|
|
90
|
+
:'reentry_rules' => :'JourneyReentryRules',
|
|
91
|
+
:'schedule' => :'JourneySchedule',
|
|
92
|
+
:'nodes' => :'Array<JourneyNode>',
|
|
93
|
+
:'state' => :'String',
|
|
94
|
+
:'concurrency_key' => :'String'
|
|
95
|
+
}
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# List of attributes with nullable: true
|
|
99
|
+
def self.openapi_nullable
|
|
100
|
+
Set.new([
|
|
101
|
+
:'description',
|
|
102
|
+
:'early_exit',
|
|
103
|
+
:'reentry_rules',
|
|
104
|
+
:'schedule',
|
|
105
|
+
:'concurrency_key'
|
|
106
|
+
])
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Initializes the object
|
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
111
|
+
def initialize(attributes = {})
|
|
112
|
+
if (!attributes.is_a?(Hash))
|
|
113
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::UpdateJourneyRequest` initialize method"
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
117
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
118
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
119
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `OneSignal::UpdateJourneyRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
120
|
+
end
|
|
121
|
+
h[k.to_sym] = v
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if attributes.key?(:'name')
|
|
125
|
+
self.name = attributes[:'name']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes.key?(:'description')
|
|
129
|
+
self.description = attributes[:'description']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes.key?(:'audience')
|
|
133
|
+
self.audience = attributes[:'audience']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes.key?(:'early_exit')
|
|
137
|
+
self.early_exit = attributes[:'early_exit']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes.key?(:'reentry_rules')
|
|
141
|
+
self.reentry_rules = attributes[:'reentry_rules']
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'schedule')
|
|
145
|
+
self.schedule = attributes[:'schedule']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'nodes')
|
|
149
|
+
if (value = attributes[:'nodes']).is_a?(Array)
|
|
150
|
+
self.nodes = value
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'state')
|
|
155
|
+
self.state = attributes[:'state']
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
if attributes.key?(:'concurrency_key')
|
|
159
|
+
self.concurrency_key = attributes[:'concurrency_key']
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
164
|
+
# @return Array for valid properties with the reasons
|
|
165
|
+
def list_invalid_properties
|
|
166
|
+
invalid_properties = Array.new
|
|
167
|
+
invalid_properties
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
# Check to see if the all the properties in the model are valid
|
|
171
|
+
# @return true if the model is valid
|
|
172
|
+
def valid?
|
|
173
|
+
state_validator = EnumAttributeValidator.new('String', ["draft", "scheduled", "active", "archived"])
|
|
174
|
+
return false unless state_validator.valid?(@state)
|
|
175
|
+
true
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
179
|
+
# @param [Object] state Object to be assigned
|
|
180
|
+
def state=(state)
|
|
181
|
+
validator = EnumAttributeValidator.new('String', ["draft", "scheduled", "active", "archived"])
|
|
182
|
+
unless validator.valid?(state)
|
|
183
|
+
fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
|
|
184
|
+
end
|
|
185
|
+
@state = state
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Checks equality by comparing each attribute.
|
|
189
|
+
# @param [Object] Object to be compared
|
|
190
|
+
def ==(o)
|
|
191
|
+
return true if self.equal?(o)
|
|
192
|
+
self.class == o.class &&
|
|
193
|
+
name == o.name &&
|
|
194
|
+
description == o.description &&
|
|
195
|
+
audience == o.audience &&
|
|
196
|
+
early_exit == o.early_exit &&
|
|
197
|
+
reentry_rules == o.reentry_rules &&
|
|
198
|
+
schedule == o.schedule &&
|
|
199
|
+
nodes == o.nodes &&
|
|
200
|
+
state == o.state &&
|
|
201
|
+
concurrency_key == o.concurrency_key
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# @see the `==` method
|
|
205
|
+
# @param [Object] Object to be compared
|
|
206
|
+
def eql?(o)
|
|
207
|
+
self == o
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Calculates hash code according to all attributes.
|
|
211
|
+
# @return [Integer] Hash code
|
|
212
|
+
def hash
|
|
213
|
+
[name, description, audience, early_exit, reentry_rules, schedule, nodes, state, concurrency_key].hash
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
# Builds the object from hash
|
|
217
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
218
|
+
# @return [Object] Returns the model itself
|
|
219
|
+
def self.build_from_hash(attributes)
|
|
220
|
+
new.build_from_hash(attributes)
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Builds the object from hash
|
|
224
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
225
|
+
# @return [Object] Returns the model itself
|
|
226
|
+
def build_from_hash(attributes)
|
|
227
|
+
return nil unless attributes.is_a?(Hash)
|
|
228
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
229
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
230
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
231
|
+
self.send("#{key}=", nil)
|
|
232
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
233
|
+
# check to ensure the input is an array given that the attribute
|
|
234
|
+
# is documented as an array but the input is not
|
|
235
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
236
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
237
|
+
end
|
|
238
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
239
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
240
|
+
end
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
self
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
# Deserializes the data based on type
|
|
247
|
+
# @param string type Data type
|
|
248
|
+
# @param string value Value to be deserialized
|
|
249
|
+
# @return [Object] Deserialized data
|
|
250
|
+
def _deserialize(type, value)
|
|
251
|
+
case type.to_sym
|
|
252
|
+
when :Time
|
|
253
|
+
Time.parse(value)
|
|
254
|
+
when :Date
|
|
255
|
+
Date.parse(value)
|
|
256
|
+
when :String
|
|
257
|
+
value.to_s
|
|
258
|
+
when :Integer
|
|
259
|
+
value.to_i
|
|
260
|
+
when :Float
|
|
261
|
+
value.to_f
|
|
262
|
+
when :Boolean
|
|
263
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
264
|
+
true
|
|
265
|
+
else
|
|
266
|
+
false
|
|
267
|
+
end
|
|
268
|
+
when :Object
|
|
269
|
+
# generic object (usually a Hash), return directly
|
|
270
|
+
value
|
|
271
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
272
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
273
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
274
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
275
|
+
k_type = Regexp.last_match[:k_type]
|
|
276
|
+
v_type = Regexp.last_match[:v_type]
|
|
277
|
+
{}.tap do |hash|
|
|
278
|
+
value.each do |k, v|
|
|
279
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
280
|
+
end
|
|
281
|
+
end
|
|
282
|
+
else # model
|
|
283
|
+
# models (e.g. Pet) or oneOf
|
|
284
|
+
klass = OneSignal.const_get(type)
|
|
285
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
286
|
+
end
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
# Returns the string representation of the object
|
|
290
|
+
# @return [String] String presentation of the object
|
|
291
|
+
def to_s
|
|
292
|
+
to_hash.to_s
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
296
|
+
# @return [Hash] Returns the object in the form of hash
|
|
297
|
+
def to_body
|
|
298
|
+
to_hash
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
# Returns the object in the form of hash
|
|
302
|
+
# @return [Hash] Returns the object in the form of hash
|
|
303
|
+
def to_hash
|
|
304
|
+
hash = {}
|
|
305
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
306
|
+
value = self.send(attr)
|
|
307
|
+
if value.nil?
|
|
308
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
309
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
hash[param] = _to_hash(value)
|
|
313
|
+
end
|
|
314
|
+
hash
|
|
315
|
+
end
|
|
316
|
+
|
|
317
|
+
# Outputs non-array value in the form of hash
|
|
318
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
319
|
+
# @param [Object] value Any valid value
|
|
320
|
+
# @return [Hash] Returns the value in the form of hash
|
|
321
|
+
def _to_hash(value)
|
|
322
|
+
if value.is_a?(Array)
|
|
323
|
+
value.compact.map { |v| _to_hash(v) }
|
|
324
|
+
elsif value.is_a?(Hash)
|
|
325
|
+
{}.tap do |hash|
|
|
326
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
327
|
+
end
|
|
328
|
+
elsif value.respond_to? :to_hash
|
|
329
|
+
value.to_hash
|
|
330
|
+
else
|
|
331
|
+
value
|
|
332
|
+
end
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
end
|
|
336
|
+
|
|
337
|
+
end
|
data/lib/onesignal/version.rb
CHANGED
data/lib/onesignal.rb
CHANGED
|
@@ -31,6 +31,7 @@ require 'onesignal/models/button'
|
|
|
31
31
|
require 'onesignal/models/copy_template_request'
|
|
32
32
|
require 'onesignal/models/create_api_key_request'
|
|
33
33
|
require 'onesignal/models/create_api_key_response'
|
|
34
|
+
require 'onesignal/models/create_journey_request'
|
|
34
35
|
require 'onesignal/models/create_notification_success_response'
|
|
35
36
|
require 'onesignal/models/create_segment_conflict_response'
|
|
36
37
|
require 'onesignal/models/create_segment_success_response'
|
|
@@ -51,6 +52,28 @@ require 'onesignal/models/generic_success_bool_response'
|
|
|
51
52
|
require 'onesignal/models/get_notification_history_request_body'
|
|
52
53
|
require 'onesignal/models/get_segment_success_response'
|
|
53
54
|
require 'onesignal/models/get_segments_success_response'
|
|
55
|
+
require 'onesignal/models/journey'
|
|
56
|
+
require 'onesignal/models/journey_audience'
|
|
57
|
+
require 'onesignal/models/journey_branch'
|
|
58
|
+
require 'onesignal/models/journey_branch_stats'
|
|
59
|
+
require 'onesignal/models/journey_condition'
|
|
60
|
+
require 'onesignal/models/journey_early_exit'
|
|
61
|
+
require 'onesignal/models/journey_early_exit_rules'
|
|
62
|
+
require 'onesignal/models/journey_early_exit_rules_on_event'
|
|
63
|
+
require 'onesignal/models/journey_early_exit_rules_on_segment'
|
|
64
|
+
require 'onesignal/models/journey_event_attribute'
|
|
65
|
+
require 'onesignal/models/journey_list_audience'
|
|
66
|
+
require 'onesignal/models/journey_list_item'
|
|
67
|
+
require 'onesignal/models/journey_list_response'
|
|
68
|
+
require 'onesignal/models/journey_message_stats'
|
|
69
|
+
require 'onesignal/models/journey_node'
|
|
70
|
+
require 'onesignal/models/journey_node_stats'
|
|
71
|
+
require 'onesignal/models/journey_reentry_rules'
|
|
72
|
+
require 'onesignal/models/journey_schedule'
|
|
73
|
+
require 'onesignal/models/journey_stats'
|
|
74
|
+
require 'onesignal/models/journey_time_point'
|
|
75
|
+
require 'onesignal/models/journey_time_window'
|
|
76
|
+
require 'onesignal/models/journey_wait_until_expiration'
|
|
54
77
|
require 'onesignal/models/language_string_map'
|
|
55
78
|
require 'onesignal/models/list_audit_logs_success_response'
|
|
56
79
|
require 'onesignal/models/notification'
|
|
@@ -84,6 +107,8 @@ require 'onesignal/models/template_resource'
|
|
|
84
107
|
require 'onesignal/models/templates_list_response'
|
|
85
108
|
require 'onesignal/models/transfer_subscription_request_body'
|
|
86
109
|
require 'onesignal/models/update_api_key_request'
|
|
110
|
+
require 'onesignal/models/update_journey_node_request'
|
|
111
|
+
require 'onesignal/models/update_journey_request'
|
|
87
112
|
require 'onesignal/models/update_live_activity_request'
|
|
88
113
|
require 'onesignal/models/update_live_activity_success_response'
|
|
89
114
|
require 'onesignal/models/update_segment_request'
|
|
@@ -123,6 +123,19 @@ describe 'DefaultApi' do
|
|
|
123
123
|
end
|
|
124
124
|
end
|
|
125
125
|
|
|
126
|
+
# unit tests for create_journey
|
|
127
|
+
# Create journey
|
|
128
|
+
# The Journeys API is in beta. Endpoints and response fields can still change. Create a new journey with an audience and a node graph. Journeys are always created in the draft state. The authenticated App API key must have permission to create journeys.
|
|
129
|
+
# @param app_id Your OneSignal App ID in UUID v4 format.
|
|
130
|
+
# @param create_journey_request
|
|
131
|
+
# @param [Hash] opts the optional parameters
|
|
132
|
+
# @return [Journey]
|
|
133
|
+
describe 'create_journey test' do
|
|
134
|
+
it 'should work' do
|
|
135
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
|
|
126
139
|
# unit tests for create_notification
|
|
127
140
|
# Create notification
|
|
128
141
|
# Sends notifications to your users. **Target by External ID (push example):** set `include_aliases` to `{ \"external_id\": [\"your-user-id\"] }` and set `target_channel` to `push` (or `email` / `sms` for those channels). Alias object keys must match API labels exactly (for example `external_id`, not camelCase). **Do not confuse** the notification-level `external_id` field with External ID targeting: top-level `external_id` / `idempotency_key` are for idempotent notification requests only, not for selecting recipients. **Targeting compatibility:** `include_aliases` must not be combined with other targeting modes (segments, filters, subscription IDs, legacy player IDs, etc.). Clients should send only one targeting strategy per request.
|
|
@@ -213,6 +226,19 @@ describe 'DefaultApi' do
|
|
|
213
226
|
end
|
|
214
227
|
end
|
|
215
228
|
|
|
229
|
+
# unit tests for delete_journey
|
|
230
|
+
# Delete journey
|
|
231
|
+
# The Journeys API is in beta. Endpoints and response fields can still change. Permanently delete a journey by its UUID. Returns { \"success\": true } on success. The authenticated App API key must have permission to delete journeys. Deleting a journey stops any in-flight users and cannot be undone. Archive a running journey instead if you need to keep its data.
|
|
232
|
+
# @param app_id Your OneSignal App ID in UUID v4 format.
|
|
233
|
+
# @param journey_id UUID of the journey to delete.
|
|
234
|
+
# @param [Hash] opts the optional parameters
|
|
235
|
+
# @return [GenericSuccessBoolResponse]
|
|
236
|
+
describe 'delete_journey test' do
|
|
237
|
+
it 'should work' do
|
|
238
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
|
|
216
242
|
# unit tests for delete_segment
|
|
217
243
|
# Delete Segment
|
|
218
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.
|
|
@@ -542,6 +568,35 @@ describe 'DefaultApi' do
|
|
|
542
568
|
end
|
|
543
569
|
end
|
|
544
570
|
|
|
571
|
+
# unit tests for update_journey
|
|
572
|
+
# Update journey
|
|
573
|
+
# The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a journey using JSON Merge Patch (RFC 7396). Send only the fields you want to change; omitted fields are left unchanged. A null value clears a nullable field, and arrays such as nodes are replaced wholesale. Set state to active to activate a draft journey.
|
|
574
|
+
# @param app_id Your OneSignal App ID in UUID v4 format.
|
|
575
|
+
# @param journey_id UUID of the journey to update.
|
|
576
|
+
# @param update_journey_request
|
|
577
|
+
# @param [Hash] opts the optional parameters
|
|
578
|
+
# @return [Journey]
|
|
579
|
+
describe 'update_journey test' do
|
|
580
|
+
it 'should work' do
|
|
581
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
582
|
+
end
|
|
583
|
+
end
|
|
584
|
+
|
|
585
|
+
# unit tests for update_journey_node
|
|
586
|
+
# Update journey node
|
|
587
|
+
# The Journeys API is in beta. Endpoints and response fields can still change. Apply a partial update to a single node, located by its server-assigned id, using JSON Merge Patch (RFC 7396). Send only the node fields you want to change; the rest of the node and the rest of the journey graph are left untouched. Returns the full updated journey.
|
|
588
|
+
# @param app_id Your OneSignal App ID in UUID v4 format.
|
|
589
|
+
# @param journey_id UUID of the journey that owns the node.
|
|
590
|
+
# @param node_id Server-assigned UUID of the node to update, from a prior View journey fetch.
|
|
591
|
+
# @param update_journey_node_request
|
|
592
|
+
# @param [Hash] opts the optional parameters
|
|
593
|
+
# @return [Journey]
|
|
594
|
+
describe 'update_journey_node test' do
|
|
595
|
+
it 'should work' do
|
|
596
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
597
|
+
end
|
|
598
|
+
end
|
|
599
|
+
|
|
545
600
|
# unit tests for update_live_activity
|
|
546
601
|
# Update a Live Activity via Push
|
|
547
602
|
# Updates a specified live activity.
|
|
@@ -638,6 +693,46 @@ describe 'DefaultApi' do
|
|
|
638
693
|
end
|
|
639
694
|
end
|
|
640
695
|
|
|
696
|
+
# unit tests for view_journey
|
|
697
|
+
# View journey
|
|
698
|
+
# The Journeys API is in beta. Endpoints and response fields can still change. Retrieve the full configuration of a single journey by its UUID, including its audience and node graph.
|
|
699
|
+
# @param app_id Your OneSignal App ID in UUID v4 format.
|
|
700
|
+
# @param journey_id UUID of the journey to retrieve.
|
|
701
|
+
# @param [Hash] opts the optional parameters
|
|
702
|
+
# @return [Journey]
|
|
703
|
+
describe 'view_journey test' do
|
|
704
|
+
it 'should work' do
|
|
705
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
706
|
+
end
|
|
707
|
+
end
|
|
708
|
+
|
|
709
|
+
# unit tests for view_journey_stats
|
|
710
|
+
# View journey stats
|
|
711
|
+
# The Journeys API is in beta. Endpoints and response fields can still change. Retrieve performance stats for a single journey: journey-level entry and exit counts, per-node counts keyed by node id, per-branch counts keyed by branch id, and channel delivery stats for message-sending nodes. The response carries no definition detail, so join it by id against the journey from View journey.
|
|
712
|
+
# @param app_id Your OneSignal App ID in UUID v4 format.
|
|
713
|
+
# @param journey_id UUID of the journey to retrieve stats for.
|
|
714
|
+
# @param [Hash] opts the optional parameters
|
|
715
|
+
# @return [JourneyStats]
|
|
716
|
+
describe 'view_journey_stats test' do
|
|
717
|
+
it 'should work' do
|
|
718
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
719
|
+
end
|
|
720
|
+
end
|
|
721
|
+
|
|
722
|
+
# unit tests for view_journeys
|
|
723
|
+
# View journeys
|
|
724
|
+
# The Journeys API is in beta. Endpoints and response fields can still change. Retrieve a paginated list of journeys for an app. Returns a summary representation of each journey; use View journey for the full configuration. Uses forward-only cursor-based pagination.
|
|
725
|
+
# @param app_id Your OneSignal App ID in UUID v4 format.
|
|
726
|
+
# @param [Hash] opts the optional parameters
|
|
727
|
+
# @option opts [String] :cursor Opaque pagination token from a previous response's next_cursor. Omit for the first page.
|
|
728
|
+
# @option opts [Integer] :limit Maximum journeys to return per page. Minimum 1, maximum 50.
|
|
729
|
+
# @return [JourneyListResponse]
|
|
730
|
+
describe 'view_journeys test' do
|
|
731
|
+
it 'should work' do
|
|
732
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
733
|
+
end
|
|
734
|
+
end
|
|
735
|
+
|
|
641
736
|
# unit tests for view_template
|
|
642
737
|
# View template
|
|
643
738
|
# Fetch a single template by id.
|
|
@@ -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::CreateJourneyRequest
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe OneSignal::CreateJourneyRequest do
|
|
20
|
+
let(:instance) { OneSignal::CreateJourneyRequest.new }
|
|
21
|
+
|
|
22
|
+
describe 'test an instance of CreateJourneyRequest' do
|
|
23
|
+
it 'should create an instance of CreateJourneyRequest' do
|
|
24
|
+
expect(instance).to be_instance_of(OneSignal::CreateJourneyRequest)
|
|
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
|
|
@@ -0,0 +1,67 @@
|
|
|
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::JourneyAudience
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe OneSignal::JourneyAudience do
|
|
20
|
+
let(:instance) { OneSignal::JourneyAudience.new }
|
|
21
|
+
|
|
22
|
+
describe 'test an instance of JourneyAudience' do
|
|
23
|
+
it 'should create an instance of JourneyAudience' do
|
|
24
|
+
expect(instance).to be_instance_of(OneSignal::JourneyAudience)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
describe 'test attribute "kind"' do
|
|
28
|
+
it 'should work' do
|
|
29
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
30
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["segment", "event_trigger"])
|
|
31
|
+
# validator.allowable_values.each do |value|
|
|
32
|
+
# expect { instance.kind = value }.not_to raise_error
|
|
33
|
+
# end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
describe 'test attribute "included_segment_ids"' do
|
|
38
|
+
it 'should work' do
|
|
39
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
describe 'test attribute "excluded_segment_ids"' do
|
|
44
|
+
it 'should work' do
|
|
45
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
describe 'test attribute "future_additions_only"' do
|
|
50
|
+
it 'should work' do
|
|
51
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
describe 'test attribute "name"' do
|
|
56
|
+
it 'should work' do
|
|
57
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
describe 'test attribute "attributes"' do
|
|
62
|
+
it 'should work' do
|
|
63
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
end
|