Class: CyberSourceMergedSpec::DeviceInformation7
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::DeviceInformation7
- Defined in:
- lib/cyber_source_merged_spec/models/device_information7.rb
Overview
DeviceInformation7 Model.
Instance Attribute Summary collapse
-
#http_accept_browser_value ⇒ String
Value of the Accept header sent by the customer’s web browser.
-
#ip_address ⇒ String
IP address of the customer.
-
#user_agent_browser_value ⇒ String
Value of the User-Agent header sent by the customer’s web browser.
Class Method Summary collapse
- .from_element(root) ⇒ Object
-
.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(http_accept_browser_value: SKIP, ip_address: SKIP, user_agent_browser_value: SKIP, additional_properties: nil) ⇒ DeviceInformation7
constructor
A new instance of DeviceInformation7.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
- #to_xml_element(doc, root_name) ⇒ 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(http_accept_browser_value: SKIP, ip_address: SKIP, user_agent_browser_value: SKIP, additional_properties: nil) ⇒ DeviceInformation7
Returns a new instance of DeviceInformation7.
54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/cyber_source_merged_spec/models/device_information7.rb', line 54 def initialize(http_accept_browser_value: SKIP, ip_address: SKIP, user_agent_browser_value: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? unless http_accept_browser_value == SKIP @http_accept_browser_value = http_accept_browser_value end @ip_address = ip_address unless ip_address == SKIP @user_agent_browser_value = user_agent_browser_value unless user_agent_browser_value == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#http_accept_browser_value ⇒ String
Value of the Accept header sent by the customer’s web browser. Note If the customer’s browser provides a value, you must include it in your request.
16 17 18 |
# File 'lib/cyber_source_merged_spec/models/device_information7.rb', line 16 def http_accept_browser_value @http_accept_browser_value end |
#ip_address ⇒ String
IP address of the customer.
Used by
Authorization, Capture, and Credit Optional field.
23 24 25 |
# File 'lib/cyber_source_merged_spec/models/device_information7.rb', line 23 def ip_address @ip_address end |
#user_agent_browser_value ⇒ String
Value of the User-Agent header sent by the customer’s web browser. Note If the customer’s browser provides a value, you must include it in your request.
29 30 31 |
# File 'lib/cyber_source_merged_spec/models/device_information7.rb', line 29 def user_agent_browser_value @user_agent_browser_value end |
Class Method Details
.from_element(root) ⇒ Object
93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/cyber_source_merged_spec/models/device_information7.rb', line 93 def self.from_element(root) http_accept_browser_value = XmlUtilities.from_element( root, 'httpAcceptBrowserValue', String ) ip_address = XmlUtilities.from_element(root, 'ipAddress', String) user_agent_browser_value = XmlUtilities.from_element( root, 'userAgentBrowserValue', String ) new(http_accept_browser_value: http_accept_browser_value, ip_address: ip_address, user_agent_browser_value: user_agent_browser_value, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/cyber_source_merged_spec/models/device_information7.rb', line 69 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. http_accept_browser_value = hash.key?('httpAcceptBrowserValue') ? hash['httpAcceptBrowserValue'] : SKIP ip_address = hash.key?('ipAddress') ? hash['ipAddress'] : SKIP user_agent_browser_value = hash.key?('userAgentBrowserValue') ? hash['userAgentBrowserValue'] : 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. DeviceInformation7.new(http_accept_browser_value: http_accept_browser_value, ip_address: ip_address, user_agent_browser_value: user_agent_browser_value, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
32 33 34 35 36 37 38 |
# File 'lib/cyber_source_merged_spec/models/device_information7.rb', line 32 def self.names @_hash = {} if @_hash.nil? @_hash['http_accept_browser_value'] = 'httpAcceptBrowserValue' @_hash['ip_address'] = 'ipAddress' @_hash['user_agent_browser_value'] = 'userAgentBrowserValue' @_hash end |
.nullables ⇒ Object
An array for nullable fields
50 51 52 |
# File 'lib/cyber_source_merged_spec/models/device_information7.rb', line 50 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
41 42 43 44 45 46 47 |
# File 'lib/cyber_source_merged_spec/models/device_information7.rb', line 41 def self.optionals %w[ http_accept_browser_value ip_address user_agent_browser_value ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
131 132 133 134 135 136 |
# File 'lib/cyber_source_merged_spec/models/device_information7.rb', line 131 def inspect class_name = self.class.name.split('::').last "<#{class_name} http_accept_browser_value: #{@http_accept_browser_value.inspect},"\ " ip_address: #{@ip_address.inspect}, user_agent_browser_value:"\ " #{@user_agent_browser_value.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
123 124 125 126 127 128 |
# File 'lib/cyber_source_merged_spec/models/device_information7.rb', line 123 def to_s class_name = self.class.name.split('::').last "<#{class_name} http_accept_browser_value: #{@http_accept_browser_value}, ip_address:"\ " #{@ip_address}, user_agent_browser_value: #{@user_agent_browser_value},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/cyber_source_merged_spec/models/device_information7.rb', line 108 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'httpAcceptBrowserValue', http_accept_browser_value) XmlUtilities.add_as_subelement(doc, root, 'ipAddress', ip_address) XmlUtilities.add_as_subelement(doc, root, 'userAgentBrowserValue', user_agent_browser_value) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |