Class: TrinsicApi::GoogleWalletIdPassCredential

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

Overview

A Google Wallet ID Pass credential, with document type ‘com.google.wallet.idcard.1`. This is a passport-derived digital credential issued by Google.

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

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
173
174
175
176
177
178
179
180
181
182
183
184
# File 'lib/trinsic_api/models/google_wallet_id_pass_credential.rb', line 121

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

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

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

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

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

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

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

Instance Attribute Details

#age_overObject

Processed age-over claims returned by the ID Pass.



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

def age_over
  @age_over
end

#date_of_birthObject

The date of birth of the individual.



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

def date_of_birth
  @date_of_birth
end

#document_numberObject

The number of the underlying passport used to create the ID Pass.



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

def document_number
  @document_number
end

#expiry_dateObject

The date when the ID Pass expires. This is not necessarily the same as the expiration date of the underlying physical passport used to create the ID Pass.



32
33
34
# File 'lib/trinsic_api/models/google_wallet_id_pass_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/google_wallet_id_pass_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/google_wallet_id_pass_credential.rb', line 20

def given_name
  @given_name
end

#issue_dateObject

The date when the ID Pass was issued. This is not the same as the issue date of the underlying physical passport used to create the ID Pass.



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

def issue_date
  @issue_date
end

#issue_date_of_underlying_documentObject

Date when the underlying passport backing this digital credential was originally issued.



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

def issue_date_of_underlying_document
  @issue_date_of_underlying_document
end

#issuing_authorityObject

Name or identifier of the mDL issuing authority. This field’s contents are arbitrary; it has no guaranteed format.



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

def issuing_authority
  @issuing_authority
end

#issuing_countryObject

Alpha-2 country code of the issuing authority’s country or territory.



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

def issuing_country
  @issuing_country
end

#nationalityObject

Nationality of the individual as an ISO 3166-1 alpha-2 country code.



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

def nationality
  @nationality
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/google_wallet_id_pass_credential.rb', line 47

def sex
  @sex
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



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

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



79
80
81
# File 'lib/trinsic_api/models/google_wallet_id_pass_credential.rb', line 79

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/trinsic_api/models/google_wallet_id_pass_credential.rb', line 56

def self.attribute_map
  {
    :'given_name' => :'givenName',
    :'family_name' => :'familyName',
    :'date_of_birth' => :'dateOfBirth',
    :'issue_date' => :'issueDate',
    :'expiry_date' => :'expiryDate',
    :'issuing_country' => :'issuingCountry',
    :'issuing_authority' => :'issuingAuthority',
    :'nationality' => :'nationality',
    :'document_number' => :'documentNumber',
    :'sex' => :'sex',
    :'age_over' => :'ageOver',
    :'issue_date_of_underlying_document' => :'issueDateOfUnderlyingDocument'
  }
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



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/trinsic_api/models/google_wallet_id_pass_credential.rb', line 235

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



102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/trinsic_api/models/google_wallet_id_pass_credential.rb', line 102

def self.openapi_nullable
  Set.new([
    :'given_name',
    :'family_name',
    :'date_of_birth',
    :'issue_date',
    :'expiry_date',
    :'issuing_country',
    :'issuing_authority',
    :'nationality',
    :'document_number',
    :'sex',
    :'age_over',
    :'issue_date_of_underlying_document'
  ])
end

.openapi_typesObject

Attribute type mapping.



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/trinsic_api/models/google_wallet_id_pass_credential.rb', line 84

def self.openapi_types
  {
    :'given_name' => :'String',
    :'family_name' => :'String',
    :'date_of_birth' => :'Date',
    :'issue_date' => :'Date',
    :'expiry_date' => :'Date',
    :'issuing_country' => :'String',
    :'issuing_authority' => :'String',
    :'nationality' => :'String',
    :'document_number' => :'String',
    :'sex' => :'Integer',
    :'age_over' => :'Array<AgeOverOutput>',
    :'issue_date_of_underlying_document' => :'Date'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/trinsic_api/models/google_wallet_id_pass_credential.rb', line 203

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 &&
      issuing_country == o.issuing_country &&
      issuing_authority == o.issuing_authority &&
      nationality == o.nationality &&
      document_number == o.document_number &&
      sex == o.sex &&
      age_over == o.age_over &&
      issue_date_of_underlying_document == o.issue_date_of_underlying_document
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


222
223
224
# File 'lib/trinsic_api/models/google_wallet_id_pass_credential.rb', line 222

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



228
229
230
# File 'lib/trinsic_api/models/google_wallet_id_pass_credential.rb', line 228

def hash
  [given_name, family_name, date_of_birth, issue_date, expiry_date, issuing_country, issuing_authority, nationality, document_number, sex, age_over, issue_date_of_underlying_document].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



188
189
190
191
192
# File 'lib/trinsic_api/models/google_wallet_id_pass_credential.rb', line 188

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



257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/trinsic_api/models/google_wallet_id_pass_credential.rb', line 257

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



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

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