Class: ThePlaidApi::SelfieAnalysis
- Defined in:
- lib/the_plaid_api/models/selfie_analysis.rb
Overview
High level descriptions of how the associated selfie was processed. If a selfie fails verification, the details in the ‘analysis` object should help clarify why the selfie was rejected.
Instance Attribute Summary collapse
-
#document_comparison ⇒ SelfieAnalysisDocumentComparison
Information about the comparison between the selfie and the document (if documentary verification also ran).
-
#facial_analysis ⇒ SelfieAnalysisFacialAnalysis
Analysis of the facial features of the selfie when compared to the face in the uploaded document, if one is present.
-
#liveness_check ⇒ SelfieAnalysisLivenessCheck
Assessment of whether the selfie capture is of a real human being, as opposed to a picture of a human on a screen, a picture of a paper cut out, someone wearing a mask, or a deepfake.
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_comparison:, liveness_check:, facial_analysis: SKIP, additional_properties: nil) ⇒ SelfieAnalysis
constructor
A new instance of SelfieAnalysis.
-
#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_comparison:, liveness_check:, facial_analysis: SKIP, additional_properties: nil) ⇒ SelfieAnalysis
Returns a new instance of SelfieAnalysis.
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/the_plaid_api/models/selfie_analysis.rb', line 53 def initialize(document_comparison:, liveness_check:, facial_analysis: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @document_comparison = document_comparison @liveness_check = liveness_check @facial_analysis = facial_analysis unless facial_analysis == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#document_comparison ⇒ SelfieAnalysisDocumentComparison
Information about the comparison between the selfie and the document (if documentary verification also ran).
17 18 19 |
# File 'lib/the_plaid_api/models/selfie_analysis.rb', line 17 def document_comparison @document_comparison end |
#facial_analysis ⇒ SelfieAnalysisFacialAnalysis
Analysis of the facial features of the selfie when compared to the face in the uploaded document, if one is present.
28 29 30 |
# File 'lib/the_plaid_api/models/selfie_analysis.rb', line 28 def facial_analysis @facial_analysis end |
#liveness_check ⇒ SelfieAnalysisLivenessCheck
Assessment of whether the selfie capture is of a real human being, as opposed to a picture of a human on a screen, a picture of a paper cut out, someone wearing a mask, or a deepfake.
23 24 25 |
# File 'lib/the_plaid_api/models/selfie_analysis.rb', line 23 def liveness_check @liveness_check end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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/selfie_analysis.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. document_comparison = hash.key?('document_comparison') ? hash['document_comparison'] : nil liveness_check = hash.key?('liveness_check') ? hash['liveness_check'] : nil facial_analysis = SelfieAnalysisFacialAnalysis.from_hash(hash['facial_analysis']) if hash['facial_analysis'] # 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. SelfieAnalysis.new(document_comparison: document_comparison, liveness_check: liveness_check, facial_analysis: facial_analysis, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
31 32 33 34 35 36 37 |
# File 'lib/the_plaid_api/models/selfie_analysis.rb', line 31 def self.names @_hash = {} if @_hash.nil? @_hash['document_comparison'] = 'document_comparison' @_hash['liveness_check'] = 'liveness_check' @_hash['facial_analysis'] = 'facial_analysis' @_hash end |
.nullables ⇒ Object
An array for nullable fields
47 48 49 50 51 |
# File 'lib/the_plaid_api/models/selfie_analysis.rb', line 47 def self.nullables %w[ facial_analysis ] end |
.optionals ⇒ Object
An array for optional fields
40 41 42 43 44 |
# File 'lib/the_plaid_api/models/selfie_analysis.rb', line 40 def self.optionals %w[ facial_analysis ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
99 100 101 102 103 104 |
# File 'lib/the_plaid_api/models/selfie_analysis.rb', line 99 def inspect class_name = self.class.name.split('::').last "<#{class_name} document_comparison: #{@document_comparison.inspect}, liveness_check:"\ " #{@liveness_check.inspect}, facial_analysis: #{@facial_analysis.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
91 92 93 94 95 96 |
# File 'lib/the_plaid_api/models/selfie_analysis.rb', line 91 def to_s class_name = self.class.name.split('::').last "<#{class_name} document_comparison: #{@document_comparison}, liveness_check:"\ " #{@liveness_check}, facial_analysis: #{@facial_analysis}, additional_properties:"\ " #{@additional_properties}>" end |