Class: VisaAcceptanceMergedSpec::TokenInformation1

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

Overview

TokenInformation1 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(instrumentidentifier_new: SKIP, customer: SKIP, payment_instrument: SKIP, shipping_address: SKIP, instrument_identifier: SKIP, additional_properties: nil) ⇒ TokenInformation1

Returns a new instance of TokenInformation1.



79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/visa_acceptance_merged_spec/models/token_information1.rb', line 79

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

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

Instance Attribute Details

#customerCustomer4

A value of true means the card number or bank account used to create an Instrument Identifier was new and did not already exist in the token vault. A value of false means the card number or bank account used to create an Instrument Identifier already existed in the token vault.

Returns:



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

def customer
  @customer
end

#instrument_identifierInstrumentIdentifier3

A value of true means the card number or bank account used to create an Instrument Identifier was new and did not already exist in the token vault. A value of false means the card number or bank account used to create an Instrument Identifier already existed in the token vault.



50
51
52
# File 'lib/visa_acceptance_merged_spec/models/token_information1.rb', line 50

def instrument_identifier
  @instrument_identifier
end

#instrumentidentifier_newTrueClass | FalseClass

A value of true means the card number or bank account used to create an Instrument Identifier was new and did not already exist in the token vault. A value of false means the card number or bank account used to create an Instrument Identifier already existed in the token vault.

Returns:

  • (TrueClass | FalseClass)


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

def instrumentidentifier_new
  @instrumentidentifier_new
end

#payment_instrumentPaymentInstrument4

A value of true means the card number or bank account used to create an Instrument Identifier was new and did not already exist in the token vault. A value of false means the card number or bank account used to create an Instrument Identifier already existed in the token vault.

Returns:



34
35
36
# File 'lib/visa_acceptance_merged_spec/models/token_information1.rb', line 34

def payment_instrument
  @payment_instrument
end

#shipping_addressShippingAddress4

A value of true means the card number or bank account used to create an Instrument Identifier was new and did not already exist in the token vault. A value of false means the card number or bank account used to create an Instrument Identifier already existed in the token vault.

Returns:



42
43
44
# File 'lib/visa_acceptance_merged_spec/models/token_information1.rb', line 42

def shipping_address
  @shipping_address
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
119
120
121
122
# File 'lib/visa_acceptance_merged_spec/models/token_information1.rb', line 94

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  instrumentidentifier_new =
    hash.key?('instrumentidentifierNew') ? hash['instrumentidentifierNew'] : SKIP
  customer = Customer4.from_hash(hash['customer']) if hash['customer']
  payment_instrument = PaymentInstrument4.from_hash(hash['paymentInstrument']) if
    hash['paymentInstrument']
  shipping_address = ShippingAddress4.from_hash(hash['shippingAddress']) if
    hash['shippingAddress']
  instrument_identifier = InstrumentIdentifier3.from_hash(hash['instrumentIdentifier']) if
    hash['instrumentIdentifier']

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

.namesObject

A mapping from model property names to API property names.



53
54
55
56
57
58
59
60
61
# File 'lib/visa_acceptance_merged_spec/models/token_information1.rb', line 53

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

.nullablesObject

An array for nullable fields



75
76
77
# File 'lib/visa_acceptance_merged_spec/models/token_information1.rb', line 75

def self.nullables
  []
end

.optionalsObject

An array for optional fields



64
65
66
67
68
69
70
71
72
# File 'lib/visa_acceptance_merged_spec/models/token_information1.rb', line 64

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



134
135
136
137
138
139
140
# File 'lib/visa_acceptance_merged_spec/models/token_information1.rb', line 134

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

#to_sObject

Provides a human-readable string representation of the object.



125
126
127
128
129
130
131
# File 'lib/visa_acceptance_merged_spec/models/token_information1.rb', line 125

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