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