Class: Plaid::AAMVAAnalysis

Inherits:
Object
  • Object
show all
Defined in:
lib/plaid/models/aamva_analysis.rb

Overview

Analyzed AAMVA data for the associated hit. Note: This field is only available for U.S. driver’s licenses issued by participating states.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AAMVAAnalysis

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/plaid/models/aamva_analysis.rb', line 123

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#cityObject

Returns the value of attribute city.



30
31
32
# File 'lib/plaid/models/aamva_analysis.rb', line 30

def city
  @city
end

#date_of_birthObject

Returns the value of attribute date_of_birth.



34
35
36
# File 'lib/plaid/models/aamva_analysis.rb', line 34

def date_of_birth
  @date_of_birth
end

#eye_colorObject

Returns the value of attribute eye_color.



40
41
42
# File 'lib/plaid/models/aamva_analysis.rb', line 40

def eye_color
  @eye_color
end

#first_nameObject

Returns the value of attribute first_name.



42
43
44
# File 'lib/plaid/models/aamva_analysis.rb', line 42

def first_name
  @first_name
end

#genderObject

Returns the value of attribute gender.



36
37
38
# File 'lib/plaid/models/aamva_analysis.rb', line 36

def gender
  @gender
end

#heightObject

Returns the value of attribute height.



38
39
40
# File 'lib/plaid/models/aamva_analysis.rb', line 38

def height
  @height
end

#id_expiration_dateObject

Returns the value of attribute id_expiration_date.



26
27
28
# File 'lib/plaid/models/aamva_analysis.rb', line 26

def id_expiration_date
  @id_expiration_date
end

#id_issue_dateObject

Returns the value of attribute id_issue_date.



24
25
26
# File 'lib/plaid/models/aamva_analysis.rb', line 24

def id_issue_date
  @id_issue_date
end

#id_numberObject

Returns the value of attribute id_number.



22
23
24
# File 'lib/plaid/models/aamva_analysis.rb', line 22

def id_number
  @id_number
end

#is_verifiedObject

The overall outcome of checking the associated hit against the issuing state database.



20
21
22
# File 'lib/plaid/models/aamva_analysis.rb', line 20

def is_verified
  @is_verified
end

#last_nameObject

Returns the value of attribute last_name.



46
47
48
# File 'lib/plaid/models/aamva_analysis.rb', line 46

def last_name
  @last_name
end

#middle_nameObject

Returns the value of attribute middle_name.



44
45
46
# File 'lib/plaid/models/aamva_analysis.rb', line 44

def middle_name
  @middle_name
end

#postal_codeObject

Returns the value of attribute postal_code.



32
33
34
# File 'lib/plaid/models/aamva_analysis.rb', line 32

def postal_code
  @postal_code
end

#streetObject

Returns the value of attribute street.



28
29
30
# File 'lib/plaid/models/aamva_analysis.rb', line 28

def street
  @street
end

Class Method Details

.acceptable_attributesObject

Returns all the JSON keys this model knows about



91
92
93
# File 'lib/plaid/models/aamva_analysis.rb', line 91

def self.acceptable_attributes
  attribute_map.values
end

.attribute_mapObject

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



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/plaid/models/aamva_analysis.rb', line 71

def self.attribute_map
  {
    :'is_verified' => :'is_verified',
    :'id_number' => :'id_number',
    :'id_issue_date' => :'id_issue_date',
    :'id_expiration_date' => :'id_expiration_date',
    :'street' => :'street',
    :'city' => :'city',
    :'postal_code' => :'postal_code',
    :'date_of_birth' => :'date_of_birth',
    :'gender' => :'gender',
    :'height' => :'height',
    :'eye_color' => :'eye_color',
    :'first_name' => :'first_name',
    :'middle_name' => :'middle_name',
    :'last_name' => :'last_name'
  }
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



312
313
314
# File 'lib/plaid/models/aamva_analysis.rb', line 312

def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end

.openapi_nullableObject

List of attributes with nullable: true



116
117
118
119
# File 'lib/plaid/models/aamva_analysis.rb', line 116

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/plaid/models/aamva_analysis.rb', line 96

def self.openapi_types
  {
    :'is_verified' => :'Boolean',
    :'id_number' => :'AAMVAMatchResult',
    :'id_issue_date' => :'AAMVAMatchResult',
    :'id_expiration_date' => :'AAMVAMatchResult',
    :'street' => :'AAMVADetailedMatchResult',
    :'city' => :'AAMVAMatchResult',
    :'postal_code' => :'AAMVADetailedMatchResult',
    :'date_of_birth' => :'AAMVAMatchResult',
    :'gender' => :'AAMVAMatchResult',
    :'height' => :'AAMVAMatchResult',
    :'eye_color' => :'AAMVAMatchResult',
    :'first_name' => :'AAMVADetailedMatchResult',
    :'middle_name' => :'AAMVADetailedMatchResult',
    :'last_name' => :'AAMVADetailedMatchResult'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
# File 'lib/plaid/models/aamva_analysis.rb', line 278

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      is_verified == o.is_verified &&
      id_number == o.id_number &&
      id_issue_date == o.id_issue_date &&
      id_expiration_date == o.id_expiration_date &&
      street == o.street &&
      city == o.city &&
      postal_code == o.postal_code &&
      date_of_birth == o.date_of_birth &&
      gender == o.gender &&
      height == o.height &&
      eye_color == o.eye_color &&
      first_name == o.first_name &&
      middle_name == o.middle_name &&
      last_name == o.last_name
end

#_deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
# File 'lib/plaid/models/aamva_analysis.rb', line 343

def _deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = Plaid.const_get(type)
    klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/plaid/models/aamva_analysis.rb', line 414

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
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



319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/plaid/models/aamva_analysis.rb', line 319

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  self.class.openapi_types.each_pair do |key, type|
    if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
      self.send("#{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[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end
  end

  self
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


299
300
301
# File 'lib/plaid/models/aamva_analysis.rb', line 299

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



305
306
307
# File 'lib/plaid/models/aamva_analysis.rb', line 305

def hash
  [is_verified, id_number, id_issue_date, id_expiration_date, street, city, postal_code, date_of_birth, gender, height, eye_color, first_name, middle_name, last_name].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/plaid/models/aamva_analysis.rb', line 195

def list_invalid_properties
  invalid_properties = Array.new
  if @is_verified.nil?
    invalid_properties.push('invalid value for "is_verified", is_verified cannot be nil.')
  end

  if @id_number.nil?
    invalid_properties.push('invalid value for "id_number", id_number cannot be nil.')
  end

  if @id_issue_date.nil?
    invalid_properties.push('invalid value for "id_issue_date", id_issue_date cannot be nil.')
  end

  if @id_expiration_date.nil?
    invalid_properties.push('invalid value for "id_expiration_date", id_expiration_date cannot be nil.')
  end

  if @street.nil?
    invalid_properties.push('invalid value for "street", street cannot be nil.')
  end

  if @city.nil?
    invalid_properties.push('invalid value for "city", city cannot be nil.')
  end

  if @postal_code.nil?
    invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.')
  end

  if @date_of_birth.nil?
    invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.')
  end

  if @gender.nil?
    invalid_properties.push('invalid value for "gender", gender cannot be nil.')
  end

  if @height.nil?
    invalid_properties.push('invalid value for "height", height cannot be nil.')
  end

  if @eye_color.nil?
    invalid_properties.push('invalid value for "eye_color", eye_color cannot be nil.')
  end

  if @first_name.nil?
    invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
  end

  if @middle_name.nil?
    invalid_properties.push('invalid value for "middle_name", middle_name cannot be nil.')
  end

  if @last_name.nil?
    invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



390
391
392
# File 'lib/plaid/models/aamva_analysis.rb', line 390

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/plaid/models/aamva_analysis.rb', line 396

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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



384
385
386
# File 'lib/plaid/models/aamva_analysis.rb', line 384

def to_s
  to_hash.to_s
end

#valid?Boolean

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

Returns:

  • (Boolean)

    true if the model is valid



258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/plaid/models/aamva_analysis.rb', line 258

def valid?
  return false if @is_verified.nil?
  return false if @id_number.nil?
  return false if @id_issue_date.nil?
  return false if @id_expiration_date.nil?
  return false if @street.nil?
  return false if @city.nil?
  return false if @postal_code.nil?
  return false if @date_of_birth.nil?
  return false if @gender.nil?
  return false if @height.nil?
  return false if @eye_color.nil?
  return false if @first_name.nil?
  return false if @middle_name.nil?
  return false if @last_name.nil?
  true
end