Class: TrinsicApi::SmartIdProviderOutput

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

Overview

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#certificate_levelObject

The certificate level indicating the authentication assurance level. Possible values: - QUALIFIED: Highest assurance level (eIDAS QES - Qualified Electronic Signature), legally equivalent to a handwritten signature. This is the standard production level. - ADVANCED: Lower assurance level (eIDAS AdES), also called "Smart-ID Basic". Only available in test environments for test accounts.



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

def certificate_level
  @certificate_level
end

#certificate_subjectObject

The full Subject Distinguished Name (Subject DN) from the Smart ID authentication certificate. Contains comma-separated RDN (Relative Distinguished Name) components including C (Country), CN (Common Name), SN (Surname), G (Given Name), and SERIALNUMBER (Personal identifier).



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

def certificate_subject
  @certificate_subject
end

#countryObject

The ISO 3166-1 alpha-2 country code extracted from the Smart ID authentication certificate’s Subject Distinguished Name "C" (country) attribute. This represents the country of the certificate issuer, not the person’s nationality or citizenship. For Smart ID, this will be "EE" (Estonia), "LT" (Lithuania), or "LV" (Latvia).



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

def country
  @country
end

#date_of_birthObject

The individual’s date of birth, derived from the personal code. NOTE: Newer Latvian personal codes starting with "32" do not contain date of birth information.



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

def date_of_birth
  @date_of_birth
end

#device_ip_addressObject

The IP address of the device where the Smart ID app was used for authentication. Can be IPv4 or IPv6 format.



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

def device_ip_address
  @device_ip_address
end

#document_numberObject

A unique identifier for the Smart ID account/document used for this authentication. Format: PNOCC-personal-code-device-id-qualification Components: - PNO = Personal Number (identity type) - CC = Country code (EE, LT, LV) - personal-code = The individual’s personal code - device-id = Random 4-character device identifier - qualification = NQ (non-qualified) or Q (qualified certificate) This is a stable identifier that can be used to recognize returning individuals across sessions.



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

def document_number
  @document_number
end

#family_nameObject

The family name (surname) of the individual, extracted from the Smart ID authentication certificate’s Subject Distinguished Name "SN" (surname) attribute.



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

def family_name
  @family_name
end

#given_nameObject

The given name (first name) of the individual, extracted from the Smart ID authentication certificate’s Subject Distinguished Name "G" (givenName) attribute.



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

def given_name
  @given_name
end

#identity_typeObject

The identity document type, extracted from the first 3 characters of the SERIALNUMBER field (before the country code). Possible values: - PNO: Personal Number (national civic registration number) - PAS: Passport - IDC: National identity card



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

def identity_type
  @identity_type
end

#interaction_flow_usedObject

Indicates which interaction flow was used during the Smart ID authentication process. This reflects which of the allowedInteractionsOrder options was actually used. Possible values: - displayTextAndPIN: User saw text and entered PIN - verificationCodeChoice: User selected from multiple verification codes - confirmationMessage: User confirmed a message - confirmationMessageAndVerificationCodeChoice: Combination of both



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

def interaction_flow_used
  @interaction_flow_used
end

#personal_codeObject

The personal code (Estonian: isikukood, Lithuanian: asmens kodas, Latvian: personas kods) of the individual, extracted from the SERIALNUMBER field of the Smart ID authentication certificate. This is the portion after the identity type and country prefix (e.g., "48501010014" from "PNOEE-48501010014"). Estonian and Lithuanian personal codes are 11 digits in the format GYYMMDDSSSC where: - G = century/gender (3-4 = 1900s, 5-6 = 2000s; odd = male, even = female) - YYMMDD = date of birth - SSS = sequence number - C = checksum digit Latvian personal codes use the format DDMMYY-NNNNN (6 digits, a dash, and 5 digits). See: - en.wikipedia.org/wiki/National_identification_number#Estonia - en.wikipedia.org/wiki/National_identification_number#Lithuania - en.wikipedia.org/wiki/National_identification_number#Latvia



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

def personal_code
  @personal_code
end

#serial_numberObject

The SERIALNUMBER attribute from the Smart ID authentication certificate’s Subject Distinguished Name. Format: "identity-typecountry-code-identifier" Components: - identity-type (3 chars): PNO (Personal Number), PAS (Passport), IDC (ID Card) - country-code (2 chars): ISO 3166-1 alpha-2 (EE, LT, LV) - identifier: The personal code



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

def serial_number
  @serial_number
end

#sexObject

The individual’s sex, derived from the first digit of the personal code. NOTE: Not available for Latvian personal codes. Possible values: - Male - Female



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

def sex
  @sex
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



78
79
80
# File 'lib/trinsic_api/models/smart_id_provider_output.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/smart_id_provider_output.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/smart_id_provider_output.rb', line 59

def self.attribute_map
  {
    :'given_name' => :'givenName',
    :'family_name' => :'familyName',
    :'date_of_birth' => :'dateOfBirth',
    :'sex' => :'sex',
    :'country' => :'country',
    :'identity_type' => :'identityType',
    :'personal_code' => :'personalCode',
    :'serial_number' => :'serialNumber',
    :'certificate_subject' => :'certificateSubject',
    :'certificate_level' => :'certificateLevel',
    :'document_number' => :'documentNumber',
    :'interaction_flow_used' => :'interactionFlowUsed',
    :'device_ip_address' => :'deviceIpAddress'
  }
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



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

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/smart_id_provider_output.rb', line 107

def self.openapi_nullable
  Set.new([
    :'given_name',
    :'family_name',
    :'date_of_birth',
    :'sex',
    :'country',
    :'identity_type',
    :'personal_code',
    :'serial_number',
    :'certificate_subject',
    :'certificate_level',
    :'document_number',
    :'interaction_flow_used',
    :'device_ip_address'
  ])
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/smart_id_provider_output.rb', line 88

def self.openapi_types
  {
    :'given_name' => :'String',
    :'family_name' => :'String',
    :'date_of_birth' => :'Date',
    :'sex' => :'String',
    :'country' => :'String',
    :'identity_type' => :'String',
    :'personal_code' => :'String',
    :'serial_number' => :'String',
    :'certificate_subject' => :'String',
    :'certificate_level' => :'String',
    :'document_number' => :'String',
    :'interaction_flow_used' => :'String',
    :'device_ip_address' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      given_name == o.given_name &&
      family_name == o.family_name &&
      date_of_birth == o.date_of_birth &&
      sex == o.sex &&
      country == o.country &&
      identity_type == o.identity_type &&
      personal_code == o.personal_code &&
      serial_number == o.serial_number &&
      certificate_subject == o.certificate_subject &&
      certificate_level == o.certificate_level &&
      document_number == o.document_number &&
      interaction_flow_used == o.interaction_flow_used &&
      device_ip_address == o.device_ip_address
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


231
232
233
# File 'lib/trinsic_api/models/smart_id_provider_output.rb', line 231

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



237
238
239
# File 'lib/trinsic_api/models/smart_id_provider_output.rb', line 237

def hash
  [given_name, family_name, date_of_birth, sex, country, identity_type, personal_code, serial_number, certificate_subject, certificate_level, document_number, interaction_flow_used, device_ip_address].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



196
197
198
199
200
# File 'lib/trinsic_api/models/smart_id_provider_output.rb', line 196

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



266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/trinsic_api/models/smart_id_provider_output.rb', line 266

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



204
205
206
207
# File 'lib/trinsic_api/models/smart_id_provider_output.rb', line 204

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