Class: VisaAcceptanceMergedSpec::PaymentInformation8

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/visa_acceptance_merged_spec/models/payment_information8.rb

Overview

PaymentInformation8 Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(bank: SKIP, customer: SKIP, payment_instrument: SKIP, instrument_identifier: SKIP, shipping_address: SKIP, additional_properties: nil) ⇒ PaymentInformation8

Returns a new instance of PaymentInformation8.



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/visa_acceptance_merged_spec/models/payment_information8.rb', line 59

def initialize(bank: SKIP, customer: SKIP, payment_instrument: SKIP,
               instrument_identifier: SKIP, shipping_address: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @bank = bank unless bank == SKIP
  @customer = customer unless customer == SKIP
  @payment_instrument = payment_instrument unless payment_instrument == SKIP
  @instrument_identifier = instrument_identifier unless instrument_identifier == SKIP
  @shipping_address = shipping_address unless shipping_address == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#bankBank1

TODO: Write general description for this method

Returns:



14
15
16
# File 'lib/visa_acceptance_merged_spec/models/payment_information8.rb', line 14

def bank
  @bank
end

#customerCustomer

TODO: Write general description for this method

Returns:



18
19
20
# File 'lib/visa_acceptance_merged_spec/models/payment_information8.rb', line 18

def customer
  @customer
end

#instrument_identifierInstrumentIdentifier2

TODO: Write general description for this method



26
27
28
# File 'lib/visa_acceptance_merged_spec/models/payment_information8.rb', line 26

def instrument_identifier
  @instrument_identifier
end

#payment_instrumentPaymentInstrument

TODO: Write general description for this method

Returns:



22
23
24
# File 'lib/visa_acceptance_merged_spec/models/payment_information8.rb', line 22

def payment_instrument
  @payment_instrument
end

#shipping_addressShippingAddress

TODO: Write general description for this method

Returns:



30
31
32
# File 'lib/visa_acceptance_merged_spec/models/payment_information8.rb', line 30

def shipping_address
  @shipping_address
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/visa_acceptance_merged_spec/models/payment_information8.rb', line 74

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  bank = Bank1.from_hash(hash['bank']) if hash['bank']
  customer = Customer.from_hash(hash['customer']) if hash['customer']
  payment_instrument = PaymentInstrument.from_hash(hash['paymentInstrument']) if
    hash['paymentInstrument']
  instrument_identifier = InstrumentIdentifier2.from_hash(hash['instrumentIdentifier']) if
    hash['instrumentIdentifier']
  shipping_address = ShippingAddress.from_hash(hash['shippingAddress']) if
    hash['shippingAddress']

  # 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.
  PaymentInformation8.new(bank: bank,
                          customer: customer,
                          payment_instrument: payment_instrument,
                          instrument_identifier: instrument_identifier,
                          shipping_address: shipping_address,
                          additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/visa_acceptance_merged_spec/models/payment_information8.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['bank'] = 'bank'
  @_hash['customer'] = 'customer'
  @_hash['payment_instrument'] = 'paymentInstrument'
  @_hash['instrument_identifier'] = 'instrumentIdentifier'
  @_hash['shipping_address'] = 'shippingAddress'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/visa_acceptance_merged_spec/models/payment_information8.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/visa_acceptance_merged_spec/models/payment_information8.rb', line 44

def self.optionals
  %w[
    bank
    customer
    payment_instrument
    instrument_identifier
    shipping_address
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



112
113
114
115
116
117
118
# File 'lib/visa_acceptance_merged_spec/models/payment_information8.rb', line 112

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} bank: #{@bank.inspect}, customer: #{@customer.inspect}, payment_instrument:"\
  " #{@payment_instrument.inspect}, instrument_identifier: #{@instrument_identifier.inspect},"\
  " shipping_address: #{@shipping_address.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



104
105
106
107
108
109
# File 'lib/visa_acceptance_merged_spec/models/payment_information8.rb', line 104

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} bank: #{@bank}, customer: #{@customer}, payment_instrument:"\
  " #{@payment_instrument}, instrument_identifier: #{@instrument_identifier},"\
  " shipping_address: #{@shipping_address}, additional_properties: #{@additional_properties}>"
end