Class: TrinsicApi::FrejaProviderOutput

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

Overview

Exposed properties for the ‘freja` 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 = {}) ⇒ FrejaProviderOutput

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#ageObject

The individual’s age in years.



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

def age
  @age
end

#all_email_addressesObject

An array of all associated email addresses of the individual.



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

def all_email_addresses
  @all_email_addresses
end

#all_physical_addressesObject

A list of all associated addresses of the individual.



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

def all_physical_addresses
  @all_physical_addresses
end

#countryObject

The ISO 3166-1 alpha-2 country code associated with the individual’s country of origin.



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

def country
  @country
end

#date_of_birthObject

The date of birth of the individual. Formatted as an ISO 8601 Date.



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

def date_of_birth
  @date_of_birth
end

#documentObject

The underlying document, such as a passport, used to create the Freja credential.



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

def document
  @document
end

#emailObject

The individual’s primary email address within Freja.



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

def email
  @email
end

#email_verifiedObject

A boolean which indicates whether the individual’s primary email address has been verified by Freja.



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

def email_verified
  @email_verified
end

#family_nameObject

The individual’s last name.



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

def family_name
  @family_name
end

#given_nameObject

The individual’s first name.



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

def given_name
  @given_name
end

#nameObject

The individual’s full name.



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

def name
  @name
end

#personal_identity_numberObject

The individual’s personal identity number. The actual value of this field depends on the country of origin used to create the Freja credential. It is typically a Social Security Number, National Identification Number, or equivalent personal identifier.



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

def personal_identity_number
  @personal_identity_number
end

#phone_numberObject

The individual’s phone number in the E.164 format.



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

def phone_number
  @phone_number
end

#phone_number_verifiedObject

Whether the individual’s phone number has been verified by Freja.



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

def phone_number_verified
  @phone_number_verified
end

#primary_physical_addressObject

The individual’s primary address on file.



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

def primary_physical_address
  @primary_physical_address
end

#registration_levelObject

The Freja registration level associated with this individual. This can be BASIC, EXTENDED, or PLUS. * BASIC: Individual has a registered account with Freja. * EXTENDED: Individual has an official identity document verified by Freja. * PLUS: Individual has undergone in-person verification with Freja.



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

def registration_level
  @registration_level
end

#relying_party_user_idObject

The relying party identifier for this individual. This is an identifier specific to the individual and the relying party (your service).



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

def relying_party_user_id
  @relying_party_user_id
end

#transaction_referenceObject

The Freja transaction reference for this verification. This is an identifier specific to the verification transaction.



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

def transaction_reference
  @transaction_reference
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



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

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



103
104
105
# File 'lib/trinsic_api/models/freja_provider_output.rb', line 103

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/trinsic_api/models/freja_provider_output.rb', line 74

def self.attribute_map
  {
    :'name' => :'name',
    :'given_name' => :'givenName',
    :'family_name' => :'familyName',
    :'date_of_birth' => :'dateOfBirth',
    :'email' => :'email',
    :'email_verified' => :'emailVerified',
    :'all_email_addresses' => :'allEmailAddresses',
    :'primary_physical_address' => :'primaryPhysicalAddress',
    :'all_physical_addresses' => :'allPhysicalAddresses',
    :'age' => :'age',
    :'phone_number' => :'phoneNumber',
    :'phone_number_verified' => :'phoneNumberVerified',
    :'personal_identity_number' => :'personalIdentityNumber',
    :'country' => :'country',
    :'document' => :'document',
    :'registration_level' => :'registrationLevel',
    :'relying_party_user_id' => :'relyingPartyUserId',
    :'transaction_reference' => :'transactionReference'
  }
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



303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/trinsic_api/models/freja_provider_output.rb', line 303

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



132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/trinsic_api/models/freja_provider_output.rb', line 132

def self.openapi_nullable
  Set.new([
    :'name',
    :'given_name',
    :'family_name',
    :'date_of_birth',
    :'email',
    :'email_verified',
    :'all_email_addresses',
    :'primary_physical_address',
    :'all_physical_addresses',
    :'age',
    :'phone_number',
    :'phone_number_verified',
    :'personal_identity_number',
    :'country',
    :'document',
    :'registration_level',
    :'relying_party_user_id',
    :'transaction_reference'
  ])
end

.openapi_typesObject

Attribute type mapping.



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/trinsic_api/models/freja_provider_output.rb', line 108

def self.openapi_types
  {
    :'name' => :'String',
    :'given_name' => :'String',
    :'family_name' => :'String',
    :'date_of_birth' => :'Date',
    :'email' => :'String',
    :'email_verified' => :'Boolean',
    :'all_email_addresses' => :'Array<String>',
    :'primary_physical_address' => :'OutputFrejaAddress',
    :'all_physical_addresses' => :'Array<OutputFrejaAddress>',
    :'age' => :'Integer',
    :'phone_number' => :'String',
    :'phone_number_verified' => :'Boolean',
    :'personal_identity_number' => :'String',
    :'country' => :'String',
    :'document' => :'OutputFrejaDocument',
    :'registration_level' => :'String',
    :'relying_party_user_id' => :'String',
    :'transaction_reference' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/trinsic_api/models/freja_provider_output.rb', line 265

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      name == o.name &&
      given_name == o.given_name &&
      family_name == o.family_name &&
      date_of_birth == o.date_of_birth &&
      email == o.email &&
      email_verified == o.email_verified &&
      all_email_addresses == o.all_email_addresses &&
      primary_physical_address == o.primary_physical_address &&
      all_physical_addresses == o.all_physical_addresses &&
      age == o.age &&
      phone_number == o.phone_number &&
      phone_number_verified == o.phone_number_verified &&
      personal_identity_number == o.personal_identity_number &&
      country == o.country &&
      document == o.document &&
      registration_level == o.registration_level &&
      relying_party_user_id == o.relying_party_user_id &&
      transaction_reference == o.transaction_reference
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


290
291
292
# File 'lib/trinsic_api/models/freja_provider_output.rb', line 290

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



296
297
298
# File 'lib/trinsic_api/models/freja_provider_output.rb', line 296

def hash
  [name, given_name, family_name, date_of_birth, email, email_verified, all_email_addresses, primary_physical_address, all_physical_addresses, age, phone_number, phone_number_verified, personal_identity_number, country, document, registration_level, relying_party_user_id, transaction_reference].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



250
251
252
253
254
# File 'lib/trinsic_api/models/freja_provider_output.rb', line 250

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



325
326
327
328
329
330
331
332
333
334
335
336
337
# File 'lib/trinsic_api/models/freja_provider_output.rb', line 325

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



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

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