Class: ThePlaidApi::SelfieAnalysisFacialAnalysis

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb

Overview

Analysis of the facial features of the selfie when compared to the face in the uploaded document, if one is present.

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(left_eye:, right_eye:, left_brow:, right_brow:, forehead:, middle_forehead:, nose:, philtrum:, mouth:, jaw:, left_cheek:, right_cheek:, additional_properties: nil) ⇒ SelfieAnalysisFacialAnalysis

Returns a new instance of SelfieAnalysisFacialAnalysis.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 89

def initialize(left_eye:, right_eye:, left_brow:, right_brow:, forehead:,
               middle_forehead:, nose:, philtrum:, mouth:, jaw:,
               left_cheek:, right_cheek:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @left_eye = left_eye
  @right_eye = right_eye
  @left_brow = left_brow
  @right_brow = right_brow
  @forehead = forehead
  @middle_forehead = middle_forehead
  @nose = nose
  @philtrum = philtrum
  @mouth = mouth
  @jaw = jaw
  @left_cheek = left_cheek
  @right_cheek = right_cheek
  @additional_properties = additional_properties
end

Instance Attribute Details

#foreheadSelfieAnalysisFacialAnalysisOutcome

Outcome of the facial analysis for a specific facial feature.



31
32
33
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 31

def forehead
  @forehead
end

#jawSelfieAnalysisFacialAnalysisOutcome

Outcome of the facial analysis for a specific facial feature.



51
52
53
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 51

def jaw
  @jaw
end

#left_browSelfieAnalysisFacialAnalysisOutcome

Outcome of the facial analysis for a specific facial feature.



23
24
25
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 23

def left_brow
  @left_brow
end

#left_cheekSelfieAnalysisFacialAnalysisOutcome

Outcome of the facial analysis for a specific facial feature.



55
56
57
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 55

def left_cheek
  @left_cheek
end

#left_eyeSelfieAnalysisFacialAnalysisOutcome

Outcome of the facial analysis for a specific facial feature.



15
16
17
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 15

def left_eye
  @left_eye
end

#middle_foreheadSelfieAnalysisFacialAnalysisOutcome

Outcome of the facial analysis for a specific facial feature.



35
36
37
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 35

def middle_forehead
  @middle_forehead
end

#mouthSelfieAnalysisFacialAnalysisOutcome

Outcome of the facial analysis for a specific facial feature.



47
48
49
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 47

def mouth
  @mouth
end

#noseSelfieAnalysisFacialAnalysisOutcome

Outcome of the facial analysis for a specific facial feature.



39
40
41
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 39

def nose
  @nose
end

#philtrumSelfieAnalysisFacialAnalysisOutcome

Outcome of the facial analysis for a specific facial feature.



43
44
45
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 43

def philtrum
  @philtrum
end

#right_browSelfieAnalysisFacialAnalysisOutcome

Outcome of the facial analysis for a specific facial feature.



27
28
29
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 27

def right_brow
  @right_brow
end

#right_cheekSelfieAnalysisFacialAnalysisOutcome

Outcome of the facial analysis for a specific facial feature.



59
60
61
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 59

def right_cheek
  @right_cheek
end

#right_eyeSelfieAnalysisFacialAnalysisOutcome

Outcome of the facial analysis for a specific facial feature.



19
20
21
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 19

def right_eye
  @right_eye
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
143
144
145
146
147
148
149
150
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 111

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  left_eye = hash.key?('left_eye') ? hash['left_eye'] : nil
  right_eye = hash.key?('right_eye') ? hash['right_eye'] : nil
  left_brow = hash.key?('left_brow') ? hash['left_brow'] : nil
  right_brow = hash.key?('right_brow') ? hash['right_brow'] : nil
  forehead = hash.key?('forehead') ? hash['forehead'] : nil
  middle_forehead =
    hash.key?('middle_forehead') ? hash['middle_forehead'] : nil
  nose = hash.key?('nose') ? hash['nose'] : nil
  philtrum = hash.key?('philtrum') ? hash['philtrum'] : nil
  mouth = hash.key?('mouth') ? hash['mouth'] : nil
  jaw = hash.key?('jaw') ? hash['jaw'] : nil
  left_cheek = hash.key?('left_cheek') ? hash['left_cheek'] : nil
  right_cheek = hash.key?('right_cheek') ? hash['right_cheek'] : nil

  # 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.
  SelfieAnalysisFacialAnalysis.new(left_eye: left_eye,
                                   right_eye: right_eye,
                                   left_brow: left_brow,
                                   right_brow: right_brow,
                                   forehead: forehead,
                                   middle_forehead: middle_forehead,
                                   nose: nose,
                                   philtrum: philtrum,
                                   mouth: mouth,
                                   jaw: jaw,
                                   left_cheek: left_cheek,
                                   right_cheek: right_cheek,
                                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 62

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['left_eye'] = 'left_eye'
  @_hash['right_eye'] = 'right_eye'
  @_hash['left_brow'] = 'left_brow'
  @_hash['right_brow'] = 'right_brow'
  @_hash['forehead'] = 'forehead'
  @_hash['middle_forehead'] = 'middle_forehead'
  @_hash['nose'] = 'nose'
  @_hash['philtrum'] = 'philtrum'
  @_hash['mouth'] = 'mouth'
  @_hash['jaw'] = 'jaw'
  @_hash['left_cheek'] = 'left_cheek'
  @_hash['right_cheek'] = 'right_cheek'
  @_hash
end

.nullablesObject

An array for nullable fields



85
86
87
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 85

def self.nullables
  []
end

.optionalsObject

An array for optional fields



80
81
82
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 80

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



163
164
165
166
167
168
169
170
171
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 163

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} left_eye: #{@left_eye.inspect}, right_eye: #{@right_eye.inspect},"\
  " left_brow: #{@left_brow.inspect}, right_brow: #{@right_brow.inspect}, forehead:"\
  " #{@forehead.inspect}, middle_forehead: #{@middle_forehead.inspect}, nose:"\
  " #{@nose.inspect}, philtrum: #{@philtrum.inspect}, mouth: #{@mouth.inspect}, jaw:"\
  " #{@jaw.inspect}, left_cheek: #{@left_cheek.inspect}, right_cheek: #{@right_cheek.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



153
154
155
156
157
158
159
160
# File 'lib/the_plaid_api/models/selfie_analysis_facial_analysis.rb', line 153

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} left_eye: #{@left_eye}, right_eye: #{@right_eye}, left_brow: #{@left_brow},"\
  " right_brow: #{@right_brow}, forehead: #{@forehead}, middle_forehead: #{@middle_forehead},"\
  " nose: #{@nose}, philtrum: #{@philtrum}, mouth: #{@mouth}, jaw: #{@jaw}, left_cheek:"\
  " #{@left_cheek}, right_cheek: #{@right_cheek}, additional_properties:"\
  " #{@additional_properties}>"
end