Class: TrinsicApi::UnitedKingdomEvisaProviderOutput

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

Overview

Exposed properties for the ‘uk-evisa-lookup` 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 = {}) ⇒ UnitedKingdomEvisaProviderOutput

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/united_kingdom_evisa_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::UnitedKingdomEvisaProviderOutput` 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::UnitedKingdomEvisaProviderOutput`. 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?(:'first_name')
    self.first_name = attributes[:'first_name']
  end

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#date_of_birthObject

The date of birth of the individual.



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

def date_of_birth
  @date_of_birth
end

#evidence_typeObject

Type of verification. List of possible values: - immigration_status - right_to_work - right_to_rent



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

def evidence_type
  @evidence_type
end

#expiration_dateObject

The expiration date of the eVisa. Only present for immigration_status verifications.



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

def expiration_date
  @expiration_date
end

#first_nameObject

The first name of the individual as recorded on the eVisa.



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

def first_name
  @first_name
end

#immigration_statusObject

The immigration status of the individual. Only present for immigration_status verifications. This is a personalized record for each individual, and there is no single definitive list. Some common values: - Settled - Pre-settled - Student - Graduate - Youth Mobility - Global Talent - Skilled Worker - Limited leave



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

def immigration_status
  @immigration_status
end

#last_nameObject

The last name of the individual as recorded on the eVisa.



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

def last_name
  @last_name
end

#nationalityObject

The nationality of the individual as recorded on the eVisa. Only present for immigration_status verifications.



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

def nationality
  @nationality
end

#outcomeObject

Overall verification outcome: "pass", "fail", or "inconclusive". "inconclusive" is returned for indefinite immigration statuses not yet on the provider’s official list — identity details are still returned, but date validations cannot be performed.



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

def outcome
  @outcome
end

#reference_numberObject

The eVisa reference number issued by UK Visas and Immigration (UKVI).



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

def reference_number
  @reference_number
end

#share_codeObject

The 9-character share code used for the verification.



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

def share_code
  @share_code
end

#valid_fromObject

The start date from which the eVisa is valid. Only returned for immigration_status and right_to_rent verifications — not returned for right_to_work.



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

def valid_from
  @valid_from
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



70
71
72
# File 'lib/trinsic_api/models/united_kingdom_evisa_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/united_kingdom_evisa_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/united_kingdom_evisa_provider_output.rb', line 53

def self.attribute_map
  {
    :'first_name' => :'firstName',
    :'last_name' => :'lastName',
    :'date_of_birth' => :'dateOfBirth',
    :'share_code' => :'shareCode',
    :'reference_number' => :'referenceNumber',
    :'expiration_date' => :'expirationDate',
    :'valid_from' => :'validFrom',
    :'nationality' => :'nationality',
    :'immigration_status' => :'immigrationStatus',
    :'outcome' => :'outcome',
    :'evidence_type' => :'evidenceType'
  }
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/united_kingdom_evisa_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/united_kingdom_evisa_provider_output.rb', line 97

def self.openapi_nullable
  Set.new([
    :'first_name',
    :'last_name',
    :'date_of_birth',
    :'share_code',
    :'reference_number',
    :'expiration_date',
    :'valid_from',
    :'nationality',
    :'immigration_status',
    :'outcome',
    :'evidence_type'
  ])
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/united_kingdom_evisa_provider_output.rb', line 80

def self.openapi_types
  {
    :'first_name' => :'String',
    :'last_name' => :'String',
    :'date_of_birth' => :'Date',
    :'share_code' => :'String',
    :'reference_number' => :'String',
    :'expiration_date' => :'Date',
    :'valid_from' => :'Date',
    :'nationality' => :'String',
    :'immigration_status' => :'String',
    :'outcome' => :'String',
    :'evidence_type' => :'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/united_kingdom_evisa_provider_output.rb', line 191

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      first_name == o.first_name &&
      last_name == o.last_name &&
      date_of_birth == o.date_of_birth &&
      share_code == o.share_code &&
      reference_number == o.reference_number &&
      expiration_date == o.expiration_date &&
      valid_from == o.valid_from &&
      nationality == o.nationality &&
      immigration_status == o.immigration_status &&
      outcome == o.outcome &&
      evidence_type == o.evidence_type
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


209
210
211
# File 'lib/trinsic_api/models/united_kingdom_evisa_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/united_kingdom_evisa_provider_output.rb', line 215

def hash
  [first_name, last_name, date_of_birth, share_code, reference_number, expiration_date, valid_from, nationality, immigration_status, outcome, evidence_type].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/united_kingdom_evisa_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_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/trinsic_api/models/united_kingdom_evisa_provider_output.rb', line 244

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



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

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