Class: ThePlaidApi::LinkEventMetadata

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

Overview

Metadata about an event that occurred while the user was going through Link

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(error_code: SKIP, error_message: SKIP, error_type: SKIP, exit_status: SKIP, institution_id: SKIP, institution_name: SKIP, institution_search_query: SKIP, request_id: SKIP, mfa_type: SKIP, view_name: SKIP, selection: SKIP, brand_name: SKIP, match_reason: SKIP, routing_number: SKIP, account_number_mask: SKIP, additional_properties: nil) ⇒ LinkEventMetadata

Returns a new instance of LinkEventMetadata.



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 137

def initialize(error_code: SKIP, error_message: SKIP, error_type: SKIP,
               exit_status: SKIP, institution_id: SKIP,
               institution_name: SKIP, institution_search_query: SKIP,
               request_id: SKIP, mfa_type: SKIP, view_name: SKIP,
               selection: SKIP, brand_name: SKIP, match_reason: SKIP,
               routing_number: SKIP, account_number_mask: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @error_code = error_code unless error_code == SKIP
  @error_message = error_message unless error_message == SKIP
  @error_type = error_type unless error_type == SKIP
  @exit_status = exit_status unless exit_status == SKIP
  @institution_id = institution_id unless institution_id == SKIP
  @institution_name = institution_name unless institution_name == SKIP
  @institution_search_query = institution_search_query unless institution_search_query == SKIP
  @request_id = request_id unless request_id == SKIP
  @mfa_type = mfa_type unless mfa_type == SKIP
  @view_name = view_name unless view_name == SKIP
  @selection = selection unless selection == SKIP
  @brand_name = brand_name unless brand_name == SKIP
  @match_reason = match_reason unless match_reason == SKIP
  @routing_number = routing_number unless routing_number == SKIP
  @account_number_mask =  unless  == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_number_maskString

The account number mask extracted from the user-provided account number. If the user-inputted account number is four digits long, ‘account_number_mask` is empty. Emitted by `SUBMIT_ACCOUNT_NUMBER`.

Returns:

  • (String)


88
89
90
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 88

def 
  @account_number_mask
end

#brand_nameString

The name of the selected brand.

Returns:

  • (String)


70
71
72
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 70

def brand_name
  @brand_name
end

#error_codeString

The error code that the user encountered. Emitted by ‘ERROR`, `EXIT`.

Returns:

  • (String)


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

def error_code
  @error_code
end

#error_messageString

The error message that the user encountered. Emitted by: ‘ERROR`, `EXIT`.

Returns:

  • (String)


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

def error_message
  @error_message
end

#error_typeString

The error type that the user encountered. Emitted by: ‘ERROR`, `EXIT`.

Returns:

  • (String)


22
23
24
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 22

def error_type
  @error_type
end

#exit_statusString

The status key indicates the point at which the user exited the Link flow. Emitted by: ‘EXIT`.

Returns:

  • (String)


27
28
29
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 27

def exit_status
  @exit_status
end

#institution_idString

The ID of the selected institution. Emitted by: all events.

Returns:

  • (String)


31
32
33
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 31

def institution_id
  @institution_id
end

#institution_nameString

The name of the selected institution. Emitted by: all events.

Returns:

  • (String)


35
36
37
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 35

def institution_name
  @institution_name
end

#institution_search_queryString

The query used to search for institutions. Emitted by: ‘SEARCH_INSTITUTION`.

Returns:

  • (String)


40
41
42
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 40

def institution_search_query
  @institution_search_query
end

#match_reasonString

The reason this institution was matched. This will be either ‘returning_user` or `routing_number` if emitted by `MATCHED_SELECT_INSTITUTION`. Otherwise, this will be `SAVED_INSTITUTION` or `AUTO_SELECT_SAVED_INSTITUTION` if emitted by `SELECT_INSTITUTION`.

Returns:

  • (String)


77
78
79
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 77

def match_reason
  @match_reason
end

#mfa_typeString

If set, the user has encountered one of the following MFA types: code, device, questions, selections. Emitted by: ‘SUBMIT_MFA` and `TRANSITION_VIEW` when `view_name` is `MFA`.

Returns:

  • (String)


51
52
53
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 51

def mfa_type
  @mfa_type
end

#request_idString

The request ID for the last request made by Link. This can be shared with Plaid Support to expedite investigation. Emitted by: all events.

Returns:

  • (String)


45
46
47
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 45

def request_id
  @request_id
end

#routing_numberString

The routing number submitted by user at the micro-deposits routing number pane. Emitted by ‘SUBMIT_ROUTING_NUMBER`.

Returns:

  • (String)


82
83
84
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 82

def routing_number
  @routing_number
end

#selectionString

Either the verification method for a matched institution selected by the user or the Auth Type Select flow type selected by the user. If selection is used to describe selected verification method, then possible values are ‘phoneotp` or `password`; if selection is used to describe the selected Auth Type Select flow, then possible values are `flow_type_manual` or `flow_type_instant`. Emitted by: `MATCHED_SELECT_VERIFY_METHOD` and `SELECT_AUTH_TYPE`.

Returns:

  • (String)


66
67
68
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 66

def selection
  @selection
end

#view_nameString

The name of the view that is being transitioned to. Emitted by: ‘TRANSITION_VIEW`.

Returns:

  • (String)


56
57
58
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 56

def view_name
  @view_name
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



166
167
168
169
170
171
172
173
174
175
176
177
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
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 166

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  error_code = hash.key?('error_code') ? hash['error_code'] : SKIP
  error_message = hash.key?('error_message') ? hash['error_message'] : SKIP
  error_type = hash.key?('error_type') ? hash['error_type'] : SKIP
  exit_status = hash.key?('exit_status') ? hash['exit_status'] : SKIP
  institution_id =
    hash.key?('institution_id') ? hash['institution_id'] : SKIP
  institution_name =
    hash.key?('institution_name') ? hash['institution_name'] : SKIP
  institution_search_query =
    hash.key?('institution_search_query') ? hash['institution_search_query'] : SKIP
  request_id = hash.key?('request_id') ? hash['request_id'] : SKIP
  mfa_type = hash.key?('mfa_type') ? hash['mfa_type'] : SKIP
  view_name = hash.key?('view_name') ? hash['view_name'] : SKIP
  selection = hash.key?('selection') ? hash['selection'] : SKIP
  brand_name = hash.key?('brand_name') ? hash['brand_name'] : SKIP
  match_reason = hash.key?('match_reason') ? hash['match_reason'] : SKIP
  routing_number =
    hash.key?('routing_number') ? hash['routing_number'] : SKIP
   =
    hash.key?('account_number_mask') ? hash['account_number_mask'] : 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.
  LinkEventMetadata.new(error_code: error_code,
                        error_message: error_message,
                        error_type: error_type,
                        exit_status: exit_status,
                        institution_id: institution_id,
                        institution_name: institution_name,
                        institution_search_query: institution_search_query,
                        request_id: request_id,
                        mfa_type: mfa_type,
                        view_name: view_name,
                        selection: selection,
                        brand_name: brand_name,
                        match_reason: match_reason,
                        routing_number: routing_number,
                        account_number_mask: ,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 91

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['error_code'] = 'error_code'
  @_hash['error_message'] = 'error_message'
  @_hash['error_type'] = 'error_type'
  @_hash['exit_status'] = 'exit_status'
  @_hash['institution_id'] = 'institution_id'
  @_hash['institution_name'] = 'institution_name'
  @_hash['institution_search_query'] = 'institution_search_query'
  @_hash['request_id'] = 'request_id'
  @_hash['mfa_type'] = 'mfa_type'
  @_hash['view_name'] = 'view_name'
  @_hash['selection'] = 'selection'
  @_hash['brand_name'] = 'brand_name'
  @_hash['match_reason'] = 'match_reason'
  @_hash['routing_number'] = 'routing_number'
  @_hash['account_number_mask'] = 'account_number_mask'
  @_hash
end

.nullablesObject

An array for nullable fields



133
134
135
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 133

def self.nullables
  []
end

.optionalsObject

An array for optional fields



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 112

def self.optionals
  %w[
    error_code
    error_message
    error_type
    exit_status
    institution_id
    institution_name
    institution_search_query
    request_id
    mfa_type
    view_name
    selection
    brand_name
    match_reason
    routing_number
    account_number_mask
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 230

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} error_code: #{@error_code.inspect}, error_message:"\
  " #{@error_message.inspect}, error_type: #{@error_type.inspect}, exit_status:"\
  " #{@exit_status.inspect}, institution_id: #{@institution_id.inspect}, institution_name:"\
  " #{@institution_name.inspect}, institution_search_query:"\
  " #{@institution_search_query.inspect}, request_id: #{@request_id.inspect}, mfa_type:"\
  " #{@mfa_type.inspect}, view_name: #{@view_name.inspect}, selection: #{@selection.inspect},"\
  " brand_name: #{@brand_name.inspect}, match_reason: #{@match_reason.inspect},"\
  " routing_number: #{@routing_number.inspect}, account_number_mask:"\
  " #{@account_number_mask.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



218
219
220
221
222
223
224
225
226
227
# File 'lib/the_plaid_api/models/link_event_metadata.rb', line 218

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} error_code: #{@error_code}, error_message: #{@error_message}, error_type:"\
  " #{@error_type}, exit_status: #{@exit_status}, institution_id: #{@institution_id},"\
  " institution_name: #{@institution_name}, institution_search_query:"\
  " #{@institution_search_query}, request_id: #{@request_id}, mfa_type: #{@mfa_type},"\
  " view_name: #{@view_name}, selection: #{@selection}, brand_name: #{@brand_name},"\
  " match_reason: #{@match_reason}, routing_number: #{@routing_number}, account_number_mask:"\
  " #{@account_number_mask}, additional_properties: #{@additional_properties}>"
end