Class: TrinsicApi::MitIdProviderOutput

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

Overview

Exposed properties for the ‘denmark-mitid` Provider which do not directly map to the normalized IdentityData model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MitIdProviderOutput

Initializes the object

Parameters:

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

    Model attributes in the form of hash



115
116
117
118
119
120
121
122
123
124
125
126
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
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 115

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#authentication_assurance_levelObject

The authentication assurance level (AAL) for the verification. The National Institute of Standards and Technology (NIST) measures the confidence in a digital identity’s authentication strength set by a set of requirements for different levels. More information can be found here: pages.nist.gov/800-63-4/sp800-63b/aal/#AAL_SEC4 Possible values: - data.gov.dk/concept/core/nsis/Low - (Level 1) Provides basic confidence that the authenticator is either single factor or multifactor authentication. - data.gov.dk/concept/core/nsis/Substantial - (Level 2) Provides high confidence that the authenticator uses two distinct authentication factors that use secure authentication protocols. - data.gov.dk/concept/core/nsis/High - (Level 3) Provides very high confidence that the authenticator uses an non-exportable private key and another authentication factor. Note: These urls are not valid anymore, but they still contain the level of assurance name.



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

def authentication_assurance_level
  @authentication_assurance_level
end

#authorized_representative_numberObject

The organization number (CVR number) of the organization the user is authorized to represent. This is only returned if the requested scope is for an organization verification and the user provides a private source in behalf of a company.



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

def authorized_representative_number
  @authorized_representative_number
end

#civil_registration_numberObject

The civil registration number (CPR number) of the individual for the verification. The CPR number is a 10-digit number in the format DDMMYYY-XXXX, where: - DDMMYYY represents the individual’s date of birth (day, month, year). - XXXX is a unique identifier. If XXXX is even, the individual is female. If XXXX is odd, the individual is male. More information can be found here: international.kk.dk/live/cpr-registration-and-documents/cpr-number



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

def civil_registration_number
  @civil_registration_number
end

#date_of_birthObject

The date of birth of the individual.



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

def date_of_birth
  @date_of_birth
end

#full_nameObject

The full name of the individual.



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

def full_name
  @full_name
end

#identification_sourceObject

The source of the identification for the verification Possible values: - private - The verification is from a private individual. - professional - The verification is a user in behalf of a organization.



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

def identification_source
  @identification_source
end

#identity_authentication_levelObject

The identity assurance level (IAL) for the verification. The National Institute of Standards and Technology (NIST) measures the confidence of the digital identity’s verification set by a set of requirements for different levels. More information can be found here: pages.nist.gov/800-63-4/sp800-63b/aal/#AAL_SEC4 Possible values: - data.gov.dk/concept/core/nsis/Low - (Level 1) The user has self asserted their identity and is neither verified nor validated. - data.gov.dk/concept/core/nsis/Substantial - (Level 2) The user has performed either a remote or in-person identity proofing. - data.gov.dk/concept/core/nsis/High - (Level 3) The user has performed an in person identity proofing with an authorized representative. Note: These urls are not valid anymore, but they still contain the level of assurance name.



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

def identity_authentication_level
  @identity_authentication_level
end

#level_of_assuranceObject

The level of assurance (LOA) for the verification. This is an older retired model that is a combination of Identity Assurance Level and Authentication Assurance Level. The National Institute of Standards and Technology (NIST) measures the confidence of the digital identity’s verification and authentication strength by a set of requirements for different levels. Possible values: - data.gov.dk/concept/core/nsis/Low - (Level 1) The user has self asserted their identity and multifactor authentication is not required. - data.gov.dk/concept/core/nsis/Substantial - (Level 3) The user has performed either a remote or in-person identity proofing and multifactor authentication is required. - data.gov.dk/concept/core/nsis/High - (Level 4) The user has performed an in person identity proofing with an authorized representative and has strong cryptographic authentication requirements. Note: These urls are not valid anymore, but they still contain the level of assurance name. MitID only returns three of the four potential levels and does not include level 2. More information can be found here: - pages.nist.gov/800-63-3/sp800-63-3.html - pages.nist.gov/800-63-3/



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

def level_of_assurance
  @level_of_assurance
end

#organization_nameObject

The name of the organization for the verification



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

def organization_name
  @organization_name
end

#organization_numberObject

The organization number (CVR number). This is an 8-digit unique identifier for the organization. This will be prefixed with "DK" for VAT numbers.



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

def organization_number
  @organization_number
end

#unique_identifierObject

A stable unique identifier representing the user in MitID’s system. It is recommended to use this identifier instead of using the civil registration number (CPR number) directly.



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

def unique_identifier
  @unique_identifier
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



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

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = TrinsicApi.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



70
71
72
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 70

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



75
76
77
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 75

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 53

def self.attribute_map
  {
    :'full_name' => :'fullName',
    :'date_of_birth' => :'dateOfBirth',
    :'unique_identifier' => :'uniqueIdentifier',
    :'authentication_assurance_level' => :'authenticationAssuranceLevel',
    :'identity_authentication_level' => :'identityAuthenticationLevel',
    :'level_of_assurance' => :'levelOfAssurance',
    :'identification_source' => :'identificationSource',
    :'civil_registration_number' => :'civilRegistrationNumber',
    :'organization_name' => :'organizationName',
    :'organization_number' => :'organizationNumber',
    :'authorized_representative_number' => :'authorizedRepresentativeNumber'
  }
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



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 222

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



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 97

def self.openapi_nullable
  Set.new([
    :'full_name',
    :'date_of_birth',
    :'unique_identifier',
    :'authentication_assurance_level',
    :'identity_authentication_level',
    :'level_of_assurance',
    :'identification_source',
    :'civil_registration_number',
    :'organization_name',
    :'organization_number',
    :'authorized_representative_number'
  ])
end

.openapi_typesObject

Attribute type mapping.



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 80

def self.openapi_types
  {
    :'full_name' => :'String',
    :'date_of_birth' => :'Date',
    :'unique_identifier' => :'String',
    :'authentication_assurance_level' => :'String',
    :'identity_authentication_level' => :'String',
    :'level_of_assurance' => :'String',
    :'identification_source' => :'String',
    :'civil_registration_number' => :'String',
    :'organization_name' => :'String',
    :'organization_number' => :'String',
    :'authorized_representative_number' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 191

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      full_name == o.full_name &&
      date_of_birth == o.date_of_birth &&
      unique_identifier == o.unique_identifier &&
      authentication_assurance_level == o.authentication_assurance_level &&
      identity_authentication_level == o.identity_authentication_level &&
      level_of_assurance == o.level_of_assurance &&
      identification_source == o.identification_source &&
      civil_registration_number == o.civil_registration_number &&
      organization_name == o.organization_name &&
      organization_number == o.organization_number &&
      authorized_representative_number == o.authorized_representative_number
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



317
318
319
320
321
322
323
324
325
326
327
328
329
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 317

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


209
210
211
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 209

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



215
216
217
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 215

def hash
  [full_name, date_of_birth, unique_identifier, authentication_assurance_level, identity_authentication_level, level_of_assurance, identification_source, civil_registration_number, organization_name, organization_number, authorized_representative_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



176
177
178
179
180
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 176

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



293
294
295
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 293

def to_body
  to_hash
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/mit_id_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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



287
288
289
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 287

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



184
185
186
187
# File 'lib/trinsic_api/models/mit_id_provider_output.rb', line 184

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