Class: Plaid::SignalEvaluateResponse

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

Overview

SignalEvaluateResponse defines the response schema for ‘/signal/income/evaluate`

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(request_id:, scores:, core_attributes:, additional_properties: nil) ⇒ SignalEvaluateResponse

Returns a new instance of SignalEvaluateResponse.



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

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

  @request_id = request_id
  @scores = scores
  @core_attributes = core_attributes
  @additional_properties = additional_properties
end

Instance Attribute Details

#core_attributesSignalEvaluateCoreAttributes

The core attributes object contains additional data that can be used to assess the ACH return risk, such as past ACH return events, balance/transaction history, the Item’s connection history in the Plaid network, and identity change history.



28
29
30
# File 'lib/plaid/models/signal_evaluate_response.rb', line 28

def core_attributes
  @core_attributes
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)


17
18
19
# File 'lib/plaid/models/signal_evaluate_response.rb', line 17

def request_id
  @request_id
end

#scoresSignalEvaluateScores

Risk scoring details broken down by risk category.



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

def scores
  @scores
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
# File 'lib/plaid/models/signal_evaluate_response.rb', line 61

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  request_id = hash.key?('request_id') ? hash['request_id'] : nil
  scores = SignalEvaluateScores.from_hash(hash['scores']) if hash['scores']
  core_attributes = SignalEvaluateCoreAttributes.from_hash(hash['core_attributes']) if
    hash['core_attributes']

  # 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.
  SignalEvaluateResponse.new(request_id: request_id,
                             scores: scores,
                             core_attributes: core_attributes,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



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

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

.nullablesObject

An array for nullable fields



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

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



92
93
94
95
96
97
# File 'lib/plaid/models/signal_evaluate_response.rb', line 92

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

#to_sObject

Provides a human-readable string representation of the object.



85
86
87
88
89
# File 'lib/plaid/models/signal_evaluate_response.rb', line 85

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