Class: ThePlaidApi::SessionTokenCreateResponseLink
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::SessionTokenCreateResponseLink
- Defined in:
- lib/the_plaid_api/models/session_token_create_response_link.rb
Overview
Response data for ‘/session/token/create` intended for use with the Link SDK.
Instance Attribute Summary collapse
-
#expiration ⇒ DateTime
The expiration date for the ‘link_token`, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format.
-
#link_token ⇒ String
A Link token, which can be supplied to Link in order to initialize it and receive a ‘public_token`.
-
#user_id ⇒ String
A unique user identifier, created by ‘/user/create`.
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(link_token:, expiration:, user_id: SKIP, additional_properties: nil) ⇒ SessionTokenCreateResponseLink
constructor
A new instance of SessionTokenCreateResponseLink.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_expiration ⇒ Object
-
#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(link_token:, expiration:, user_id: SKIP, additional_properties: nil) ⇒ SessionTokenCreateResponseLink
Returns a new instance of SessionTokenCreateResponseLink.
56 57 58 59 60 61 62 63 64 65 |
# File 'lib/the_plaid_api/models/session_token_create_response_link.rb', line 56 def initialize(link_token:, expiration:, user_id: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @link_token = link_token @expiration = expiration @user_id = user_id unless user_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#expiration ⇒ DateTime
The expiration date for the ‘link_token`, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format. A `link_token` created to generate a `public_token` that will be exchanged for a new `access_token` expires after 4 hours. A `link_token` created for an existing Item (such as when updating an existing `access_token` by launching Link in update mode) expires after 30 minutes.
26 27 28 |
# File 'lib/the_plaid_api/models/session_token_create_response_link.rb', line 26 def expiration @expiration end |
#link_token ⇒ String
A Link token, which can be supplied to Link in order to initialize it and receive a ‘public_token`.
17 18 19 |
# File 'lib/the_plaid_api/models/session_token_create_response_link.rb', line 17 def link_token @link_token end |
#user_id ⇒ String
A unique user identifier, created by ‘/user/create`. Integrations that began using `/user/create` after December 10, 2025 use this field to identify a user instead of the `user_token`. For more details, see [new user APIs](plaid.com/docs/api/users/user-apis).
33 34 35 |
# File 'lib/the_plaid_api/models/session_token_create_response_link.rb', line 33 def user_id @user_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/the_plaid_api/models/session_token_create_response_link.rb', line 68 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. link_token = hash.key?('link_token') ? hash['link_token'] : nil expiration = if hash.key?('expiration') (DateTimeHelper.from_rfc3339(hash['expiration']) if hash['expiration']) end user_id = hash.key?('user_id') ? hash['user_id'] : 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. SessionTokenCreateResponseLink.new(link_token: link_token, expiration: expiration, user_id: user_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
36 37 38 39 40 41 42 |
# File 'lib/the_plaid_api/models/session_token_create_response_link.rb', line 36 def self.names @_hash = {} if @_hash.nil? @_hash['link_token'] = 'link_token' @_hash['expiration'] = 'expiration' @_hash['user_id'] = 'user_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 |
# File 'lib/the_plaid_api/models/session_token_create_response_link.rb', line 52 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
45 46 47 48 49 |
# File 'lib/the_plaid_api/models/session_token_create_response_link.rb', line 45 def self.optionals %w[ user_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
104 105 106 107 108 |
# File 'lib/the_plaid_api/models/session_token_create_response_link.rb', line 104 def inspect class_name = self.class.name.split('::').last "<#{class_name} link_token: #{@link_token.inspect}, expiration: #{@expiration.inspect},"\ " user_id: #{@user_id.inspect}, additional_properties: #{@additional_properties}>" end |
#to_custom_expiration ⇒ Object
92 93 94 |
# File 'lib/the_plaid_api/models/session_token_create_response_link.rb', line 92 def to_custom_expiration DateTimeHelper.to_rfc3339(expiration) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
97 98 99 100 101 |
# File 'lib/the_plaid_api/models/session_token_create_response_link.rb', line 97 def to_s class_name = self.class.name.split('::').last "<#{class_name} link_token: #{@link_token}, expiration: #{@expiration}, user_id:"\ " #{@user_id}, additional_properties: #{@additional_properties}>" end |