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.
- checksums.yaml +4 -4
- data/README.md +6 -8
- data/docs/AchievementBase.md +35 -0
- data/docs/AchievementProgressWithDefinition.md +45 -0
- data/docs/AchievementStatusEntry.md +45 -0
- data/docs/AnalyticsSKU.md +23 -0
- data/docs/ApplicationCIFReferences.md +19 -0
- data/docs/CampaignDetail.md +19 -0
- data/docs/CampaignStoreBudgetLimitConfig.md +25 -0
- data/docs/CampaignTemplate.md +3 -1
- data/docs/HiddenConditionsEffects.md +23 -0
- data/docs/InlineResponse20048.md +19 -0
- data/docs/InlineResponse20049.md +19 -0
- data/docs/IntegrationApi.md +3 -1
- data/docs/LedgerTransactionLogEntryIntegrationAPI.md +3 -1
- data/docs/LoyaltyLedgerEntryFlags.md +17 -0
- data/docs/LoyaltyProgramTransaction.md +3 -1
- data/docs/ManagementApi.md +164 -323
- data/docs/MessageTest.md +27 -0
- data/docs/NewMessageTest.md +29 -0
- data/docs/ProductUnitAnalyticsDataPoint.md +25 -0
- data/docs/ProductUnitAnalyticsTotals.md +17 -0
- data/docs/SkuUnitAnalytics.md +19 -0
- data/docs/SkuUnitAnalyticsDataPoint.md +23 -0
- data/docs/StrikethroughLabelingNotification.md +2 -0
- data/lib/talon_one/api/integration_api.rb +3 -0
- data/lib/talon_one/api/management_api.rb +191 -354
- data/lib/talon_one/models/achievement_base.rb +377 -0
- data/lib/talon_one/models/achievement_progress_with_definition.rb +490 -0
- data/lib/talon_one/models/achievement_status_entry.rb +472 -0
- data/lib/talon_one/models/analytics_sku.rb +246 -0
- data/lib/talon_one/models/application_cif_references.rb +219 -0
- data/lib/talon_one/models/campaign_detail.rb +232 -0
- data/lib/talon_one/models/campaign_store_budget_limit_config.rb +322 -0
- data/lib/talon_one/models/campaign_template.rb +16 -4
- data/lib/talon_one/models/delete_user_request.rb +0 -1
- data/lib/talon_one/models/hidden_conditions_effects.rb +246 -0
- data/lib/talon_one/models/inline_response20048.rb +222 -0
- data/lib/talon_one/models/inline_response20049.rb +227 -0
- data/lib/talon_one/models/ledger_transaction_log_entry_integration_api.rb +13 -4
- data/lib/talon_one/models/loyalty_ledger_entry_flags.rb +208 -0
- data/lib/talon_one/models/loyalty_program_transaction.rb +13 -4
- data/lib/talon_one/models/message_test.rb +227 -0
- data/lib/talon_one/models/new_message_test.rb +322 -0
- data/lib/talon_one/models/product_unit_analytics_data_point.rb +271 -0
- data/lib/talon_one/models/product_unit_analytics_totals.rb +206 -0
- data/lib/talon_one/models/sku_unit_analytics.rb +227 -0
- data/lib/talon_one/models/sku_unit_analytics_data_point.rb +256 -0
- data/lib/talon_one/models/strikethrough_labeling_notification.rb +11 -1
- data/lib/talon_one/version.rb +1 -1
- data/lib/talon_one.rb +2 -1
- data/spec/api/integration_api_spec.rb +1 -0
- data/spec/api/management_api_spec.rb +60 -87
- data/spec/models/campaign_template_spec.rb +6 -0
- data/spec/models/ledger_transaction_log_entry_integration_api_spec.rb +6 -0
- data/spec/models/loyalty_program_transaction_spec.rb +6 -0
- data/spec/models/revision_activation_request_spec.rb +47 -0
- data/spec/models/strikethrough_labeling_notification_spec.rb +6 -0
- metadata +563 -527
@@ -0,0 +1,472 @@
|
|
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 AchievementStatusEntry
|
17
|
+
# Internal ID of this entity.
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
# The time this entity was created.
|
21
|
+
attr_accessor :created
|
22
|
+
|
23
|
+
# 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.
|
24
|
+
attr_accessor :name
|
25
|
+
|
26
|
+
# The display name for the achievement in the Campaign Manager.
|
27
|
+
attr_accessor :title
|
28
|
+
|
29
|
+
# A description of the achievement.
|
30
|
+
attr_accessor :description
|
31
|
+
|
32
|
+
# The required number of actions or the transactional milestone to complete the achievement.
|
33
|
+
attr_accessor :target
|
34
|
+
|
35
|
+
# 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.
|
36
|
+
attr_accessor :period
|
37
|
+
|
38
|
+
attr_accessor :period_end_override
|
39
|
+
|
40
|
+
# 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.
|
41
|
+
attr_accessor :recurrence_policy
|
42
|
+
|
43
|
+
# 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.
|
44
|
+
attr_accessor :activation_policy
|
45
|
+
|
46
|
+
# The achievement's start date when `activationPolicy` is set to `fixed_schedule`. **Note:** It must be an RFC3339 timestamp string.
|
47
|
+
attr_accessor :fixed_start_date
|
48
|
+
|
49
|
+
# The achievement's end date. If defined, customers cannot participate in the achievement after this date. **Note:** It must be an RFC3339 timestamp string.
|
50
|
+
attr_accessor :end_date
|
51
|
+
|
52
|
+
# The ID of the campaign the achievement belongs to.
|
53
|
+
attr_accessor :campaign_id
|
54
|
+
|
55
|
+
# The status of the achievement.
|
56
|
+
attr_accessor :status
|
57
|
+
|
58
|
+
attr_accessor :current_progress
|
59
|
+
|
60
|
+
class EnumAttributeValidator
|
61
|
+
attr_reader :datatype
|
62
|
+
attr_reader :allowable_values
|
63
|
+
|
64
|
+
def initialize(datatype, allowable_values)
|
65
|
+
@allowable_values = allowable_values.map do |value|
|
66
|
+
case datatype.to_s
|
67
|
+
when /Integer/i
|
68
|
+
value.to_i
|
69
|
+
when /Float/i
|
70
|
+
value.to_f
|
71
|
+
else
|
72
|
+
value
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
|
77
|
+
def valid?(value)
|
78
|
+
!value || allowable_values.include?(value)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
83
|
+
def self.attribute_map
|
84
|
+
{
|
85
|
+
:'id' => :'id',
|
86
|
+
:'created' => :'created',
|
87
|
+
:'name' => :'name',
|
88
|
+
:'title' => :'title',
|
89
|
+
:'description' => :'description',
|
90
|
+
:'target' => :'target',
|
91
|
+
:'period' => :'period',
|
92
|
+
:'period_end_override' => :'periodEndOverride',
|
93
|
+
:'recurrence_policy' => :'recurrencePolicy',
|
94
|
+
:'activation_policy' => :'activationPolicy',
|
95
|
+
:'fixed_start_date' => :'fixedStartDate',
|
96
|
+
:'end_date' => :'endDate',
|
97
|
+
:'campaign_id' => :'campaignId',
|
98
|
+
:'status' => :'status',
|
99
|
+
:'current_progress' => :'currentProgress'
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
# Attribute type mapping.
|
104
|
+
def self.openapi_types
|
105
|
+
{
|
106
|
+
:'id' => :'Integer',
|
107
|
+
:'created' => :'DateTime',
|
108
|
+
:'name' => :'String',
|
109
|
+
:'title' => :'String',
|
110
|
+
:'description' => :'String',
|
111
|
+
:'target' => :'Float',
|
112
|
+
:'period' => :'String',
|
113
|
+
:'period_end_override' => :'TimePoint',
|
114
|
+
:'recurrence_policy' => :'String',
|
115
|
+
:'activation_policy' => :'String',
|
116
|
+
:'fixed_start_date' => :'DateTime',
|
117
|
+
:'end_date' => :'DateTime',
|
118
|
+
:'campaign_id' => :'Integer',
|
119
|
+
:'status' => :'String',
|
120
|
+
:'current_progress' => :'AchievementProgress'
|
121
|
+
}
|
122
|
+
end
|
123
|
+
|
124
|
+
# List of attributes with nullable: true
|
125
|
+
def self.openapi_nullable
|
126
|
+
Set.new([
|
127
|
+
])
|
128
|
+
end
|
129
|
+
|
130
|
+
# Initializes the object
|
131
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
132
|
+
def initialize(attributes = {})
|
133
|
+
if (!attributes.is_a?(Hash))
|
134
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TalonOne::AchievementStatusEntry` initialize method"
|
135
|
+
end
|
136
|
+
|
137
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
138
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
139
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
140
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TalonOne::AchievementStatusEntry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
141
|
+
end
|
142
|
+
h[k.to_sym] = v
|
143
|
+
}
|
144
|
+
|
145
|
+
if attributes.key?(:'id')
|
146
|
+
self.id = attributes[:'id']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes.key?(:'created')
|
150
|
+
self.created = attributes[:'created']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.key?(:'name')
|
154
|
+
self.name = attributes[:'name']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes.key?(:'title')
|
158
|
+
self.title = attributes[:'title']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.key?(:'description')
|
162
|
+
self.description = attributes[:'description']
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes.key?(:'target')
|
166
|
+
self.target = attributes[:'target']
|
167
|
+
end
|
168
|
+
|
169
|
+
if attributes.key?(:'period')
|
170
|
+
self.period = attributes[:'period']
|
171
|
+
end
|
172
|
+
|
173
|
+
if attributes.key?(:'period_end_override')
|
174
|
+
self.period_end_override = attributes[:'period_end_override']
|
175
|
+
end
|
176
|
+
|
177
|
+
if attributes.key?(:'recurrence_policy')
|
178
|
+
self.recurrence_policy = attributes[:'recurrence_policy']
|
179
|
+
end
|
180
|
+
|
181
|
+
if attributes.key?(:'activation_policy')
|
182
|
+
self.activation_policy = attributes[:'activation_policy']
|
183
|
+
end
|
184
|
+
|
185
|
+
if attributes.key?(:'fixed_start_date')
|
186
|
+
self.fixed_start_date = attributes[:'fixed_start_date']
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.key?(:'end_date')
|
190
|
+
self.end_date = attributes[:'end_date']
|
191
|
+
end
|
192
|
+
|
193
|
+
if attributes.key?(:'campaign_id')
|
194
|
+
self.campaign_id = attributes[:'campaign_id']
|
195
|
+
end
|
196
|
+
|
197
|
+
if attributes.key?(:'status')
|
198
|
+
self.status = attributes[:'status']
|
199
|
+
end
|
200
|
+
|
201
|
+
if attributes.key?(:'current_progress')
|
202
|
+
self.current_progress = attributes[:'current_progress']
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
207
|
+
# @return Array for valid properties with the reasons
|
208
|
+
def list_invalid_properties
|
209
|
+
invalid_properties = Array.new
|
210
|
+
if @id.nil?
|
211
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
212
|
+
end
|
213
|
+
|
214
|
+
if @created.nil?
|
215
|
+
invalid_properties.push('invalid value for "created", created cannot be nil.')
|
216
|
+
end
|
217
|
+
|
218
|
+
if @name.nil?
|
219
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
220
|
+
end
|
221
|
+
|
222
|
+
if @name.to_s.length > 1000
|
223
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 1000.')
|
224
|
+
end
|
225
|
+
|
226
|
+
if @name.to_s.length < 1
|
227
|
+
invalid_properties.push('invalid value for "name", the character length must be great than or equal to 1.')
|
228
|
+
end
|
229
|
+
|
230
|
+
pattern = Regexp.new(/^[a-zA-Z]\w+$/)
|
231
|
+
if @name !~ pattern
|
232
|
+
invalid_properties.push("invalid value for \"name\", must conform to the pattern #{pattern}.")
|
233
|
+
end
|
234
|
+
|
235
|
+
if @title.nil?
|
236
|
+
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
237
|
+
end
|
238
|
+
|
239
|
+
if @description.nil?
|
240
|
+
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
241
|
+
end
|
242
|
+
|
243
|
+
if @target.nil?
|
244
|
+
invalid_properties.push('invalid value for "target", target cannot be nil.')
|
245
|
+
end
|
246
|
+
|
247
|
+
invalid_properties
|
248
|
+
end
|
249
|
+
|
250
|
+
# Check to see if the all the properties in the model are valid
|
251
|
+
# @return true if the model is valid
|
252
|
+
def valid?
|
253
|
+
return false if @id.nil?
|
254
|
+
return false if @created.nil?
|
255
|
+
return false if @name.nil?
|
256
|
+
return false if @name.to_s.length > 1000
|
257
|
+
return false if @name.to_s.length < 1
|
258
|
+
return false if @name !~ Regexp.new(/^[a-zA-Z]\w+$/)
|
259
|
+
return false if @title.nil?
|
260
|
+
return false if @description.nil?
|
261
|
+
return false if @target.nil?
|
262
|
+
recurrence_policy_validator = EnumAttributeValidator.new('String', ["no_recurrence", "on_expiration"])
|
263
|
+
return false unless recurrence_policy_validator.valid?(@recurrence_policy)
|
264
|
+
activation_policy_validator = EnumAttributeValidator.new('String', ["user_action", "fixed_schedule"])
|
265
|
+
return false unless activation_policy_validator.valid?(@activation_policy)
|
266
|
+
status_validator = EnumAttributeValidator.new('String', ["active", "scheduled"])
|
267
|
+
return false unless status_validator.valid?(@status)
|
268
|
+
true
|
269
|
+
end
|
270
|
+
|
271
|
+
# Custom attribute writer method with validation
|
272
|
+
# @param [Object] name Value to be assigned
|
273
|
+
def name=(name)
|
274
|
+
if name.nil?
|
275
|
+
fail ArgumentError, 'name cannot be nil'
|
276
|
+
end
|
277
|
+
|
278
|
+
if name.to_s.length > 1000
|
279
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 1000.'
|
280
|
+
end
|
281
|
+
|
282
|
+
if name.to_s.length < 1
|
283
|
+
fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.'
|
284
|
+
end
|
285
|
+
|
286
|
+
pattern = Regexp.new(/^[a-zA-Z]\w+$/)
|
287
|
+
if name !~ pattern
|
288
|
+
fail ArgumentError, "invalid value for \"name\", must conform to the pattern #{pattern}."
|
289
|
+
end
|
290
|
+
|
291
|
+
@name = name
|
292
|
+
end
|
293
|
+
|
294
|
+
# Custom attribute writer method checking allowed values (enum).
|
295
|
+
# @param [Object] recurrence_policy Object to be assigned
|
296
|
+
def recurrence_policy=(recurrence_policy)
|
297
|
+
validator = EnumAttributeValidator.new('String', ["no_recurrence", "on_expiration"])
|
298
|
+
unless validator.valid?(recurrence_policy)
|
299
|
+
fail ArgumentError, "invalid value for \"recurrence_policy\", must be one of #{validator.allowable_values}."
|
300
|
+
end
|
301
|
+
@recurrence_policy = recurrence_policy
|
302
|
+
end
|
303
|
+
|
304
|
+
# Custom attribute writer method checking allowed values (enum).
|
305
|
+
# @param [Object] activation_policy Object to be assigned
|
306
|
+
def activation_policy=(activation_policy)
|
307
|
+
validator = EnumAttributeValidator.new('String', ["user_action", "fixed_schedule"])
|
308
|
+
unless validator.valid?(activation_policy)
|
309
|
+
fail ArgumentError, "invalid value for \"activation_policy\", must be one of #{validator.allowable_values}."
|
310
|
+
end
|
311
|
+
@activation_policy = activation_policy
|
312
|
+
end
|
313
|
+
|
314
|
+
# Custom attribute writer method checking allowed values (enum).
|
315
|
+
# @param [Object] status Object to be assigned
|
316
|
+
def status=(status)
|
317
|
+
validator = EnumAttributeValidator.new('String', ["active", "scheduled"])
|
318
|
+
unless validator.valid?(status)
|
319
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
320
|
+
end
|
321
|
+
@status = status
|
322
|
+
end
|
323
|
+
|
324
|
+
# Checks equality by comparing each attribute.
|
325
|
+
# @param [Object] Object to be compared
|
326
|
+
def ==(o)
|
327
|
+
return true if self.equal?(o)
|
328
|
+
self.class == o.class &&
|
329
|
+
id == o.id &&
|
330
|
+
created == o.created &&
|
331
|
+
name == o.name &&
|
332
|
+
title == o.title &&
|
333
|
+
description == o.description &&
|
334
|
+
target == o.target &&
|
335
|
+
period == o.period &&
|
336
|
+
period_end_override == o.period_end_override &&
|
337
|
+
recurrence_policy == o.recurrence_policy &&
|
338
|
+
activation_policy == o.activation_policy &&
|
339
|
+
fixed_start_date == o.fixed_start_date &&
|
340
|
+
end_date == o.end_date &&
|
341
|
+
campaign_id == o.campaign_id &&
|
342
|
+
status == o.status &&
|
343
|
+
current_progress == o.current_progress
|
344
|
+
end
|
345
|
+
|
346
|
+
# @see the `==` method
|
347
|
+
# @param [Object] Object to be compared
|
348
|
+
def eql?(o)
|
349
|
+
self == o
|
350
|
+
end
|
351
|
+
|
352
|
+
# Calculates hash code according to all attributes.
|
353
|
+
# @return [Integer] Hash code
|
354
|
+
def hash
|
355
|
+
[id, created, name, title, description, target, period, period_end_override, recurrence_policy, activation_policy, fixed_start_date, end_date, campaign_id, status, current_progress].hash
|
356
|
+
end
|
357
|
+
|
358
|
+
# Builds the object from hash
|
359
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
360
|
+
# @return [Object] Returns the model itself
|
361
|
+
def self.build_from_hash(attributes)
|
362
|
+
new.build_from_hash(attributes)
|
363
|
+
end
|
364
|
+
|
365
|
+
# Builds the object from hash
|
366
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
367
|
+
# @return [Object] Returns the model itself
|
368
|
+
def build_from_hash(attributes)
|
369
|
+
return nil unless attributes.is_a?(Hash)
|
370
|
+
self.class.openapi_types.each_pair do |key, type|
|
371
|
+
if type =~ /\AArray<(.*)>/i
|
372
|
+
# check to ensure the input is an array given that the attribute
|
373
|
+
# is documented as an array but the input is not
|
374
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
375
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
376
|
+
end
|
377
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
378
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
379
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
380
|
+
end
|
381
|
+
|
382
|
+
self
|
383
|
+
end
|
384
|
+
|
385
|
+
# Deserializes the data based on type
|
386
|
+
# @param string type Data type
|
387
|
+
# @param string value Value to be deserialized
|
388
|
+
# @return [Object] Deserialized data
|
389
|
+
def _deserialize(type, value)
|
390
|
+
case type.to_sym
|
391
|
+
when :DateTime
|
392
|
+
DateTime.parse(value)
|
393
|
+
when :Date
|
394
|
+
Date.parse(value)
|
395
|
+
when :String
|
396
|
+
value.to_s
|
397
|
+
when :Integer
|
398
|
+
value.to_i
|
399
|
+
when :Float
|
400
|
+
value.to_f
|
401
|
+
when :Boolean
|
402
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
403
|
+
true
|
404
|
+
else
|
405
|
+
false
|
406
|
+
end
|
407
|
+
when :Object
|
408
|
+
# generic object (usually a Hash), return directly
|
409
|
+
value
|
410
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
411
|
+
inner_type = Regexp.last_match[:inner_type]
|
412
|
+
value.map { |v| _deserialize(inner_type, v) }
|
413
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
414
|
+
k_type = Regexp.last_match[:k_type]
|
415
|
+
v_type = Regexp.last_match[:v_type]
|
416
|
+
{}.tap do |hash|
|
417
|
+
value.each do |k, v|
|
418
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
419
|
+
end
|
420
|
+
end
|
421
|
+
else # model
|
422
|
+
TalonOne.const_get(type).build_from_hash(value)
|
423
|
+
end
|
424
|
+
end
|
425
|
+
|
426
|
+
# Returns the string representation of the object
|
427
|
+
# @return [String] String presentation of the object
|
428
|
+
def to_s
|
429
|
+
to_hash.to_s
|
430
|
+
end
|
431
|
+
|
432
|
+
# to_body is an alias to to_hash (backward compatibility)
|
433
|
+
# @return [Hash] Returns the object in the form of hash
|
434
|
+
def to_body
|
435
|
+
to_hash
|
436
|
+
end
|
437
|
+
|
438
|
+
# Returns the object in the form of hash
|
439
|
+
# @return [Hash] Returns the object in the form of hash
|
440
|
+
def to_hash
|
441
|
+
hash = {}
|
442
|
+
self.class.attribute_map.each_pair do |attr, param|
|
443
|
+
value = self.send(attr)
|
444
|
+
if value.nil?
|
445
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
446
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
447
|
+
end
|
448
|
+
|
449
|
+
hash[param] = _to_hash(value)
|
450
|
+
end
|
451
|
+
hash
|
452
|
+
end
|
453
|
+
|
454
|
+
# Outputs non-array value in the form of hash
|
455
|
+
# For object, use to_hash. Otherwise, just return the value
|
456
|
+
# @param [Object] value Any valid value
|
457
|
+
# @return [Hash] Returns the value in the form of hash
|
458
|
+
def _to_hash(value)
|
459
|
+
if value.is_a?(Array)
|
460
|
+
value.compact.map { |v| _to_hash(v) }
|
461
|
+
elsif value.is_a?(Hash)
|
462
|
+
{}.tap do |hash|
|
463
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
464
|
+
end
|
465
|
+
elsif value.respond_to? :to_hash
|
466
|
+
value.to_hash
|
467
|
+
else
|
468
|
+
value
|
469
|
+
end
|
470
|
+
end
|
471
|
+
end
|
472
|
+
end
|