Class: TrinsicApi::SamsungIdWithClearCredential

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

Overview

A Samsung ID with CLEAR credential, retrieved from Samsung Wallet. This is a passport-derived digital credential issued by Samsung in partnership with CLEAR.

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/trinsic_api/models/samsung_id_with_clear_credential.rb', line 133

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#age_birth_yearObject

Year of birth of the individual.



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

def age_birth_year
  @age_birth_year
end

#age_in_yearsObject

Age of the individual in years.



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

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/samsung_id_with_clear_credential.rb', line 59

def age_over
  @age_over
end

#date_of_birthObject

The date of birth of the individual.



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

def date_of_birth
  @date_of_birth
end

#dhs_complianceObject

Whether the credential is compliant with REAL ID. This is always true for Samsung ID with CLEAR credentials.



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

def dhs_compliance
  @dhs_compliance
end

#document_numberObject

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



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

def document_number
  @document_number
end

#expiry_dateObject

The date the Samsung ID expires. This is not necessarily the expiry date of the passport used to create the Samsung ID; see originalDocumentExpiryDate.



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

def expiry_date
  @expiry_date
end

#family_nameObject

Last name, surname, or primary identifier of the individual.



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

def family_name
  @family_name
end

#given_nameObject

First name(s), other name(s), or secondary identifier of the individual.



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

def given_name
  @given_name
end

#issue_dateObject

The date the Samsung ID was issued. This is not the issue date of the passport used to create the Samsung ID; see originalDocumentIssueDate.



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

def issue_date
  @issue_date
end

#issuing_authorityObject

Identifier of Samsung as the issuing authority of the Samsung ID credential. This always begins with "XS-".



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

def issuing_authority
  @issuing_authority
end

#original_document_expiry_dateObject

Expiry date of the underlying passport used to create the Samsung ID.



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

def original_document_expiry_date
  @original_document_expiry_date
end

#original_document_issue_dateObject

Issue date of the underlying passport used to create the Samsung ID.



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

def original_document_issue_date
  @original_document_issue_date
end

#sexObject

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



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

def sex
  @sex
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



82
83
84
# File 'lib/trinsic_api/models/samsung_id_with_clear_credential.rb', line 82

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



87
88
89
# File 'lib/trinsic_api/models/samsung_id_with_clear_credential.rb', line 87

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/trinsic_api/models/samsung_id_with_clear_credential.rb', line 62

def self.attribute_map
  {
    :'given_name' => :'givenName',
    :'family_name' => :'familyName',
    :'date_of_birth' => :'dateOfBirth',
    :'issue_date' => :'issueDate',
    :'expiry_date' => :'expiryDate',
    :'original_document_issue_date' => :'originalDocumentIssueDate',
    :'original_document_expiry_date' => :'originalDocumentExpiryDate',
    :'document_number' => :'documentNumber',
    :'issuing_authority' => :'issuingAuthority',
    :'sex' => :'sex',
    :'dhs_compliance' => :'dhsCompliance',
    :'age_in_years' => :'ageInYears',
    :'age_birth_year' => :'ageBirthYear',
    :'age_over' => :'ageOver'
  }
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



257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# File 'lib/trinsic_api/models/samsung_id_with_clear_credential.rb', line 257

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



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

def self.openapi_nullable
  Set.new([
    :'given_name',
    :'family_name',
    :'date_of_birth',
    :'issue_date',
    :'expiry_date',
    :'original_document_issue_date',
    :'original_document_expiry_date',
    :'document_number',
    :'issuing_authority',
    :'sex',
    :'dhs_compliance',
    :'age_in_years',
    :'age_birth_year',
    :'age_over'
  ])
end

.openapi_typesObject

Attribute type mapping.



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/trinsic_api/models/samsung_id_with_clear_credential.rb', line 92

def self.openapi_types
  {
    :'given_name' => :'String',
    :'family_name' => :'String',
    :'date_of_birth' => :'Date',
    :'issue_date' => :'Date',
    :'expiry_date' => :'Date',
    :'original_document_issue_date' => :'Date',
    :'original_document_expiry_date' => :'Date',
    :'document_number' => :'String',
    :'issuing_authority' => :'String',
    :'sex' => :'Integer',
    :'dhs_compliance' => :'Boolean',
    :'age_in_years' => :'Integer',
    :'age_birth_year' => :'Integer',
    :'age_over' => :'Array<AgeOverOutput>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



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

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 &&
      issue_date == o.issue_date &&
      expiry_date == o.expiry_date &&
      original_document_issue_date == o.original_document_issue_date &&
      original_document_expiry_date == o.original_document_expiry_date &&
      document_number == o.document_number &&
      issuing_authority == o.issuing_authority &&
      sex == o.sex &&
      dhs_compliance == o.dhs_compliance &&
      age_in_years == o.age_in_years &&
      age_birth_year == o.age_birth_year &&
      age_over == o.age_over
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


244
245
246
# File 'lib/trinsic_api/models/samsung_id_with_clear_credential.rb', line 244

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



250
251
252
# File 'lib/trinsic_api/models/samsung_id_with_clear_credential.rb', line 250

def hash
  [given_name, family_name, date_of_birth, issue_date, expiry_date, original_document_issue_date, original_document_expiry_date, document_number, issuing_authority, sex, dhs_compliance, age_in_years, age_birth_year, age_over].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



208
209
210
211
212
# File 'lib/trinsic_api/models/samsung_id_with_clear_credential.rb', line 208

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



279
280
281
282
283
284
285
286
287
288
289
290
291
# File 'lib/trinsic_api/models/samsung_id_with_clear_credential.rb', line 279

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



216
217
218
219
# File 'lib/trinsic_api/models/samsung_id_with_clear_credential.rb', line 216

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