talon_one 1.1.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +21 -12
- data/docs/AccountAnalytics.md +1 -0
- data/docs/AccountLimits.md +1 -0
- data/docs/Application.md +2 -1
- data/docs/ApplicationCustomer.md +1 -1
- data/docs/ApplicationSession.md +2 -1
- data/docs/Attribute.md +0 -2
- data/docs/AttributesMandatory.md +9 -0
- data/docs/AttributesSettings.md +8 -0
- data/docs/BaseSamlConnection.md +15 -0
- data/docs/Campaign.md +2 -0
- data/docs/CampaignAnalytics.md +9 -3
- data/docs/CampaignCopy.md +4 -0
- data/docs/Change.md +2 -2
- data/docs/CustomerInventory.md +9 -0
- data/docs/CustomerProfile.md +1 -1
- data/docs/ErrorSource.md +1 -0
- data/docs/Event.md +1 -1
- data/docs/InlineResponse20020.md +1 -1
- data/docs/InlineResponse20021.md +1 -1
- data/docs/InlineResponse20022.md +1 -1
- data/docs/InlineResponse20023.md +1 -1
- data/docs/InlineResponse20024.md +1 -1
- data/docs/InlineResponse20025.md +1 -1
- data/docs/InlineResponse20026.md +3 -2
- data/docs/InlineResponse20027.md +1 -1
- data/docs/InlineResponse20028.md +1 -1
- data/docs/InlineResponse20029.md +9 -0
- data/docs/IntegrationApi.md +66 -0
- data/docs/IntegrationEvent.md +10 -0
- data/docs/IntegrationState.md +1 -0
- data/docs/ManagementApi.md +175 -104
- data/docs/Meta.md +1 -0
- data/docs/NewApplication.md +2 -1
- data/docs/NewEvent.md +1 -1
- data/docs/NewSamlConnection.md +16 -0
- data/docs/Notification.md +10 -0
- data/docs/{ApplicationStorageData.md → Notifications.md} +1 -1
- data/docs/ReferralRejectionReason.md +10 -0
- data/docs/SamlConnection.md +18 -0
- data/docs/SamlConnectionMetadata.md +11 -0
- data/docs/UpdateApplication.md +15 -0
- data/docs/UpdateUser.md +1 -0
- data/docs/User.md +2 -0
- data/docs/Webhook.md +0 -1
- data/lib/talon_one.rb +13 -6
- data/lib/talon_one/api/integration_api.rb +60 -0
- data/lib/talon_one/api/management_api.rb +194 -121
- data/lib/talon_one/models/account_analytics.rb +19 -4
- data/lib/talon_one/models/account_limits.rb +11 -1
- data/lib/talon_one/models/application.rb +62 -53
- data/lib/talon_one/models/application_customer.rb +0 -5
- data/lib/talon_one/models/application_session.rb +12 -2
- data/lib/talon_one/models/attribute.rb +4 -38
- data/lib/talon_one/models/attributes_mandatory.rb +199 -0
- data/lib/talon_one/models/{new_application_storage_data.rb → attributes_settings.rb} +13 -4
- data/lib/talon_one/models/{application_storage.rb → base_saml_connection.rb} +122 -78
- data/lib/talon_one/models/campaign.rb +21 -1
- data/lib/talon_one/models/campaign_analytics.rb +94 -4
- data/lib/talon_one/models/campaign_copy.rb +46 -4
- data/lib/talon_one/models/change.rb +2 -2
- data/lib/talon_one/models/coupon_rejection_reason.rb +2 -2
- data/lib/talon_one/models/customer_inventory.rb +194 -0
- data/lib/talon_one/models/customer_profile.rb +0 -5
- data/lib/talon_one/models/error_source.rb +14 -4
- data/lib/talon_one/models/event.rb +11 -35
- data/lib/talon_one/models/inline_response_200_20.rb +1 -1
- data/lib/talon_one/models/inline_response_200_21.rb +1 -1
- data/lib/talon_one/models/inline_response_200_22.rb +1 -1
- data/lib/talon_one/models/inline_response_200_23.rb +1 -1
- data/lib/talon_one/models/inline_response_200_24.rb +1 -1
- data/lib/talon_one/models/inline_response_200_25.rb +1 -1
- data/lib/talon_one/models/inline_response_200_26.rb +11 -7
- data/lib/talon_one/models/inline_response_200_27.rb +1 -1
- data/lib/talon_one/models/inline_response_200_28.rb +1 -1
- data/lib/talon_one/models/{new_application_storage_tuple.rb → inline_response_200_29.rb} +22 -40
- data/lib/talon_one/models/integration_event.rb +234 -0
- data/lib/talon_one/models/integration_state.rb +13 -4
- data/lib/talon_one/models/limit_config.rb +2 -2
- data/lib/talon_one/models/meta.rb +10 -1
- data/lib/talon_one/models/new_application.rb +57 -56
- data/lib/talon_one/models/new_event.rb +38 -38
- data/lib/talon_one/models/new_saml_connection.rb +371 -0
- data/lib/talon_one/models/{new_application_storage.rb → notification.rb} +22 -17
- data/lib/talon_one/models/{application_storage_data.rb → notifications.rb} +1 -2
- data/lib/talon_one/models/referral_rejection_reason.rb +251 -0
- data/lib/talon_one/models/saml_connection.rb +387 -0
- data/lib/talon_one/models/{application_storage_tuple.rb → saml_connection_metadata.rb} +68 -80
- data/lib/talon_one/models/update_application.rb +361 -0
- data/lib/talon_one/models/update_user.rb +13 -4
- data/lib/talon_one/models/user.rb +23 -4
- data/lib/talon_one/models/webhook.rb +4 -21
- data/lib/talon_one/version.rb +1 -1
- data/spec/api/integration_api_spec.rb +14 -0
- data/spec/api/management_api_spec.rb +56 -37
- data/spec/models/account_analytics_spec.rb +6 -0
- data/spec/models/account_limits_spec.rb +6 -0
- data/spec/models/application_session_spec.rb +6 -0
- data/spec/models/application_spec.rb +12 -6
- data/spec/models/attribute_spec.rb +0 -12
- data/spec/models/{new_application_storage_tuple_spec.rb → attributes_mandatory_spec.rb} +8 -8
- data/spec/models/{new_application_storage_data_spec.rb → attributes_settings_spec.rb} +12 -6
- data/spec/models/{application_storage_spec.rb → base_saml_connection_spec.rb} +14 -14
- data/spec/models/campaign_analytics_spec.rb +36 -0
- data/spec/models/campaign_copy_spec.rb +24 -0
- data/spec/models/campaign_spec.rb +12 -0
- data/spec/models/coupon_rejection_reason_spec.rb +1 -1
- data/spec/models/customer_inventory_spec.rb +47 -0
- data/spec/models/error_source_spec.rb +6 -0
- data/spec/models/event_spec.rb +3 -3
- data/spec/models/inline_response_200_26_spec.rb +6 -0
- data/spec/models/inline_response_200_29_spec.rb +47 -0
- data/spec/models/integration_event_spec.rb +53 -0
- data/spec/models/integration_state_spec.rb +6 -0
- data/spec/models/limit_config_spec.rb +1 -1
- data/spec/models/meta_spec.rb +6 -0
- data/spec/models/new_application_spec.rb +12 -6
- data/spec/models/new_event_spec.rb +3 -3
- data/spec/models/new_saml_connection_spec.rb +89 -0
- data/spec/models/{new_application_storage_spec.rb → notification_spec.rb} +8 -8
- data/spec/models/{application_storage_data_spec.rb → notifications_spec.rb} +6 -6
- data/spec/models/referral_rejection_reason_spec.rb +57 -0
- data/spec/models/{application_storage_tuple_spec.rb → saml_connection_metadata_spec.rb} +10 -22
- data/spec/models/saml_connection_spec.rb +101 -0
- data/spec/models/update_application_spec.rb +87 -0
- data/spec/models/update_user_spec.rb +6 -0
- data/spec/models/user_spec.rb +12 -0
- data/spec/models/webhook_spec.rb +0 -6
- data/talon_one-1.0.0.gem +0 -0
- data/talon_one-1.1.0.gem +0 -0
- data/talon_one-1.1.1.gem +0 -0
- data/talon_one-1.1.2.gem +0 -0
- data/talon_one-1.2.0.gem +0 -0
- data/talon_one-1.3.0.gem +0 -0
- data/talon_one.gemspec +1 -1
- metadata +74 -42
- data/docs/ApplicationStorage.md +0 -15
- data/docs/ApplicationStorageTuple.md +0 -13
- data/docs/NewApplicationStorage.md +0 -10
- data/docs/NewApplicationStorageData.md +0 -7
- data/docs/NewApplicationStorageTuple.md +0 -9
- data/fck.rb +0 -64
@@ -70,6 +70,12 @@ module TalonOne
|
|
70
70
|
# Total amount of discounts redeemed in the campaign.
|
71
71
|
attr_accessor :discount_count
|
72
72
|
|
73
|
+
# Total number of times discounts were redeemed in this campaign.
|
74
|
+
attr_accessor :discount_effect_count
|
75
|
+
|
76
|
+
# Total number of coupons created by rules in this campaign.
|
77
|
+
attr_accessor :coupon_creation_count
|
78
|
+
|
73
79
|
# Timestamp of the most recent event received by this campaign.
|
74
80
|
attr_accessor :last_activity
|
75
81
|
|
@@ -126,6 +132,8 @@ module TalonOne
|
|
126
132
|
:'coupon_redemption_count' => :'couponRedemptionCount',
|
127
133
|
:'referral_redemption_count' => :'referralRedemptionCount',
|
128
134
|
:'discount_count' => :'discountCount',
|
135
|
+
:'discount_effect_count' => :'discountEffectCount',
|
136
|
+
:'coupon_creation_count' => :'couponCreationCount',
|
129
137
|
:'last_activity' => :'lastActivity',
|
130
138
|
:'updated' => :'updated',
|
131
139
|
:'created_by' => :'createdBy',
|
@@ -155,6 +163,8 @@ module TalonOne
|
|
155
163
|
:'coupon_redemption_count' => :'Integer',
|
156
164
|
:'referral_redemption_count' => :'Integer',
|
157
165
|
:'discount_count' => :'Integer',
|
166
|
+
:'discount_effect_count' => :'Integer',
|
167
|
+
:'coupon_creation_count' => :'Integer',
|
158
168
|
:'last_activity' => :'DateTime',
|
159
169
|
:'updated' => :'DateTime',
|
160
170
|
:'created_by' => :'String',
|
@@ -254,6 +264,14 @@ module TalonOne
|
|
254
264
|
self.discount_count = attributes[:'discountCount']
|
255
265
|
end
|
256
266
|
|
267
|
+
if attributes.has_key?(:'discountEffectCount')
|
268
|
+
self.discount_effect_count = attributes[:'discountEffectCount']
|
269
|
+
end
|
270
|
+
|
271
|
+
if attributes.has_key?(:'couponCreationCount')
|
272
|
+
self.coupon_creation_count = attributes[:'couponCreationCount']
|
273
|
+
end
|
274
|
+
|
257
275
|
if attributes.has_key?(:'lastActivity')
|
258
276
|
self.last_activity = attributes[:'lastActivity']
|
259
277
|
end
|
@@ -389,6 +407,8 @@ module TalonOne
|
|
389
407
|
coupon_redemption_count == o.coupon_redemption_count &&
|
390
408
|
referral_redemption_count == o.referral_redemption_count &&
|
391
409
|
discount_count == o.discount_count &&
|
410
|
+
discount_effect_count == o.discount_effect_count &&
|
411
|
+
coupon_creation_count == o.coupon_creation_count &&
|
392
412
|
last_activity == o.last_activity &&
|
393
413
|
updated == o.updated &&
|
394
414
|
created_by == o.created_by &&
|
@@ -404,7 +424,7 @@ module TalonOne
|
|
404
424
|
# Calculates hash code according to all attributes.
|
405
425
|
# @return [Fixnum] Hash code
|
406
426
|
def hash
|
407
|
-
[id, created, application_id, user_id, name, description, start_time, end_time, attributes, state, active_ruleset_id, tags, features, coupon_settings, referral_settings, limits, coupon_redemption_count, referral_redemption_count, discount_count, last_activity, updated, created_by, updated_by].hash
|
427
|
+
[id, created, application_id, user_id, name, description, start_time, end_time, attributes, state, active_ruleset_id, tags, features, coupon_settings, referral_settings, limits, coupon_redemption_count, referral_redemption_count, discount_count, discount_effect_count, coupon_creation_count, last_activity, updated, created_by, updated_by].hash
|
408
428
|
end
|
409
429
|
|
410
430
|
# Builds the object from hash
|
@@ -17,30 +17,48 @@ module TalonOne
|
|
17
17
|
class CampaignAnalytics
|
18
18
|
attr_accessor :date
|
19
19
|
|
20
|
-
# Amount of revenue in this campaign.
|
20
|
+
# Amount of revenue in this campaign (for coupon or discount sessions).
|
21
21
|
attr_accessor :campaign_revenue
|
22
22
|
|
23
|
-
# Amount of revenue in this campaign since it began.
|
23
|
+
# Amount of revenue in this campaign since it began (for coupon or discount sessions).
|
24
24
|
attr_accessor :total_campaign_revenue
|
25
25
|
|
26
|
+
# Amount of refunds in this campaign (for coupon or discount sessions).
|
27
|
+
attr_accessor :campaign_refund
|
28
|
+
|
29
|
+
# Amount of refunds in this campaign since it began (for coupon or discount sessions).
|
30
|
+
attr_accessor :total_campaign_refund
|
31
|
+
|
26
32
|
# Amount of cost caused by discounts given in the campaign.
|
27
33
|
attr_accessor :campaign_discount_costs
|
28
34
|
|
29
35
|
# Amount of cost caused by discounts given in the campaign since it began.
|
30
36
|
attr_accessor :total_campaign_discount_costs
|
31
37
|
|
38
|
+
# Amount of discounts rolledback due to refund in the campaign.
|
39
|
+
attr_accessor :campaign_refunded_discounts
|
40
|
+
|
41
|
+
# Amount of discounts rolledback due to refund in the campaign since it began.
|
42
|
+
attr_accessor :total_campaign_refunded_discounts
|
43
|
+
|
32
44
|
# Amount of free items given in the campaign.
|
33
45
|
attr_accessor :campaign_free_items
|
34
46
|
|
35
47
|
# Amount of free items given in the campaign since it began.
|
36
48
|
attr_accessor :total_campaign_free_items
|
37
49
|
|
38
|
-
# Number of coupon redemptions in the campaign
|
50
|
+
# Number of coupon redemptions in the campaign.
|
39
51
|
attr_accessor :coupon_redemptions
|
40
52
|
|
41
53
|
# Number of coupon redemptions in the campaign since it began.
|
42
54
|
attr_accessor :total_coupon_redemptions
|
43
55
|
|
56
|
+
# Number of coupon redemptions that have been rolled back (due to canceling closed session) in the campaign.
|
57
|
+
attr_accessor :coupon_rolledback_redemptions
|
58
|
+
|
59
|
+
# Number of coupon redemptions that have been rolled back (due to canceling closed session) in the campaign since it began.
|
60
|
+
attr_accessor :total_coupon_rolledback_redemptions
|
61
|
+
|
44
62
|
# Number of referral redemptions in the campaign.
|
45
63
|
attr_accessor :referral_redemptions
|
46
64
|
|
@@ -65,12 +83,18 @@ module TalonOne
|
|
65
83
|
:'date' => :'date',
|
66
84
|
:'campaign_revenue' => :'campaignRevenue',
|
67
85
|
:'total_campaign_revenue' => :'totalCampaignRevenue',
|
86
|
+
:'campaign_refund' => :'campaignRefund',
|
87
|
+
:'total_campaign_refund' => :'totalCampaignRefund',
|
68
88
|
:'campaign_discount_costs' => :'campaignDiscountCosts',
|
69
89
|
:'total_campaign_discount_costs' => :'totalCampaignDiscountCosts',
|
90
|
+
:'campaign_refunded_discounts' => :'campaignRefundedDiscounts',
|
91
|
+
:'total_campaign_refunded_discounts' => :'totalCampaignRefundedDiscounts',
|
70
92
|
:'campaign_free_items' => :'campaignFreeItems',
|
71
93
|
:'total_campaign_free_items' => :'totalCampaignFreeItems',
|
72
94
|
:'coupon_redemptions' => :'couponRedemptions',
|
73
95
|
:'total_coupon_redemptions' => :'totalCouponRedemptions',
|
96
|
+
:'coupon_rolledback_redemptions' => :'couponRolledbackRedemptions',
|
97
|
+
:'total_coupon_rolledback_redemptions' => :'totalCouponRolledbackRedemptions',
|
74
98
|
:'referral_redemptions' => :'referralRedemptions',
|
75
99
|
:'total_referral_redemptions' => :'totalReferralRedemptions',
|
76
100
|
:'coupons_created' => :'couponsCreated',
|
@@ -86,12 +110,18 @@ module TalonOne
|
|
86
110
|
:'date' => :'DateTime',
|
87
111
|
:'campaign_revenue' => :'Float',
|
88
112
|
:'total_campaign_revenue' => :'Float',
|
113
|
+
:'campaign_refund' => :'Float',
|
114
|
+
:'total_campaign_refund' => :'Float',
|
89
115
|
:'campaign_discount_costs' => :'Float',
|
90
116
|
:'total_campaign_discount_costs' => :'Float',
|
117
|
+
:'campaign_refunded_discounts' => :'Float',
|
118
|
+
:'total_campaign_refunded_discounts' => :'Float',
|
91
119
|
:'campaign_free_items' => :'Integer',
|
92
120
|
:'total_campaign_free_items' => :'Integer',
|
93
121
|
:'coupon_redemptions' => :'Integer',
|
94
122
|
:'total_coupon_redemptions' => :'Integer',
|
123
|
+
:'coupon_rolledback_redemptions' => :'Integer',
|
124
|
+
:'total_coupon_rolledback_redemptions' => :'Integer',
|
95
125
|
:'referral_redemptions' => :'Integer',
|
96
126
|
:'total_referral_redemptions' => :'Integer',
|
97
127
|
:'coupons_created' => :'Integer',
|
@@ -121,6 +151,14 @@ module TalonOne
|
|
121
151
|
self.total_campaign_revenue = attributes[:'totalCampaignRevenue']
|
122
152
|
end
|
123
153
|
|
154
|
+
if attributes.has_key?(:'campaignRefund')
|
155
|
+
self.campaign_refund = attributes[:'campaignRefund']
|
156
|
+
end
|
157
|
+
|
158
|
+
if attributes.has_key?(:'totalCampaignRefund')
|
159
|
+
self.total_campaign_refund = attributes[:'totalCampaignRefund']
|
160
|
+
end
|
161
|
+
|
124
162
|
if attributes.has_key?(:'campaignDiscountCosts')
|
125
163
|
self.campaign_discount_costs = attributes[:'campaignDiscountCosts']
|
126
164
|
end
|
@@ -129,6 +167,14 @@ module TalonOne
|
|
129
167
|
self.total_campaign_discount_costs = attributes[:'totalCampaignDiscountCosts']
|
130
168
|
end
|
131
169
|
|
170
|
+
if attributes.has_key?(:'campaignRefundedDiscounts')
|
171
|
+
self.campaign_refunded_discounts = attributes[:'campaignRefundedDiscounts']
|
172
|
+
end
|
173
|
+
|
174
|
+
if attributes.has_key?(:'totalCampaignRefundedDiscounts')
|
175
|
+
self.total_campaign_refunded_discounts = attributes[:'totalCampaignRefundedDiscounts']
|
176
|
+
end
|
177
|
+
|
132
178
|
if attributes.has_key?(:'campaignFreeItems')
|
133
179
|
self.campaign_free_items = attributes[:'campaignFreeItems']
|
134
180
|
end
|
@@ -145,6 +191,14 @@ module TalonOne
|
|
145
191
|
self.total_coupon_redemptions = attributes[:'totalCouponRedemptions']
|
146
192
|
end
|
147
193
|
|
194
|
+
if attributes.has_key?(:'couponRolledbackRedemptions')
|
195
|
+
self.coupon_rolledback_redemptions = attributes[:'couponRolledbackRedemptions']
|
196
|
+
end
|
197
|
+
|
198
|
+
if attributes.has_key?(:'totalCouponRolledbackRedemptions')
|
199
|
+
self.total_coupon_rolledback_redemptions = attributes[:'totalCouponRolledbackRedemptions']
|
200
|
+
end
|
201
|
+
|
148
202
|
if attributes.has_key?(:'referralRedemptions')
|
149
203
|
self.referral_redemptions = attributes[:'referralRedemptions']
|
150
204
|
end
|
@@ -186,6 +240,14 @@ module TalonOne
|
|
186
240
|
invalid_properties.push('invalid value for "total_campaign_revenue", total_campaign_revenue cannot be nil.')
|
187
241
|
end
|
188
242
|
|
243
|
+
if @campaign_refund.nil?
|
244
|
+
invalid_properties.push('invalid value for "campaign_refund", campaign_refund cannot be nil.')
|
245
|
+
end
|
246
|
+
|
247
|
+
if @total_campaign_refund.nil?
|
248
|
+
invalid_properties.push('invalid value for "total_campaign_refund", total_campaign_refund cannot be nil.')
|
249
|
+
end
|
250
|
+
|
189
251
|
if @campaign_discount_costs.nil?
|
190
252
|
invalid_properties.push('invalid value for "campaign_discount_costs", campaign_discount_costs cannot be nil.')
|
191
253
|
end
|
@@ -194,6 +256,14 @@ module TalonOne
|
|
194
256
|
invalid_properties.push('invalid value for "total_campaign_discount_costs", total_campaign_discount_costs cannot be nil.')
|
195
257
|
end
|
196
258
|
|
259
|
+
if @campaign_refunded_discounts.nil?
|
260
|
+
invalid_properties.push('invalid value for "campaign_refunded_discounts", campaign_refunded_discounts cannot be nil.')
|
261
|
+
end
|
262
|
+
|
263
|
+
if @total_campaign_refunded_discounts.nil?
|
264
|
+
invalid_properties.push('invalid value for "total_campaign_refunded_discounts", total_campaign_refunded_discounts cannot be nil.')
|
265
|
+
end
|
266
|
+
|
197
267
|
if @campaign_free_items.nil?
|
198
268
|
invalid_properties.push('invalid value for "campaign_free_items", campaign_free_items cannot be nil.')
|
199
269
|
end
|
@@ -210,6 +280,14 @@ module TalonOne
|
|
210
280
|
invalid_properties.push('invalid value for "total_coupon_redemptions", total_coupon_redemptions cannot be nil.')
|
211
281
|
end
|
212
282
|
|
283
|
+
if @coupon_rolledback_redemptions.nil?
|
284
|
+
invalid_properties.push('invalid value for "coupon_rolledback_redemptions", coupon_rolledback_redemptions cannot be nil.')
|
285
|
+
end
|
286
|
+
|
287
|
+
if @total_coupon_rolledback_redemptions.nil?
|
288
|
+
invalid_properties.push('invalid value for "total_coupon_rolledback_redemptions", total_coupon_rolledback_redemptions cannot be nil.')
|
289
|
+
end
|
290
|
+
|
213
291
|
if @referral_redemptions.nil?
|
214
292
|
invalid_properties.push('invalid value for "referral_redemptions", referral_redemptions cannot be nil.')
|
215
293
|
end
|
@@ -243,12 +321,18 @@ module TalonOne
|
|
243
321
|
return false if @date.nil?
|
244
322
|
return false if @campaign_revenue.nil?
|
245
323
|
return false if @total_campaign_revenue.nil?
|
324
|
+
return false if @campaign_refund.nil?
|
325
|
+
return false if @total_campaign_refund.nil?
|
246
326
|
return false if @campaign_discount_costs.nil?
|
247
327
|
return false if @total_campaign_discount_costs.nil?
|
328
|
+
return false if @campaign_refunded_discounts.nil?
|
329
|
+
return false if @total_campaign_refunded_discounts.nil?
|
248
330
|
return false if @campaign_free_items.nil?
|
249
331
|
return false if @total_campaign_free_items.nil?
|
250
332
|
return false if @coupon_redemptions.nil?
|
251
333
|
return false if @total_coupon_redemptions.nil?
|
334
|
+
return false if @coupon_rolledback_redemptions.nil?
|
335
|
+
return false if @total_coupon_rolledback_redemptions.nil?
|
252
336
|
return false if @referral_redemptions.nil?
|
253
337
|
return false if @total_referral_redemptions.nil?
|
254
338
|
return false if @coupons_created.nil?
|
@@ -266,12 +350,18 @@ module TalonOne
|
|
266
350
|
date == o.date &&
|
267
351
|
campaign_revenue == o.campaign_revenue &&
|
268
352
|
total_campaign_revenue == o.total_campaign_revenue &&
|
353
|
+
campaign_refund == o.campaign_refund &&
|
354
|
+
total_campaign_refund == o.total_campaign_refund &&
|
269
355
|
campaign_discount_costs == o.campaign_discount_costs &&
|
270
356
|
total_campaign_discount_costs == o.total_campaign_discount_costs &&
|
357
|
+
campaign_refunded_discounts == o.campaign_refunded_discounts &&
|
358
|
+
total_campaign_refunded_discounts == o.total_campaign_refunded_discounts &&
|
271
359
|
campaign_free_items == o.campaign_free_items &&
|
272
360
|
total_campaign_free_items == o.total_campaign_free_items &&
|
273
361
|
coupon_redemptions == o.coupon_redemptions &&
|
274
362
|
total_coupon_redemptions == o.total_coupon_redemptions &&
|
363
|
+
coupon_rolledback_redemptions == o.coupon_rolledback_redemptions &&
|
364
|
+
total_coupon_rolledback_redemptions == o.total_coupon_rolledback_redemptions &&
|
275
365
|
referral_redemptions == o.referral_redemptions &&
|
276
366
|
total_referral_redemptions == o.total_referral_redemptions &&
|
277
367
|
coupons_created == o.coupons_created &&
|
@@ -289,7 +379,7 @@ module TalonOne
|
|
289
379
|
# Calculates hash code according to all attributes.
|
290
380
|
# @return [Fixnum] Hash code
|
291
381
|
def hash
|
292
|
-
[date, campaign_revenue, total_campaign_revenue, campaign_discount_costs, total_campaign_discount_costs, campaign_free_items, total_campaign_free_items, coupon_redemptions, total_coupon_redemptions, referral_redemptions, total_referral_redemptions, coupons_created, total_coupons_created, referrals_created, total_referrals_created].hash
|
382
|
+
[date, campaign_revenue, total_campaign_revenue, campaign_refund, total_campaign_refund, campaign_discount_costs, total_campaign_discount_costs, campaign_refunded_discounts, total_campaign_refunded_discounts, campaign_free_items, total_campaign_free_items, coupon_redemptions, total_coupon_redemptions, coupon_rolledback_redemptions, total_coupon_rolledback_redemptions, referral_redemptions, total_referral_redemptions, coupons_created, total_coupons_created, referrals_created, total_referrals_created].hash
|
293
383
|
end
|
294
384
|
|
295
385
|
# Builds the object from hash
|
@@ -20,11 +20,27 @@ module TalonOne
|
|
20
20
|
# Application IDs of the applications to which a campaign should be copied to
|
21
21
|
attr_accessor :application_ids
|
22
22
|
|
23
|
+
# A detailed description of the campaign.
|
24
|
+
attr_accessor :description
|
25
|
+
|
26
|
+
# Datetime when the campaign will become active.
|
27
|
+
attr_accessor :start_time
|
28
|
+
|
29
|
+
# Datetime when the campaign will become in-active.
|
30
|
+
attr_accessor :end_time
|
31
|
+
|
32
|
+
# A list of tags for the campaign.
|
33
|
+
attr_accessor :tags
|
34
|
+
|
23
35
|
# Attribute mapping from ruby-style variable name to JSON key.
|
24
36
|
def self.attribute_map
|
25
37
|
{
|
26
38
|
:'name' => :'name',
|
27
|
-
:'application_ids' => :'applicationIds'
|
39
|
+
:'application_ids' => :'applicationIds',
|
40
|
+
:'description' => :'description',
|
41
|
+
:'start_time' => :'startTime',
|
42
|
+
:'end_time' => :'endTime',
|
43
|
+
:'tags' => :'tags'
|
28
44
|
}
|
29
45
|
end
|
30
46
|
|
@@ -32,7 +48,11 @@ module TalonOne
|
|
32
48
|
def self.swagger_types
|
33
49
|
{
|
34
50
|
:'name' => :'String',
|
35
|
-
:'application_ids' => :'Array<String>'
|
51
|
+
:'application_ids' => :'Array<String>',
|
52
|
+
:'description' => :'String',
|
53
|
+
:'start_time' => :'DateTime',
|
54
|
+
:'end_time' => :'DateTime',
|
55
|
+
:'tags' => :'Array<String>'
|
36
56
|
}
|
37
57
|
end
|
38
58
|
|
@@ -53,6 +73,24 @@ module TalonOne
|
|
53
73
|
self.application_ids = value
|
54
74
|
end
|
55
75
|
end
|
76
|
+
|
77
|
+
if attributes.has_key?(:'description')
|
78
|
+
self.description = attributes[:'description']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.has_key?(:'startTime')
|
82
|
+
self.start_time = attributes[:'startTime']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.has_key?(:'endTime')
|
86
|
+
self.end_time = attributes[:'endTime']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.has_key?(:'tags')
|
90
|
+
if (value = attributes[:'tags']).is_a?(Array)
|
91
|
+
self.tags = value
|
92
|
+
end
|
93
|
+
end
|
56
94
|
end
|
57
95
|
|
58
96
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -79,7 +117,11 @@ module TalonOne
|
|
79
117
|
return true if self.equal?(o)
|
80
118
|
self.class == o.class &&
|
81
119
|
name == o.name &&
|
82
|
-
application_ids == o.application_ids
|
120
|
+
application_ids == o.application_ids &&
|
121
|
+
description == o.description &&
|
122
|
+
start_time == o.start_time &&
|
123
|
+
end_time == o.end_time &&
|
124
|
+
tags == o.tags
|
83
125
|
end
|
84
126
|
|
85
127
|
# @see the `==` method
|
@@ -91,7 +133,7 @@ module TalonOne
|
|
91
133
|
# Calculates hash code according to all attributes.
|
92
134
|
# @return [Fixnum] Hash code
|
93
135
|
def hash
|
94
|
-
[name, application_ids].hash
|
136
|
+
[name, application_ids, description, start_time, end_time, tags].hash
|
95
137
|
end
|
96
138
|
|
97
139
|
# Builds the object from hash
|
@@ -27,10 +27,10 @@ module TalonOne
|
|
27
27
|
# API endpoint on which the change was initiated.
|
28
28
|
attr_accessor :entity
|
29
29
|
|
30
|
-
# Resource before the change
|
30
|
+
# Resource before the change occurred.
|
31
31
|
attr_accessor :old
|
32
32
|
|
33
|
-
# Resource after the change
|
33
|
+
# Resource after the change occurred.
|
34
34
|
attr_accessor :new
|
35
35
|
|
36
36
|
# Attribute mapping from ruby-style variable name to JSON key.
|
@@ -107,7 +107,7 @@ module TalonOne
|
|
107
107
|
return false if @campaign_id.nil?
|
108
108
|
return false if @coupon_id.nil?
|
109
109
|
return false if @reason.nil?
|
110
|
-
reason_validator = EnumAttributeValidator.new('String', ['CouponNotFound', 'CouponPartOfNotRunningCampaign', 'CouponLimitReached', 'CampaignLimitReached', 'ProfileLimitReached', 'CouponRecipientDoesNotMatch', 'CouponExpired', 'CouponStartDateInFuture', 'CouponRejectedByCondition'])
|
110
|
+
reason_validator = EnumAttributeValidator.new('String', ['CouponNotFound', 'CouponPartOfNotRunningCampaign', 'CouponValidConditionMissing', 'CouponLimitReached', 'CampaignLimitReached', 'ProfileLimitReached', 'CouponRecipientDoesNotMatch', 'CouponExpired', 'CouponStartDateInFuture', 'CouponRejectedByCondition', 'EffectCouldNotBeApplied'])
|
111
111
|
return false unless reason_validator.valid?(@reason)
|
112
112
|
true
|
113
113
|
end
|
@@ -115,7 +115,7 @@ module TalonOne
|
|
115
115
|
# Custom attribute writer method checking allowed values (enum).
|
116
116
|
# @param [Object] reason Object to be assigned
|
117
117
|
def reason=(reason)
|
118
|
-
validator = EnumAttributeValidator.new('String', ['CouponNotFound', 'CouponPartOfNotRunningCampaign', 'CouponLimitReached', 'CampaignLimitReached', 'ProfileLimitReached', 'CouponRecipientDoesNotMatch', 'CouponExpired', 'CouponStartDateInFuture', 'CouponRejectedByCondition'])
|
118
|
+
validator = EnumAttributeValidator.new('String', ['CouponNotFound', 'CouponPartOfNotRunningCampaign', 'CouponValidConditionMissing', 'CouponLimitReached', 'CampaignLimitReached', 'ProfileLimitReached', 'CouponRecipientDoesNotMatch', 'CouponExpired', 'CouponStartDateInFuture', 'CouponRejectedByCondition', 'EffectCouldNotBeApplied'])
|
119
119
|
unless validator.valid?(reason)
|
120
120
|
fail ArgumentError, 'invalid value for "reason", must be one of #{validator.allowable_values}.'
|
121
121
|
end
|
@@ -0,0 +1,194 @@
|
|
1
|
+
=begin
|
2
|
+
#Talon.One API
|
3
|
+
|
4
|
+
#The Talon.One API is used to manage applications and campaigns, as well as to integrate with your application. The operations in the _Integration API_ section are used to integrate with our platform, while the other operations are used to manage applications and campaigns. ### Where is the API? The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id` [updateCustomerProfile]: #operation--v1-customer_profiles--integrationId--put
|
5
|
+
|
6
|
+
OpenAPI spec version: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 2.4.7
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
|
15
|
+
module TalonOne
|
16
|
+
class CustomerInventory
|
17
|
+
attr_accessor :profile
|
18
|
+
|
19
|
+
attr_accessor :referrals
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'profile' => :'profile',
|
25
|
+
:'referrals' => :'referrals'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.swagger_types
|
31
|
+
{
|
32
|
+
:'profile' => :'CustomerProfile',
|
33
|
+
:'referrals' => :'Array<Referral>'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Initializes the object
|
38
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
39
|
+
def initialize(attributes = {})
|
40
|
+
return unless attributes.is_a?(Hash)
|
41
|
+
|
42
|
+
# convert string to symbol for hash key
|
43
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
44
|
+
|
45
|
+
if attributes.has_key?(:'profile')
|
46
|
+
self.profile = attributes[:'profile']
|
47
|
+
end
|
48
|
+
|
49
|
+
if attributes.has_key?(:'referrals')
|
50
|
+
if (value = attributes[:'referrals']).is_a?(Array)
|
51
|
+
self.referrals = value
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
57
|
+
# @return Array for valid properties with the reasons
|
58
|
+
def list_invalid_properties
|
59
|
+
invalid_properties = Array.new
|
60
|
+
invalid_properties
|
61
|
+
end
|
62
|
+
|
63
|
+
# Check to see if the all the properties in the model are valid
|
64
|
+
# @return true if the model is valid
|
65
|
+
def valid?
|
66
|
+
true
|
67
|
+
end
|
68
|
+
|
69
|
+
# Checks equality by comparing each attribute.
|
70
|
+
# @param [Object] Object to be compared
|
71
|
+
def ==(o)
|
72
|
+
return true if self.equal?(o)
|
73
|
+
self.class == o.class &&
|
74
|
+
profile == o.profile &&
|
75
|
+
referrals == o.referrals
|
76
|
+
end
|
77
|
+
|
78
|
+
# @see the `==` method
|
79
|
+
# @param [Object] Object to be compared
|
80
|
+
def eql?(o)
|
81
|
+
self == o
|
82
|
+
end
|
83
|
+
|
84
|
+
# Calculates hash code according to all attributes.
|
85
|
+
# @return [Fixnum] Hash code
|
86
|
+
def hash
|
87
|
+
[profile, referrals].hash
|
88
|
+
end
|
89
|
+
|
90
|
+
# Builds the object from hash
|
91
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
92
|
+
# @return [Object] Returns the model itself
|
93
|
+
def build_from_hash(attributes)
|
94
|
+
return nil unless attributes.is_a?(Hash)
|
95
|
+
self.class.swagger_types.each_pair do |key, type|
|
96
|
+
if type =~ /\AArray<(.*)>/i
|
97
|
+
# check to ensure the input is an array given that the the attribute
|
98
|
+
# is documented as an array but the input is not
|
99
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
100
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
101
|
+
end
|
102
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
103
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
104
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
105
|
+
end
|
106
|
+
|
107
|
+
self
|
108
|
+
end
|
109
|
+
|
110
|
+
# Deserializes the data based on type
|
111
|
+
# @param string type Data type
|
112
|
+
# @param string value Value to be deserialized
|
113
|
+
# @return [Object] Deserialized data
|
114
|
+
def _deserialize(type, value)
|
115
|
+
case type.to_sym
|
116
|
+
when :DateTime
|
117
|
+
DateTime.parse(value)
|
118
|
+
when :Date
|
119
|
+
Date.parse(value)
|
120
|
+
when :String
|
121
|
+
value.to_s
|
122
|
+
when :Integer
|
123
|
+
value.to_i
|
124
|
+
when :Float
|
125
|
+
value.to_f
|
126
|
+
when :BOOLEAN
|
127
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
128
|
+
true
|
129
|
+
else
|
130
|
+
false
|
131
|
+
end
|
132
|
+
when :Object
|
133
|
+
# generic object (usually a Hash), return directly
|
134
|
+
value
|
135
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
136
|
+
inner_type = Regexp.last_match[:inner_type]
|
137
|
+
value.map { |v| _deserialize(inner_type, v) }
|
138
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
139
|
+
k_type = Regexp.last_match[:k_type]
|
140
|
+
v_type = Regexp.last_match[:v_type]
|
141
|
+
{}.tap do |hash|
|
142
|
+
value.each do |k, v|
|
143
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
144
|
+
end
|
145
|
+
end
|
146
|
+
else # model
|
147
|
+
temp_model = TalonOne.const_get(type).new
|
148
|
+
temp_model.build_from_hash(value)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
# Returns the string representation of the object
|
153
|
+
# @return [String] String presentation of the object
|
154
|
+
def to_s
|
155
|
+
to_hash.to_s
|
156
|
+
end
|
157
|
+
|
158
|
+
# to_body is an alias to to_hash (backward compatibility)
|
159
|
+
# @return [Hash] Returns the object in the form of hash
|
160
|
+
def to_body
|
161
|
+
to_hash
|
162
|
+
end
|
163
|
+
|
164
|
+
# Returns the object in the form of hash
|
165
|
+
# @return [Hash] Returns the object in the form of hash
|
166
|
+
def to_hash
|
167
|
+
hash = {}
|
168
|
+
self.class.attribute_map.each_pair do |attr, param|
|
169
|
+
value = self.send(attr)
|
170
|
+
next if value.nil?
|
171
|
+
hash[param] = _to_hash(value)
|
172
|
+
end
|
173
|
+
hash
|
174
|
+
end
|
175
|
+
|
176
|
+
# Outputs non-array value in the form of hash
|
177
|
+
# For object, use to_hash. Otherwise, just return the value
|
178
|
+
# @param [Object] value Any valid value
|
179
|
+
# @return [Hash] Returns the value in the form of hash
|
180
|
+
def _to_hash(value)
|
181
|
+
if value.is_a?(Array)
|
182
|
+
value.compact.map { |v| _to_hash(v) }
|
183
|
+
elsif value.is_a?(Hash)
|
184
|
+
{}.tap do |hash|
|
185
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
186
|
+
end
|
187
|
+
elsif value.respond_to? :to_hash
|
188
|
+
value.to_hash
|
189
|
+
else
|
190
|
+
value
|
191
|
+
end
|
192
|
+
end
|
193
|
+
end
|
194
|
+
end
|