ultracart_api 4.1.92 → 4.1.94

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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +22 -2
  3. data/docs/FraudApi.md +278 -0
  4. data/docs/FraudDeclineEmailRequest.md +18 -0
  5. data/docs/FraudLookupValues.md +28 -0
  6. data/docs/FraudLookupValuesResponse.md +26 -0
  7. data/docs/FraudRuleInsertRequest.md +76 -0
  8. data/docs/FraudRuleItemFilter.md +20 -0
  9. data/docs/FraudRulePublic.md +90 -0
  10. data/docs/FraudRuleResponse.md +26 -0
  11. data/docs/FraudRuleRotatingTransactionGatewayFilter.md +20 -0
  12. data/docs/FraudRuleSearchRequest.md +78 -0
  13. data/docs/FraudRuleStorefrontFilter.md +20 -0
  14. data/docs/FraudRulesResponse.md +26 -0
  15. data/docs/ItemVariantItem.md +2 -0
  16. data/lib/ultracart_api/api/fraud_api.rb +373 -0
  17. data/lib/ultracart_api/models/fraud_decline_email_request.rb +220 -0
  18. data/lib/ultracart_api/models/fraud_lookup_values.rb +270 -0
  19. data/lib/ultracart_api/models/fraud_lookup_values_response.rb +256 -0
  20. data/lib/ultracart_api/models/fraud_rule_insert_request.rb +583 -0
  21. data/lib/ultracart_api/models/fraud_rule_item_filter.rb +245 -0
  22. data/lib/ultracart_api/models/fraud_rule_public.rb +652 -0
  23. data/lib/ultracart_api/models/fraud_rule_response.rb +256 -0
  24. data/lib/ultracart_api/models/fraud_rule_rotating_transaction_gateway_filter.rb +230 -0
  25. data/lib/ultracart_api/models/fraud_rule_search_request.rb +572 -0
  26. data/lib/ultracart_api/models/fraud_rule_storefront_filter.rb +245 -0
  27. data/lib/ultracart_api/models/fraud_rules_response.rb +259 -0
  28. data/lib/ultracart_api/models/item_variant_item.rb +11 -1
  29. data/lib/ultracart_api/version.rb +1 -1
  30. data/lib/ultracart_api.rb +12 -0
  31. metadata +26 -2
@@ -0,0 +1,652 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class FraudRulePublic
18
+ attr_accessor :affiliate_oid
19
+
20
+ attr_accessor :amount_threshold
21
+
22
+ attr_accessor :auto_note
23
+
24
+ attr_accessor :avs_match_type
25
+
26
+ attr_accessor :avs_response_codes
27
+
28
+ # Masked credit card number for rules tied to a specific card
29
+ attr_accessor :card_number
30
+
31
+ attr_accessor :count_threshold
32
+
33
+ attr_accessor :country_code
34
+
35
+ attr_accessor :created_by
36
+
37
+ # Created date
38
+ attr_accessor :created_dts
39
+
40
+ # Credit card BINs blocked by the 'credit card block bin' rule type.
41
+ attr_accessor :credit_card_bins
42
+
43
+ attr_accessor :decline_message
44
+
45
+ # Human-readable description of the rule
46
+ attr_accessor :description
47
+
48
+ # HTML version of the rule description
49
+ attr_accessor :description_html
50
+
51
+ attr_accessor :email
52
+
53
+ # Action taken when this rule fires.
54
+ attr_accessor :failure_action
55
+
56
+ # UltraCart unique identifier for this fraud rule
57
+ attr_accessor :fraud_rule_oid
58
+
59
+ attr_accessor :gateway_response_codes
60
+
61
+ attr_accessor :gateway_response_value
62
+
63
+ attr_accessor :ip_address
64
+
65
+ attr_accessor :ip_range_type
66
+
67
+ attr_accessor :item_filters
68
+
69
+ attr_accessor :merchant_item_id
70
+
71
+ attr_accessor :modify_custom_field1
72
+
73
+ attr_accessor :modify_custom_field2
74
+
75
+ attr_accessor :modify_custom_field3
76
+
77
+ attr_accessor :modify_custom_field4
78
+
79
+ attr_accessor :modify_custom_field5
80
+
81
+ attr_accessor :modify_custom_field6
82
+
83
+ attr_accessor :modify_custom_field7
84
+
85
+ attr_accessor :modify_skip_affiliate
86
+
87
+ attr_accessor :modify_skip_affiliate_network_pixel
88
+
89
+ attr_accessor :rotating_transaction_gateway_filters
90
+
91
+ # Group containing this rule type (eg 'creditCardRules')
92
+ attr_accessor :rule_group
93
+
94
+ # Rule type.
95
+ attr_accessor :rule_type
96
+
97
+ attr_accessor :storefront_filters
98
+
99
+ attr_accessor :user_action
100
+
101
+ class EnumAttributeValidator
102
+ attr_reader :datatype
103
+ attr_reader :allowable_values
104
+
105
+ def initialize(datatype, allowable_values)
106
+ @allowable_values = allowable_values.map do |value|
107
+ case datatype.to_s
108
+ when /Integer/i
109
+ value.to_i
110
+ when /Float/i
111
+ value.to_f
112
+ else
113
+ value
114
+ end
115
+ end
116
+ end
117
+
118
+ def valid?(value)
119
+ !value || allowable_values.include?(value)
120
+ end
121
+ end
122
+
123
+ # Attribute mapping from ruby-style variable name to JSON key.
124
+ def self.attribute_map
125
+ {
126
+ :'affiliate_oid' => :'affiliate_oid',
127
+ :'amount_threshold' => :'amount_threshold',
128
+ :'auto_note' => :'auto_note',
129
+ :'avs_match_type' => :'avs_match_type',
130
+ :'avs_response_codes' => :'avs_response_codes',
131
+ :'card_number' => :'card_number',
132
+ :'count_threshold' => :'count_threshold',
133
+ :'country_code' => :'country_code',
134
+ :'created_by' => :'created_by',
135
+ :'created_dts' => :'created_dts',
136
+ :'credit_card_bins' => :'credit_card_bins',
137
+ :'decline_message' => :'decline_message',
138
+ :'description' => :'description',
139
+ :'description_html' => :'description_html',
140
+ :'email' => :'email',
141
+ :'failure_action' => :'failure_action',
142
+ :'fraud_rule_oid' => :'fraud_rule_oid',
143
+ :'gateway_response_codes' => :'gateway_response_codes',
144
+ :'gateway_response_value' => :'gateway_response_value',
145
+ :'ip_address' => :'ip_address',
146
+ :'ip_range_type' => :'ip_range_type',
147
+ :'item_filters' => :'item_filters',
148
+ :'merchant_item_id' => :'merchant_item_id',
149
+ :'modify_custom_field1' => :'modify_custom_field1',
150
+ :'modify_custom_field2' => :'modify_custom_field2',
151
+ :'modify_custom_field3' => :'modify_custom_field3',
152
+ :'modify_custom_field4' => :'modify_custom_field4',
153
+ :'modify_custom_field5' => :'modify_custom_field5',
154
+ :'modify_custom_field6' => :'modify_custom_field6',
155
+ :'modify_custom_field7' => :'modify_custom_field7',
156
+ :'modify_skip_affiliate' => :'modify_skip_affiliate',
157
+ :'modify_skip_affiliate_network_pixel' => :'modify_skip_affiliate_network_pixel',
158
+ :'rotating_transaction_gateway_filters' => :'rotating_transaction_gateway_filters',
159
+ :'rule_group' => :'rule_group',
160
+ :'rule_type' => :'rule_type',
161
+ :'storefront_filters' => :'storefront_filters',
162
+ :'user_action' => :'user_action'
163
+ }
164
+ end
165
+
166
+ # Returns all the JSON keys this model knows about
167
+ def self.acceptable_attributes
168
+ attribute_map.values
169
+ end
170
+
171
+ # Attribute type mapping.
172
+ def self.openapi_types
173
+ {
174
+ :'affiliate_oid' => :'Integer',
175
+ :'amount_threshold' => :'Float',
176
+ :'auto_note' => :'String',
177
+ :'avs_match_type' => :'String',
178
+ :'avs_response_codes' => :'String',
179
+ :'card_number' => :'String',
180
+ :'count_threshold' => :'Integer',
181
+ :'country_code' => :'String',
182
+ :'created_by' => :'String',
183
+ :'created_dts' => :'String',
184
+ :'credit_card_bins' => :'Object',
185
+ :'decline_message' => :'String',
186
+ :'description' => :'String',
187
+ :'description_html' => :'String',
188
+ :'email' => :'String',
189
+ :'failure_action' => :'String',
190
+ :'fraud_rule_oid' => :'Integer',
191
+ :'gateway_response_codes' => :'String',
192
+ :'gateway_response_value' => :'String',
193
+ :'ip_address' => :'String',
194
+ :'ip_range_type' => :'String',
195
+ :'item_filters' => :'Array<FraudRuleItemFilter>',
196
+ :'merchant_item_id' => :'String',
197
+ :'modify_custom_field1' => :'String',
198
+ :'modify_custom_field2' => :'String',
199
+ :'modify_custom_field3' => :'String',
200
+ :'modify_custom_field4' => :'String',
201
+ :'modify_custom_field5' => :'String',
202
+ :'modify_custom_field6' => :'String',
203
+ :'modify_custom_field7' => :'String',
204
+ :'modify_skip_affiliate' => :'Boolean',
205
+ :'modify_skip_affiliate_network_pixel' => :'Boolean',
206
+ :'rotating_transaction_gateway_filters' => :'Array<FraudRuleRotatingTransactionGatewayFilter>',
207
+ :'rule_group' => :'String',
208
+ :'rule_type' => :'String',
209
+ :'storefront_filters' => :'Array<FraudRuleStorefrontFilter>',
210
+ :'user_action' => :'String'
211
+ }
212
+ end
213
+
214
+ # List of attributes with nullable: true
215
+ def self.openapi_nullable
216
+ Set.new([
217
+ ])
218
+ end
219
+
220
+ # Initializes the object
221
+ # @param [Hash] attributes Model attributes in the form of hash
222
+ def initialize(attributes = {})
223
+ if (!attributes.is_a?(Hash))
224
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::FraudRulePublic` initialize method"
225
+ end
226
+
227
+ # check to see if the attribute exists and convert string to symbol for hash key
228
+ attributes = attributes.each_with_object({}) { |(k, v), h|
229
+ if (!self.class.attribute_map.key?(k.to_sym))
230
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::FraudRulePublic`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
231
+ end
232
+ h[k.to_sym] = v
233
+ }
234
+
235
+ if attributes.key?(:'affiliate_oid')
236
+ self.affiliate_oid = attributes[:'affiliate_oid']
237
+ end
238
+
239
+ if attributes.key?(:'amount_threshold')
240
+ self.amount_threshold = attributes[:'amount_threshold']
241
+ end
242
+
243
+ if attributes.key?(:'auto_note')
244
+ self.auto_note = attributes[:'auto_note']
245
+ end
246
+
247
+ if attributes.key?(:'avs_match_type')
248
+ self.avs_match_type = attributes[:'avs_match_type']
249
+ end
250
+
251
+ if attributes.key?(:'avs_response_codes')
252
+ self.avs_response_codes = attributes[:'avs_response_codes']
253
+ end
254
+
255
+ if attributes.key?(:'card_number')
256
+ self.card_number = attributes[:'card_number']
257
+ end
258
+
259
+ if attributes.key?(:'count_threshold')
260
+ self.count_threshold = attributes[:'count_threshold']
261
+ end
262
+
263
+ if attributes.key?(:'country_code')
264
+ self.country_code = attributes[:'country_code']
265
+ end
266
+
267
+ if attributes.key?(:'created_by')
268
+ self.created_by = attributes[:'created_by']
269
+ end
270
+
271
+ if attributes.key?(:'created_dts')
272
+ self.created_dts = attributes[:'created_dts']
273
+ end
274
+
275
+ if attributes.key?(:'credit_card_bins')
276
+ self.credit_card_bins = attributes[:'credit_card_bins']
277
+ end
278
+
279
+ if attributes.key?(:'decline_message')
280
+ self.decline_message = attributes[:'decline_message']
281
+ end
282
+
283
+ if attributes.key?(:'description')
284
+ self.description = attributes[:'description']
285
+ end
286
+
287
+ if attributes.key?(:'description_html')
288
+ self.description_html = attributes[:'description_html']
289
+ end
290
+
291
+ if attributes.key?(:'email')
292
+ self.email = attributes[:'email']
293
+ end
294
+
295
+ if attributes.key?(:'failure_action')
296
+ self.failure_action = attributes[:'failure_action']
297
+ end
298
+
299
+ if attributes.key?(:'fraud_rule_oid')
300
+ self.fraud_rule_oid = attributes[:'fraud_rule_oid']
301
+ end
302
+
303
+ if attributes.key?(:'gateway_response_codes')
304
+ self.gateway_response_codes = attributes[:'gateway_response_codes']
305
+ end
306
+
307
+ if attributes.key?(:'gateway_response_value')
308
+ self.gateway_response_value = attributes[:'gateway_response_value']
309
+ end
310
+
311
+ if attributes.key?(:'ip_address')
312
+ self.ip_address = attributes[:'ip_address']
313
+ end
314
+
315
+ if attributes.key?(:'ip_range_type')
316
+ self.ip_range_type = attributes[:'ip_range_type']
317
+ end
318
+
319
+ if attributes.key?(:'item_filters')
320
+ if (value = attributes[:'item_filters']).is_a?(Array)
321
+ self.item_filters = value
322
+ end
323
+ end
324
+
325
+ if attributes.key?(:'merchant_item_id')
326
+ self.merchant_item_id = attributes[:'merchant_item_id']
327
+ end
328
+
329
+ if attributes.key?(:'modify_custom_field1')
330
+ self.modify_custom_field1 = attributes[:'modify_custom_field1']
331
+ end
332
+
333
+ if attributes.key?(:'modify_custom_field2')
334
+ self.modify_custom_field2 = attributes[:'modify_custom_field2']
335
+ end
336
+
337
+ if attributes.key?(:'modify_custom_field3')
338
+ self.modify_custom_field3 = attributes[:'modify_custom_field3']
339
+ end
340
+
341
+ if attributes.key?(:'modify_custom_field4')
342
+ self.modify_custom_field4 = attributes[:'modify_custom_field4']
343
+ end
344
+
345
+ if attributes.key?(:'modify_custom_field5')
346
+ self.modify_custom_field5 = attributes[:'modify_custom_field5']
347
+ end
348
+
349
+ if attributes.key?(:'modify_custom_field6')
350
+ self.modify_custom_field6 = attributes[:'modify_custom_field6']
351
+ end
352
+
353
+ if attributes.key?(:'modify_custom_field7')
354
+ self.modify_custom_field7 = attributes[:'modify_custom_field7']
355
+ end
356
+
357
+ if attributes.key?(:'modify_skip_affiliate')
358
+ self.modify_skip_affiliate = attributes[:'modify_skip_affiliate']
359
+ end
360
+
361
+ if attributes.key?(:'modify_skip_affiliate_network_pixel')
362
+ self.modify_skip_affiliate_network_pixel = attributes[:'modify_skip_affiliate_network_pixel']
363
+ end
364
+
365
+ if attributes.key?(:'rotating_transaction_gateway_filters')
366
+ if (value = attributes[:'rotating_transaction_gateway_filters']).is_a?(Array)
367
+ self.rotating_transaction_gateway_filters = value
368
+ end
369
+ end
370
+
371
+ if attributes.key?(:'rule_group')
372
+ self.rule_group = attributes[:'rule_group']
373
+ end
374
+
375
+ if attributes.key?(:'rule_type')
376
+ self.rule_type = attributes[:'rule_type']
377
+ end
378
+
379
+ if attributes.key?(:'storefront_filters')
380
+ if (value = attributes[:'storefront_filters']).is_a?(Array)
381
+ self.storefront_filters = value
382
+ end
383
+ end
384
+
385
+ if attributes.key?(:'user_action')
386
+ self.user_action = attributes[:'user_action']
387
+ end
388
+ end
389
+
390
+ # Show invalid properties with the reasons. Usually used together with valid?
391
+ # @return Array for valid properties with the reasons
392
+ def list_invalid_properties
393
+ invalid_properties = Array.new
394
+ invalid_properties
395
+ end
396
+
397
+ # Check to see if the all the properties in the model are valid
398
+ # @return true if the model is valid
399
+ def valid?
400
+ avs_match_type_validator = EnumAttributeValidator.new('String', ["match", "no match", "partial"])
401
+ return false unless avs_match_type_validator.valid?(@avs_match_type)
402
+ failure_action_validator = EnumAttributeValidator.new('String', ["Flag For Review", "Process Payment and Modify", "Process Payment and Review", "Decline Transaction", "Exempt"])
403
+ return false unless failure_action_validator.valid?(@failure_action)
404
+ ip_range_type_validator = EnumAttributeValidator.new('String', ["address", "subnet"])
405
+ return false unless ip_range_type_validator.valid?(@ip_range_type)
406
+ rule_group_validator = EnumAttributeValidator.new('String', ["exemptRules", "creditCardRules", "ipRules", "addressRules", "affiliateRules", "itemRules", "orderRules", "browserRules"])
407
+ return false unless rule_group_validator.valid?(@rule_group)
408
+ rule_type_validator = EnumAttributeValidator.new('String', ["exempt apo fpo", "exempt ip", "exempt logged in customer with pricing tier", "credit card single transaction exceeds", "credit card daily transaction amount exceeds", "credit card daily transaction count exceeds", "credit card weekly transaction amount exceeds", "credit card weekly transaction count exceeds", "credit card change number", "credit card block bin", "credit card block prepaid", "amazon special instructions", "paypal special instructions", "reward coupon email mismatch", "gateway response", "ip daily transaction amount exceeds", "ip daily transaction count exceeds", "ip weekly transaction amount exceeds", "ip weekly transaction count exceeds", "ip matches", "ip country mismatch", "address fraud score exceeds", "address fraud score exceeds exempt apo fpo", "address street and zip avs", "address billing doesnt match shipping", "billing country doesnt match shipping", "address international", "address match except zip", "address email", "address not in country", "wholesale customer not logged in", "affiliate matches", "affiliate daily count exceeds", "affiliate weekly count exceeds", "affiliate daily decline percentage exceeds", "affiliate weekly decline percentage exceeds", "affiliate daily with same ip", "affiliate weekly with same ip", "item matches", "item quantity exceeds", "order previous return", "order purchased within last hours", "order used coupon meant for sharing", "browser os linux"])
409
+ return false unless rule_type_validator.valid?(@rule_type)
410
+ user_action_validator = EnumAttributeValidator.new('String', ["Attempted", "Approved"])
411
+ return false unless user_action_validator.valid?(@user_action)
412
+ true
413
+ end
414
+
415
+ # Custom attribute writer method checking allowed values (enum).
416
+ # @param [Object] avs_match_type Object to be assigned
417
+ def avs_match_type=(avs_match_type)
418
+ validator = EnumAttributeValidator.new('String', ["match", "no match", "partial"])
419
+ unless validator.valid?(avs_match_type)
420
+ fail ArgumentError, "invalid value for \"avs_match_type\", must be one of #{validator.allowable_values}."
421
+ end
422
+ @avs_match_type = avs_match_type
423
+ end
424
+
425
+ # Custom attribute writer method checking allowed values (enum).
426
+ # @param [Object] failure_action Object to be assigned
427
+ def failure_action=(failure_action)
428
+ validator = EnumAttributeValidator.new('String', ["Flag For Review", "Process Payment and Modify", "Process Payment and Review", "Decline Transaction", "Exempt"])
429
+ unless validator.valid?(failure_action)
430
+ fail ArgumentError, "invalid value for \"failure_action\", must be one of #{validator.allowable_values}."
431
+ end
432
+ @failure_action = failure_action
433
+ end
434
+
435
+ # Custom attribute writer method checking allowed values (enum).
436
+ # @param [Object] ip_range_type Object to be assigned
437
+ def ip_range_type=(ip_range_type)
438
+ validator = EnumAttributeValidator.new('String', ["address", "subnet"])
439
+ unless validator.valid?(ip_range_type)
440
+ fail ArgumentError, "invalid value for \"ip_range_type\", must be one of #{validator.allowable_values}."
441
+ end
442
+ @ip_range_type = ip_range_type
443
+ end
444
+
445
+ # Custom attribute writer method checking allowed values (enum).
446
+ # @param [Object] rule_group Object to be assigned
447
+ def rule_group=(rule_group)
448
+ validator = EnumAttributeValidator.new('String', ["exemptRules", "creditCardRules", "ipRules", "addressRules", "affiliateRules", "itemRules", "orderRules", "browserRules"])
449
+ unless validator.valid?(rule_group)
450
+ fail ArgumentError, "invalid value for \"rule_group\", must be one of #{validator.allowable_values}."
451
+ end
452
+ @rule_group = rule_group
453
+ end
454
+
455
+ # Custom attribute writer method checking allowed values (enum).
456
+ # @param [Object] rule_type Object to be assigned
457
+ def rule_type=(rule_type)
458
+ validator = EnumAttributeValidator.new('String', ["exempt apo fpo", "exempt ip", "exempt logged in customer with pricing tier", "credit card single transaction exceeds", "credit card daily transaction amount exceeds", "credit card daily transaction count exceeds", "credit card weekly transaction amount exceeds", "credit card weekly transaction count exceeds", "credit card change number", "credit card block bin", "credit card block prepaid", "amazon special instructions", "paypal special instructions", "reward coupon email mismatch", "gateway response", "ip daily transaction amount exceeds", "ip daily transaction count exceeds", "ip weekly transaction amount exceeds", "ip weekly transaction count exceeds", "ip matches", "ip country mismatch", "address fraud score exceeds", "address fraud score exceeds exempt apo fpo", "address street and zip avs", "address billing doesnt match shipping", "billing country doesnt match shipping", "address international", "address match except zip", "address email", "address not in country", "wholesale customer not logged in", "affiliate matches", "affiliate daily count exceeds", "affiliate weekly count exceeds", "affiliate daily decline percentage exceeds", "affiliate weekly decline percentage exceeds", "affiliate daily with same ip", "affiliate weekly with same ip", "item matches", "item quantity exceeds", "order previous return", "order purchased within last hours", "order used coupon meant for sharing", "browser os linux"])
459
+ unless validator.valid?(rule_type)
460
+ fail ArgumentError, "invalid value for \"rule_type\", must be one of #{validator.allowable_values}."
461
+ end
462
+ @rule_type = rule_type
463
+ end
464
+
465
+ # Custom attribute writer method checking allowed values (enum).
466
+ # @param [Object] user_action Object to be assigned
467
+ def user_action=(user_action)
468
+ validator = EnumAttributeValidator.new('String', ["Attempted", "Approved"])
469
+ unless validator.valid?(user_action)
470
+ fail ArgumentError, "invalid value for \"user_action\", must be one of #{validator.allowable_values}."
471
+ end
472
+ @user_action = user_action
473
+ end
474
+
475
+ # Checks equality by comparing each attribute.
476
+ # @param [Object] Object to be compared
477
+ def ==(o)
478
+ return true if self.equal?(o)
479
+ self.class == o.class &&
480
+ affiliate_oid == o.affiliate_oid &&
481
+ amount_threshold == o.amount_threshold &&
482
+ auto_note == o.auto_note &&
483
+ avs_match_type == o.avs_match_type &&
484
+ avs_response_codes == o.avs_response_codes &&
485
+ card_number == o.card_number &&
486
+ count_threshold == o.count_threshold &&
487
+ country_code == o.country_code &&
488
+ created_by == o.created_by &&
489
+ created_dts == o.created_dts &&
490
+ credit_card_bins == o.credit_card_bins &&
491
+ decline_message == o.decline_message &&
492
+ description == o.description &&
493
+ description_html == o.description_html &&
494
+ email == o.email &&
495
+ failure_action == o.failure_action &&
496
+ fraud_rule_oid == o.fraud_rule_oid &&
497
+ gateway_response_codes == o.gateway_response_codes &&
498
+ gateway_response_value == o.gateway_response_value &&
499
+ ip_address == o.ip_address &&
500
+ ip_range_type == o.ip_range_type &&
501
+ item_filters == o.item_filters &&
502
+ merchant_item_id == o.merchant_item_id &&
503
+ modify_custom_field1 == o.modify_custom_field1 &&
504
+ modify_custom_field2 == o.modify_custom_field2 &&
505
+ modify_custom_field3 == o.modify_custom_field3 &&
506
+ modify_custom_field4 == o.modify_custom_field4 &&
507
+ modify_custom_field5 == o.modify_custom_field5 &&
508
+ modify_custom_field6 == o.modify_custom_field6 &&
509
+ modify_custom_field7 == o.modify_custom_field7 &&
510
+ modify_skip_affiliate == o.modify_skip_affiliate &&
511
+ modify_skip_affiliate_network_pixel == o.modify_skip_affiliate_network_pixel &&
512
+ rotating_transaction_gateway_filters == o.rotating_transaction_gateway_filters &&
513
+ rule_group == o.rule_group &&
514
+ rule_type == o.rule_type &&
515
+ storefront_filters == o.storefront_filters &&
516
+ user_action == o.user_action
517
+ end
518
+
519
+ # @see the `==` method
520
+ # @param [Object] Object to be compared
521
+ def eql?(o)
522
+ self == o
523
+ end
524
+
525
+ # Calculates hash code according to all attributes.
526
+ # @return [Integer] Hash code
527
+ def hash
528
+ [affiliate_oid, amount_threshold, auto_note, avs_match_type, avs_response_codes, card_number, count_threshold, country_code, created_by, created_dts, credit_card_bins, decline_message, description, description_html, email, failure_action, fraud_rule_oid, gateway_response_codes, gateway_response_value, ip_address, ip_range_type, item_filters, merchant_item_id, modify_custom_field1, modify_custom_field2, modify_custom_field3, modify_custom_field4, modify_custom_field5, modify_custom_field6, modify_custom_field7, modify_skip_affiliate, modify_skip_affiliate_network_pixel, rotating_transaction_gateway_filters, rule_group, rule_type, storefront_filters, user_action].hash
529
+ end
530
+
531
+ # Builds the object from hash
532
+ # @param [Hash] attributes Model attributes in the form of hash
533
+ # @return [Object] Returns the model itself
534
+ def self.build_from_hash(attributes)
535
+ new.build_from_hash(attributes)
536
+ end
537
+
538
+ # Builds the object from hash
539
+ # @param [Hash] attributes Model attributes in the form of hash
540
+ # @return [Object] Returns the model itself
541
+ def build_from_hash(attributes)
542
+ return nil unless attributes.is_a?(Hash)
543
+ attributes = attributes.transform_keys(&:to_sym)
544
+ self.class.openapi_types.each_pair do |key, type|
545
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
546
+ self.send("#{key}=", nil)
547
+ elsif type =~ /\AArray<(.*)>/i
548
+ # check to ensure the input is an array given that the attribute
549
+ # is documented as an array but the input is not
550
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
551
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
552
+ end
553
+ elsif !attributes[self.class.attribute_map[key]].nil?
554
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
555
+ end
556
+ end
557
+
558
+ self
559
+ end
560
+
561
+ # Deserializes the data based on type
562
+ # @param string type Data type
563
+ # @param string value Value to be deserialized
564
+ # @return [Object] Deserialized data
565
+ def _deserialize(type, value)
566
+ case type.to_sym
567
+ when :Time
568
+ Time.parse(value)
569
+ when :Date
570
+ Date.parse(value)
571
+ when :String
572
+ value.to_s
573
+ when :Integer
574
+ value.to_i
575
+ when :Float
576
+ value.to_f
577
+ when :Boolean
578
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
579
+ true
580
+ else
581
+ false
582
+ end
583
+ when :Object
584
+ # generic object (usually a Hash), return directly
585
+ value
586
+ when /\AArray<(?<inner_type>.+)>\z/
587
+ inner_type = Regexp.last_match[:inner_type]
588
+ value.map { |v| _deserialize(inner_type, v) }
589
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
590
+ k_type = Regexp.last_match[:k_type]
591
+ v_type = Regexp.last_match[:v_type]
592
+ {}.tap do |hash|
593
+ value.each do |k, v|
594
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
595
+ end
596
+ end
597
+ else # model
598
+ # models (e.g. Pet) or oneOf
599
+ klass = UltracartClient.const_get(type)
600
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
601
+ end
602
+ end
603
+
604
+ # Returns the string representation of the object
605
+ # @return [String] String presentation of the object
606
+ def to_s
607
+ to_hash.to_s
608
+ end
609
+
610
+ # to_body is an alias to to_hash (backward compatibility)
611
+ # @return [Hash] Returns the object in the form of hash
612
+ def to_body
613
+ to_hash
614
+ end
615
+
616
+ # Returns the object in the form of hash
617
+ # @return [Hash] Returns the object in the form of hash
618
+ def to_hash
619
+ hash = {}
620
+ self.class.attribute_map.each_pair do |attr, param|
621
+ value = self.send(attr)
622
+ if value.nil?
623
+ is_nullable = self.class.openapi_nullable.include?(attr)
624
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
625
+ end
626
+
627
+ hash[param] = _to_hash(value)
628
+ end
629
+ hash
630
+ end
631
+
632
+ # Outputs non-array value in the form of hash
633
+ # For object, use to_hash. Otherwise, just return the value
634
+ # @param [Object] value Any valid value
635
+ # @return [Hash] Returns the value in the form of hash
636
+ def _to_hash(value)
637
+ if value.is_a?(Array)
638
+ value.compact.map { |v| _to_hash(v) }
639
+ elsif value.is_a?(Hash)
640
+ {}.tap do |hash|
641
+ value.each { |k, v| hash[k] = _to_hash(v) }
642
+ end
643
+ elsif value.respond_to? :to_hash
644
+ value.to_hash
645
+ else
646
+ value
647
+ end
648
+ end
649
+
650
+ end
651
+
652
+ end