Class: TrinsicApi::MoldovaDriverLicenseCredential

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

Overview

A Moldovan Driver License credential, with document type md.gov.wallet.dl.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 = {}) ⇒ MoldovaDriverLicenseCredential

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

  if attributes.key?(:'birth_city')
    self.birth_city = attributes[:'birth_city']
  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

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

Instance Attribute Details

#age_over18Object

Whether the individual is at least 18 years of age at the time of issuance of the digital credential.



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

def age_over18
  @age_over18
end

#age_over21Object

Whether the individual is at least 21 years of age at the time of issuance of the digital credential.



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

def age_over21
  @age_over21
end

#birth_cityObject

The locality (municipality, city, town, or village) where the individual was born.



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

def birth_city
  @birth_city
end

#birth_countryObject

The country where the individual was born, as an ISO 3166-1 alpha-2 country code.



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

def birth_country
  @birth_country
end

#date_of_birthObject

The date of birth of the individual.



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

def date_of_birth
  @date_of_birth
end

#document_numberObject

The driver license number.



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

def document_number
  @document_number
end

#driving_privilegesObject

The categories of vehicle the individual is licensed to drive, parsed per ISO 18013-5. Each entry has a vehicle category code with its own issue / expiry dates and possible restrictions.



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

def driving_privileges
  @driving_privileges
end

#expiry_dateObject

The date the driver license expires.



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

def expiry_date
  @expiry_date
end

#family_nameObject

The individual's family name (surname), as recorded on their Moldovan driver license.



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

def family_name
  @family_name
end

#given_nameObject

The individual's given name(s), as recorded on their Moldovan driver license.



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

def given_name
  @given_name
end

#idnpObject

The individual's IDNP (Numărul de Identificare Personal), the Moldovan state personal identification number. 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.



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

def idnp
  @idnp
end

#issue_dateObject

The date the driver license was issued.



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

def issue_date
  @issue_date
end

#issuing_authorityObject

The name of the authority that issued the driver license.



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

def issuing_authority
  @issuing_authority
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



78
79
80
# File 'lib/trinsic_api/models/moldova_driver_license_credential.rb', line 78

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



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

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/trinsic_api/models/moldova_driver_license_credential.rb', line 59

def self.attribute_map
  {
    :'idnp' => :'idnp',
    :'given_name' => :'givenName',
    :'family_name' => :'familyName',
    :'date_of_birth' => :'dateOfBirth',
    :'age_over18' => :'ageOver18',
    :'age_over21' => :'ageOver21',
    :'birth_country' => :'birthCountry',
    :'birth_city' => :'birthCity',
    :'issue_date' => :'issueDate',
    :'expiry_date' => :'expiryDate',
    :'issuing_authority' => :'issuingAuthority',
    :'document_number' => :'documentNumber',
    :'driving_privileges' => :'drivingPrivileges'
  }
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



246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/trinsic_api/models/moldova_driver_license_credential.rb', line 246

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



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/trinsic_api/models/moldova_driver_license_credential.rb', line 107

def self.openapi_nullable
  Set.new([
    :'idnp',
    :'given_name',
    :'family_name',
    :'date_of_birth',
    :'age_over18',
    :'age_over21',
    :'birth_country',
    :'birth_city',
    :'issue_date',
    :'expiry_date',
    :'issuing_authority',
    :'document_number',
    :'driving_privileges'
  ])
end

.openapi_typesObject

Attribute type mapping.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/trinsic_api/models/moldova_driver_license_credential.rb', line 88

def self.openapi_types
  {
    :'idnp' => :'String',
    :'given_name' => :'String',
    :'family_name' => :'String',
    :'date_of_birth' => :'Date',
    :'age_over18' => :'Boolean',
    :'age_over21' => :'Boolean',
    :'birth_country' => :'String',
    :'birth_city' => :'String',
    :'issue_date' => :'Date',
    :'expiry_date' => :'Date',
    :'issuing_authority' => :'String',
    :'document_number' => :'String',
    :'driving_privileges' => :'Array<Iso180135DrivingPrivilege>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/trinsic_api/models/moldova_driver_license_credential.rb', line 213

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      idnp == o.idnp &&
      given_name == o.given_name &&
      family_name == o.family_name &&
      date_of_birth == o.date_of_birth &&
      age_over18 == o.age_over18 &&
      age_over21 == o.age_over21 &&
      birth_country == o.birth_country &&
      birth_city == o.birth_city &&
      issue_date == o.issue_date &&
      expiry_date == o.expiry_date &&
      issuing_authority == o.issuing_authority &&
      document_number == o.document_number &&
      driving_privileges == o.driving_privileges
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


233
234
235
# File 'lib/trinsic_api/models/moldova_driver_license_credential.rb', line 233

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



239
240
241
# File 'lib/trinsic_api/models/moldova_driver_license_credential.rb', line 239

def hash
  [idnp, given_name, family_name, date_of_birth, age_over18, age_over21, birth_country, birth_city, issue_date, expiry_date, issuing_authority, document_number, driving_privileges].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



198
199
200
201
202
# File 'lib/trinsic_api/models/moldova_driver_license_credential.rb', line 198

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



268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/trinsic_api/models/moldova_driver_license_credential.rb', line 268

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



206
207
208
209
# File 'lib/trinsic_api/models/moldova_driver_license_credential.rb', line 206

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