Class: ThePlaidApi::LinkSessionItemAddResult
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::LinkSessionItemAddResult
- Defined in:
- lib/the_plaid_api/models/link_session_item_add_result.rb
Overview
The details of an Item add in Link.
Instance Attribute Summary collapse
-
#accounts ⇒ Array[LinkSessionSuccessMetadataAccount]
A list of accounts attached to the connected Item.
-
#institution ⇒ LinkSessionSuccessMetadataInstitution
An institution object.
-
#public_token ⇒ String
Returned once a user has successfully linked their Item.
Class Method Summary collapse
-
.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(public_token:, accounts:, institution:, additional_properties: nil) ⇒ LinkSessionItemAddResult
constructor
A new instance of LinkSessionItemAddResult.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the 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(public_token:, accounts:, institution:, additional_properties: nil) ⇒ LinkSessionItemAddResult
Returns a new instance of LinkSessionItemAddResult.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/the_plaid_api/models/link_session_item_add_result.rb', line 48 def initialize(public_token:, accounts:, institution:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @public_token = public_token @accounts = accounts @institution = institution @additional_properties = additional_properties end |
Instance Attribute Details
#accounts ⇒ Array[LinkSessionSuccessMetadataAccount]
A list of accounts attached to the connected Item. If Account Select is enabled via the developer dashboard, ‘accounts` will only include selected accounts.
20 21 22 |
# File 'lib/the_plaid_api/models/link_session_item_add_result.rb', line 20 def accounts @accounts end |
#institution ⇒ LinkSessionSuccessMetadataInstitution
An institution object. If the Item was created via Same-Day or Instant micro-deposit verification, will be ‘null`.
25 26 27 |
# File 'lib/the_plaid_api/models/link_session_item_add_result.rb', line 25 def institution @institution end |
#public_token ⇒ String
Returned once a user has successfully linked their Item.
14 15 16 |
# File 'lib/the_plaid_api/models/link_session_item_add_result.rb', line 14 def public_token @public_token end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/the_plaid_api/models/link_session_item_add_result.rb', line 60 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. public_token = hash.key?('public_token') ? hash['public_token'] : nil # Parameter is an array, so we need to iterate through it accounts = nil unless hash['accounts'].nil? accounts = [] hash['accounts'].each do |structure| accounts << (LinkSessionSuccessMetadataAccount.from_hash(structure) if structure) end end accounts = nil unless hash.key?('accounts') institution = LinkSessionSuccessMetadataInstitution.from_hash(hash['institution']) if hash['institution'] # 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. LinkSessionItemAddResult.new(public_token: public_token, accounts: accounts, institution: institution, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
28 29 30 31 32 33 34 |
# File 'lib/the_plaid_api/models/link_session_item_add_result.rb', line 28 def self.names @_hash = {} if @_hash.nil? @_hash['public_token'] = 'public_token' @_hash['accounts'] = 'accounts' @_hash['institution'] = 'institution' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 45 46 |
# File 'lib/the_plaid_api/models/link_session_item_add_result.rb', line 42 def self.nullables %w[ institution ] end |
.optionals ⇒ Object
An array for optional fields
37 38 39 |
# File 'lib/the_plaid_api/models/link_session_item_add_result.rb', line 37 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
100 101 102 103 104 |
# File 'lib/the_plaid_api/models/link_session_item_add_result.rb', line 100 def inspect class_name = self.class.name.split('::').last "<#{class_name} public_token: #{@public_token.inspect}, accounts: #{@accounts.inspect},"\ " institution: #{@institution.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
93 94 95 96 97 |
# File 'lib/the_plaid_api/models/link_session_item_add_result.rb', line 93 def to_s class_name = self.class.name.split('::').last "<#{class_name} public_token: #{@public_token}, accounts: #{@accounts}, institution:"\ " #{@institution}, additional_properties: #{@additional_properties}>" end |