Class: ThePlaidApi::PrismFirstDetect
- Defined in:
- lib/the_plaid_api/models/prism_first_detect.rb
Overview
The data from the FirstDetect product returned by Prism Data.
Instance Attribute Summary collapse
-
#error_reason ⇒ String
The error returned by Prism for this product.
-
#metadata ⇒ PrismCashScoreMetadata
An object containing metadata about the provided transactions.
-
#model_version ⇒ String
The version of Prism Data’s FirstDetect model used.
-
#reason_codes ⇒ Array[String]
The reasons for an individual having risk according to the FirstDetect score.
-
#score ⇒ Integer
The score returned by Prism Data.
-
#version ⇒ Integer
The version of Prism Data’s FirstDetect model used.
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(version:, score:, model_version: SKIP, reason_codes: SKIP, metadata: SKIP, error_reason: SKIP, additional_properties: nil) ⇒ PrismFirstDetect
constructor
A new instance of PrismFirstDetect.
-
#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(version:, score:, model_version: SKIP, reason_codes: SKIP, metadata: SKIP, error_reason: SKIP, additional_properties: nil) ⇒ PrismFirstDetect
Returns a new instance of PrismFirstDetect.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 68 def initialize(version:, score:, model_version: SKIP, reason_codes: SKIP, metadata: SKIP, error_reason: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @version = version @model_version = model_version unless model_version == SKIP @score = score @reason_codes = reason_codes unless reason_codes == SKIP @metadata = unless == SKIP @error_reason = error_reason unless error_reason == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#error_reason ⇒ String
The error returned by Prism for this product.
37 38 39 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 37 def error_reason @error_reason end |
#metadata ⇒ PrismCashScoreMetadata
An object containing metadata about the provided transactions.
33 34 35 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 33 def @metadata end |
#model_version ⇒ String
The version of Prism Data’s FirstDetect model used.
19 20 21 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 19 def model_version @model_version end |
#reason_codes ⇒ Array[String]
The reasons for an individual having risk according to the FirstDetect score.
29 30 31 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 29 def reason_codes @reason_codes end |
#score ⇒ Integer
The score returned by Prism Data. Ranges from 1-999, with higher score indicating lower risk.
24 25 26 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 24 def score @score end |
#version ⇒ Integer
The version of Prism Data’s FirstDetect model used. This field is deprecated in favor of ‘model_version`.
15 16 17 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 15 def version @version end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 84 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. version = hash.key?('version') ? hash['version'] : nil score = hash.key?('score') ? hash['score'] : nil model_version = hash.key?('model_version') ? hash['model_version'] : SKIP reason_codes = hash.key?('reason_codes') ? hash['reason_codes'] : SKIP = PrismCashScoreMetadata.from_hash(hash['metadata']) if hash['metadata'] error_reason = hash.key?('error_reason') ? hash['error_reason'] : SKIP # 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. PrismFirstDetect.new(version: version, score: score, model_version: model_version, reason_codes: reason_codes, metadata: , error_reason: error_reason, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 40 def self.names @_hash = {} if @_hash.nil? @_hash['version'] = 'version' @_hash['model_version'] = 'model_version' @_hash['score'] = 'score' @_hash['reason_codes'] = 'reason_codes' @_hash['metadata'] = 'metadata' @_hash['error_reason'] = 'error_reason' @_hash end |
.nullables ⇒ Object
An array for nullable fields
62 63 64 65 66 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 62 def self.nullables %w[ score ] end |
.optionals ⇒ Object
An array for optional fields
52 53 54 55 56 57 58 59 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 52 def self.optionals %w[ model_version reason_codes metadata error_reason ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
121 122 123 124 125 126 127 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 121 def inspect class_name = self.class.name.split('::').last "<#{class_name} version: #{@version.inspect}, model_version: #{@model_version.inspect},"\ " score: #{@score.inspect}, reason_codes: #{@reason_codes.inspect}, metadata:"\ " #{@metadata.inspect}, error_reason: #{@error_reason.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
113 114 115 116 117 118 |
# File 'lib/the_plaid_api/models/prism_first_detect.rb', line 113 def to_s class_name = self.class.name.split('::').last "<#{class_name} version: #{@version}, model_version: #{@model_version}, score: #{@score},"\ " reason_codes: #{@reason_codes}, metadata: #{@metadata}, error_reason: #{@error_reason},"\ " additional_properties: #{@additional_properties}>" end |