Class: Plaid::DepositSwitchTokenCreateResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/plaid/models/deposit_switch_token_create_response.rb

Overview

DepositSwitchTokenCreateResponse defines the response schema for ‘/deposit_switch/token/create`

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(deposit_switch_token:, deposit_switch_token_expiration_time:, request_id:, additional_properties: nil) ⇒ DepositSwitchTokenCreateResponse

Returns a new instance of DepositSwitchTokenCreateResponse.



49
50
51
52
53
54
55
56
57
58
# File 'lib/plaid/models/deposit_switch_token_create_response.rb', line 49

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

  @deposit_switch_token = deposit_switch_token
  @deposit_switch_token_expiration_time = deposit_switch_token_expiration_time
  @request_id = request_id
  @additional_properties = additional_properties
end

Instance Attribute Details

#deposit_switch_tokenString

Deposit switch token, used to initialize Link for the Deposit Switch product

Returns:

  • (String)


16
17
18
# File 'lib/plaid/models/deposit_switch_token_create_response.rb', line 16

def deposit_switch_token
  @deposit_switch_token
end

#deposit_switch_token_expiration_timeString

Expiration time of the token, in [ISO 8601](wikipedia.org/wiki/ISO_8601) format

Returns:

  • (String)


21
22
23
# File 'lib/plaid/models/deposit_switch_token_create_response.rb', line 21

def deposit_switch_token_expiration_time
  @deposit_switch_token_expiration_time
end

#request_idString

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Returns:

  • (String)


27
28
29
# File 'lib/plaid/models/deposit_switch_token_create_response.rb', line 27

def request_id
  @request_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/plaid/models/deposit_switch_token_create_response.rb', line 61

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  deposit_switch_token =
    hash.key?('deposit_switch_token') ? hash['deposit_switch_token'] : nil
  deposit_switch_token_expiration_time =
    hash.key?('deposit_switch_token_expiration_time') ? hash['deposit_switch_token_expiration_time'] : nil
  request_id = hash.key?('request_id') ? hash['request_id'] : 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.
  DepositSwitchTokenCreateResponse.new(deposit_switch_token: deposit_switch_token,
                                       deposit_switch_token_expiration_time: deposit_switch_token_expiration_time,
                                       request_id: request_id,
                                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



30
31
32
33
34
35
36
37
# File 'lib/plaid/models/deposit_switch_token_create_response.rb', line 30

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['deposit_switch_token'] = 'deposit_switch_token'
  @_hash['deposit_switch_token_expiration_time'] =
    'deposit_switch_token_expiration_time'
  @_hash['request_id'] = 'request_id'
  @_hash
end

.nullablesObject

An array for nullable fields



45
46
47
# File 'lib/plaid/models/deposit_switch_token_create_response.rb', line 45

def self.nullables
  []
end

.optionalsObject

An array for optional fields



40
41
42
# File 'lib/plaid/models/deposit_switch_token_create_response.rb', line 40

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



94
95
96
97
98
99
# File 'lib/plaid/models/deposit_switch_token_create_response.rb', line 94

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

#to_sObject

Provides a human-readable string representation of the object.



86
87
88
89
90
91
# File 'lib/plaid/models/deposit_switch_token_create_response.rb', line 86

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