Class: VisaAcceptanceMergedSpec::PostInstrumentIdentifierResponse

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

Overview

PostInstrumentIdentifierResponse 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(links: SKIP, id: SKIP, object: SKIP, state: SKIP, type: SKIP, token_provisioning_information: SKIP, card: SKIP, bank_account: SKIP, tokenized_card: SKIP, issuer: SKIP, processing_information: SKIP, bill_to: SKIP, metadata: SKIP, embedded: SKIP, additional_properties: nil) ⇒ PostInstrumentIdentifierResponse

Returns a new instance of PostInstrumentIdentifierResponse.



149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 149

def initialize(links: SKIP, id: SKIP, object: SKIP, state: SKIP, type: SKIP,
               token_provisioning_information: SKIP, card: SKIP,
               bank_account: SKIP, tokenized_card: SKIP, issuer: SKIP,
               processing_information: SKIP, bill_to: 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 = object unless object == SKIP
  @state = state unless state == SKIP
  @type = type unless type == SKIP
  unless token_provisioning_information == SKIP
    @token_provisioning_information =
      token_provisioning_information
  end
  @card = card unless card == SKIP
  @bank_account =  unless  == SKIP
  @tokenized_card = tokenized_card unless tokenized_card == SKIP
  @issuer = issuer unless issuer == SKIP
  @processing_information = processing_information unless processing_information == SKIP
  @bill_to = bill_to unless bill_to == SKIP
  @metadata =  unless  == SKIP
  @embedded = embedded unless embedded == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#bank_accountBankAccount1

The type of Instrument Identifier. Possible Values:

  • enrollable card
  • enrollable token

Returns:



59
60
61
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 59

def 
  @bank_account
end

#bill_toBillTo3

The type of Instrument Identifier. Possible Values:

  • enrollable card
  • enrollable token

Returns:



87
88
89
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 87

def bill_to
  @bill_to
end

#cardCard2

The type of Instrument Identifier. Possible Values:

  • enrollable card
  • enrollable token

Returns:



52
53
54
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 52

def card
  @card
end

#embeddedEmbedded2

The type of Instrument Identifier. Possible Values:

  • enrollable card
  • enrollable token

Returns:



101
102
103
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 101

def embedded
  @embedded
end

#idString

The Id of the Instrument Identifier Token.

Returns:

  • (String)


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

def id
  @id
end

#issuerIssuer4

The type of Instrument Identifier. Possible Values:

  • enrollable card
  • enrollable token

Returns:



73
74
75
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 73

def issuer
  @issuer
end

TODO: Write general description for this method

Returns:



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

def links
  @links
end

#metadataMetadata3

The type of Instrument Identifier. Possible Values:

  • enrollable card
  • enrollable token

Returns:



94
95
96
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 94

def 
  @metadata
end

#objectString

The type. Possible Values:

  • instrumentIdentifier

Returns:

  • (String)


24
25
26
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 24

def object
  @object
end

#processing_informationProcessingInformation28

The type of Instrument Identifier. Possible Values:

  • enrollable card
  • enrollable token


80
81
82
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 80

def processing_information
  @processing_information
end

#stateString

Issuers state for the card number. Possible Values:

  • ACTIVE
  • CLOSED : The account has been closed.

Returns:

  • (String)


31
32
33
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 31

def state
  @state
end

#token_provisioning_informationTokenProvisioningInformation

The type of Instrument Identifier. Possible Values:

  • enrollable card
  • enrollable token


45
46
47
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 45

def token_provisioning_information
  @token_provisioning_information
end

#tokenized_cardTmsv2TokenizedCard

The type of Instrument Identifier. Possible Values:

  • enrollable card
  • enrollable token

Returns:



66
67
68
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 66

def tokenized_card
  @tokenized_card
end

#typeString

The type of Instrument Identifier. Possible Values:

  • enrollable card
  • enrollable token

Returns:

  • (String)


38
39
40
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 38

def type
  @type
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 178

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  links = Links21.from_hash(hash['_links']) if hash['_links']
  id = hash.key?('id') ? hash['id'] : SKIP
  object = hash.key?('object') ? hash['object'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  if hash['tokenProvisioningInformation']
    token_provisioning_information = TokenProvisioningInformation.from_hash(hash['tokenProvisioningInformation'])
  end
  card = Card2.from_hash(hash['card']) if hash['card']
   = BankAccount1.from_hash(hash['bankAccount']) if hash['bankAccount']
  tokenized_card = Tmsv2TokenizedCard.from_hash(hash['tokenizedCard']) if
    hash['tokenizedCard']
  issuer = Issuer4.from_hash(hash['issuer']) if hash['issuer']
  processing_information = ProcessingInformation28.from_hash(hash['processingInformation']) if
    hash['processingInformation']
  bill_to = BillTo3.from_hash(hash['billTo']) if hash['billTo']
   = Metadata3.from_hash(hash['metadata']) if hash['metadata']
  embedded = Embedded2.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.
  PostInstrumentIdentifierResponse.new(links: links,
                                       id: id,
                                       object: object,
                                       state: state,
                                       type: type,
                                       token_provisioning_information: token_provisioning_information,
                                       card: card,
                                       bank_account: ,
                                       tokenized_card: tokenized_card,
                                       issuer: issuer,
                                       processing_information: processing_information,
                                       bill_to: bill_to,
                                       metadata: ,
                                       embedded: embedded,
                                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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/post_instrument_identifier_response.rb', line 104

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['links'] = '_links'
  @_hash['id'] = 'id'
  @_hash['object'] = 'object'
  @_hash['state'] = 'state'
  @_hash['type'] = 'type'
  @_hash['token_provisioning_information'] =
    'tokenProvisioningInformation'
  @_hash['card'] = 'card'
  @_hash['bank_account'] = 'bankAccount'
  @_hash['tokenized_card'] = 'tokenizedCard'
  @_hash['issuer'] = 'issuer'
  @_hash['processing_information'] = 'processingInformation'
  @_hash['bill_to'] = 'billTo'
  @_hash['metadata'] = 'metadata'
  @_hash['embedded'] = '_embedded'
  @_hash
end

.nullablesObject

An array for nullable fields



145
146
147
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 145

def self.nullables
  []
end

.optionalsObject

An array for optional fields



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 125

def self.optionals
  %w[
    links
    id
    object
    state
    type
    token_provisioning_information
    card
    bank_account
    tokenized_card
    issuer
    processing_information
    bill_to
    metadata
    embedded
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



238
239
240
241
242
243
244
245
246
247
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 238

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} links: #{@links.inspect}, id: #{@id.inspect}, object: #{@object.inspect},"\
  " state: #{@state.inspect}, type: #{@type.inspect}, token_provisioning_information:"\
  " #{@token_provisioning_information.inspect}, card: #{@card.inspect}, bank_account:"\
  " #{@bank_account.inspect}, tokenized_card: #{@tokenized_card.inspect}, issuer:"\
  " #{@issuer.inspect}, processing_information: #{@processing_information.inspect}, bill_to:"\
  " #{@bill_to.inspect}, metadata: #{@metadata.inspect}, embedded: #{@embedded.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



227
228
229
230
231
232
233
234
235
# File 'lib/visa_acceptance_merged_spec/models/post_instrument_identifier_response.rb', line 227

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} links: #{@links}, id: #{@id}, object: #{@object}, state: #{@state}, type:"\
  " #{@type}, token_provisioning_information: #{@token_provisioning_information}, card:"\
  " #{@card}, bank_account: #{@bank_account}, tokenized_card: #{@tokenized_card}, issuer:"\
  " #{@issuer}, processing_information: #{@processing_information}, bill_to: #{@bill_to},"\
  " metadata: #{@metadata}, embedded: #{@embedded}, additional_properties:"\
  " #{@additional_properties}>"
end