Class: Plaid::SignalEvaluateRequest
- Defined in:
- lib/plaid/models/signal_evaluate_request.rb
Overview
SignalEvaluateRequest defines the request schema for ‘/signal/evaluate`
Instance Attribute Summary collapse
-
#access_token ⇒ String
The access token associated with the Item data is being requested for.
-
#account_id ⇒ String
The ‘account_id` of the account whose verification status is to be modified.
-
#amount ⇒ Float
The transaction amount, in USD (e.g. ‘102.05`).
-
#client_id ⇒ String
Your Plaid API ‘client_id`.
-
#client_transaction_id ⇒ String
The unique ID that you would like to use to refer to this transaction.
-
#client_user_id ⇒ String
A unique ID that identifies the end user in your system.
-
#device ⇒ SignalEvaluateDevice
Details about the end user’s device.
-
#secret ⇒ String
Your Plaid API ‘secret`.
-
#user ⇒ SignalUser
Details about the end user initiating the transaction (i.e., the account holder).
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(access_token:, account_id:, client_transaction_id:, amount:, client_id: SKIP, secret: SKIP, client_user_id: SKIP, user: SKIP, device: SKIP, additional_properties: nil) ⇒ SignalEvaluateRequest
constructor
A new instance of SignalEvaluateRequest.
-
#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(access_token:, account_id:, client_transaction_id:, amount:, client_id: SKIP, secret: SKIP, client_user_id: SKIP, user: SKIP, device: SKIP, additional_properties: nil) ⇒ SignalEvaluateRequest
Returns a new instance of SignalEvaluateRequest.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 89 def initialize(access_token:, account_id:, client_transaction_id:, amount:, client_id: SKIP, secret: SKIP, client_user_id: SKIP, user: SKIP, device: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @client_id = client_id unless client_id == SKIP @secret = secret unless secret == SKIP @access_token = access_token @account_id = account_id @client_transaction_id = client_transaction_id @amount = amount @client_user_id = client_user_id unless client_user_id == SKIP @user = user unless user == SKIP @device = device unless device == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#access_token ⇒ String
The access token associated with the Item data is being requested for.
25 26 27 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 25 def access_token @access_token end |
#account_id ⇒ String
The ‘account_id` of the account whose verification status is to be modified
30 31 32 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 30 def account_id @account_id end |
#amount ⇒ Float
The transaction amount, in USD (e.g. ‘102.05`)
41 42 43 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 41 def amount @amount end |
#client_id ⇒ String
Your Plaid API ‘client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body.
16 17 18 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 16 def client_id @client_id end |
#client_transaction_id ⇒ String
The unique ID that you would like to use to refer to this transaction. For your convenience mapping your internal data, you could use your internal ID/identifier for this transaction. The max length for this field is 36 characters.
37 38 39 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 37 def client_transaction_id @client_transaction_id end |
#client_user_id ⇒ String
A unique ID that identifies the end user in your system. This ID is used to correlate requests by a user with multiple Items. The max length for this field is 36 characters.
47 48 49 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 47 def client_user_id @client_user_id end |
#device ⇒ SignalEvaluateDevice
Details about the end user’s device
56 57 58 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 56 def device @device end |
#secret ⇒ String
Your Plaid API ‘secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body.
21 22 23 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 21 def secret @secret end |
#user ⇒ SignalUser
Details about the end user initiating the transaction (i.e., the account holder).
52 53 54 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 52 def user @user end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 108 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. access_token = hash.key?('access_token') ? hash['access_token'] : nil account_id = hash.key?('account_id') ? hash['account_id'] : nil client_transaction_id = hash.key?('client_transaction_id') ? hash['client_transaction_id'] : nil amount = hash.key?('amount') ? hash['amount'] : nil client_id = hash.key?('client_id') ? hash['client_id'] : SKIP secret = hash.key?('secret') ? hash['secret'] : SKIP client_user_id = hash.key?('client_user_id') ? hash['client_user_id'] : SKIP user = SignalUser.from_hash(hash['user']) if hash['user'] device = SignalEvaluateDevice.from_hash(hash['device']) if hash['device'] # 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. SignalEvaluateRequest.new(access_token: access_token, account_id: account_id, client_transaction_id: client_transaction_id, amount: amount, client_id: client_id, secret: secret, client_user_id: client_user_id, user: user, device: device, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 59 def self.names @_hash = {} if @_hash.nil? @_hash['client_id'] = 'client_id' @_hash['secret'] = 'secret' @_hash['access_token'] = 'access_token' @_hash['account_id'] = 'account_id' @_hash['client_transaction_id'] = 'client_transaction_id' @_hash['amount'] = 'amount' @_hash['client_user_id'] = 'client_user_id' @_hash['user'] = 'user' @_hash['device'] = 'device' @_hash end |
.nullables ⇒ Object
An array for nullable fields
85 86 87 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 85 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
74 75 76 77 78 79 80 81 82 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 74 def self.optionals %w[ client_id secret client_user_id user device ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
154 155 156 157 158 159 160 161 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 154 def inspect class_name = self.class.name.split('::').last "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect}, access_token:"\ " #{@access_token.inspect}, account_id: #{@account_id.inspect}, client_transaction_id:"\ " #{@client_transaction_id.inspect}, amount: #{@amount.inspect}, client_user_id:"\ " #{@client_user_id.inspect}, user: #{@user.inspect}, device: #{@device.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
145 146 147 148 149 150 151 |
# File 'lib/plaid/models/signal_evaluate_request.rb', line 145 def to_s class_name = self.class.name.split('::').last "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, access_token:"\ " #{@access_token}, account_id: #{@account_id}, client_transaction_id:"\ " #{@client_transaction_id}, amount: #{@amount}, client_user_id: #{@client_user_id}, user:"\ " #{@user}, device: #{@device}, additional_properties: #{@additional_properties}>" end |