Class: ThePlaidApi::LinkSessionSuccess
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::LinkSessionSuccess
- Defined in:
- lib/the_plaid_api/models/link_session_success.rb
Overview
An object representing an [onSuccess](plaid.com/docs/link/web/#onsuccess) callback from Link. This field is returned only for legacy integrations and is deprecated in favor of [‘results.item_add_results`](plaid.com/docs/api/link/#link-token-get -response-link-sessions-results-item-add-results) which can support multiple public tokens in a single Link session, for flows such as multi-Item Link. If you are receiving `on_success`, contact your Account Manager to migrate to `results.item_add_results` instead.
Instance Attribute Summary collapse
-
#metadata ⇒ LinkSessionSuccessMetadata
Displayed once a user has successfully linked their Item.
-
#public_token ⇒ String
Displayed 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:, metadata:, additional_properties: nil) ⇒ LinkSessionSuccess
constructor
A new instance of LinkSessionSuccess.
-
#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:, metadata:, additional_properties: nil) ⇒ LinkSessionSuccess
Returns a new instance of LinkSessionSuccess.
48 49 50 51 52 53 54 55 |
# File 'lib/the_plaid_api/models/link_session_success.rb', line 48 def initialize(public_token:, metadata:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @public_token = public_token @metadata = @additional_properties = additional_properties end |
Instance Attribute Details
#metadata ⇒ LinkSessionSuccessMetadata
Displayed once a user has successfully linked their Item.
26 27 28 |
# File 'lib/the_plaid_api/models/link_session_success.rb', line 26 def @metadata end |
#public_token ⇒ String
Displayed once a user has successfully linked their Item.
22 23 24 |
# File 'lib/the_plaid_api/models/link_session_success.rb', line 22 def public_token @public_token end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/the_plaid_api/models/link_session_success.rb', line 58 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. public_token = hash.key?('public_token') ? hash['public_token'] : nil = LinkSessionSuccessMetadata.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. LinkSessionSuccess.new(public_token: public_token, metadata: , additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 |
# File 'lib/the_plaid_api/models/link_session_success.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['public_token'] = 'public_token' @_hash['metadata'] = 'metadata' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 45 46 |
# File 'lib/the_plaid_api/models/link_session_success.rb', line 42 def self.nullables %w[ metadata ] end |
.optionals ⇒ Object
An array for optional fields
37 38 39 |
# File 'lib/the_plaid_api/models/link_session_success.rb', line 37 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
86 87 88 89 90 |
# File 'lib/the_plaid_api/models/link_session_success.rb', line 86 def inspect class_name = self.class.name.split('::').last "<#{class_name} public_token: #{@public_token.inspect}, metadata: #{@metadata.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
79 80 81 82 83 |
# File 'lib/the_plaid_api/models/link_session_success.rb', line 79 def to_s class_name = self.class.name.split('::').last "<#{class_name} public_token: #{@public_token}, metadata: #{@metadata},"\ " additional_properties: #{@additional_properties}>" end |