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,583 @@
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 FraudRuleInsertRequest
18
+ # Affiliate email. Used by the 'affiliate matches' rule type when affiliate_oid is not supplied.
19
+ attr_accessor :affiliate_email
20
+
21
+ # Affiliate OID. Used by the 'affiliate matches' rule type. If omitted, affiliate_email is required.
22
+ attr_accessor :affiliate_oid
23
+
24
+ # Monetary or score threshold. Used by *transaction amount exceeds*, *fraud score exceeds*, and *decline percentage exceeds* rules.
25
+ attr_accessor :amount_threshold
26
+
27
+ # Note automatically appended to the order's merchant note when this rule fires.
28
+ attr_accessor :auto_note
29
+
30
+ # AVS match type for the zip portion. Used by the 'address street and zip avs' rule type.
31
+ attr_accessor :avs_match_type
32
+
33
+ # AVS response codes (street). Used by the 'address street and zip avs' rule type.
34
+ attr_accessor :avs_response_codes
35
+
36
+ # Integer count threshold. Used by *count exceeds*, *change number*, *quantity exceeds*, and *purchased within last hours* rules.
37
+ attr_accessor :count_threshold
38
+
39
+ # ISO country code. Used by the 'address not in country' rule type.
40
+ attr_accessor :country_code
41
+
42
+ # Credit card BINs to block (max 20). Used by the 'credit card block bin' rule type.
43
+ attr_accessor :credit_card_bins
44
+
45
+ # Email address. Used by the 'address email' rule type.
46
+ attr_accessor :email
47
+
48
+ # Action to take when this rule fires.
49
+ attr_accessor :failure_action
50
+
51
+ # Gateway response code key. Used by the 'gateway response' rule type.
52
+ attr_accessor :gateway_response_codes
53
+
54
+ # Gateway response code value. Used by the 'gateway response' rule type.
55
+ attr_accessor :gateway_response_value
56
+
57
+ # IP address or subnet (eg '192.168.1.1' or '10.0.0.0/8'). Used by 'exempt ip' and 'ip matches' rules.
58
+ attr_accessor :ip_address
59
+
60
+ # Specifies whether an IP rule applies to a single address or a subnet.
61
+ attr_accessor :ip_range_type
62
+
63
+ # Optional list of merchant item ids restricting this rule to orders containing one or more of these items.
64
+ attr_accessor :item_filters
65
+
66
+ # Merchant item id. Used by the 'item matches' rule type.
67
+ attr_accessor :merchant_item_id
68
+
69
+ attr_accessor :modify_custom_field1
70
+
71
+ attr_accessor :modify_custom_field2
72
+
73
+ attr_accessor :modify_custom_field3
74
+
75
+ attr_accessor :modify_custom_field4
76
+
77
+ attr_accessor :modify_custom_field5
78
+
79
+ attr_accessor :modify_custom_field6
80
+
81
+ attr_accessor :modify_custom_field7
82
+
83
+ attr_accessor :modify_skip_affiliate
84
+
85
+ attr_accessor :modify_skip_affiliate_network_pixel
86
+
87
+ # Optional list of rotating transaction gateway oids restricting this rule to orders processed by one of these gateways.
88
+ attr_accessor :rotating_transaction_gateway_filters
89
+
90
+ # Rule type. Also returned by GET /v2/fraud/lookup_values.
91
+ attr_accessor :rule_type
92
+
93
+ # Optional list of screen branding theme oids restricting this rule to orders associated with one or more storefronts.
94
+ attr_accessor :screen_branding_theme_filters
95
+
96
+ # Only used by rule types that distinguish between attempted and approved transactions.
97
+ attr_accessor :user_action
98
+
99
+ class EnumAttributeValidator
100
+ attr_reader :datatype
101
+ attr_reader :allowable_values
102
+
103
+ def initialize(datatype, allowable_values)
104
+ @allowable_values = allowable_values.map do |value|
105
+ case datatype.to_s
106
+ when /Integer/i
107
+ value.to_i
108
+ when /Float/i
109
+ value.to_f
110
+ else
111
+ value
112
+ end
113
+ end
114
+ end
115
+
116
+ def valid?(value)
117
+ !value || allowable_values.include?(value)
118
+ end
119
+ end
120
+
121
+ # Attribute mapping from ruby-style variable name to JSON key.
122
+ def self.attribute_map
123
+ {
124
+ :'affiliate_email' => :'affiliate_email',
125
+ :'affiliate_oid' => :'affiliate_oid',
126
+ :'amount_threshold' => :'amount_threshold',
127
+ :'auto_note' => :'auto_note',
128
+ :'avs_match_type' => :'avs_match_type',
129
+ :'avs_response_codes' => :'avs_response_codes',
130
+ :'count_threshold' => :'count_threshold',
131
+ :'country_code' => :'country_code',
132
+ :'credit_card_bins' => :'credit_card_bins',
133
+ :'email' => :'email',
134
+ :'failure_action' => :'failure_action',
135
+ :'gateway_response_codes' => :'gateway_response_codes',
136
+ :'gateway_response_value' => :'gateway_response_value',
137
+ :'ip_address' => :'ip_address',
138
+ :'ip_range_type' => :'ip_range_type',
139
+ :'item_filters' => :'item_filters',
140
+ :'merchant_item_id' => :'merchant_item_id',
141
+ :'modify_custom_field1' => :'modify_custom_field1',
142
+ :'modify_custom_field2' => :'modify_custom_field2',
143
+ :'modify_custom_field3' => :'modify_custom_field3',
144
+ :'modify_custom_field4' => :'modify_custom_field4',
145
+ :'modify_custom_field5' => :'modify_custom_field5',
146
+ :'modify_custom_field6' => :'modify_custom_field6',
147
+ :'modify_custom_field7' => :'modify_custom_field7',
148
+ :'modify_skip_affiliate' => :'modify_skip_affiliate',
149
+ :'modify_skip_affiliate_network_pixel' => :'modify_skip_affiliate_network_pixel',
150
+ :'rotating_transaction_gateway_filters' => :'rotating_transaction_gateway_filters',
151
+ :'rule_type' => :'rule_type',
152
+ :'screen_branding_theme_filters' => :'screen_branding_theme_filters',
153
+ :'user_action' => :'user_action'
154
+ }
155
+ end
156
+
157
+ # Returns all the JSON keys this model knows about
158
+ def self.acceptable_attributes
159
+ attribute_map.values
160
+ end
161
+
162
+ # Attribute type mapping.
163
+ def self.openapi_types
164
+ {
165
+ :'affiliate_email' => :'String',
166
+ :'affiliate_oid' => :'Integer',
167
+ :'amount_threshold' => :'Float',
168
+ :'auto_note' => :'String',
169
+ :'avs_match_type' => :'String',
170
+ :'avs_response_codes' => :'String',
171
+ :'count_threshold' => :'Integer',
172
+ :'country_code' => :'String',
173
+ :'credit_card_bins' => :'Object',
174
+ :'email' => :'String',
175
+ :'failure_action' => :'String',
176
+ :'gateway_response_codes' => :'String',
177
+ :'gateway_response_value' => :'String',
178
+ :'ip_address' => :'String',
179
+ :'ip_range_type' => :'String',
180
+ :'item_filters' => :'Object',
181
+ :'merchant_item_id' => :'String',
182
+ :'modify_custom_field1' => :'String',
183
+ :'modify_custom_field2' => :'String',
184
+ :'modify_custom_field3' => :'String',
185
+ :'modify_custom_field4' => :'String',
186
+ :'modify_custom_field5' => :'String',
187
+ :'modify_custom_field6' => :'String',
188
+ :'modify_custom_field7' => :'String',
189
+ :'modify_skip_affiliate' => :'Boolean',
190
+ :'modify_skip_affiliate_network_pixel' => :'Boolean',
191
+ :'rotating_transaction_gateway_filters' => :'Object',
192
+ :'rule_type' => :'String',
193
+ :'screen_branding_theme_filters' => :'Object',
194
+ :'user_action' => :'String'
195
+ }
196
+ end
197
+
198
+ # List of attributes with nullable: true
199
+ def self.openapi_nullable
200
+ Set.new([
201
+ ])
202
+ end
203
+
204
+ # Initializes the object
205
+ # @param [Hash] attributes Model attributes in the form of hash
206
+ def initialize(attributes = {})
207
+ if (!attributes.is_a?(Hash))
208
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::FraudRuleInsertRequest` initialize method"
209
+ end
210
+
211
+ # check to see if the attribute exists and convert string to symbol for hash key
212
+ attributes = attributes.each_with_object({}) { |(k, v), h|
213
+ if (!self.class.attribute_map.key?(k.to_sym))
214
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::FraudRuleInsertRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
215
+ end
216
+ h[k.to_sym] = v
217
+ }
218
+
219
+ if attributes.key?(:'affiliate_email')
220
+ self.affiliate_email = attributes[:'affiliate_email']
221
+ end
222
+
223
+ if attributes.key?(:'affiliate_oid')
224
+ self.affiliate_oid = attributes[:'affiliate_oid']
225
+ end
226
+
227
+ if attributes.key?(:'amount_threshold')
228
+ self.amount_threshold = attributes[:'amount_threshold']
229
+ end
230
+
231
+ if attributes.key?(:'auto_note')
232
+ self.auto_note = attributes[:'auto_note']
233
+ end
234
+
235
+ if attributes.key?(:'avs_match_type')
236
+ self.avs_match_type = attributes[:'avs_match_type']
237
+ end
238
+
239
+ if attributes.key?(:'avs_response_codes')
240
+ self.avs_response_codes = attributes[:'avs_response_codes']
241
+ end
242
+
243
+ if attributes.key?(:'count_threshold')
244
+ self.count_threshold = attributes[:'count_threshold']
245
+ end
246
+
247
+ if attributes.key?(:'country_code')
248
+ self.country_code = attributes[:'country_code']
249
+ end
250
+
251
+ if attributes.key?(:'credit_card_bins')
252
+ self.credit_card_bins = attributes[:'credit_card_bins']
253
+ end
254
+
255
+ if attributes.key?(:'email')
256
+ self.email = attributes[:'email']
257
+ end
258
+
259
+ if attributes.key?(:'failure_action')
260
+ self.failure_action = attributes[:'failure_action']
261
+ end
262
+
263
+ if attributes.key?(:'gateway_response_codes')
264
+ self.gateway_response_codes = attributes[:'gateway_response_codes']
265
+ end
266
+
267
+ if attributes.key?(:'gateway_response_value')
268
+ self.gateway_response_value = attributes[:'gateway_response_value']
269
+ end
270
+
271
+ if attributes.key?(:'ip_address')
272
+ self.ip_address = attributes[:'ip_address']
273
+ end
274
+
275
+ if attributes.key?(:'ip_range_type')
276
+ self.ip_range_type = attributes[:'ip_range_type']
277
+ end
278
+
279
+ if attributes.key?(:'item_filters')
280
+ self.item_filters = attributes[:'item_filters']
281
+ end
282
+
283
+ if attributes.key?(:'merchant_item_id')
284
+ self.merchant_item_id = attributes[:'merchant_item_id']
285
+ end
286
+
287
+ if attributes.key?(:'modify_custom_field1')
288
+ self.modify_custom_field1 = attributes[:'modify_custom_field1']
289
+ end
290
+
291
+ if attributes.key?(:'modify_custom_field2')
292
+ self.modify_custom_field2 = attributes[:'modify_custom_field2']
293
+ end
294
+
295
+ if attributes.key?(:'modify_custom_field3')
296
+ self.modify_custom_field3 = attributes[:'modify_custom_field3']
297
+ end
298
+
299
+ if attributes.key?(:'modify_custom_field4')
300
+ self.modify_custom_field4 = attributes[:'modify_custom_field4']
301
+ end
302
+
303
+ if attributes.key?(:'modify_custom_field5')
304
+ self.modify_custom_field5 = attributes[:'modify_custom_field5']
305
+ end
306
+
307
+ if attributes.key?(:'modify_custom_field6')
308
+ self.modify_custom_field6 = attributes[:'modify_custom_field6']
309
+ end
310
+
311
+ if attributes.key?(:'modify_custom_field7')
312
+ self.modify_custom_field7 = attributes[:'modify_custom_field7']
313
+ end
314
+
315
+ if attributes.key?(:'modify_skip_affiliate')
316
+ self.modify_skip_affiliate = attributes[:'modify_skip_affiliate']
317
+ end
318
+
319
+ if attributes.key?(:'modify_skip_affiliate_network_pixel')
320
+ self.modify_skip_affiliate_network_pixel = attributes[:'modify_skip_affiliate_network_pixel']
321
+ end
322
+
323
+ if attributes.key?(:'rotating_transaction_gateway_filters')
324
+ self.rotating_transaction_gateway_filters = attributes[:'rotating_transaction_gateway_filters']
325
+ end
326
+
327
+ if attributes.key?(:'rule_type')
328
+ self.rule_type = attributes[:'rule_type']
329
+ end
330
+
331
+ if attributes.key?(:'screen_branding_theme_filters')
332
+ self.screen_branding_theme_filters = attributes[:'screen_branding_theme_filters']
333
+ end
334
+
335
+ if attributes.key?(:'user_action')
336
+ self.user_action = attributes[:'user_action']
337
+ end
338
+ end
339
+
340
+ # Show invalid properties with the reasons. Usually used together with valid?
341
+ # @return Array for valid properties with the reasons
342
+ def list_invalid_properties
343
+ invalid_properties = Array.new
344
+ invalid_properties
345
+ end
346
+
347
+ # Check to see if the all the properties in the model are valid
348
+ # @return true if the model is valid
349
+ def valid?
350
+ avs_match_type_validator = EnumAttributeValidator.new('String', ["match", "no match", "partial"])
351
+ return false unless avs_match_type_validator.valid?(@avs_match_type)
352
+ failure_action_validator = EnumAttributeValidator.new('String', ["Flag For Review", "Process Payment and Modify", "Process Payment and Review", "Decline Transaction", "Exempt"])
353
+ return false unless failure_action_validator.valid?(@failure_action)
354
+ ip_range_type_validator = EnumAttributeValidator.new('String', ["address", "subnet"])
355
+ return false unless ip_range_type_validator.valid?(@ip_range_type)
356
+ 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"])
357
+ return false unless rule_type_validator.valid?(@rule_type)
358
+ user_action_validator = EnumAttributeValidator.new('String', ["Attempted", "Approved"])
359
+ return false unless user_action_validator.valid?(@user_action)
360
+ true
361
+ end
362
+
363
+ # Custom attribute writer method checking allowed values (enum).
364
+ # @param [Object] avs_match_type Object to be assigned
365
+ def avs_match_type=(avs_match_type)
366
+ validator = EnumAttributeValidator.new('String', ["match", "no match", "partial"])
367
+ unless validator.valid?(avs_match_type)
368
+ fail ArgumentError, "invalid value for \"avs_match_type\", must be one of #{validator.allowable_values}."
369
+ end
370
+ @avs_match_type = avs_match_type
371
+ end
372
+
373
+ # Custom attribute writer method checking allowed values (enum).
374
+ # @param [Object] failure_action Object to be assigned
375
+ def failure_action=(failure_action)
376
+ validator = EnumAttributeValidator.new('String', ["Flag For Review", "Process Payment and Modify", "Process Payment and Review", "Decline Transaction", "Exempt"])
377
+ unless validator.valid?(failure_action)
378
+ fail ArgumentError, "invalid value for \"failure_action\", must be one of #{validator.allowable_values}."
379
+ end
380
+ @failure_action = failure_action
381
+ end
382
+
383
+ # Custom attribute writer method checking allowed values (enum).
384
+ # @param [Object] ip_range_type Object to be assigned
385
+ def ip_range_type=(ip_range_type)
386
+ validator = EnumAttributeValidator.new('String', ["address", "subnet"])
387
+ unless validator.valid?(ip_range_type)
388
+ fail ArgumentError, "invalid value for \"ip_range_type\", must be one of #{validator.allowable_values}."
389
+ end
390
+ @ip_range_type = ip_range_type
391
+ end
392
+
393
+ # Custom attribute writer method checking allowed values (enum).
394
+ # @param [Object] rule_type Object to be assigned
395
+ def rule_type=(rule_type)
396
+ 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"])
397
+ unless validator.valid?(rule_type)
398
+ fail ArgumentError, "invalid value for \"rule_type\", must be one of #{validator.allowable_values}."
399
+ end
400
+ @rule_type = rule_type
401
+ end
402
+
403
+ # Custom attribute writer method checking allowed values (enum).
404
+ # @param [Object] user_action Object to be assigned
405
+ def user_action=(user_action)
406
+ validator = EnumAttributeValidator.new('String', ["Attempted", "Approved"])
407
+ unless validator.valid?(user_action)
408
+ fail ArgumentError, "invalid value for \"user_action\", must be one of #{validator.allowable_values}."
409
+ end
410
+ @user_action = user_action
411
+ end
412
+
413
+ # Checks equality by comparing each attribute.
414
+ # @param [Object] Object to be compared
415
+ def ==(o)
416
+ return true if self.equal?(o)
417
+ self.class == o.class &&
418
+ affiliate_email == o.affiliate_email &&
419
+ affiliate_oid == o.affiliate_oid &&
420
+ amount_threshold == o.amount_threshold &&
421
+ auto_note == o.auto_note &&
422
+ avs_match_type == o.avs_match_type &&
423
+ avs_response_codes == o.avs_response_codes &&
424
+ count_threshold == o.count_threshold &&
425
+ country_code == o.country_code &&
426
+ credit_card_bins == o.credit_card_bins &&
427
+ email == o.email &&
428
+ failure_action == o.failure_action &&
429
+ gateway_response_codes == o.gateway_response_codes &&
430
+ gateway_response_value == o.gateway_response_value &&
431
+ ip_address == o.ip_address &&
432
+ ip_range_type == o.ip_range_type &&
433
+ item_filters == o.item_filters &&
434
+ merchant_item_id == o.merchant_item_id &&
435
+ modify_custom_field1 == o.modify_custom_field1 &&
436
+ modify_custom_field2 == o.modify_custom_field2 &&
437
+ modify_custom_field3 == o.modify_custom_field3 &&
438
+ modify_custom_field4 == o.modify_custom_field4 &&
439
+ modify_custom_field5 == o.modify_custom_field5 &&
440
+ modify_custom_field6 == o.modify_custom_field6 &&
441
+ modify_custom_field7 == o.modify_custom_field7 &&
442
+ modify_skip_affiliate == o.modify_skip_affiliate &&
443
+ modify_skip_affiliate_network_pixel == o.modify_skip_affiliate_network_pixel &&
444
+ rotating_transaction_gateway_filters == o.rotating_transaction_gateway_filters &&
445
+ rule_type == o.rule_type &&
446
+ screen_branding_theme_filters == o.screen_branding_theme_filters &&
447
+ user_action == o.user_action
448
+ end
449
+
450
+ # @see the `==` method
451
+ # @param [Object] Object to be compared
452
+ def eql?(o)
453
+ self == o
454
+ end
455
+
456
+ # Calculates hash code according to all attributes.
457
+ # @return [Integer] Hash code
458
+ def hash
459
+ [affiliate_email, affiliate_oid, amount_threshold, auto_note, avs_match_type, avs_response_codes, count_threshold, country_code, credit_card_bins, email, failure_action, 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_type, screen_branding_theme_filters, user_action].hash
460
+ end
461
+
462
+ # Builds the object from hash
463
+ # @param [Hash] attributes Model attributes in the form of hash
464
+ # @return [Object] Returns the model itself
465
+ def self.build_from_hash(attributes)
466
+ new.build_from_hash(attributes)
467
+ end
468
+
469
+ # Builds the object from hash
470
+ # @param [Hash] attributes Model attributes in the form of hash
471
+ # @return [Object] Returns the model itself
472
+ def build_from_hash(attributes)
473
+ return nil unless attributes.is_a?(Hash)
474
+ attributes = attributes.transform_keys(&:to_sym)
475
+ self.class.openapi_types.each_pair do |key, type|
476
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
477
+ self.send("#{key}=", nil)
478
+ elsif type =~ /\AArray<(.*)>/i
479
+ # check to ensure the input is an array given that the attribute
480
+ # is documented as an array but the input is not
481
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
482
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
483
+ end
484
+ elsif !attributes[self.class.attribute_map[key]].nil?
485
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
486
+ end
487
+ end
488
+
489
+ self
490
+ end
491
+
492
+ # Deserializes the data based on type
493
+ # @param string type Data type
494
+ # @param string value Value to be deserialized
495
+ # @return [Object] Deserialized data
496
+ def _deserialize(type, value)
497
+ case type.to_sym
498
+ when :Time
499
+ Time.parse(value)
500
+ when :Date
501
+ Date.parse(value)
502
+ when :String
503
+ value.to_s
504
+ when :Integer
505
+ value.to_i
506
+ when :Float
507
+ value.to_f
508
+ when :Boolean
509
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
510
+ true
511
+ else
512
+ false
513
+ end
514
+ when :Object
515
+ # generic object (usually a Hash), return directly
516
+ value
517
+ when /\AArray<(?<inner_type>.+)>\z/
518
+ inner_type = Regexp.last_match[:inner_type]
519
+ value.map { |v| _deserialize(inner_type, v) }
520
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
521
+ k_type = Regexp.last_match[:k_type]
522
+ v_type = Regexp.last_match[:v_type]
523
+ {}.tap do |hash|
524
+ value.each do |k, v|
525
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
526
+ end
527
+ end
528
+ else # model
529
+ # models (e.g. Pet) or oneOf
530
+ klass = UltracartClient.const_get(type)
531
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
532
+ end
533
+ end
534
+
535
+ # Returns the string representation of the object
536
+ # @return [String] String presentation of the object
537
+ def to_s
538
+ to_hash.to_s
539
+ end
540
+
541
+ # to_body is an alias to to_hash (backward compatibility)
542
+ # @return [Hash] Returns the object in the form of hash
543
+ def to_body
544
+ to_hash
545
+ end
546
+
547
+ # Returns the object in the form of hash
548
+ # @return [Hash] Returns the object in the form of hash
549
+ def to_hash
550
+ hash = {}
551
+ self.class.attribute_map.each_pair do |attr, param|
552
+ value = self.send(attr)
553
+ if value.nil?
554
+ is_nullable = self.class.openapi_nullable.include?(attr)
555
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
556
+ end
557
+
558
+ hash[param] = _to_hash(value)
559
+ end
560
+ hash
561
+ end
562
+
563
+ # Outputs non-array value in the form of hash
564
+ # For object, use to_hash. Otherwise, just return the value
565
+ # @param [Object] value Any valid value
566
+ # @return [Hash] Returns the value in the form of hash
567
+ def _to_hash(value)
568
+ if value.is_a?(Array)
569
+ value.compact.map { |v| _to_hash(v) }
570
+ elsif value.is_a?(Hash)
571
+ {}.tap do |hash|
572
+ value.each { |k, v| hash[k] = _to_hash(v) }
573
+ end
574
+ elsif value.respond_to? :to_hash
575
+ value.to_hash
576
+ else
577
+ value
578
+ end
579
+ end
580
+
581
+ end
582
+
583
+ end