Class: ThePlaidApi::LinkSessionExitDeprecated

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

Overview

An object representing an [onExit](plaid.com/docs/link/web/#onexit) callback from Link. This field is returned only for legacy implementations and has been deprecated in favor of [‘exit`](plaid.com/docs/api/link/#link-token-get-response-link-sessi ons-exit), for improved naming consistency. If you are receiving this field, contact your Account Manager to migrate to the newer `exit` field.

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:, metadata:, additional_properties: nil) ⇒ LinkSessionExitDeprecated

Returns a new instance of LinkSessionExitDeprecated.



54
55
56
57
58
59
60
61
# File 'lib/the_plaid_api/models/link_session_exit_deprecated.rb', line 54

def initialize(error:, metadata:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @error = error
  @metadata = 
  @additional_properties = additional_properties
end

Instance Attribute Details

#errorError

Errors are identified by ‘error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead.

Returns:



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

def error
  @error
end

#metadataLinkSessionExitMetadata

Displayed if a user exits Link without successfully linking an Item.



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

def 
  @metadata
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/the_plaid_api/models/link_session_exit_deprecated.rb', line 64

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  error = Error.from_hash(hash['error']) if hash['error']
   = LinkSessionExitMetadata.from_hash(hash['metadata']) if hash['metadata']

  # 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.
  LinkSessionExitDeprecated.new(error: error,
                                metadata: ,
                                additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



34
35
36
37
38
39
# File 'lib/the_plaid_api/models/link_session_exit_deprecated.rb', line 34

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['error'] = 'error'
  @_hash['metadata'] = 'metadata'
  @_hash
end

.nullablesObject

An array for nullable fields



47
48
49
50
51
52
# File 'lib/the_plaid_api/models/link_session_exit_deprecated.rb', line 47

def self.nullables
  %w[
    error
    metadata
  ]
end

.optionalsObject

An array for optional fields



42
43
44
# File 'lib/the_plaid_api/models/link_session_exit_deprecated.rb', line 42

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



92
93
94
95
96
# File 'lib/the_plaid_api/models/link_session_exit_deprecated.rb', line 92

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} error: #{@error.inspect}, metadata: #{@metadata.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



85
86
87
88
89
# File 'lib/the_plaid_api/models/link_session_exit_deprecated.rb', line 85

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} error: #{@error}, metadata: #{@metadata}, additional_properties:"\
  " #{@additional_properties}>"
end