Class: ThePlaidApi::MultiDocumentRiskSignal
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::MultiDocumentRiskSignal
- Defined in:
- lib/the_plaid_api/models/multi_document_risk_signal.rb
Overview
Object containing risk signals and relevant metadata for a set of uploaded documents
Instance Attribute Summary collapse
-
#document_references ⇒ Array[RiskSignalDocumentReference]
Array of objects containing attributes that could indicate if a document is fraudulent.
-
#risk_signals ⇒ Array[DocumentRiskSignal]
Array of attributes that indicate whether or not there is fraud risk with a set of documents.
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(document_references:, risk_signals:, additional_properties: nil) ⇒ MultiDocumentRiskSignal
constructor
A new instance of MultiDocumentRiskSignal.
-
#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(document_references:, risk_signals:, additional_properties: nil) ⇒ MultiDocumentRiskSignal
Returns a new instance of MultiDocumentRiskSignal.
41 42 43 44 45 46 47 48 49 |
# File 'lib/the_plaid_api/models/multi_document_risk_signal.rb', line 41 def initialize(document_references:, risk_signals:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @document_references = document_references @risk_signals = risk_signals @additional_properties = additional_properties end |
Instance Attribute Details
#document_references ⇒ Array[RiskSignalDocumentReference]
Array of objects containing attributes that could indicate if a document is fraudulent
16 17 18 |
# File 'lib/the_plaid_api/models/multi_document_risk_signal.rb', line 16 def document_references @document_references end |
#risk_signals ⇒ Array[DocumentRiskSignal]
Array of attributes that indicate whether or not there is fraud risk with a set of documents
21 22 23 |
# File 'lib/the_plaid_api/models/multi_document_risk_signal.rb', line 21 def risk_signals @risk_signals end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/the_plaid_api/models/multi_document_risk_signal.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it document_references = nil unless hash['document_references'].nil? document_references = [] hash['document_references'].each do |structure| document_references << (RiskSignalDocumentReference.from_hash(structure) if structure) end end document_references = nil unless hash.key?('document_references') # Parameter is an array, so we need to iterate through it risk_signals = nil unless hash['risk_signals'].nil? risk_signals = [] hash['risk_signals'].each do |structure| risk_signals << (DocumentRiskSignal.from_hash(structure) if structure) end end risk_signals = nil unless hash.key?('risk_signals') # 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. MultiDocumentRiskSignal.new(document_references: document_references, risk_signals: risk_signals, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
24 25 26 27 28 29 |
# File 'lib/the_plaid_api/models/multi_document_risk_signal.rb', line 24 def self.names @_hash = {} if @_hash.nil? @_hash['document_references'] = 'document_references' @_hash['risk_signals'] = 'risk_signals' @_hash end |
.nullables ⇒ Object
An array for nullable fields
37 38 39 |
# File 'lib/the_plaid_api/models/multi_document_risk_signal.rb', line 37 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
32 33 34 |
# File 'lib/the_plaid_api/models/multi_document_risk_signal.rb', line 32 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
98 99 100 101 102 |
# File 'lib/the_plaid_api/models/multi_document_risk_signal.rb', line 98 def inspect class_name = self.class.name.split('::').last "<#{class_name} document_references: #{@document_references.inspect}, risk_signals:"\ " #{@risk_signals.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
91 92 93 94 95 |
# File 'lib/the_plaid_api/models/multi_document_risk_signal.rb', line 91 def to_s class_name = self.class.name.split('::').last "<#{class_name} document_references: #{@document_references}, risk_signals:"\ " #{@risk_signals}, additional_properties: #{@additional_properties}>" end |