talon_one 8.0.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -8
  3. data/docs/AchievementBase.md +35 -0
  4. data/docs/AchievementProgressWithDefinition.md +45 -0
  5. data/docs/AchievementStatusEntry.md +45 -0
  6. data/docs/AnalyticsSKU.md +23 -0
  7. data/docs/ApplicationCIFReferences.md +19 -0
  8. data/docs/CampaignDetail.md +19 -0
  9. data/docs/CampaignStoreBudgetLimitConfig.md +25 -0
  10. data/docs/CampaignTemplate.md +3 -1
  11. data/docs/HiddenConditionsEffects.md +23 -0
  12. data/docs/InlineResponse20048.md +19 -0
  13. data/docs/InlineResponse20049.md +19 -0
  14. data/docs/IntegrationApi.md +3 -1
  15. data/docs/LedgerTransactionLogEntryIntegrationAPI.md +3 -1
  16. data/docs/LoyaltyLedgerEntryFlags.md +17 -0
  17. data/docs/LoyaltyProgramTransaction.md +3 -1
  18. data/docs/ManagementApi.md +164 -323
  19. data/docs/MessageTest.md +27 -0
  20. data/docs/NewMessageTest.md +29 -0
  21. data/docs/ProductUnitAnalyticsDataPoint.md +25 -0
  22. data/docs/ProductUnitAnalyticsTotals.md +17 -0
  23. data/docs/SkuUnitAnalytics.md +19 -0
  24. data/docs/SkuUnitAnalyticsDataPoint.md +23 -0
  25. data/docs/StrikethroughLabelingNotification.md +2 -0
  26. data/lib/talon_one/api/integration_api.rb +3 -0
  27. data/lib/talon_one/api/management_api.rb +191 -354
  28. data/lib/talon_one/models/achievement_base.rb +377 -0
  29. data/lib/talon_one/models/achievement_progress_with_definition.rb +490 -0
  30. data/lib/talon_one/models/achievement_status_entry.rb +472 -0
  31. data/lib/talon_one/models/analytics_sku.rb +246 -0
  32. data/lib/talon_one/models/application_cif_references.rb +219 -0
  33. data/lib/talon_one/models/campaign_detail.rb +232 -0
  34. data/lib/talon_one/models/campaign_store_budget_limit_config.rb +322 -0
  35. data/lib/talon_one/models/campaign_template.rb +16 -4
  36. data/lib/talon_one/models/delete_user_request.rb +0 -1
  37. data/lib/talon_one/models/hidden_conditions_effects.rb +246 -0
  38. data/lib/talon_one/models/inline_response20048.rb +222 -0
  39. data/lib/talon_one/models/inline_response20049.rb +227 -0
  40. data/lib/talon_one/models/ledger_transaction_log_entry_integration_api.rb +13 -4
  41. data/lib/talon_one/models/loyalty_ledger_entry_flags.rb +208 -0
  42. data/lib/talon_one/models/loyalty_program_transaction.rb +13 -4
  43. data/lib/talon_one/models/message_test.rb +227 -0
  44. data/lib/talon_one/models/new_message_test.rb +322 -0
  45. data/lib/talon_one/models/product_unit_analytics_data_point.rb +271 -0
  46. data/lib/talon_one/models/product_unit_analytics_totals.rb +206 -0
  47. data/lib/talon_one/models/sku_unit_analytics.rb +227 -0
  48. data/lib/talon_one/models/sku_unit_analytics_data_point.rb +256 -0
  49. data/lib/talon_one/models/strikethrough_labeling_notification.rb +11 -1
  50. data/lib/talon_one/version.rb +1 -1
  51. data/lib/talon_one.rb +2 -1
  52. data/spec/api/integration_api_spec.rb +1 -0
  53. data/spec/api/management_api_spec.rb +60 -87
  54. data/spec/models/campaign_template_spec.rb +6 -0
  55. data/spec/models/ledger_transaction_log_entry_integration_api_spec.rb +6 -0
  56. data/spec/models/loyalty_program_transaction_spec.rb +6 -0
  57. data/spec/models/revision_activation_request_spec.rb +47 -0
  58. data/spec/models/strikethrough_labeling_notification_spec.rb +6 -0
  59. metadata +563 -527
@@ -0,0 +1,377 @@
1
+ =begin
2
+ #Talon.One API
3
+
4
+ #Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}`
5
+
6
+ The version of the OpenAPI document:
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module TalonOne
16
+ class AchievementBase
17
+ # The internal name of the achievement used in API requests. **Note**: The name should start with a letter. This cannot be changed after the achievement has been created.
18
+ attr_accessor :name
19
+
20
+ # The display name for the achievement in the Campaign Manager.
21
+ attr_accessor :title
22
+
23
+ # A description of the achievement.
24
+ attr_accessor :description
25
+
26
+ # The required number of actions or the transactional milestone to complete the achievement.
27
+ attr_accessor :target
28
+
29
+ # The relative duration after which the achievement ends and resets for a particular customer profile. **Note**: The `period` does not start when the achievement is created. The period is a **positive real number** followed by one letter indicating the time unit. Examples: `30s`, `40m`, `1h`, `5D`, `7W`, `10M`, `15Y`. Available units: - `s`: seconds - `m`: minutes - `h`: hours - `D`: days - `W`: weeks - `M`: months - `Y`: years You can also round certain units down to the beginning of period and up to the end of period.: - `_D` for rounding down days only. Signifies the start of the day. Example: `30D_D` - `_U` for rounding up days, weeks, months and years. Signifies the end of the day, week, month or year. Example: `23W_U` **Note**: You can either use the round down and round up option or set an absolute period.
30
+ attr_accessor :period
31
+
32
+ attr_accessor :period_end_override
33
+
34
+ # The policy that determines if and how the achievement recurs. - `no_recurrence`: The achievement can be completed only once. - `on_expiration`: The achievement resets after it expires and becomes available again.
35
+ attr_accessor :recurrence_policy
36
+
37
+ # The policy that determines how the achievement starts, ends, or resets. - `user_action`: The achievement ends or resets relative to when the customer started the achievement. - `fixed_schedule`: The achievement starts, ends, or resets for all customers following a fixed schedule.
38
+ attr_accessor :activation_policy
39
+
40
+ # The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string.
41
+ attr_accessor :fixed_start_date
42
+
43
+ # The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string.
44
+ attr_accessor :end_date
45
+
46
+ class EnumAttributeValidator
47
+ attr_reader :datatype
48
+ attr_reader :allowable_values
49
+
50
+ def initialize(datatype, allowable_values)
51
+ @allowable_values = allowable_values.map do |value|
52
+ case datatype.to_s
53
+ when /Integer/i
54
+ value.to_i
55
+ when /Float/i
56
+ value.to_f
57
+ else
58
+ value
59
+ end
60
+ end
61
+ end
62
+
63
+ def valid?(value)
64
+ !value || allowable_values.include?(value)
65
+ end
66
+ end
67
+
68
+ # Attribute mapping from ruby-style variable name to JSON key.
69
+ def self.attribute_map
70
+ {
71
+ :'name' => :'name',
72
+ :'title' => :'title',
73
+ :'description' => :'description',
74
+ :'target' => :'target',
75
+ :'period' => :'period',
76
+ :'period_end_override' => :'periodEndOverride',
77
+ :'recurrence_policy' => :'recurrencePolicy',
78
+ :'activation_policy' => :'activationPolicy',
79
+ :'fixed_start_date' => :'fixedStartDate',
80
+ :'end_date' => :'endDate'
81
+ }
82
+ end
83
+
84
+ # Attribute type mapping.
85
+ def self.openapi_types
86
+ {
87
+ :'name' => :'String',
88
+ :'title' => :'String',
89
+ :'description' => :'String',
90
+ :'target' => :'Float',
91
+ :'period' => :'String',
92
+ :'period_end_override' => :'TimePoint',
93
+ :'recurrence_policy' => :'String',
94
+ :'activation_policy' => :'String',
95
+ :'fixed_start_date' => :'DateTime',
96
+ :'end_date' => :'DateTime'
97
+ }
98
+ end
99
+
100
+ # List of attributes with nullable: true
101
+ def self.openapi_nullable
102
+ Set.new([
103
+ ])
104
+ end
105
+
106
+ # Initializes the object
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ def initialize(attributes = {})
109
+ if (!attributes.is_a?(Hash))
110
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::AchievementBase` initialize method"
111
+ end
112
+
113
+ # check to see if the attribute exists and convert string to symbol for hash key
114
+ attributes = attributes.each_with_object({}) { |(k, v), h|
115
+ if (!self.class.attribute_map.key?(k.to_sym))
116
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::AchievementBase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
117
+ end
118
+ h[k.to_sym] = v
119
+ }
120
+
121
+ if attributes.key?(:'name')
122
+ self.name = attributes[:'name']
123
+ end
124
+
125
+ if attributes.key?(:'title')
126
+ self.title = attributes[:'title']
127
+ end
128
+
129
+ if attributes.key?(:'description')
130
+ self.description = attributes[:'description']
131
+ end
132
+
133
+ if attributes.key?(:'target')
134
+ self.target = attributes[:'target']
135
+ end
136
+
137
+ if attributes.key?(:'period')
138
+ self.period = attributes[:'period']
139
+ end
140
+
141
+ if attributes.key?(:'period_end_override')
142
+ self.period_end_override = attributes[:'period_end_override']
143
+ end
144
+
145
+ if attributes.key?(:'recurrence_policy')
146
+ self.recurrence_policy = attributes[:'recurrence_policy']
147
+ end
148
+
149
+ if attributes.key?(:'activation_policy')
150
+ self.activation_policy = attributes[:'activation_policy']
151
+ end
152
+
153
+ if attributes.key?(:'fixed_start_date')
154
+ self.fixed_start_date = attributes[:'fixed_start_date']
155
+ end
156
+
157
+ if attributes.key?(:'end_date')
158
+ self.end_date = attributes[:'end_date']
159
+ end
160
+ end
161
+
162
+ # Show invalid properties with the reasons. Usually used together with valid?
163
+ # @return Array for valid properties with the reasons
164
+ def list_invalid_properties
165
+ invalid_properties = Array.new
166
+ if !@name.nil? && @name.to_s.length > 1000
167
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 1000.')
168
+ end
169
+
170
+ if !@name.nil? && @name.to_s.length < 1
171
+ invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
172
+ end
173
+
174
+ pattern = Regexp.new(/^[a-zA-Z]\w+$/)
175
+ if !@name.nil? && @name !~ pattern
176
+ invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
177
+ end
178
+
179
+ invalid_properties
180
+ end
181
+
182
+ # Check to see if the all the properties in the model are valid
183
+ # @return true if the model is valid
184
+ def valid?
185
+ return false if !@name.nil? && @name.to_s.length > 1000
186
+ return false if !@name.nil? && @name.to_s.length < 1
187
+ return false if !@name.nil? && @name !~ Regexp.new(/^[a-zA-Z]\w+$/)
188
+ recurrence_policy_validator = EnumAttributeValidator.new('String', ["no_recurrence", "on_expiration"])
189
+ return false unless recurrence_policy_validator.valid?(@recurrence_policy)
190
+ activation_policy_validator = EnumAttributeValidator.new('String', ["user_action", "fixed_schedule"])
191
+ return false unless activation_policy_validator.valid?(@activation_policy)
192
+ true
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] name Value to be assigned
197
+ def name=(name)
198
+ if !name.nil? && name.to_s.length > 1000
199
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 1000.'
200
+ end
201
+
202
+ if !name.nil? && name.to_s.length < 1
203
+ fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
204
+ end
205
+
206
+ pattern = Regexp.new(/^[a-zA-Z]\w+$/)
207
+ if !name.nil? && name !~ pattern
208
+ fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
209
+ end
210
+
211
+ @name = name
212
+ end
213
+
214
+ # Custom attribute writer method checking allowed values (enum).
215
+ # @param [Object] recurrence_policy Object to be assigned
216
+ def recurrence_policy=(recurrence_policy)
217
+ validator = EnumAttributeValidator.new('String', ["no_recurrence", "on_expiration"])
218
+ unless validator.valid?(recurrence_policy)
219
+ fail ArgumentError, "invalid value for \"recurrence_policy\", must be one of #{validator.allowable_values}."
220
+ end
221
+ @recurrence_policy = recurrence_policy
222
+ end
223
+
224
+ # Custom attribute writer method checking allowed values (enum).
225
+ # @param [Object] activation_policy Object to be assigned
226
+ def activation_policy=(activation_policy)
227
+ validator = EnumAttributeValidator.new('String', ["user_action", "fixed_schedule"])
228
+ unless validator.valid?(activation_policy)
229
+ fail ArgumentError, "invalid value for \"activation_policy\", must be one of #{validator.allowable_values}."
230
+ end
231
+ @activation_policy = activation_policy
232
+ end
233
+
234
+ # Checks equality by comparing each attribute.
235
+ # @param [Object] Object to be compared
236
+ def ==(o)
237
+ return true if self.equal?(o)
238
+ self.class == o.class &&
239
+ name == o.name &&
240
+ title == o.title &&
241
+ description == o.description &&
242
+ target == o.target &&
243
+ period == o.period &&
244
+ period_end_override == o.period_end_override &&
245
+ recurrence_policy == o.recurrence_policy &&
246
+ activation_policy == o.activation_policy &&
247
+ fixed_start_date == o.fixed_start_date &&
248
+ end_date == o.end_date
249
+ end
250
+
251
+ # @see the `==` method
252
+ # @param [Object] Object to be compared
253
+ def eql?(o)
254
+ self == o
255
+ end
256
+
257
+ # Calculates hash code according to all attributes.
258
+ # @return [Integer] Hash code
259
+ def hash
260
+ [name, title, description, target, period, period_end_override, recurrence_policy, activation_policy, fixed_start_date, end_date].hash
261
+ end
262
+
263
+ # Builds the object from hash
264
+ # @param [Hash] attributes Model attributes in the form of hash
265
+ # @return [Object] Returns the model itself
266
+ def self.build_from_hash(attributes)
267
+ new.build_from_hash(attributes)
268
+ end
269
+
270
+ # Builds the object from hash
271
+ # @param [Hash] attributes Model attributes in the form of hash
272
+ # @return [Object] Returns the model itself
273
+ def build_from_hash(attributes)
274
+ return nil unless attributes.is_a?(Hash)
275
+ self.class.openapi_types.each_pair do |key, type|
276
+ if type =~ /\AArray<(.*)>/i
277
+ # check to ensure the input is an array given that the attribute
278
+ # is documented as an array but the input is not
279
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
280
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
281
+ end
282
+ elsif !attributes[self.class.attribute_map[key]].nil?
283
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
284
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
285
+ end
286
+
287
+ self
288
+ end
289
+
290
+ # Deserializes the data based on type
291
+ # @param string type Data type
292
+ # @param string value Value to be deserialized
293
+ # @return [Object] Deserialized data
294
+ def _deserialize(type, value)
295
+ case type.to_sym
296
+ when :DateTime
297
+ DateTime.parse(value)
298
+ when :Date
299
+ Date.parse(value)
300
+ when :String
301
+ value.to_s
302
+ when :Integer
303
+ value.to_i
304
+ when :Float
305
+ value.to_f
306
+ when :Boolean
307
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
308
+ true
309
+ else
310
+ false
311
+ end
312
+ when :Object
313
+ # generic object (usually a Hash), return directly
314
+ value
315
+ when /\AArray<(?<inner_type>.+)>\z/
316
+ inner_type = Regexp.last_match[:inner_type]
317
+ value.map { |v| _deserialize(inner_type, v) }
318
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
319
+ k_type = Regexp.last_match[:k_type]
320
+ v_type = Regexp.last_match[:v_type]
321
+ {}.tap do |hash|
322
+ value.each do |k, v|
323
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
324
+ end
325
+ end
326
+ else # model
327
+ TalonOne.const_get(type).build_from_hash(value)
328
+ end
329
+ end
330
+
331
+ # Returns the string representation of the object
332
+ # @return [String] String presentation of the object
333
+ def to_s
334
+ to_hash.to_s
335
+ end
336
+
337
+ # to_body is an alias to to_hash (backward compatibility)
338
+ # @return [Hash] Returns the object in the form of hash
339
+ def to_body
340
+ to_hash
341
+ end
342
+
343
+ # Returns the object in the form of hash
344
+ # @return [Hash] Returns the object in the form of hash
345
+ def to_hash
346
+ hash = {}
347
+ self.class.attribute_map.each_pair do |attr, param|
348
+ value = self.send(attr)
349
+ if value.nil?
350
+ is_nullable = self.class.openapi_nullable.include?(attr)
351
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
352
+ end
353
+
354
+ hash[param] = _to_hash(value)
355
+ end
356
+ hash
357
+ end
358
+
359
+ # Outputs non-array value in the form of hash
360
+ # For object, use to_hash. Otherwise, just return the value
361
+ # @param [Object] value Any valid value
362
+ # @return [Hash] Returns the value in the form of hash
363
+ def _to_hash(value)
364
+ if value.is_a?(Array)
365
+ value.compact.map { |v| _to_hash(v) }
366
+ elsif value.is_a?(Hash)
367
+ {}.tap do |hash|
368
+ value.each { |k, v| hash[k] = _to_hash(v) }
369
+ end
370
+ elsif value.respond_to? :to_hash
371
+ value.to_hash
372
+ else
373
+ value
374
+ end
375
+ end
376
+ end
377
+ end