Class: TrinsicApi::BrazilCnhProviderOutput

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

Overview

Exposed properties for the brazil-digital-cnh Provider which do not directly map to the normalized IdentityData model.

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 = {}) ⇒ BrazilCnhProviderOutput

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
192
193
194
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
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 145

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::BrazilCnhProviderOutput` 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::BrazilCnhProviderOutput`. 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?(:'full_name')
    self.full_name = attributes[:'full_name']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#categoryObject

Driver license category decoded from the CNH QR Code. Known values: - A: Two- or three-wheeled motor vehicles, with or without a sidecar. - B: Motor vehicles outside category A up to 3,500 kg, with capacity for up to eight passengers besides the driver, and without articulation or trailer. - C: Category B vehicles and rigid cargo vehicles above 3,500 kg. - D: Category C vehicles and passenger vehicles with capacity above eight passengers besides the driver. - E: Category D vehicles, trailers, semi-trailers, and articulated buses.



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

def category
  @category
end

#date_of_birthObject

Date of birth decoded from the CNH QR Code and whether it matched the government database.



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

def date_of_birth
  @date_of_birth
end

#facial_biometryObject

Facial biometric comparison result if submitted and available.



65
66
67
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 65

def facial_biometry
  @facial_biometry
end

#father_full_nameObject

Father's full name decoded from the CNH QR Code.



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

def father_full_name
  @father_full_name
end

#first_issue_dateObject

Date when the driver was first licensed, decoded from the CNH QR Code.



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

def first_issue_date
  @first_issue_date
end

#full_nameObject

Full name decoded from the CNH QR Code and whether it matched the government database.



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

def full_name
  @full_name
end

#full_name_similarityObject

Similarity score for the decoded full name from the CNH QR Code. Ranges from 0.0 to 1.0, where 1.0 is an exact match.



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

def full_name_similarity
  @full_name_similarity
end

#issue_cityObject

City where the CNH was issued, decoded from the QR Code.



53
54
55
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 53

def issue_city
  @issue_city
end

#issue_stateObject

Brazilian state where the CNH was issued, decoded from the QR Code. Format is a two-letter Brazilian state abbreviation when present.



56
57
58
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 56

def issue_state
  @issue_state
end

#mother_full_nameObject

Mother's full name decoded from the CNH QR Code.



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

def mother_full_name
  @mother_full_name
end

#observationsObject

CNH observations decoded from the QR Code. May include EAR for paid driving activity and one or more restriction codes: - A: Corrective lenses required. - B: Hearing prosthesis required. - C: Left-side accelerator required. - D: Automatic transmission vehicle required. - E: Steering-wheel grip, handle, or knob required. - F: Power steering vehicle required. - G: Manual clutch, automated clutch, or automatic transmission vehicle required. - H: Hand accelerator and brake required. - I: Dashboard control adaptations to the steering wheel required. - J: Dashboard control adaptations for lower limbs or other body parts required. - K: Gear-shift lever extension and/or fixed height/depth compensation cushions required. - L: Pedal extensions and floor elevation and/or fixed height/depth compensation cushions required. - M: Motorcycle with adapted gear-shift pedal required. - N: Motorcycle with adapted rear-brake pedal required. - O: Motorcycle with adapted front-brake handle required. - P: Motorcycle with adapted clutch handle required. - Q: Motorcycle with sidecar or tricycle required. - R: Scooter with sidecar or tricycle required. - S: Motorcycle with automated gear shifting required. - T: Driving on highways and high-speed roads prohibited. - U: Driving after sunset prohibited. - V: Helmet with visor and unrestricted field of vision required. - X: Other restrictions.



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

def observations
  @observations
end

#origin_documentObject

Source identity document number/reference for the CNH record, decoded from the CNH QR Code.



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

def origin_document
  @origin_document
end

#registration_numberObject

National Registry (Registro Nacional de Habilitacao) number decoded from the CNH QR Code and whether it matched the government database. Is an 11-character ID with the format XXXXXXXXX@@: - XXXXXXXXX: Base characters. The value is unique to the driver for their lifetime. - @@: Security check digits



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

def registration_number
  @registration_number
end

#registration_number_check_digits_validObject

Whether the National Registry number satisfies the CNH modulo-11 check digit routine.



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

def registration_number_check_digits_valid
  @registration_number_check_digits_valid
end

#renach_numberObject

Registro Nacional de Condutores Habilitados (RENACH) form number decoded from the CNH QR Code. Is an 11-character ID with the format FFXXXXXXXX@: - FF: The issuing federation unit abbreviation. It identifies the state where the driver was licensed or last had record changes. - XXXXXXXXX: Serial number - @: Modulo-11 security check digit



62
63
64
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 62

def renach_number
  @renach_number
end

#validation_numberObject

Numeric security validation code decoded from the CNH QR Code. This is an 11-digit code generated from Departamento Estadual de TrĂ¢nsito (State Traffic Department or DETRAN) owned data for each CNH and used to validate the document. The algorithm is proprietary, so no further information is available on this number.



59
60
61
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 59

def validation_number
  @validation_number
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



90
91
92
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 90

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



95
96
97
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 95

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 68

def self.attribute_map
  {
    :'full_name' => :'fullName',
    :'full_name_similarity' => :'fullNameSimilarity',
    :'origin_document' => :'originDocument',
    :'date_of_birth' => :'dateOfBirth',
    :'mother_full_name' => :'motherFullName',
    :'father_full_name' => :'fatherFullName',
    :'category' => :'category',
    :'registration_number' => :'registrationNumber',
    :'registration_number_check_digits_valid' => :'registrationNumberCheckDigitsValid',
    :'first_issue_date' => :'firstIssueDate',
    :'observations' => :'observations',
    :'issue_city' => :'issueCity',
    :'issue_state' => :'issueState',
    :'validation_number' => :'validationNumber',
    :'renach_number' => :'renachNumber',
    :'facial_biometry' => :'facialBiometry'
  }
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



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

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



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 122

def self.openapi_nullable
  Set.new([
    :'full_name',
    :'full_name_similarity',
    :'origin_document',
    :'date_of_birth',
    :'mother_full_name',
    :'father_full_name',
    :'category',
    :'registration_number',
    :'registration_number_check_digits_valid',
    :'first_issue_date',
    :'observations',
    :'issue_city',
    :'issue_state',
    :'validation_number',
    :'renach_number',
    :'facial_biometry'
  ])
end

.openapi_typesObject

Attribute type mapping.



100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 100

def self.openapi_types
  {
    :'full_name' => :'BrazilCnhMatchFieldString',
    :'full_name_similarity' => :'Float',
    :'origin_document' => :'String',
    :'date_of_birth' => :'BrazilCnhMatchFieldDateOnly',
    :'mother_full_name' => :'String',
    :'father_full_name' => :'String',
    :'category' => :'String',
    :'registration_number' => :'BrazilCnhMatchFieldString',
    :'registration_number_check_digits_valid' => :'Boolean',
    :'first_issue_date' => :'Date',
    :'observations' => :'String',
    :'issue_city' => :'String',
    :'issue_state' => :'String',
    :'validation_number' => :'String',
    :'renach_number' => :'String',
    :'facial_biometry' => :'BrazilCnhFacialBiometryOutput'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 241

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      full_name == o.full_name &&
      full_name_similarity == o.full_name_similarity &&
      origin_document == o.origin_document &&
      date_of_birth == o.date_of_birth &&
      mother_full_name == o.mother_full_name &&
      father_full_name == o.father_full_name &&
      category == o.category &&
      registration_number == o.registration_number &&
      registration_number_check_digits_valid == o.registration_number_check_digits_valid &&
      first_issue_date == o.first_issue_date &&
      observations == o.observations &&
      issue_city == o.issue_city &&
      issue_state == o.issue_state &&
      validation_number == o.validation_number &&
      renach_number == o.renach_number &&
      facial_biometry == o.facial_biometry
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


264
265
266
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 264

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



270
271
272
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 270

def hash
  [full_name, full_name_similarity, origin_document, date_of_birth, mother_full_name, father_full_name, category, registration_number, registration_number_check_digits_valid, first_issue_date, observations, issue_city, issue_state, validation_number, renach_number, facial_biometry].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



226
227
228
229
230
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 226

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



299
300
301
302
303
304
305
306
307
308
309
310
311
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 299

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



234
235
236
237
# File 'lib/trinsic_api/models/brazil_cnh_provider_output.rb', line 234

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