Class: VisaAcceptanceMergedSpec::IpAddress2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- VisaAcceptanceMergedSpec::IpAddress2
- Defined in:
- lib/visa_acceptance_merged_spec/models/ip_address2.rb
Overview
IpAddress2 Model.
Instance Attribute Summary collapse
-
#administrative_area ⇒ String
Name of the state decoded from the IP address used directly or indirectly by the customer to send the order.
-
#anonymizer_status ⇒ String
Indicates whether the transaction IP address is associated with a known anonymous proxy.
-
#carrier ⇒ String
Provides the name of the organization that owns the ASN.
-
#country ⇒ String
Name of the country decoded from the IP address used directly or indirectly by the customer to send the order.
-
#locality ⇒ String
Name of the city decoded from the IP address used directly or indirectly by the customer to send the order.
-
#organization ⇒ String
The Registering Organization is the entity responsible for the actions and content associated with a given block of IP addresses.
-
#routing_method ⇒ String
Routing method decoded from the IP address used directly or indirectly by the customer to send the order.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(anonymizer_status: SKIP, locality: SKIP, country: SKIP, administrative_area: SKIP, routing_method: SKIP, carrier: SKIP, organization: SKIP, additional_properties: nil) ⇒ IpAddress2
constructor
A new instance of IpAddress2.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(anonymizer_status: SKIP, locality: SKIP, country: SKIP, administrative_area: SKIP, routing_method: SKIP, carrier: SKIP, organization: SKIP, additional_properties: nil) ⇒ IpAddress2
Returns a new instance of IpAddress2.
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 110 def initialize(anonymizer_status: SKIP, locality: SKIP, country: SKIP, administrative_area: SKIP, routing_method: SKIP, carrier: SKIP, organization: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @anonymizer_status = anonymizer_status unless anonymizer_status == SKIP @locality = locality unless locality == SKIP @country = country unless country == SKIP @administrative_area = administrative_area unless administrative_area == SKIP @routing_method = routing_method unless routing_method == SKIP @carrier = carrier unless carrier == SKIP @organization = organization unless organization == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#administrative_area ⇒ String
Name of the state decoded from the IP address used directly or indirectly
by the customer to send the order.
For all possible values, see the score_ip_state field description in the
Decision Manager Using the SCMP API Developer Guide on the [Visa
Acceptance Business Center.]( Click Decision Manager >
Documentation > Guides > Decision Manager Using the SCMP API
Developer Guide (PDF link).
50 51 52 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 50 def administrative_area @administrative_area end |
#anonymizer_status ⇒ String
Indicates whether the transaction IP address is associated with a known
anonymous proxy.
For all possible values, see the score_ip_anonymizer_status field
description in the Decision Manager Using the SCMP API Developer Guide
on the [Visa Acceptance Business Center.]( Click Decision Manager >
Documentation > Guides > Decision Manager Using the SCMP API
Developer Guide (PDF link).
20 21 22 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 20 def anonymizer_status @anonymizer_status end |
#carrier ⇒ String
Provides the name of the organization that owns the ASN. The carrier is responsible for the traffic carried on the network or set of networks designated as an Autonomous System (AS) and identified by the ASN. While there are more than 27,000 active ASNs, there are fewer carriers, because a single carrier often manages several ASNs.
68 69 70 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 68 def carrier @carrier end |
#country ⇒ String
Name of the country decoded from the IP address used directly or
indirectly by the customer to send the order.
For all possible values, see the score_ip_country field description in
the Decision Manager Using the SCMP API Developer Guide on the [Visa
Acceptance Business Center.]( Click Decision Manager >
Documentation > Guides > Decision Manager Using the SCMP API
Developer Guide (PDF link).
40 41 42 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 40 def country @country end |
#locality ⇒ String
Name of the city decoded from the IP address used directly or indirectly
by the customer to send the order.
For all possible values, see the score_ip_city field description in the
Decision Manager Using the SCMP API Developer Guide on the [Visa
Acceptance Business Center.]( Click Decision Manager >
Documentation > Guides > Decision Manager Using the SCMP API
Developer Guide (PDF link).
30 31 32 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 30 def locality @locality end |
#organization ⇒ String
The Registering Organization is the entity responsible for the actions and content associated with a given block of IP addresses. This is in contrast to the carrier, which is responsible for the routing of traffic for network blocks. Registering Organizations include many types of entities, including corporate, government, or educational entities, and ISPs managing the allocation and use of network blocks.
77 78 79 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 77 def organization @organization end |
#routing_method ⇒ String
Routing method decoded from the IP address used directly or indirectly by
the customer to send the order.
For all possible values, see the score_ip_routing_method field
description in the Decision Manager Using the SCMP API Developer Guide
on the [Visa Acceptance Business Center.]( Click Decision Manager >
Documentation > Guides > Decision Manager Using the SCMP API
Developer Guide (PDF link).
60 61 62 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 60 def routing_method @routing_method end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
128 129 130 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 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 128 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. anonymizer_status = hash.key?('anonymizerStatus') ? hash['anonymizerStatus'] : SKIP locality = hash.key?('locality') ? hash['locality'] : SKIP country = hash.key?('country') ? hash['country'] : SKIP administrative_area = hash.key?('administrativeArea') ? hash['administrativeArea'] : SKIP routing_method = hash.key?('routingMethod') ? hash['routingMethod'] : SKIP carrier = hash.key?('carrier') ? hash['carrier'] : SKIP organization = hash.key?('organization') ? hash['organization'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. IpAddress2.new(anonymizer_status: anonymizer_status, locality: locality, country: country, administrative_area: administrative_area, routing_method: routing_method, carrier: carrier, organization: organization, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 80 def self.names @_hash = {} if @_hash.nil? @_hash['anonymizer_status'] = 'anonymizerStatus' @_hash['locality'] = 'locality' @_hash['country'] = 'country' @_hash['administrative_area'] = 'administrativeArea' @_hash['routing_method'] = 'routingMethod' @_hash['carrier'] = 'carrier' @_hash['organization'] = 'organization' @_hash end |
.nullables ⇒ Object
An array for nullable fields
106 107 108 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 106 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 93 def self.optionals %w[ anonymizer_status locality country administrative_area routing_method carrier organization ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
170 171 172 173 174 175 176 177 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 170 def inspect class_name = self.class.name.split('::').last "<#{class_name} anonymizer_status: #{@anonymizer_status.inspect}, locality:"\ " #{@locality.inspect}, country: #{@country.inspect}, administrative_area:"\ " #{@administrative_area.inspect}, routing_method: #{@routing_method.inspect}, carrier:"\ " #{@carrier.inspect}, organization: #{@organization.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
161 162 163 164 165 166 167 |
# File 'lib/visa_acceptance_merged_spec/models/ip_address2.rb', line 161 def to_s class_name = self.class.name.split('::').last "<#{class_name} anonymizer_status: #{@anonymizer_status}, locality: #{@locality}, country:"\ " #{@country}, administrative_area: #{@administrative_area}, routing_method:"\ " #{@routing_method}, carrier: #{@carrier}, organization: #{@organization},"\ " additional_properties: #{@additional_properties}>" end |