Class: TrinsicApi::MatchData

Inherits:
ApiModelBase show all
Defined in:
lib/trinsic_api/models/match_data.rb

Overview

Match results for the data being matched against. This applies to Providers which operate based on matching data / biometrics against a government database, returning match scores or results as opposed to the data itself.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ MatchData

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# File 'lib/trinsic_api/models/match_data.rb', line 115

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::MatchData` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::MatchData`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'national_id_number')
    self.national_id_number = attributes[:'national_id_number']
  end

  if attributes.key?(:'full_name')
    self.full_name = attributes[:'full_name']
  end

  if attributes.key?(:'given_name')
    self.given_name = attributes[:'given_name']
  end

  if attributes.key?(:'middle_name')
    self.middle_name = attributes[:'middle_name']
  end

  if attributes.key?(:'family_name')
    self.family_name = attributes[:'family_name']
  end

  if attributes.key?(:'sex')
    self.sex = attributes[:'sex']
  end

  if attributes.key?(:'date_of_birth')
    self.date_of_birth = attributes[:'date_of_birth']
  end

  if attributes.key?(:'phone_number')
    self.phone_number = attributes[:'phone_number']
  end

  if attributes.key?(:'face_match')
    self.face_match = attributes[:'face_match']
  end

  if attributes.key?(:'liveness')
    self.liveness = attributes[:'liveness']
  end

  if attributes.key?(:'image_authenticity')
    self.image_authenticity = attributes[:'image_authenticity']
  end
end

Instance Attribute Details

#date_of_birthObject

Whether the provided date of birth matched the information on file for the individual



38
39
40
# File 'lib/trinsic_api/models/match_data.rb', line 38

def date_of_birth
  @date_of_birth
end

#face_matchObject

The match score for the face match between the provided selfie image and the biometrics on file for the individual. Higher values indicate greater match confidence.



44
45
46
# File 'lib/trinsic_api/models/match_data.rb', line 44

def face_match
  @face_match
end

#family_nameObject

The match score for the family (last) name of the individual. Higher values indicate a closer match.



32
33
34
# File 'lib/trinsic_api/models/match_data.rb', line 32

def family_name
  @family_name
end

#full_nameObject

The match score for the full name of the individual. Higher values indicate a closer match.



23
24
25
# File 'lib/trinsic_api/models/match_data.rb', line 23

def full_name
  @full_name
end

#given_nameObject

The match score for the given (first) name of the individual. Higher values indicate a closer match.



26
27
28
# File 'lib/trinsic_api/models/match_data.rb', line 26

def given_name
  @given_name
end

#image_authenticityObject

The confidence score for the image manipulation check performed against the selfie image of the individual. Higher values indicate lower suspicion of image manipulation.



50
51
52
# File 'lib/trinsic_api/models/match_data.rb', line 50

def image_authenticity
  @image_authenticity
end

#livenessObject

The confidence score for the liveness check performed against the selfie image of the individual. Higher values indicate lower suspicion.



47
48
49
# File 'lib/trinsic_api/models/match_data.rb', line 47

def liveness
  @liveness
end

#middle_nameObject

The match score for the middle name(s) of the individual. Higher values indicate a closer match.



29
30
31
# File 'lib/trinsic_api/models/match_data.rb', line 29

def middle_name
  @middle_name
end

#national_id_numberObject

Whether the provided National ID Number matched the information on file for the individual



20
21
22
# File 'lib/trinsic_api/models/match_data.rb', line 20

def national_id_number
  @national_id_number
end

#phone_numberObject

Whether the provided phone number matched the information on file for the individual



41
42
43
# File 'lib/trinsic_api/models/match_data.rb', line 41

def phone_number
  @phone_number
end

#sexObject

Whether the provided sex of the individual matched the information on file for the individual



35
36
37
# File 'lib/trinsic_api/models/match_data.rb', line 35

def sex
  @sex
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



70
71
72
# File 'lib/trinsic_api/models/match_data.rb', line 70

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



75
76
77
# File 'lib/trinsic_api/models/match_data.rb', line 75

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/trinsic_api/models/match_data.rb', line 53

def self.attribute_map
  {
    :'national_id_number' => :'nationalIdNumber',
    :'full_name' => :'fullName',
    :'given_name' => :'givenName',
    :'middle_name' => :'middleName',
    :'family_name' => :'familyName',
    :'sex' => :'sex',
    :'date_of_birth' => :'dateOfBirth',
    :'phone_number' => :'phoneNumber',
    :'face_match' => :'faceMatch',
    :'liveness' => :'liveness',
    :'image_authenticity' => :'imageAuthenticity'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/trinsic_api/models/match_data.rb', line 222

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/trinsic_api/models/match_data.rb', line 97

def self.openapi_nullable
  Set.new([
    :'national_id_number',
    :'full_name',
    :'given_name',
    :'middle_name',
    :'family_name',
    :'sex',
    :'date_of_birth',
    :'phone_number',
    :'face_match',
    :'liveness',
    :'image_authenticity'
  ])
end

.openapi_typesObject

Attribute type mapping.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/trinsic_api/models/match_data.rb', line 80

def self.openapi_types
  {
    :'national_id_number' => :'Match',
    :'full_name' => :'Match',
    :'given_name' => :'Match',
    :'middle_name' => :'Match',
    :'family_name' => :'Match',
    :'sex' => :'Match',
    :'date_of_birth' => :'Match',
    :'phone_number' => :'Match',
    :'face_match' => :'Match',
    :'liveness' => :'Match',
    :'image_authenticity' => :'Match'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/trinsic_api/models/match_data.rb', line 191

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      national_id_number == o.national_id_number &&
      full_name == o.full_name &&
      given_name == o.given_name &&
      middle_name == o.middle_name &&
      family_name == o.family_name &&
      sex == o.sex &&
      date_of_birth == o.date_of_birth &&
      phone_number == o.phone_number &&
      face_match == o.face_match &&
      liveness == o.liveness &&
      image_authenticity == o.image_authenticity
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


209
210
211
# File 'lib/trinsic_api/models/match_data.rb', line 209

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



215
216
217
# File 'lib/trinsic_api/models/match_data.rb', line 215

def hash
  [national_id_number, full_name, given_name, middle_name, family_name, sex, date_of_birth, phone_number, face_match, liveness, image_authenticity].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



176
177
178
179
180
# File 'lib/trinsic_api/models/match_data.rb', line 176

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/trinsic_api/models/match_data.rb', line 244

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



184
185
186
187
# File 'lib/trinsic_api/models/match_data.rb', line 184

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end