Class: ThePlaidApi::LinkSessionSuccessMetadataAccount

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/link_session_success_metadata_account.rb

Overview

An account attached to the connected Item.

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(id: SKIP, name: SKIP, mask: SKIP, type: SKIP, subtype: SKIP, verification_status: SKIP, class_type: SKIP, additional_properties: nil) ⇒ LinkSessionSuccessMetadataAccount

Returns a new instance of LinkSessionSuccessMetadataAccount.



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 128

def initialize(id: SKIP, name: SKIP, mask: SKIP, type: SKIP, subtype: SKIP,
               verification_status: SKIP, class_type: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id unless id == SKIP
  @name = name unless name == SKIP
  @mask = mask unless mask == SKIP
  @type = type unless type == SKIP
  @subtype = subtype unless subtype == SKIP
  @verification_status = verification_status unless verification_status == SKIP
  @class_type = class_type unless class_type == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#class_typeString

If micro-deposit verification was being used, indicates the user’s selection when asked if the account being verified is a ‘business` or `personal` account. This field is deprecated as Plaid no longer collects this information during the micro-deposit flow. To see whether an account is business or personal, use the `holder_category` field instead.

Returns:

  • (String)


91
92
93
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 91

def class_type
  @class_type
end

#idString

The Plaid ‘account_id`

Returns:

  • (String)


14
15
16
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 14

def id
  @id
end

#maskString

The last 2-4 alphanumeric characters of an account’s official account number. Note that the mask may be non-unique between an Item’s accounts. It may also not match the mask that the bank displays to the user.

Returns:

  • (String)


24
25
26
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 24

def mask
  @mask
end

#nameString

The official account name

Returns:

  • (String)


18
19
20
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 18

def name
  @name
end

#subtypeString

The account subtype. See the [Account schema](plaid.com/docs/api/accounts#account-type-schema) for a full list of possible values

Returns:

  • (String)


36
37
38
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 36

def subtype
  @subtype
end

#typeString

The account type. See the [Account schema](plaid.com/docs/api/accounts#account-type-schema) for a full list of possible values

Returns:

  • (String)


30
31
32
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 30

def type
  @type
end

#verification_statusString

Indicates an Item’s micro-deposit-based verification or database verification status. This field is only populated when using Auth and falling back to micro-deposit or database verification. Possible values are: ‘pending_automatic_verification`: The Item is pending automatic verification. `pending_manual_verification`: The Item is pending manual micro-deposit verification. Items remain in this state until the user successfully verifies the code. `automatically_verified`: The Item has successfully been automatically verified. `manually_verified`: The Item has successfully been manually verified. `verification_expired`: Plaid was unable to automatically verify the deposit within 7 calendar days and will no longer attempt to validate the Item. Users may retry by submitting their information again through Link. `verification_failed`: The Item failed manual micro-deposit verification because the user exhausted all 3 verification attempts. Users may retry by submitting their information again through Link. `unsent`: The Item is pending micro-deposit verification, but Plaid has not yet sent the micro-deposit. `database_insights_pending`: The Database Auth result is pending and will be available upon Auth request. `database_insights_fail`: The Item’s numbers have been verified using Plaid’s data sources and have signal for being invalid and/or have no signal for being valid. Typically this indicates that the routing number is invalid, the account number does not match the account number format associated with the routing number, or the account has been reported as closed or frozen. Only returned for Auth Items created via Database Auth. ‘database_insights_pass`: The Item’s numbers have been verified using Plaid’s data sources: the routing and account number match a routing and account number of an account recognized on the Plaid network, and the account is not known by Plaid to be frozen or closed. Only returned for Auth Items created via Database Auth. ‘database_insights_pass_with_caution`: The Item’s numbers have been verified using Plaid’s data sources and have some signal for being valid: the routing and account number were not recognized on the Plaid network, but the routing number is valid and the account number is a potential valid account number for that routing number. Only returned for Auth Items created via Database Auth. ‘database_matched`: (deprecated) The Item has successfully been verified using Plaid’s data sources. Only returned for Auth Items created via Database Match. ‘null` or empty string: Neither micro-deposit-based verification nor database verification are being used for the Item.

Returns:

  • (String)


83
84
85
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 83

def verification_status
  @verification_status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
172
173
174
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 145

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  mask = hash.key?('mask') ? hash['mask'] : SKIP
  type = hash.key?('type') ? hash['type'] : SKIP
  subtype = hash.key?('subtype') ? hash['subtype'] : SKIP
  verification_status =
    hash.key?('verification_status') ? hash['verification_status'] : SKIP
  class_type = hash.key?('class_type') ? hash['class_type'] : SKIP

  # 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.
  LinkSessionSuccessMetadataAccount.new(id: id,
                                        name: name,
                                        mask: mask,
                                        type: type,
                                        subtype: subtype,
                                        verification_status: verification_status,
                                        class_type: class_type,
                                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



94
95
96
97
98
99
100
101
102
103
104
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 94

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['name'] = 'name'
  @_hash['mask'] = 'mask'
  @_hash['type'] = 'type'
  @_hash['subtype'] = 'subtype'
  @_hash['verification_status'] = 'verification_status'
  @_hash['class_type'] = 'class_type'
  @_hash
end

.nullablesObject

An array for nullable fields



120
121
122
123
124
125
126
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 120

def self.nullables
  %w[
    mask
    verification_status
    class_type
  ]
end

.optionalsObject

An array for optional fields



107
108
109
110
111
112
113
114
115
116
117
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 107

def self.optionals
  %w[
    id
    name
    mask
    type
    subtype
    verification_status
    class_type
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



185
186
187
188
189
190
191
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 185

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, mask: #{@mask.inspect}, type:"\
  " #{@type.inspect}, subtype: #{@subtype.inspect}, verification_status:"\
  " #{@verification_status.inspect}, class_type: #{@class_type.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



177
178
179
180
181
182
# File 'lib/the_plaid_api/models/link_session_success_metadata_account.rb', line 177

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, name: #{@name}, mask: #{@mask}, type: #{@type}, subtype:"\
  " #{@subtype}, verification_status: #{@verification_status}, class_type: #{@class_type},"\
  " additional_properties: #{@additional_properties}>"
end