Class: TrinsicApi::AppleWalletDigitalIdCredential

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

Overview

An Apple Wallet Digital ID credential, with document type org.iso.23220.photoid.1. This is a passport-derived digital credential issued by Apple.

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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/trinsic_api/models/apple_wallet_digital_id_credential.rb', line 163

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

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

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

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

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

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

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

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

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

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

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

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

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

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

#age_in_yearsObject

The age of the individual, as of the issuance date of the credential.



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

def age_in_years
  @age_in_years
end

#age_overObject

Processed age-over claims returned by the credential.



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

def age_over
  @age_over
end

#date_of_birthObject

The date of birth of the individual, possibly with an "approximate mask" indicating uncertain digits.



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

def date_of_birth
  @date_of_birth
end

#document_numberObject

The document number of the underlying passport used to create the Digital ID.



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

def document_number
  @document_number
end

#expiry_dateObject

Date when the underlying passport used to create the Digital ID expires.



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

def expiry_date
  @expiry_date
end

#family_name_latin1Object

Last name, surname, or primary identifier of the individual. This field uses only the Latin-1 character set and is largely limited to names which can be represented using the English alphabet.



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

def family_name_latin1
  @family_name_latin1
end

#family_name_unicodeObject

Last name, surname, or primary identifier of the individual. This field uses the full UTF-8 character set and can represent any name.



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

def family_name_unicode
  @family_name_unicode
end

#given_name_latin1Object

First name(s), other name(s), or secondary identifier of the individual. This field uses the Latin-1 character set and is limited to names represented by the English alphabet. represented using the English alphabet.



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

def given_name_latin1
  @given_name_latin1
end

#given_name_unicodeObject

First name(s), other name(s), or secondary identifier of the individual. This field uses the full UTF-8 character set and can represent any name.



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

def given_name_unicode
  @given_name_unicode
end

#issue_dateObject

Date when the underlying passport used to create the Digital ID was issued.



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

def issue_date
  @issue_date
end

#issuing_authority_unicodeObject

Name or identifier of the issuing authority of the credential, using the full UTF-8 character set. This field's contents are arbitrary; it has no guaranteed format.



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

def issuing_authority_unicode
  @issuing_authority_unicode
end

#issuing_countryObject

ISO 3166-1 alpha-2 country code of the issuing authority's country or territory.



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

def issuing_country
  @issuing_country
end

#issuing_subdivisionObject

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



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

def issuing_subdivision
  @issuing_subdivision
end

#resident_address_unicodeObject

The permanent address of the individual, using the full UTF-8 character set. This is only present if the underlying passport contained an address, which is uncommon.



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

def resident_address_unicode
  @resident_address_unicode
end

#resident_city_latin1Object

City of the individual's permanent address, using the Latin-1 character set. This is only present if the underlying passport contained an address, which is uncommon.



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

def resident_city_latin1
  @resident_city_latin1
end

#resident_city_unicodeObject

City of the individual's permanent address, using the full UTF-8 character set. This is only present if the underlying passport contained an address, which is uncommon.



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

def resident_city_unicode
  @resident_city_unicode
end

#resident_countryObject

ISO 3166-1 alpha-2 country code of the individual's permanent address. This is only present if the underlying passport contained an address, which is uncommon.



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

def resident_country
  @resident_country
end

#resident_postal_codeObject

Postal code of the individual's permanent address. This is only present if the underlying passport contained an address, which is uncommon.



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

def resident_postal_code
  @resident_postal_code
end

#sexObject

The individual's sex as an ISO/IEC 5218 code. Possible values: - 0: Unknown - 1: Male - 2: Female - 9: Not Applicable



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

def sex
  @sex
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



102
103
104
# File 'lib/trinsic_api/models/apple_wallet_digital_id_credential.rb', line 102

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



107
108
109
# File 'lib/trinsic_api/models/apple_wallet_digital_id_credential.rb', line 107

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/trinsic_api/models/apple_wallet_digital_id_credential.rb', line 77

def self.attribute_map
  {
    :'given_name_unicode' => :'givenNameUnicode',
    :'given_name_latin1' => :'givenNameLatin1',
    :'family_name_unicode' => :'familyNameUnicode',
    :'family_name_latin1' => :'familyNameLatin1',
    :'sex' => :'sex',
    :'date_of_birth' => :'dateOfBirth',
    :'document_number' => :'documentNumber',
    :'issuing_authority_unicode' => :'issuingAuthorityUnicode',
    :'issuing_subdivision' => :'issuingSubdivision',
    :'issuing_country' => :'issuingCountry',
    :'issue_date' => :'issueDate',
    :'expiry_date' => :'expiryDate',
    :'age_in_years' => :'ageInYears',
    :'age_over' => :'ageOver',
    :'resident_address_unicode' => :'residentAddressUnicode',
    :'resident_city_unicode' => :'residentCityUnicode',
    :'resident_city_latin1' => :'residentCityLatin1',
    :'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



312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'lib/trinsic_api/models/apple_wallet_digital_id_credential.rb', line 312

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



137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/trinsic_api/models/apple_wallet_digital_id_credential.rb', line 137

def self.openapi_nullable
  Set.new([
    :'given_name_unicode',
    :'given_name_latin1',
    :'family_name_unicode',
    :'family_name_latin1',
    :'sex',
    :'date_of_birth',
    :'document_number',
    :'issuing_authority_unicode',
    :'issuing_subdivision',
    :'issuing_country',
    :'issue_date',
    :'expiry_date',
    :'age_in_years',
    :'age_over',
    :'resident_address_unicode',
    :'resident_city_unicode',
    :'resident_city_latin1',
    :'resident_postal_code',
    :'resident_country'
  ])
end

.openapi_typesObject

Attribute type mapping.



112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/trinsic_api/models/apple_wallet_digital_id_credential.rb', line 112

def self.openapi_types
  {
    :'given_name_unicode' => :'String',
    :'given_name_latin1' => :'String',
    :'family_name_unicode' => :'String',
    :'family_name_latin1' => :'String',
    :'sex' => :'Integer',
    :'date_of_birth' => :'AppleWalletDigitalIdBirthDate',
    :'document_number' => :'String',
    :'issuing_authority_unicode' => :'String',
    :'issuing_subdivision' => :'String',
    :'issuing_country' => :'String',
    :'issue_date' => :'Date',
    :'expiry_date' => :'Date',
    :'age_in_years' => :'Integer',
    :'age_over' => :'Array<AgeOverOutput>',
    :'resident_address_unicode' => :'String',
    :'resident_city_unicode' => :'String',
    :'resident_city_latin1' => :'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



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

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      given_name_unicode == o.given_name_unicode &&
      given_name_latin1 == o.given_name_latin1 &&
      family_name_unicode == o.family_name_unicode &&
      family_name_latin1 == o.family_name_latin1 &&
      sex == o.sex &&
      date_of_birth == o.date_of_birth &&
      document_number == o.document_number &&
      issuing_authority_unicode == o.issuing_authority_unicode &&
      issuing_subdivision == o.issuing_subdivision &&
      issuing_country == o.issuing_country &&
      issue_date == o.issue_date &&
      expiry_date == o.expiry_date &&
      age_in_years == o.age_in_years &&
      age_over == o.age_over &&
      resident_address_unicode == o.resident_address_unicode &&
      resident_city_unicode == o.resident_city_unicode &&
      resident_city_latin1 == o.resident_city_latin1 &&
      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


299
300
301
# File 'lib/trinsic_api/models/apple_wallet_digital_id_credential.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/trinsic_api/models/apple_wallet_digital_id_credential.rb', line 305

def hash
  [given_name_unicode, given_name_latin1, family_name_unicode, family_name_latin1, sex, date_of_birth, document_number, issuing_authority_unicode, issuing_subdivision, issuing_country, issue_date, expiry_date, age_in_years, age_over, resident_address_unicode, resident_city_unicode, resident_city_latin1, 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



258
259
260
261
262
# File 'lib/trinsic_api/models/apple_wallet_digital_id_credential.rb', line 258

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



334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/trinsic_api/models/apple_wallet_digital_id_credential.rb', line 334

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



266
267
268
269
# File 'lib/trinsic_api/models/apple_wallet_digital_id_credential.rb', line 266

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