Class: ThePlaidApi::ItemAddResultWebhook
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::ItemAddResultWebhook
- Defined in:
- lib/the_plaid_api/models/item_add_result_webhook.rb
Overview
Fired when a user successfully adds a Plaid Item during a Link session when using Hosted Link or Multi-Item Link sessions. Contains the public token for the Item.
Instance Attribute Summary collapse
-
#environment ⇒ WebhookEnvironmentValues
The Plaid environment the webhook was sent from.
-
#link_session_id ⇒ String
The identifier for the Link session.
-
#link_token ⇒ String
The link token used to create the Link session.
-
#public_token ⇒ String
The public token corresponding to the item that was added.
-
#webhook_code ⇒ String
‘ITEM_ADD_RESULT`.
-
#webhook_type ⇒ String
‘LINK`.
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(webhook_type:, webhook_code:, link_session_id:, link_token:, public_token:, environment:, additional_properties: nil) ⇒ ItemAddResultWebhook
constructor
A new instance of ItemAddResultWebhook.
-
#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(webhook_type:, webhook_code:, link_session_id:, link_token:, public_token:, environment:, additional_properties: nil) ⇒ ItemAddResultWebhook
Returns a new instance of ItemAddResultWebhook.
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 60 def initialize(webhook_type:, webhook_code:, link_session_id:, link_token:, public_token:, environment:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @webhook_type = webhook_type @webhook_code = webhook_code @link_session_id = link_session_id @link_token = link_token @public_token = public_token @environment = environment @additional_properties = additional_properties end |
Instance Attribute Details
#environment ⇒ WebhookEnvironmentValues
The Plaid environment the webhook was sent from
36 37 38 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 36 def environment @environment end |
#link_session_id ⇒ String
The identifier for the Link session.
24 25 26 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 24 def link_session_id @link_session_id end |
#link_token ⇒ String
The link token used to create the Link session.
28 29 30 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 28 def link_token @link_token end |
#public_token ⇒ String
The public token corresponding to the item that was added.
32 33 34 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 32 def public_token @public_token end |
#webhook_code ⇒ String
‘ITEM_ADD_RESULT`
20 21 22 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 20 def webhook_code @webhook_code end |
#webhook_type ⇒ String
‘LINK`
16 17 18 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 16 def webhook_type @webhook_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 75 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. webhook_type = hash.key?('webhook_type') ? hash['webhook_type'] : nil webhook_code = hash.key?('webhook_code') ? hash['webhook_code'] : nil link_session_id = hash.key?('link_session_id') ? hash['link_session_id'] : nil link_token = hash.key?('link_token') ? hash['link_token'] : nil public_token = hash.key?('public_token') ? hash['public_token'] : nil environment = hash.key?('environment') ? hash['environment'] : nil # 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. ItemAddResultWebhook.new(webhook_type: webhook_type, webhook_code: webhook_code, link_session_id: link_session_id, link_token: link_token, public_token: public_token, environment: environment, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
39 40 41 42 43 44 45 46 47 48 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 39 def self.names @_hash = {} if @_hash.nil? @_hash['webhook_type'] = 'webhook_type' @_hash['webhook_code'] = 'webhook_code' @_hash['link_session_id'] = 'link_session_id' @_hash['link_token'] = 'link_token' @_hash['public_token'] = 'public_token' @_hash['environment'] = 'environment' @_hash end |
.nullables ⇒ Object
An array for nullable fields
56 57 58 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 56 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
51 52 53 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 51 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
114 115 116 117 118 119 120 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 114 def inspect class_name = self.class.name.split('::').last "<#{class_name} webhook_type: #{@webhook_type.inspect}, webhook_code:"\ " #{@webhook_code.inspect}, link_session_id: #{@link_session_id.inspect}, link_token:"\ " #{@link_token.inspect}, public_token: #{@public_token.inspect}, environment:"\ " #{@environment.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
105 106 107 108 109 110 111 |
# File 'lib/the_plaid_api/models/item_add_result_webhook.rb', line 105 def to_s class_name = self.class.name.split('::').last "<#{class_name} webhook_type: #{@webhook_type}, webhook_code: #{@webhook_code},"\ " link_session_id: #{@link_session_id}, link_token: #{@link_token}, public_token:"\ " #{@public_token}, environment: #{@environment}, additional_properties:"\ " #{@additional_properties}>" end |