Class: ThePlaidApi::SandboxPublicTokenCreateRequestOptions

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

Overview

An optional set of options to be used when configuring the Item. If specified, must not be ‘null`.

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(webhook: SKIP, override_username: 'user_good', override_password: 'pass_good', transactions: SKIP, statements: SKIP, income_verification: SKIP, additional_properties: nil) ⇒ SandboxPublicTokenCreateRequestOptions

Returns a new instance of SandboxPublicTokenCreateRequestOptions.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/the_plaid_api/models/sandbox_public_token_create_request_options.rb', line 75

def initialize(webhook: SKIP, override_username: 'user_good',
               override_password: 'pass_good', transactions: SKIP,
               statements: SKIP, income_verification: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @webhook = webhook unless webhook == SKIP
  @override_username = override_username unless override_username == SKIP
  @override_password = override_password unless override_password == SKIP
  @transactions = transactions unless transactions == SKIP
  @statements = statements unless statements == SKIP
  @income_verification = income_verification unless income_verification == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#income_verificationSandboxPublicTokenCreateRequestOptionsIncomeVerification

A set of parameters for income verification options. This field is required if ‘income_verification` is included in the `initial_products` array.



39
40
41
# File 'lib/the_plaid_api/models/sandbox_public_token_create_request_options.rb', line 39

def income_verification
  @income_verification
end

#override_passwordString

Test password to use for the creation of the Sandbox Item. Default value is ‘pass_good`.

Returns:

  • (String)


25
26
27
# File 'lib/the_plaid_api/models/sandbox_public_token_create_request_options.rb', line 25

def override_password
  @override_password
end

#override_usernameString

Test username to use for the creation of the Sandbox Item. Default value is ‘user_good`.

Returns:

  • (String)


20
21
22
# File 'lib/the_plaid_api/models/sandbox_public_token_create_request_options.rb', line 20

def override_username
  @override_username
end

#statementsSandboxPublicTokenCreateRequestOptionsStatements

An optional set of parameters corresponding to statements options.



33
34
35
# File 'lib/the_plaid_api/models/sandbox_public_token_create_request_options.rb', line 33

def statements
  @statements
end

#transactionsSandboxPublicTokenCreateRequestOptionsTransactions

An optional set of parameters corresponding to transactions options.



29
30
31
# File 'lib/the_plaid_api/models/sandbox_public_token_create_request_options.rb', line 29

def transactions
  @transactions
end

#webhookString

Specify a webhook to associate with the new Item.

Returns:

  • (String)


15
16
17
# File 'lib/the_plaid_api/models/sandbox_public_token_create_request_options.rb', line 15

def webhook
  @webhook
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/the_plaid_api/models/sandbox_public_token_create_request_options.rb', line 92

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  webhook = hash.key?('webhook') ? hash['webhook'] : SKIP
  override_username = hash['override_username'] ||= 'user_good'
  override_password = hash['override_password'] ||= 'pass_good'
  if hash['transactions']
    transactions = SandboxPublicTokenCreateRequestOptionsTransactions.from_hash(hash['transactions'])
  end
  statements = SandboxPublicTokenCreateRequestOptionsStatements.from_hash(hash['statements']) if
    hash['statements']
  if hash['income_verification']
    income_verification = SandboxPublicTokenCreateRequestOptionsIncomeVerification.from_hash(hash['income_verification'])
  end

  # 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.
  SandboxPublicTokenCreateRequestOptions.new(webhook: webhook,
                                             override_username: override_username,
                                             override_password: override_password,
                                             transactions: transactions,
                                             statements: statements,
                                             income_verification: income_verification,
                                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



42
43
44
45
46
47
48
49
50
51
# File 'lib/the_plaid_api/models/sandbox_public_token_create_request_options.rb', line 42

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['webhook'] = 'webhook'
  @_hash['override_username'] = 'override_username'
  @_hash['override_password'] = 'override_password'
  @_hash['transactions'] = 'transactions'
  @_hash['statements'] = 'statements'
  @_hash['income_verification'] = 'income_verification'
  @_hash
end

.nullablesObject

An array for nullable fields



66
67
68
69
70
71
72
73
# File 'lib/the_plaid_api/models/sandbox_public_token_create_request_options.rb', line 66

def self.nullables
  %w[
    override_username
    override_password
    transactions
    statements
  ]
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    webhook
    override_username
    override_password
    transactions
    statements
    income_verification
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



135
136
137
138
139
140
141
142
# File 'lib/the_plaid_api/models/sandbox_public_token_create_request_options.rb', line 135

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} webhook: #{@webhook.inspect}, override_username:"\
  " #{@override_username.inspect}, override_password: #{@override_password.inspect},"\
  " transactions: #{@transactions.inspect}, statements: #{@statements.inspect},"\
  " income_verification: #{@income_verification.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



126
127
128
129
130
131
132
# File 'lib/the_plaid_api/models/sandbox_public_token_create_request_options.rb', line 126

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} webhook: #{@webhook}, override_username: #{@override_username},"\
  " override_password: #{@override_password}, transactions: #{@transactions}, statements:"\
  " #{@statements}, income_verification: #{@income_verification}, additional_properties:"\
  " #{@additional_properties}>"
end