Class: TrinsicApi::EudiPidCredential

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

Overview

An EUDI Person Identification Data (PID) credential, with document type ‘eu.europa.ec.eudi.pid.1`. This is the primary identity credential type defined in the EUDI Wallet framework.

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

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/eudi_pid_credential.rb', line 211

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

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

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

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

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

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

  if attributes.key?(:'nationality')
    if (value = attributes[:'nationality']).is_a?(Array)
      self.nationality = value
    end
  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?(:'issuing_country')
    self.issuing_country = attributes[:'issuing_country']
  end

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

Indicator that this credential has been issued specifically as PID. When present, typically equal to "PID".



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

def attestation_legal_category
  @attestation_legal_category
end

#birth_placeObject

Country (ISO 3166-1 alpha-2), state, province, district, local area, municipality, city, town, or village where the individual was born.



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

def birth_place
  @birth_place
end

#date_of_birthObject

The date of birth of the individual.



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

def date_of_birth
  @date_of_birth
end

#document_numberObject

A number assigned to the PID by the issuer. This does not correspond to the document number of a physical document.



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

def document_number
  @document_number
end

#email_addressObject

The individual’s email address.



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

def email_address
  @email_address
end

#expiry_dateObject

Date when the PID expires. Because PIDs are not necessarily backed by a physical document, this does not correspond to the expiration date of such.



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

def expiry_date
  @expiry_date
end

#family_nameObject

Current last name(s) or surname(s) of the individuals.



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

def family_name
  @family_name
end

#family_name_birthObject

Last name(s) or surname(s) of the individual at the time of birth.



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

def family_name_birth
  @family_name_birth
end

#given_nameObject

Current first name(s), including middle name(s) where applicable, of the individual to whom the PID relates.



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

def given_name
  @given_name
end

#given_name_birthObject

First name(s), including middle name(s), of the individual at the time of birth.



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

def given_name_birth
  @given_name_birth
end

#issuance_dateObject

Date when the PID was issued and/or the administrative validity period began.



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

def issuance_date
  @issuance_date
end

#issuing_authorityObject

Name of the administrative authority that issued the PID, or the ISO 3166 alpha-2 country code of the respective Member State if there is no separate authority entitled to issue PIDs.



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

def issuing_authority
  @issuing_authority
end

#issuing_countryObject

ISO 3166-1 alpha-2 country code of the country or territory of the issuer of the PID.



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

def issuing_country
  @issuing_country
end

#issuing_jurisdictionObject

ISO 3166-2 country-subdivision code for the jurisdiction that issued the PID.



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

def issuing_jurisdiction
  @issuing_jurisdiction
end

#location_statusObject

Location of validity status information for the PID, where revocation information is published.



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

def location_status
  @location_status
end

#mobile_phone_numberObject

The mobile phone number of the individual, in international format.



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

def mobile_phone_number
  @mobile_phone_number
end

#nationalityObject

One or more ISO 3166-1 alpha-2 country codes representing the nationality of the individual.



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

def nationality
  @nationality
end

#personal_administrative_numberObject

A value assigned to the individual that is unique among all personal administrative numbers issued by the provider.



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

def personal_administrative_number
  @personal_administrative_number
end

#resident_addressObject

The full address of the individual’s permanent residence.



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

def resident_address
  @resident_address
end

#resident_cityObject

The municipality, city, town, or village of the individual’s permanent residence.



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

def resident_city
  @resident_city
end

#resident_countryObject

The ISO 3166-1 alpha-2 country code of the individual’s permanent residence.



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

def resident_country
  @resident_country
end

#resident_house_numberObject

The house number of the individual’s permanent residence.



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

def resident_house_number
  @resident_house_number
end

#resident_postal_codeObject

The postal code of the individual’s permanent residence.



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

def resident_postal_code
  @resident_postal_code
end

#resident_stateObject

The state, province, district, or local area of the individual’s permanent residence.



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

def resident_state
  @resident_state
end

#resident_streetObject

The street name of the individual’s permanent residence.



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

def resident_street
  @resident_street
end

#sexObject

Sex of the individual. This is a superset of the ISO/IEC 5218 sex code standard, defining additional "other", "inter", "diverse", and "open" values. Possible values: - 0: Unknown - 1: Male - 2: Female - 3: Other - 4: Inter - 5: Diverse - 6: Open - 9: Not Applicable For values 0, 1, 2, and 9, ISO/IEC 5218 applies.



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

def sex
  @sex
end

#trust_anchorObject

URL where a machine-readable trust anchor for verifying the PID can be found.



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

def trust_anchor
  @trust_anchor
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



134
135
136
# File 'lib/trinsic_api/models/eudi_pid_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/eudi_pid_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/eudi_pid_credential.rb', line 101

def self.attribute_map
  {
    :'given_name' => :'givenName',
    :'given_name_birth' => :'givenNameBirth',
    :'family_name' => :'familyName',
    :'family_name_birth' => :'familyNameBirth',
    :'date_of_birth' => :'dateOfBirth',
    :'birth_place' => :'birthPlace',
    :'nationality' => :'nationality',
    :'expiry_date' => :'expiryDate',
    :'issuing_authority' => :'issuingAuthority',
    :'issuing_country' => :'issuingCountry',
    :'issuance_date' => :'issuanceDate',
    :'trust_anchor' => :'trustAnchor',
    :'attestation_legal_category' => :'attestationLegalCategory',
    :'document_number' => :'documentNumber',
    :'issuing_jurisdiction' => :'issuingJurisdiction',
    :'location_status' => :'locationStatus',
    :'sex' => :'sex',
    :'email_address' => :'emailAddress',
    :'mobile_phone_number' => :'mobilePhoneNumber',
    :'personal_administrative_number' => :'personalAdministrativeNumber',
    :'resident_address' => :'residentAddress',
    :'resident_street' => :'residentStreet',
    :'resident_house_number' => :'residentHouseNumber',
    :'resident_city' => :'residentCity',
    :'resident_state' => :'residentState',
    :'resident_postal_code' => :'residentPostalCode',
    :'resident_country' => :'residentCountry'
  }
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/eudi_pid_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/eudi_pid_credential.rb', line 177

def self.openapi_nullable
  Set.new([
    :'given_name',
    :'given_name_birth',
    :'family_name',
    :'family_name_birth',
    :'date_of_birth',
    :'birth_place',
    :'nationality',
    :'expiry_date',
    :'issuing_authority',
    :'issuing_country',
    :'issuance_date',
    :'trust_anchor',
    :'attestation_legal_category',
    :'document_number',
    :'issuing_jurisdiction',
    :'location_status',
    :'sex',
    :'email_address',
    :'mobile_phone_number',
    :'personal_administrative_number',
    :'resident_address',
    :'resident_street',
    :'resident_house_number',
    :'resident_city',
    :'resident_state',
    :'resident_postal_code',
    :'resident_country'
  ])
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/eudi_pid_credential.rb', line 144

def self.openapi_types
  {
    :'given_name' => :'String',
    :'given_name_birth' => :'String',
    :'family_name' => :'String',
    :'family_name_birth' => :'String',
    :'date_of_birth' => :'Date',
    :'birth_place' => :'String',
    :'nationality' => :'Array<String>',
    :'expiry_date' => :'Date',
    :'issuing_authority' => :'String',
    :'issuing_country' => :'String',
    :'issuance_date' => :'Date',
    :'trust_anchor' => :'String',
    :'attestation_legal_category' => :'String',
    :'document_number' => :'String',
    :'issuing_jurisdiction' => :'String',
    :'location_status' => :'String',
    :'sex' => :'Integer',
    :'email_address' => :'String',
    :'mobile_phone_number' => :'String',
    :'personal_administrative_number' => :'String',
    :'resident_address' => :'String',
    :'resident_street' => :'String',
    :'resident_house_number' => :'String',
    :'resident_city' => :'String',
    :'resident_state' => :'String',
    :'resident_postal_code' => :'String',
    :'resident_country' => :'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/eudi_pid_credential.rb', line 353

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      given_name == o.given_name &&
      given_name_birth == o.given_name_birth &&
      family_name == o.family_name &&
      family_name_birth == o.family_name_birth &&
      date_of_birth == o.date_of_birth &&
      birth_place == o.birth_place &&
      nationality == o.nationality &&
      expiry_date == o.expiry_date &&
      issuing_authority == o.issuing_authority &&
      issuing_country == o.issuing_country &&
      issuance_date == o.issuance_date &&
      trust_anchor == o.trust_anchor &&
      attestation_legal_category == o.attestation_legal_category &&
      document_number == o.document_number &&
      issuing_jurisdiction == o.issuing_jurisdiction &&
      location_status == o.location_status &&
      sex == o.sex &&
      email_address == o.email_address &&
      mobile_phone_number == o.mobile_phone_number &&
      personal_administrative_number == o.personal_administrative_number &&
      resident_address == o.resident_address &&
      resident_street == o.resident_street &&
      resident_house_number == o.resident_house_number &&
      resident_city == o.resident_city &&
      resident_state == o.resident_state &&
      resident_postal_code == o.resident_postal_code &&
      resident_country == o.resident_country
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


387
388
389
# File 'lib/trinsic_api/models/eudi_pid_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/eudi_pid_credential.rb', line 393

def hash
  [given_name, given_name_birth, family_name, family_name_birth, date_of_birth, birth_place, nationality, expiry_date, issuing_authority, issuing_country, issuance_date, trust_anchor, attestation_legal_category, document_number, issuing_jurisdiction, location_status, sex, email_address, mobile_phone_number, personal_administrative_number, resident_address, resident_street, resident_house_number, resident_city, resident_state, resident_postal_code, resident_country].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/eudi_pid_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/eudi_pid_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/eudi_pid_credential.rb', line 346

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