talon_one 2.2.0 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -12
  3. data/docs/AddLoyaltyPointsEffectProps.md +3 -1
  4. data/docs/Application.md +2 -0
  5. data/docs/ApplicationEvent.md +3 -1
  6. data/docs/Binding.md +2 -0
  7. data/docs/Campaign.md +11 -1
  8. data/docs/CartItem.md +1 -3
  9. data/docs/Change.md +2 -0
  10. data/docs/CustomerProfileIntegrationRequestV2.md +3 -1
  11. data/docs/DeductLoyaltyPointsEffectProps.md +3 -1
  12. data/docs/Effect.md +2 -0
  13. data/docs/EffectEntity.md +3 -1
  14. data/docs/Import.md +1 -1
  15. data/docs/InlineResponse20020.md +2 -2
  16. data/docs/InlineResponse20021.md +1 -1
  17. data/docs/InlineResponse20022.md +1 -1
  18. data/docs/InlineResponse20023.md +1 -1
  19. data/docs/InlineResponse20024.md +1 -1
  20. data/docs/InlineResponse20025.md +1 -1
  21. data/docs/InlineResponse20026.md +1 -1
  22. data/docs/InlineResponse20027.md +2 -4
  23. data/docs/InlineResponse20028.md +4 -2
  24. data/docs/InlineResponse20029.md +1 -1
  25. data/docs/IntegrationApi.md +27 -27
  26. data/docs/IntegrationRequest.md +1 -1
  27. data/docs/IntegrationStateV2.md +2 -0
  28. data/docs/LoyaltyProgramBalance.md +10 -2
  29. data/docs/LoyaltyProgramLedgers.md +3 -1
  30. data/docs/LoyaltySubLedger.md +1 -1
  31. data/docs/ManagementApi.md +623 -169
  32. data/docs/NewApplication.md +2 -0
  33. data/docs/NewCoupons.md +5 -5
  34. data/docs/NewCouponsForMultipleRecipients.md +31 -0
  35. data/docs/ProfileAudiencesChanges.md +19 -0
  36. data/docs/RejectCouponEffectProps.md +7 -1
  37. data/docs/RejectReferralEffectProps.md +7 -1
  38. data/docs/RollbackAddedLoyaltyPointsEffectProps.md +25 -0
  39. data/docs/RollbackDeductedLoyaltyPointsEffectProps.md +29 -0
  40. data/docs/RollbackReferralEffectProps.md +17 -0
  41. data/docs/RuleFailureReason.md +39 -0
  42. data/docs/UpdateApplication.md +2 -0
  43. data/lib/talon_one.rb +6 -3
  44. data/lib/talon_one/api/integration_api.rb +30 -30
  45. data/lib/talon_one/api/management_api.rb +816 -242
  46. data/lib/talon_one/models/add_loyalty_points_effect_props.rb +19 -4
  47. data/lib/talon_one/models/application.rb +23 -1
  48. data/lib/talon_one/models/application_api_key.rb +2 -2
  49. data/lib/talon_one/models/application_event.rb +16 -4
  50. data/lib/talon_one/models/binding.rb +11 -1
  51. data/lib/talon_one/models/campaign.rb +52 -2
  52. data/lib/talon_one/models/cart_item.rb +4 -13
  53. data/lib/talon_one/models/change.rb +11 -1
  54. data/lib/talon_one/models/code_generator_settings.rb +9 -0
  55. data/lib/talon_one/models/create_application_api_key.rb +2 -2
  56. data/lib/talon_one/models/customer_profile_integration_request_v2.rb +11 -2
  57. data/lib/talon_one/models/customer_session.rb +38 -0
  58. data/lib/talon_one/models/customer_session_v2.rb +15 -0
  59. data/lib/talon_one/models/deduct_loyalty_points_effect_props.rb +19 -4
  60. data/lib/talon_one/models/effect.rb +11 -1
  61. data/lib/talon_one/models/effect_entity.rb +14 -4
  62. data/lib/talon_one/models/import.rb +1 -35
  63. data/lib/talon_one/models/inline_response20020.rb +1 -6
  64. data/lib/talon_one/models/inline_response20021.rb +1 -1
  65. data/lib/talon_one/models/inline_response20022.rb +1 -1
  66. data/lib/talon_one/models/inline_response20023.rb +1 -1
  67. data/lib/talon_one/models/inline_response20024.rb +1 -1
  68. data/lib/talon_one/models/inline_response20025.rb +1 -1
  69. data/lib/talon_one/models/inline_response20026.rb +1 -1
  70. data/lib/talon_one/models/inline_response20027.rb +7 -11
  71. data/lib/talon_one/models/inline_response20028.rb +11 -7
  72. data/lib/talon_one/models/inline_response20029.rb +1 -1
  73. data/lib/talon_one/models/integration_request.rb +1 -1
  74. data/lib/talon_one/models/integration_state_v2.rb +12 -1
  75. data/lib/talon_one/models/limit_config.rb +0 -12
  76. data/lib/talon_one/models/loyalty_points.rb +28 -0
  77. data/lib/talon_one/models/loyalty_program_balance.rb +65 -4
  78. data/lib/talon_one/models/loyalty_program_ledgers.rb +16 -1
  79. data/lib/talon_one/models/loyalty_sub_ledger.rb +1 -1
  80. data/lib/talon_one/models/new_application.rb +23 -1
  81. data/lib/talon_one/models/new_application_api_key.rb +2 -2
  82. data/lib/talon_one/models/new_coupons.rb +36 -41
  83. data/lib/talon_one/models/new_coupons_for_multiple_recipients.rb +368 -0
  84. data/lib/talon_one/models/new_customer_session.rb +30 -0
  85. data/lib/talon_one/models/new_customer_session_v2.rb +15 -0
  86. data/lib/talon_one/models/{new_import.rb → profile_audiences_changes.rb} +32 -48
  87. data/lib/talon_one/models/reject_coupon_effect_props.rb +34 -4
  88. data/lib/talon_one/models/reject_referral_effect_props.rb +34 -4
  89. data/lib/talon_one/models/{cart_item_adjustment.rb → rollback_added_loyalty_points_effect_props.rb} +63 -61
  90. data/lib/talon_one/models/rollback_deducted_loyalty_points_effect_props.rb +293 -0
  91. data/lib/talon_one/models/{import_coupons.rb → rollback_referral_effect_props.rb} +15 -13
  92. data/lib/talon_one/models/rule_failure_reason.rb +343 -0
  93. data/lib/talon_one/models/update_application.rb +23 -1
  94. data/lib/talon_one/version.rb +1 -1
  95. data/spec/api/integration_api_spec.rb +15 -15
  96. data/spec/api/management_api_spec.rb +183 -68
  97. data/spec/models/add_loyalty_points_effect_props_spec.rb +6 -0
  98. data/spec/models/application_api_key_spec.rb +1 -1
  99. data/spec/models/application_event_spec.rb +6 -0
  100. data/spec/models/application_spec.rb +10 -0
  101. data/spec/models/binding_spec.rb +6 -0
  102. data/spec/models/campaign_spec.rb +30 -0
  103. data/spec/models/cart_item_spec.rb +0 -6
  104. data/spec/models/change_spec.rb +6 -0
  105. data/spec/models/create_application_api_key_spec.rb +1 -1
  106. data/spec/models/customer_profile_integration_request_v2_spec.rb +7 -1
  107. data/spec/models/deduct_loyalty_points_effect_props_spec.rb +6 -0
  108. data/spec/models/effect_entity_spec.rb +6 -0
  109. data/spec/models/effect_spec.rb +6 -0
  110. data/spec/models/import_spec.rb +0 -4
  111. data/spec/models/inline_response20027_spec.rb +0 -6
  112. data/spec/models/inline_response20028_spec.rb +6 -0
  113. data/spec/models/integration_request_spec.rb +1 -1
  114. data/spec/models/integration_state_v2_spec.rb +6 -0
  115. data/spec/models/limit_config_spec.rb +0 -4
  116. data/spec/models/loyalty_program_balance_spec.rb +24 -0
  117. data/spec/models/loyalty_program_ledgers_spec.rb +6 -0
  118. data/spec/models/new_application_api_key_spec.rb +1 -1
  119. data/spec/models/new_application_spec.rb +10 -0
  120. data/spec/models/new_coupons_for_multiple_recipients_spec.rb +83 -0
  121. data/spec/models/new_coupons_spec.rb +6 -6
  122. data/spec/models/{cart_item_adjustment_spec.rb → profile_audiences_changes_spec.rb} +8 -14
  123. data/spec/models/reject_coupon_effect_props_spec.rb +18 -0
  124. data/spec/models/reject_referral_effect_props_spec.rb +18 -0
  125. data/spec/models/rollback_added_loyalty_points_effect_props_spec.rb +65 -0
  126. data/spec/models/rollback_deducted_loyalty_points_effect_props_spec.rb +77 -0
  127. data/spec/models/{import_coupons_spec.rb → rollback_referral_effect_props_spec.rb} +7 -7
  128. data/spec/models/rule_failure_reason_spec.rb +107 -0
  129. data/spec/models/update_application_spec.rb +10 -0
  130. metadata +26 -14
  131. data/docs/CartItemAdjustment.md +0 -21
  132. data/docs/ImportCoupons.md +0 -17
  133. data/docs/NewImport.md +0 -17
  134. data/spec/models/new_import_spec.rb +0 -45
@@ -80,6 +80,10 @@ module TalonOne
80
80
  invalid_properties.push('invalid value for "coupon_pattern", coupon_pattern cannot be nil.')
81
81
  end
82
82
 
83
+ if @coupon_pattern.to_s.length > 100
84
+ invalid_properties.push('invalid value for "coupon_pattern", the character length must be smaller than or equal to 100.')
85
+ end
86
+
83
87
  if @coupon_pattern.to_s.length < 3
84
88
  invalid_properties.push('invalid value for "coupon_pattern", the character length must be great than or equal to 3.')
85
89
  end
@@ -92,6 +96,7 @@ module TalonOne
92
96
  def valid?
93
97
  return false if @valid_characters.nil?
94
98
  return false if @coupon_pattern.nil?
99
+ return false if @coupon_pattern.to_s.length > 100
95
100
  return false if @coupon_pattern.to_s.length < 3
96
101
  true
97
102
  end
@@ -103,6 +108,10 @@ module TalonOne
103
108
  fail ArgumentError, 'coupon_pattern cannot be nil'
104
109
  end
105
110
 
111
+ if coupon_pattern.to_s.length > 100
112
+ fail ArgumentError, 'invalid value for "coupon_pattern", the character length must be smaller than or equal to 100.'
113
+ end
114
+
106
115
  if coupon_pattern.to_s.length < 3
107
116
  fail ArgumentError, 'invalid value for "coupon_pattern", the character length must be great than or equal to 3.'
108
117
  end
@@ -117,7 +117,7 @@ module TalonOne
117
117
  def valid?
118
118
  return false if @title.nil?
119
119
  return false if @expires.nil?
120
- platform_validator = EnumAttributeValidator.new('String', ["none", "segment", "braze", "mparticle"])
120
+ platform_validator = EnumAttributeValidator.new('String', ["none", "segment", "braze", "mparticle", "selligent"])
121
121
  return false unless platform_validator.valid?(@platform)
122
122
  true
123
123
  end
@@ -125,7 +125,7 @@ module TalonOne
125
125
  # Custom attribute writer method checking allowed values (enum).
126
126
  # @param [Object] platform Object to be assigned
127
127
  def platform=(platform)
128
- validator = EnumAttributeValidator.new('String', ["none", "segment", "braze", "mparticle"])
128
+ validator = EnumAttributeValidator.new('String', ["none", "segment", "braze", "mparticle", "selligent"])
129
129
  unless validator.valid?(platform)
130
130
  fail ArgumentError, "invalid value for \"platform\", must be one of #{validator.allowable_values}."
131
131
  end
@@ -18,7 +18,9 @@ module TalonOne
18
18
  # Arbitrary properties associated with this item
19
19
  attr_accessor :attributes
20
20
 
21
- # Optional list of requested information to be present on the response related to the customer profile update. Currently supported: \"customerProfile\", \"triggeredCampaigns\", \"loyalty\" and \"event\".
21
+ attr_accessor :audiences_changes
22
+
23
+ # Optional list of requested information to be present on the response related to the customer profile update. Currently supported: \"customerProfile\", \"triggeredCampaigns\", \"loyalty\", \"event\" and \"ruleFailureReasons\".
22
24
  attr_accessor :response_content
23
25
 
24
26
  class EnumAttributeValidator
@@ -47,6 +49,7 @@ module TalonOne
47
49
  def self.attribute_map
48
50
  {
49
51
  :'attributes' => :'attributes',
52
+ :'audiences_changes' => :'audiencesChanges',
50
53
  :'response_content' => :'responseContent'
51
54
  }
52
55
  end
@@ -55,6 +58,7 @@ module TalonOne
55
58
  def self.openapi_types
56
59
  {
57
60
  :'attributes' => :'Object',
61
+ :'audiences_changes' => :'ProfileAudiencesChanges',
58
62
  :'response_content' => :'Array<String>'
59
63
  }
60
64
  end
@@ -84,6 +88,10 @@ module TalonOne
84
88
  self.attributes = attributes[:'attributes']
85
89
  end
86
90
 
91
+ if attributes.key?(:'audiences_changes')
92
+ self.audiences_changes = attributes[:'audiences_changes']
93
+ end
94
+
87
95
  if attributes.key?(:'response_content')
88
96
  if (value = attributes[:'response_content']).is_a?(Array)
89
97
  self.response_content = value
@@ -110,6 +118,7 @@ module TalonOne
110
118
  return true if self.equal?(o)
111
119
  self.class == o.class &&
112
120
  attributes == o.attributes &&
121
+ audiences_changes == o.audiences_changes &&
113
122
  response_content == o.response_content
114
123
  end
115
124
 
@@ -122,7 +131,7 @@ module TalonOne
122
131
  # Calculates hash code according to all attributes.
123
132
  # @return [Integer] Hash code
124
133
  def hash
125
- [attributes, response_content].hash
134
+ [attributes, audiences_changes, response_content].hash
126
135
  end
127
136
 
128
137
  # Builds the object from hash
@@ -220,10 +220,18 @@ module TalonOne
220
220
  invalid_properties.push('invalid value for "coupon", coupon cannot be nil.')
221
221
  end
222
222
 
223
+ if @coupon.to_s.length > 100
224
+ invalid_properties.push('invalid value for "coupon", the character length must be smaller than or equal to 100.')
225
+ end
226
+
223
227
  if @referral.nil?
224
228
  invalid_properties.push('invalid value for "referral", referral cannot be nil.')
225
229
  end
226
230
 
231
+ if @referral.to_s.length > 100
232
+ invalid_properties.push('invalid value for "referral", the character length must be smaller than or equal to 100.')
233
+ end
234
+
227
235
  if @state.nil?
228
236
  invalid_properties.push('invalid value for "state", state cannot be nil.')
229
237
  end
@@ -259,7 +267,9 @@ module TalonOne
259
267
  return false if @application_id.nil?
260
268
  return false if @profile_id.nil?
261
269
  return false if @coupon.nil?
270
+ return false if @coupon.to_s.length > 100
262
271
  return false if @referral.nil?
272
+ return false if @referral.to_s.length > 100
263
273
  return false if @state.nil?
264
274
  state_validator = EnumAttributeValidator.new('String', ["open", "closed", "cancelled"])
265
275
  return false unless state_validator.valid?(@state)
@@ -271,6 +281,34 @@ module TalonOne
271
281
  true
272
282
  end
273
283
 
284
+ # Custom attribute writer method with validation
285
+ # @param [Object] coupon Value to be assigned
286
+ def coupon=(coupon)
287
+ if coupon.nil?
288
+ fail ArgumentError, 'coupon cannot be nil'
289
+ end
290
+
291
+ if coupon.to_s.length > 100
292
+ fail ArgumentError, 'invalid value for "coupon", the character length must be smaller than or equal to 100.'
293
+ end
294
+
295
+ @coupon = coupon
296
+ end
297
+
298
+ # Custom attribute writer method with validation
299
+ # @param [Object] referral Value to be assigned
300
+ def referral=(referral)
301
+ if referral.nil?
302
+ fail ArgumentError, 'referral cannot be nil'
303
+ end
304
+
305
+ if referral.to_s.length > 100
306
+ fail ArgumentError, 'invalid value for "referral", the character length must be smaller than or equal to 100.'
307
+ end
308
+
309
+ @referral = referral
310
+ end
311
+
274
312
  # Custom attribute writer method checking allowed values (enum).
275
313
  # @param [Object] state Object to be assigned
276
314
  def state=(state)
@@ -236,6 +236,10 @@ module TalonOne
236
236
  invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.')
237
237
  end
238
238
 
239
+ if !@referral_code.nil? && @referral_code.to_s.length > 100
240
+ invalid_properties.push('invalid value for "referral_code", the character length must be smaller than or equal to 100.')
241
+ end
242
+
239
243
  if @state.nil?
240
244
  invalid_properties.push('invalid value for "state", state cannot be nil.')
241
245
  end
@@ -274,6 +278,7 @@ module TalonOne
274
278
  return false if @created.nil?
275
279
  return false if @application_id.nil?
276
280
  return false if @profile_id.nil?
281
+ return false if !@referral_code.nil? && @referral_code.to_s.length > 100
277
282
  return false if @state.nil?
278
283
  state_validator = EnumAttributeValidator.new('String', ["open", "closed", "cancelled"])
279
284
  return false unless state_validator.valid?(@state)
@@ -286,6 +291,16 @@ module TalonOne
286
291
  true
287
292
  end
288
293
 
294
+ # Custom attribute writer method with validation
295
+ # @param [Object] referral_code Value to be assigned
296
+ def referral_code=(referral_code)
297
+ if !referral_code.nil? && referral_code.to_s.length > 100
298
+ fail ArgumentError, 'invalid value for "referral_code", the character length must be smaller than or equal to 100.'
299
+ end
300
+
301
+ @referral_code = referral_code
302
+ end
303
+
289
304
  # Custom attribute writer method checking allowed values (enum).
290
305
  # @param [Object] state Object to be assigned
291
306
  def state=(state)
@@ -27,13 +27,17 @@ module TalonOne
27
27
  # The amount of points that were deducted
28
28
  attr_accessor :value
29
29
 
30
+ # The identifier of this deduction in the loyalty ledger
31
+ attr_accessor :transaction_uuid
32
+
30
33
  # Attribute mapping from ruby-style variable name to JSON key.
31
34
  def self.attribute_map
32
35
  {
33
36
  :'rule_title' => :'ruleTitle',
34
37
  :'program_id' => :'programId',
35
38
  :'sub_ledger_id' => :'subLedgerId',
36
- :'value' => :'value'
39
+ :'value' => :'value',
40
+ :'transaction_uuid' => :'transactionUUID'
37
41
  }
38
42
  end
39
43
 
@@ -43,7 +47,8 @@ module TalonOne
43
47
  :'rule_title' => :'String',
44
48
  :'program_id' => :'Integer',
45
49
  :'sub_ledger_id' => :'String',
46
- :'value' => :'Float'
50
+ :'value' => :'Float',
51
+ :'transaction_uuid' => :'String'
47
52
  }
48
53
  end
49
54
 
@@ -83,6 +88,10 @@ module TalonOne
83
88
  if attributes.key?(:'value')
84
89
  self.value = attributes[:'value']
85
90
  end
91
+
92
+ if attributes.key?(:'transaction_uuid')
93
+ self.transaction_uuid = attributes[:'transaction_uuid']
94
+ end
86
95
  end
87
96
 
88
97
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -105,6 +114,10 @@ module TalonOne
105
114
  invalid_properties.push('invalid value for "value", value cannot be nil.')
106
115
  end
107
116
 
117
+ if @transaction_uuid.nil?
118
+ invalid_properties.push('invalid value for "transaction_uuid", transaction_uuid cannot be nil.')
119
+ end
120
+
108
121
  invalid_properties
109
122
  end
110
123
 
@@ -115,6 +128,7 @@ module TalonOne
115
128
  return false if @program_id.nil?
116
129
  return false if @sub_ledger_id.nil?
117
130
  return false if @value.nil?
131
+ return false if @transaction_uuid.nil?
118
132
  true
119
133
  end
120
134
 
@@ -126,7 +140,8 @@ module TalonOne
126
140
  rule_title == o.rule_title &&
127
141
  program_id == o.program_id &&
128
142
  sub_ledger_id == o.sub_ledger_id &&
129
- value == o.value
143
+ value == o.value &&
144
+ transaction_uuid == o.transaction_uuid
130
145
  end
131
146
 
132
147
  # @see the `==` method
@@ -138,7 +153,7 @@ module TalonOne
138
153
  # Calculates hash code according to all attributes.
139
154
  # @return [Integer] Hash code
140
155
  def hash
141
- [rule_title, program_id, sub_ledger_id, value].hash
156
+ [rule_title, program_id, sub_ledger_id, value, transaction_uuid].hash
142
157
  end
143
158
 
144
159
  # Builds the object from hash
@@ -30,6 +30,9 @@ module TalonOne
30
30
  # The type of effect that was triggered
31
31
  attr_accessor :effect_type
32
32
 
33
+ # The ID of the coupon that was being evaluated when this effect was triggered
34
+ attr_accessor :triggered_by_coupon
35
+
33
36
  attr_accessor :props
34
37
 
35
38
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -40,6 +43,7 @@ module TalonOne
40
43
  :'rule_index' => :'ruleIndex',
41
44
  :'rule_name' => :'ruleName',
42
45
  :'effect_type' => :'effectType',
46
+ :'triggered_by_coupon' => :'triggeredByCoupon',
43
47
  :'props' => :'props'
44
48
  }
45
49
  end
@@ -52,6 +56,7 @@ module TalonOne
52
56
  :'rule_index' => :'Integer',
53
57
  :'rule_name' => :'String',
54
58
  :'effect_type' => :'String',
59
+ :'triggered_by_coupon' => :'Integer',
55
60
  :'props' => :'Object'
56
61
  }
57
62
  end
@@ -97,6 +102,10 @@ module TalonOne
97
102
  self.effect_type = attributes[:'effect_type']
98
103
  end
99
104
 
105
+ if attributes.key?(:'triggered_by_coupon')
106
+ self.triggered_by_coupon = attributes[:'triggered_by_coupon']
107
+ end
108
+
100
109
  if attributes.key?(:'props')
101
110
  self.props = attributes[:'props']
102
111
  end
@@ -155,6 +164,7 @@ module TalonOne
155
164
  rule_index == o.rule_index &&
156
165
  rule_name == o.rule_name &&
157
166
  effect_type == o.effect_type &&
167
+ triggered_by_coupon == o.triggered_by_coupon &&
158
168
  props == o.props
159
169
  end
160
170
 
@@ -167,7 +177,7 @@ module TalonOne
167
177
  # Calculates hash code according to all attributes.
168
178
  # @return [Integer] Hash code
169
179
  def hash
170
- [campaign_id, ruleset_id, rule_index, rule_name, effect_type, props].hash
180
+ [campaign_id, ruleset_id, rule_index, rule_name, effect_type, triggered_by_coupon, props].hash
171
181
  end
172
182
 
173
183
  # Builds the object from hash
@@ -30,6 +30,9 @@ module TalonOne
30
30
  # The type of effect that was triggered
31
31
  attr_accessor :effect_type
32
32
 
33
+ # The ID of the coupon that was being evaluated when this effect was triggered
34
+ attr_accessor :triggered_by_coupon
35
+
33
36
  # Attribute mapping from ruby-style variable name to JSON key.
34
37
  def self.attribute_map
35
38
  {
@@ -37,7 +40,8 @@ module TalonOne
37
40
  :'ruleset_id' => :'rulesetId',
38
41
  :'rule_index' => :'ruleIndex',
39
42
  :'rule_name' => :'ruleName',
40
- :'effect_type' => :'effectType'
43
+ :'effect_type' => :'effectType',
44
+ :'triggered_by_coupon' => :'triggeredByCoupon'
41
45
  }
42
46
  end
43
47
 
@@ -48,7 +52,8 @@ module TalonOne
48
52
  :'ruleset_id' => :'Integer',
49
53
  :'rule_index' => :'Integer',
50
54
  :'rule_name' => :'String',
51
- :'effect_type' => :'String'
55
+ :'effect_type' => :'String',
56
+ :'triggered_by_coupon' => :'Integer'
52
57
  }
53
58
  end
54
59
 
@@ -92,6 +97,10 @@ module TalonOne
92
97
  if attributes.key?(:'effect_type')
93
98
  self.effect_type = attributes[:'effect_type']
94
99
  end
100
+
101
+ if attributes.key?(:'triggered_by_coupon')
102
+ self.triggered_by_coupon = attributes[:'triggered_by_coupon']
103
+ end
95
104
  end
96
105
 
97
106
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -141,7 +150,8 @@ module TalonOne
141
150
  ruleset_id == o.ruleset_id &&
142
151
  rule_index == o.rule_index &&
143
152
  rule_name == o.rule_name &&
144
- effect_type == o.effect_type
153
+ effect_type == o.effect_type &&
154
+ triggered_by_coupon == o.triggered_by_coupon
145
155
  end
146
156
 
147
157
  # @see the `==` method
@@ -153,7 +163,7 @@ module TalonOne
153
163
  # Calculates hash code according to all attributes.
154
164
  # @return [Integer] Hash code
155
165
  def hash
156
- [campaign_id, ruleset_id, rule_index, rule_name, effect_type].hash
166
+ [campaign_id, ruleset_id, rule_index, rule_name, effect_type, triggered_by_coupon].hash
157
167
  end
158
168
 
159
169
  # Builds the object from hash
@@ -27,34 +27,12 @@ module TalonOne
27
27
  # The ID of the account that owns this entity.
28
28
  attr_accessor :user_id
29
29
 
30
- # The name of the entity that was imported.
30
+ # The name of the entity that was imported. Possible values are Coupons and LoyaltyPoints.
31
31
  attr_accessor :entity
32
32
 
33
33
  # The number of members that imported.
34
34
  attr_accessor :amount
35
35
 
36
- class EnumAttributeValidator
37
- attr_reader :datatype
38
- attr_reader :allowable_values
39
-
40
- def initialize(datatype, allowable_values)
41
- @allowable_values = allowable_values.map do |value|
42
- case datatype.to_s
43
- when /Integer/i
44
- value.to_i
45
- when /Float/i
46
- value.to_f
47
- else
48
- value
49
- end
50
- end
51
- end
52
-
53
- def valid?(value)
54
- !value || allowable_values.include?(value)
55
- end
56
- end
57
-
58
36
  # Attribute mapping from ruby-style variable name to JSON key.
59
37
  def self.attribute_map
60
38
  {
@@ -168,23 +146,11 @@ module TalonOne
168
146
  return false if @account_id.nil?
169
147
  return false if @user_id.nil?
170
148
  return false if @entity.nil?
171
- entity_validator = EnumAttributeValidator.new('String', ["Coupon"])
172
- return false unless entity_validator.valid?(@entity)
173
149
  return false if @amount.nil?
174
150
  return false if @amount < 0
175
151
  true
176
152
  end
177
153
 
178
- # Custom attribute writer method checking allowed values (enum).
179
- # @param [Object] entity Object to be assigned
180
- def entity=(entity)
181
- validator = EnumAttributeValidator.new('String', ["Coupon"])
182
- unless validator.valid?(entity)
183
- fail ArgumentError, "invalid value for \"entity\", must be one of #{validator.allowable_values}."
184
- end
185
- @entity = entity
186
- end
187
-
188
154
  # Custom attribute writer method with validation
189
155
  # @param [Object] amount Value to be assigned
190
156
  def amount=(amount)