Class: TrinsicApi::MoldovaVehicleRegistrationCertificateCredential

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb

Overview

A Moldovan Vehicle Registration Certificate credential, with document type md.gov.wallet.vrc.1, retrieved from the Moldovan EVO wallet.

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 211

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  if attributes.key?(:'special_remarks')
    if (value = attributes[:'special_remarks']).is_a?(Array)
      self.special_remarks = value
    end
  end

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

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

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

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

Instance Attribute Details

#addressObject

The registered address of the vehicle's holder, as a single formatted string.



80
81
82
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 80

def address
  @address
end

#authorized_weightObject

The maximum technically permissible laden mass of the vehicle, in kilograms.



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

def authorized_weight
  @authorized_weight
end

#body_numberObject

The body number of the vehicle, if recorded separately from the VIN.



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

def body_number
  @body_number
end

#body_typeObject

The body type of the vehicle, as recorded by the issuer. This is a free text field with no guaranteed format.



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

def body_type
  @body_type
end

#categoryObject

The vehicle's EU vehicle category code.



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

def category
  @category
end

#chassis_numberObject

The chassis number of the vehicle, if recorded separately from the VIN.



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

def chassis_number
  @chassis_number
end

#colorObject

The color of the vehicle, as recorded by the issuer. TODO: Possible values?



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

def color
  @color
end

#document_numberObject

The number of the registration certificate document itself.



98
99
100
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 98

def document_number
  @document_number
end

#engine_numberObject

The engine number of the vehicle.



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

def engine_number
  @engine_number
end

#engine_typeObject

The engine/fuel type of the vehicle, as recorded by the issuer. This is a free text field with no guaranteed format.



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

def engine_type
  @engine_type
end

#engine_volumeObject

The engine displacement volume of the vehicle, as recorded by the issuer (typically in cubic centimeters). This is a free text field with no guaranteed format.



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

def engine_volume
  @engine_volume
end

#expiry_dateObject

The date the registration certificate expires.



92
93
94
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 92

def expiry_date
  @expiry_date
end

#family_nameObject

The family name (surname) of the vehicle's registered holder.



74
75
76
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 74

def family_name
  @family_name
end

#given_nameObject

The given name(s) of the vehicle's registered holder.



77
78
79
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 77

def given_name
  @given_name
end

#idnpObject

The IDNP (Numărul de Identificare Personal) of the vehicle's registered holder. This is a 13-digit number which uniquely identifies all natural persons in the Republic of Moldova. It has the format 2YYYOOOSSSSSX, where: - 2 is the literal number 2 to indicate that the identifier belongs to a natural person - YYY is the last 3 digits of the year in which the identifier was issued - OOO is the code of the registrar office which issued the identifier - SSSSS is the sequential birth number for that year - X is a check digit Note that the year encoded in the identifier is not necessarily the same as the year of birth of the individual.



71
72
73
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 71

def idnp
  @idnp
end

#idnvObject

The registered vehicle's IDNV (Numărul de Identificare a Vehiculului), the identifier assigned to the vehicle in the Moldovan State Register of Transport. This is a Moldovan registry identifier and is distinct from the manufacturer's VIN.



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

def idnv
  @idnv
end

#issue_dateObject

The date the registration certificate was issued.



89
90
91
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 89

def issue_date
  @issue_date
end

#issuing_authorityObject

The name of the authority that issued the registration certificate.



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

def issuing_authority
  @issuing_authority
end

#makeObject

The make (manufacturer brand) of the vehicle.



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

def make
  @make
end

#modelObject

The commercial model name of the vehicle.



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

def model
  @model
end

#placesObject

The number of seating positions in the vehicle, including the driver.



68
69
70
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 68

def places
  @places
end

#plate_numberObject

The registered vehicle's plate number.



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

def plate_number
  @plate_number
end

#special_remarksObject

Free-text remarks or annotations recorded on the registration certificate.



86
87
88
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 86

def special_remarks
  @special_remarks
end

#vehicle_rightObject

The legal relationship the registration holder has to the vehicle (e.g. owner vs. authorized user), as recorded by the issuer. TODO: Values



83
84
85
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 83

def vehicle_right
  @vehicle_right
end

#vinObject

The vehicle's manufacturer-assigned Vehicle Identification Number (VIN), per ISO 3779.



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

def vin
  @vin
end

#weightObject

The mass of the vehicle in service (unladen / kerb weight), in kilograms.



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

def weight
  @weight
end

#yearObject

The vehicle's year of manufacture.



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

def year
  @year
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



134
135
136
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 134

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



139
140
141
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 139

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 101

def self.attribute_map
  {
    :'plate_number' => :'plateNumber',
    :'idnv' => :'idnv',
    :'vin' => :'vin',
    :'make' => :'make',
    :'model' => :'model',
    :'color' => :'color',
    :'category' => :'category',
    :'year' => :'year',
    :'body_number' => :'bodyNumber',
    :'body_type' => :'bodyType',
    :'chassis_number' => :'chassisNumber',
    :'engine_volume' => :'engineVolume',
    :'engine_type' => :'engineType',
    :'engine_number' => :'engineNumber',
    :'authorized_weight' => :'authorizedWeight',
    :'weight' => :'weight',
    :'places' => :'places',
    :'idnp' => :'idnp',
    :'family_name' => :'familyName',
    :'given_name' => :'givenName',
    :'address' => :'address',
    :'vehicle_right' => :'vehicleRight',
    :'special_remarks' => :'specialRemarks',
    :'issue_date' => :'issueDate',
    :'expiry_date' => :'expiryDate',
    :'issuing_authority' => :'issuingAuthority',
    :'document_number' => :'documentNumber'
  }
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



400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 400

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



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
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 177

def self.openapi_nullable
  Set.new([
    :'plate_number',
    :'idnv',
    :'vin',
    :'make',
    :'model',
    :'color',
    :'category',
    :'year',
    :'body_number',
    :'body_type',
    :'chassis_number',
    :'engine_volume',
    :'engine_type',
    :'engine_number',
    :'authorized_weight',
    :'weight',
    :'places',
    :'idnp',
    :'family_name',
    :'given_name',
    :'address',
    :'vehicle_right',
    :'special_remarks',
    :'issue_date',
    :'expiry_date',
    :'issuing_authority',
    :'document_number'
  ])
end

.openapi_typesObject

Attribute type mapping.



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
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 144

def self.openapi_types
  {
    :'plate_number' => :'String',
    :'idnv' => :'String',
    :'vin' => :'String',
    :'make' => :'String',
    :'model' => :'String',
    :'color' => :'String',
    :'category' => :'String',
    :'year' => :'Integer',
    :'body_number' => :'String',
    :'body_type' => :'String',
    :'chassis_number' => :'String',
    :'engine_volume' => :'String',
    :'engine_type' => :'String',
    :'engine_number' => :'String',
    :'authorized_weight' => :'Integer',
    :'weight' => :'Integer',
    :'places' => :'Integer',
    :'idnp' => :'String',
    :'family_name' => :'String',
    :'given_name' => :'String',
    :'address' => :'String',
    :'vehicle_right' => :'String',
    :'special_remarks' => :'Array<String>',
    :'issue_date' => :'Date',
    :'expiry_date' => :'Date',
    :'issuing_authority' => :'String',
    :'document_number' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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
381
382
383
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 353

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      plate_number == o.plate_number &&
      idnv == o.idnv &&
      vin == o.vin &&
      make == o.make &&
      model == o.model &&
      color == o.color &&
      category == o.category &&
      year == o.year &&
      body_number == o.body_number &&
      body_type == o.body_type &&
      chassis_number == o.chassis_number &&
      engine_volume == o.engine_volume &&
      engine_type == o.engine_type &&
      engine_number == o.engine_number &&
      authorized_weight == o.authorized_weight &&
      weight == o.weight &&
      places == o.places &&
      idnp == o.idnp &&
      family_name == o.family_name &&
      given_name == o.given_name &&
      address == o.address &&
      vehicle_right == o.vehicle_right &&
      special_remarks == o.special_remarks &&
      issue_date == o.issue_date &&
      expiry_date == o.expiry_date &&
      issuing_authority == o.issuing_authority &&
      document_number == o.document_number
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


387
388
389
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 387

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



393
394
395
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 393

def hash
  [plate_number, idnv, vin, make, model, color, category, year, body_number, body_type, chassis_number, engine_volume, engine_type, engine_number, authorized_weight, weight, places, idnp, family_name, given_name, address, vehicle_right, special_remarks, issue_date, expiry_date, issuing_authority, document_number].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



338
339
340
341
342
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 338

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



422
423
424
425
426
427
428
429
430
431
432
433
434
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 422

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



346
347
348
349
# File 'lib/trinsic_api/models/moldova_vehicle_registration_certificate_credential.rb', line 346

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