Class: CyberSourceMergedSpec::TravelInformation3
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::TravelInformation3
- Defined in:
- lib/cyber_source_merged_spec/models/travel_information3.rb
Overview
TravelInformation3 Model.
Instance Attribute Summary collapse
-
#agency ⇒ Agency
Duration of the auto rental or lodging rental.
-
#auto_rental ⇒ AutoRental
Duration of the auto rental or lodging rental.
-
#duration ⇒ String
Duration of the auto rental or lodging rental.
-
#lodging ⇒ Lodging
Duration of the auto rental or lodging rental.
-
#transit ⇒ Transit2
Duration of the auto rental or lodging rental.
-
#vehicle_data ⇒ VehicleData
Duration of the auto rental or lodging rental.
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(duration: SKIP, agency: SKIP, auto_rental: SKIP, lodging: SKIP, transit: SKIP, vehicle_data: SKIP, additional_properties: nil) ⇒ TravelInformation3
constructor
A new instance of TravelInformation3.
-
#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(duration: SKIP, agency: SKIP, auto_rental: SKIP, lodging: SKIP, transit: SKIP, vehicle_data: SKIP, additional_properties: nil) ⇒ TravelInformation3
Returns a new instance of TravelInformation3.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 95 def initialize(duration: SKIP, agency: SKIP, auto_rental: SKIP, lodging: SKIP, transit: SKIP, vehicle_data: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @duration = duration unless duration == SKIP @agency = agency unless agency == SKIP @auto_rental = auto_rental unless auto_rental == SKIP @lodging = lodging unless lodging == SKIP @transit = transit unless transit == SKIP @vehicle_data = vehicle_data unless vehicle_data == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#agency ⇒ Agency
Duration of the auto rental or lodging rental.
Auto rental
This field is supported for Visa, MasterCard, and American Express.
Important If this field is not included when the
processingInformation.industryDataType is auto rental,
the transaction is declined.
28 29 30 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 28 def agency @agency end |
#auto_rental ⇒ AutoRental
Duration of the auto rental or lodging rental.
Auto rental
This field is supported for Visa, MasterCard, and American Express.
Important If this field is not included when the
processingInformation.industryDataType is auto rental,
the transaction is declined.
37 38 39 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 37 def auto_rental @auto_rental end |
#duration ⇒ String
Duration of the auto rental or lodging rental.
Auto rental
This field is supported for Visa, MasterCard, and American Express.
Important If this field is not included when the
processingInformation.industryDataType is auto rental,
the transaction is declined.
19 20 21 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 19 def duration @duration end |
#lodging ⇒ Lodging
Duration of the auto rental or lodging rental.
Auto rental
This field is supported for Visa, MasterCard, and American Express.
Important If this field is not included when the
processingInformation.industryDataType is auto rental,
the transaction is declined.
46 47 48 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 46 def lodging @lodging end |
#transit ⇒ Transit2
Duration of the auto rental or lodging rental.
Auto rental
This field is supported for Visa, MasterCard, and American Express.
Important If this field is not included when the
processingInformation.industryDataType is auto rental,
the transaction is declined.
55 56 57 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 55 def transit @transit end |
#vehicle_data ⇒ VehicleData
Duration of the auto rental or lodging rental.
Auto rental
This field is supported for Visa, MasterCard, and American Express.
Important If this field is not included when the
processingInformation.industryDataType is auto rental,
the transaction is declined.
64 65 66 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 64 def vehicle_data @vehicle_data end |
Class Method Details
.from_element(root) ⇒ Object
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 139 def self.from_element(root) duration = XmlUtilities.from_element(root, 'duration', String) agency = XmlUtilities.from_element(root, 'Agency', Agency) auto_rental = XmlUtilities.from_element(root, 'AutoRental', AutoRental) lodging = XmlUtilities.from_element(root, 'Lodging', Lodging) transit = XmlUtilities.from_element(root, 'Transit2', Transit2) vehicle_data = XmlUtilities.from_element(root, 'VehicleData', VehicleData) new(duration: duration, agency: agency, auto_rental: auto_rental, lodging: lodging, transit: transit, vehicle_data: vehicle_data, additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 111 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. duration = hash.key?('duration') ? hash['duration'] : SKIP agency = Agency.from_hash(hash['agency']) if hash['agency'] auto_rental = AutoRental.from_hash(hash['autoRental']) if hash['autoRental'] lodging = Lodging.from_hash(hash['lodging']) if hash['lodging'] transit = Transit2.from_hash(hash['transit']) if hash['transit'] vehicle_data = VehicleData.from_hash(hash['vehicleData']) if hash['vehicleData'] # 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. TravelInformation3.new(duration: duration, agency: agency, auto_rental: auto_rental, lodging: lodging, transit: transit, vehicle_data: vehicle_data, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
67 68 69 70 71 72 73 74 75 76 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 67 def self.names @_hash = {} if @_hash.nil? @_hash['duration'] = 'duration' @_hash['agency'] = 'agency' @_hash['auto_rental'] = 'autoRental' @_hash['lodging'] = 'lodging' @_hash['transit'] = 'transit' @_hash['vehicle_data'] = 'vehicleData' @_hash end |
.nullables ⇒ Object
An array for nullable fields
91 92 93 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 91 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 79 def self.optionals %w[ duration agency auto_rental lodging transit vehicle_data ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
180 181 182 183 184 185 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 180 def inspect class_name = self.class.name.split('::').last "<#{class_name} duration: #{@duration.inspect}, agency: #{@agency.inspect}, auto_rental:"\ " #{@auto_rental.inspect}, lodging: #{@lodging.inspect}, transit: #{@transit.inspect},"\ " vehicle_data: #{@vehicle_data.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
172 173 174 175 176 177 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 172 def to_s class_name = self.class.name.split('::').last "<#{class_name} duration: #{@duration}, agency: #{@agency}, auto_rental: #{@auto_rental},"\ " lodging: #{@lodging}, transit: #{@transit}, vehicle_data: #{@vehicle_data},"\ " additional_properties: #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/cyber_source_merged_spec/models/travel_information3.rb', line 156 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'duration', duration) XmlUtilities.add_as_subelement(doc, root, 'Agency', agency) XmlUtilities.add_as_subelement(doc, root, 'AutoRental', auto_rental) XmlUtilities.add_as_subelement(doc, root, 'Lodging', lodging) XmlUtilities.add_as_subelement(doc, root, 'Transit2', transit) XmlUtilities.add_as_subelement(doc, root, 'VehicleData', vehicle_data) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |