Class: Plaid::SandboxPublicTokenCreateRequestOptions

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/plaid/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, additional_properties: nil) ⇒ SandboxPublicTokenCreateRequestOptions

Returns a new instance of SandboxPublicTokenCreateRequestOptions.



60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/plaid/models/sandbox_public_token_create_request_options.rb', line 60

def initialize(webhook: SKIP, override_username: 'user_good',
               override_password: 'pass_good', transactions: 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
  @additional_properties = additional_properties
end

Instance Attribute Details

#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/plaid/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/plaid/models/sandbox_public_token_create_request_options.rb', line 20

def override_username
  @override_username
end

#transactionsSandboxPublicTokenCreateRequestOptionsTransactions

SandboxPublicTokenCreateRequestOptionsTransactions is an optional set of parameters corresponding to transactions options.



30
31
32
# File 'lib/plaid/models/sandbox_public_token_create_request_options.rb', line 30

def transactions
  @transactions
end

#webhookString

Specify a webhook to associate with the new Item.

Returns:

  • (String)


15
16
17
# File 'lib/plaid/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.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/plaid/models/sandbox_public_token_create_request_options.rb', line 74

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

  # 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,
                                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
# File 'lib/plaid/models/sandbox_public_token_create_request_options.rb', line 33

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

.nullablesObject

An array for nullable fields



53
54
55
56
57
58
# File 'lib/plaid/models/sandbox_public_token_create_request_options.rb', line 53

def self.nullables
  %w[
    override_username
    override_password
  ]
end

.optionalsObject

An array for optional fields



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

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



109
110
111
112
113
114
# File 'lib/plaid/models/sandbox_public_token_create_request_options.rb', line 109

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}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



101
102
103
104
105
106
# File 'lib/plaid/models/sandbox_public_token_create_request_options.rb', line 101

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