Class: CyberSourceMergedSpec::Customer14
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- CyberSourceMergedSpec::Customer14
- Defined in:
- lib/cyber_source_merged_spec/models/customer14.rb
Overview
Customer14 Model.
Instance Attribute Summary collapse
-
#buyer_information ⇒ BuyerInformation12
The Id of the Customer Token.
-
#client_reference_information ⇒ ClientReferenceInformation42
The Id of the Customer Token.
-
#default_payment_instrument ⇒ DefaultPaymentInstrument
Object containing the custom data that the merchant defines.
-
#default_shipping_address ⇒ DefaultShippingAddress
Object containing the custom data that the merchant defines.
-
#embedded ⇒ Embedded
Additional resources for the Customer.
-
#id ⇒ String
The Id of the Customer Token.
-
#links ⇒ Links19
TODO: Write general description for this method.
-
#merchant_defined_information ⇒ Array[MerchantDefinedInformation7]
Object containing the custom data that the merchant defines.
-
#metadata ⇒ Metadata
Object containing the custom data that the merchant defines.
-
#object_information ⇒ ObjectInformation
The Id of the Customer Token.
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(links: SKIP, id: SKIP, object_information: SKIP, buyer_information: SKIP, client_reference_information: SKIP, merchant_defined_information: SKIP, default_payment_instrument: SKIP, default_shipping_address: SKIP, metadata: SKIP, embedded: SKIP, additional_properties: nil) ⇒ Customer14
constructor
A new instance of Customer14.
-
#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(links: SKIP, id: SKIP, object_information: SKIP, buyer_information: SKIP, client_reference_information: SKIP, merchant_defined_information: SKIP, default_payment_instrument: SKIP, default_shipping_address: SKIP, metadata: SKIP, embedded: SKIP, additional_properties: nil) ⇒ Customer14
Returns a new instance of Customer14.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 89 def initialize(links: SKIP, id: SKIP, object_information: SKIP, buyer_information: SKIP, client_reference_information: SKIP, merchant_defined_information: SKIP, default_payment_instrument: SKIP, default_shipping_address: SKIP, metadata: SKIP, embedded: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @links = links unless links == SKIP @id = id unless id == SKIP @object_information = object_information unless object_information == SKIP @buyer_information = buyer_information unless buyer_information == SKIP unless client_reference_information == SKIP @client_reference_information = client_reference_information end unless merchant_defined_information == SKIP @merchant_defined_information = merchant_defined_information end unless default_payment_instrument == SKIP @default_payment_instrument = default_payment_instrument end @default_shipping_address = default_shipping_address unless default_shipping_address == SKIP @metadata = unless == SKIP @embedded = unless == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#buyer_information ⇒ BuyerInformation12
The Id of the Customer Token.
26 27 28 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 26 def buyer_information @buyer_information end |
#client_reference_information ⇒ ClientReferenceInformation42
The Id of the Customer Token.
30 31 32 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 30 def client_reference_information @client_reference_information end |
#default_payment_instrument ⇒ DefaultPaymentInstrument
Object containing the custom data that the merchant defines.
38 39 40 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 38 def default_payment_instrument @default_payment_instrument end |
#default_shipping_address ⇒ DefaultShippingAddress
Object containing the custom data that the merchant defines.
42 43 44 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 42 def default_shipping_address @default_shipping_address end |
#embedded ⇒ Embedded
Additional resources for the Customer.
50 51 52 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 50 def @embedded end |
#id ⇒ String
The Id of the Customer Token.
18 19 20 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 18 def id @id end |
#links ⇒ Links19
TODO: Write general description for this method
14 15 16 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 14 def links @links end |
#merchant_defined_information ⇒ Array[MerchantDefinedInformation7]
Object containing the custom data that the merchant defines.
34 35 36 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 34 def merchant_defined_information @merchant_defined_information end |
#metadata ⇒ Metadata
Object containing the custom data that the merchant defines.
46 47 48 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 46 def @metadata end |
#object_information ⇒ ObjectInformation
The Id of the Customer Token.
22 23 24 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 22 def object_information @object_information end |
Class Method Details
.from_element(root) ⇒ Object
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 206 207 208 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 173 def self.from_element(root) links = XmlUtilities.from_element(root, 'Links19', Links19) id = XmlUtilities.from_element(root, 'id', String) object_information = XmlUtilities.from_element(root, 'ObjectInformation', ObjectInformation) buyer_information = XmlUtilities.from_element(root, 'BuyerInformation12', BuyerInformation12) client_reference_information = XmlUtilities.from_element( root, 'ClientReferenceInformation42', ClientReferenceInformation42 ) merchant_defined_information = XmlUtilities.from_element_to_array( root, 'MerchantDefinedInformation7', MerchantDefinedInformation7 ) default_payment_instrument = XmlUtilities.from_element( root, 'DefaultPaymentInstrument', DefaultPaymentInstrument ) default_shipping_address = XmlUtilities.from_element( root, 'DefaultShippingAddress', DefaultShippingAddress ) = XmlUtilities.from_element(root, 'Metadata', Metadata) = XmlUtilities.from_element(root, 'Embedded', Embedded) new(links: links, id: id, object_information: object_information, buyer_information: buyer_information, client_reference_information: client_reference_information, merchant_defined_information: merchant_defined_information, default_payment_instrument: default_payment_instrument, default_shipping_address: default_shipping_address, metadata: , embedded: , additional_properties: additional_properties) end |
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
121 122 123 124 125 126 127 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 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 121 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. links = Links19.from_hash(hash['_links']) if hash['_links'] id = hash.key?('id') ? hash['id'] : SKIP object_information = ObjectInformation.from_hash(hash['objectInformation']) if hash['objectInformation'] buyer_information = BuyerInformation12.from_hash(hash['buyerInformation']) if hash['buyerInformation'] if hash['clientReferenceInformation'] client_reference_information = ClientReferenceInformation42.from_hash(hash['clientReferenceInformation']) end # Parameter is an array, so we need to iterate through it merchant_defined_information = nil unless hash['merchantDefinedInformation'].nil? merchant_defined_information = [] hash['merchantDefinedInformation'].each do |structure| merchant_defined_information << (MerchantDefinedInformation7.from_hash(structure) if structure) end end merchant_defined_information = SKIP unless hash.key?('merchantDefinedInformation') if hash['defaultPaymentInstrument'] default_payment_instrument = DefaultPaymentInstrument.from_hash(hash['defaultPaymentInstrument']) end default_shipping_address = DefaultShippingAddress.from_hash(hash['defaultShippingAddress']) if hash['defaultShippingAddress'] = Metadata.from_hash(hash['metadata']) if hash['metadata'] = Embedded.from_hash(hash['_embedded']) if hash['_embedded'] # 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. Customer14.new(links: links, id: id, object_information: object_information, buyer_information: buyer_information, client_reference_information: client_reference_information, merchant_defined_information: merchant_defined_information, default_payment_instrument: default_payment_instrument, default_shipping_address: default_shipping_address, metadata: , embedded: , additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 53 def self.names @_hash = {} if @_hash.nil? @_hash['links'] = '_links' @_hash['id'] = 'id' @_hash['object_information'] = 'objectInformation' @_hash['buyer_information'] = 'buyerInformation' @_hash['client_reference_information'] = 'clientReferenceInformation' @_hash['merchant_defined_information'] = 'merchantDefinedInformation' @_hash['default_payment_instrument'] = 'defaultPaymentInstrument' @_hash['default_shipping_address'] = 'defaultShippingAddress' @_hash['metadata'] = 'metadata' @_hash['embedded'] = '_embedded' @_hash end |
.nullables ⇒ Object
An array for nullable fields
85 86 87 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 85 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 69 def self.optionals %w[ links id object_information buyer_information client_reference_information merchant_defined_information default_payment_instrument default_shipping_address metadata embedded ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
249 250 251 252 253 254 255 256 257 258 259 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 249 def inspect class_name = self.class.name.split('::').last "<#{class_name} links: #{@links.inspect}, id: #{@id.inspect}, object_information:"\ " #{@object_information.inspect}, buyer_information: #{@buyer_information.inspect},"\ " client_reference_information: #{@client_reference_information.inspect},"\ " merchant_defined_information: #{@merchant_defined_information.inspect},"\ " default_payment_instrument: #{@default_payment_instrument.inspect},"\ " default_shipping_address: #{@default_shipping_address.inspect}, metadata:"\ " #{@metadata.inspect}, embedded: #{@embedded.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
237 238 239 240 241 242 243 244 245 246 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 237 def to_s class_name = self.class.name.split('::').last "<#{class_name} links: #{@links}, id: #{@id}, object_information: #{@object_information},"\ " buyer_information: #{@buyer_information}, client_reference_information:"\ " #{@client_reference_information}, merchant_defined_information:"\ " #{@merchant_defined_information}, default_payment_instrument:"\ " #{@default_payment_instrument}, default_shipping_address: #{@default_shipping_address},"\ " metadata: #{@metadata}, embedded: #{@embedded}, additional_properties:"\ " #{@additional_properties}>" end |
#to_xml_element(doc, root_name) ⇒ Object
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
# File 'lib/cyber_source_merged_spec/models/customer14.rb', line 210 def to_xml_element(doc, root_name) root = doc.create_element(root_name) XmlUtilities.add_as_subelement(doc, root, 'Links19', links) XmlUtilities.add_as_subelement(doc, root, 'id', id) XmlUtilities.add_as_subelement(doc, root, 'ObjectInformation', object_information) XmlUtilities.add_as_subelement(doc, root, 'BuyerInformation12', buyer_information) XmlUtilities.add_as_subelement(doc, root, 'ClientReferenceInformation42', client_reference_information) XmlUtilities.add_array_as_subelement(doc, root, 'MerchantDefinedInformation7', merchant_defined_information) XmlUtilities.add_as_subelement(doc, root, 'DefaultPaymentInstrument', default_payment_instrument) XmlUtilities.add_as_subelement(doc, root, 'DefaultShippingAddress', default_shipping_address) XmlUtilities.add_as_subelement(doc, root, 'Metadata', ) XmlUtilities.add_as_subelement(doc, root, 'Embedded', ) XmlUtilities.add_as_subelement(doc, root, 'additional_properties', additional_properties) root end |