trinsic_api 3.0.1 → 3.0.2.pre.preview

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AadhaarClaims.md +46 -0
  3. data/docs/AadhaarLanguage.md +20 -0
  4. data/docs/AadhaarLocalizedClaims.md +40 -0
  5. data/docs/AppleWalletInput.md +3 -1
  6. data/docs/ConnectIdAddress.md +26 -0
  7. data/docs/ConnectIdAgeVerification.md +20 -0
  8. data/docs/ConnectIdBeneficiaryAccount.md +24 -0
  9. data/docs/ConnectIdProviderOutput.md +38 -0
  10. data/docs/CzechMojeIdAddressOutput.md +28 -0
  11. data/docs/CzechMojeIdProviderOutput.md +62 -0
  12. data/docs/DigilockerAadhaarProviderOutput.md +30 -0
  13. data/docs/FaydaProviderOutput.md +7 -1
  14. data/docs/FinnishTrustNetworkProviderOutput.md +38 -0
  15. data/docs/FranceIdentiteInput.md +18 -0
  16. data/docs/FranceIdentiteProviderOutput.md +18 -0
  17. data/docs/FrejaIndirectProviderOutput.md +24 -0
  18. data/docs/FrejaProviderOutput.md +36 -8
  19. data/docs/GetProviderResponse.md +18 -0
  20. data/docs/GoogleWalletInput.md +3 -1
  21. data/docs/NigeriaNinLookup2ProviderOutput.md +40 -0
  22. data/docs/NorwegianBankIdProviderOutput.md +32 -0
  23. data/docs/OneIdProviderAddress.md +26 -0
  24. data/docs/OneIdProviderOutput.md +28 -0
  25. data/docs/OutputFrejaAddress.md +24 -0
  26. data/docs/OutputFrejaDocument.md +24 -0
  27. data/docs/PhilippinesDigitalNidProviderOutput.md +21 -1
  28. data/docs/PhilippinesPhysicalNidProviderOutput.md +17 -1
  29. data/docs/ProviderInput.md +6 -0
  30. data/docs/ProviderOutput.md +24 -2
  31. data/docs/ProvidersApi.md +70 -0
  32. data/docs/Raw18013DocumentRequest.md +20 -0
  33. data/docs/Raw18013RequestInput.md +18 -0
  34. data/docs/RecommendProvidersResponse.md +3 -1
  35. data/docs/SamsungWalletInput.md +18 -0
  36. data/docs/UkEvisaLookupInput.md +20 -0
  37. data/docs/UnitedKingdomEvisaProviderOutput.md +38 -0
  38. data/docs/VerificationProfileResponse.md +2 -0
  39. data/docs/VerificationProfilesApi.md +4 -0
  40. data/docs/YotiDeeplinkProviderOutput.md +40 -0
  41. data/lib/trinsic_api/api/providers_api.rb +63 -0
  42. data/lib/trinsic_api/api/verification_profiles_api.rb +6 -0
  43. data/lib/trinsic_api/models/aadhaar_claims.rb +376 -0
  44. data/lib/trinsic_api/models/aadhaar_language.rb +250 -0
  45. data/lib/trinsic_api/models/aadhaar_localized_claims.rb +343 -0
  46. data/lib/trinsic_api/models/apple_wallet_input.rb +16 -5
  47. data/lib/trinsic_api/models/connect_id_address.rb +266 -0
  48. data/lib/trinsic_api/models/connect_id_age_verification.rb +233 -0
  49. data/lib/trinsic_api/models/connect_id_beneficiary_account.rb +255 -0
  50. data/lib/trinsic_api/models/connect_id_provider_output.rb +333 -0
  51. data/lib/trinsic_api/models/czech_moje_id_address_output.rb +277 -0
  52. data/lib/trinsic_api/models/czech_moje_id_provider_output.rb +465 -0
  53. data/lib/trinsic_api/models/digilocker_aadhaar_provider_output.rb +305 -0
  54. data/lib/trinsic_api/models/fayda_provider_output.rb +38 -5
  55. data/lib/trinsic_api/models/finnish_trust_network_provider_output.rb +333 -0
  56. data/lib/trinsic_api/models/france_identite_input.rb +222 -0
  57. data/lib/trinsic_api/models/france_identite_provider_output.rb +239 -0
  58. data/lib/trinsic_api/models/freja_indirect_provider_output.rb +320 -0
  59. data/lib/trinsic_api/models/freja_provider_output.rb +185 -91
  60. data/lib/trinsic_api/models/get_provider_response.rb +238 -0
  61. data/lib/trinsic_api/models/google_wallet_input.rb +16 -5
  62. data/lib/trinsic_api/models/integration_step.rb +1 -1
  63. data/lib/trinsic_api/models/nigeria_nin_lookup2_provider_output.rb +392 -0
  64. data/lib/trinsic_api/models/norwegian_bank_id_provider_output.rb +300 -0
  65. data/lib/trinsic_api/models/one_id_provider_address.rb +266 -0
  66. data/lib/trinsic_api/models/one_id_provider_output.rb +278 -0
  67. data/lib/trinsic_api/models/output_freja_address.rb +255 -0
  68. data/lib/trinsic_api/models/output_freja_document.rb +255 -0
  69. data/lib/trinsic_api/models/philippines_digital_nid_provider_output.rb +114 -4
  70. data/lib/trinsic_api/models/philippines_physical_nid_provider_output.rb +92 -4
  71. data/lib/trinsic_api/models/provider_input.rb +34 -1
  72. data/lib/trinsic_api/models/provider_output.rb +127 -6
  73. data/lib/trinsic_api/models/raw18013_document_request.rb +276 -0
  74. data/lib/trinsic_api/models/raw18013_request_input.rb +259 -0
  75. data/lib/trinsic_api/models/recommend_providers_response.rb +33 -4
  76. data/lib/trinsic_api/models/samsung_wallet_input.rb +222 -0
  77. data/lib/trinsic_api/models/uk_evisa_lookup_input.rb +283 -0
  78. data/lib/trinsic_api/models/united_kingdom_evisa_provider_output.rb +333 -0
  79. data/lib/trinsic_api/models/verification_profile_response.rb +28 -1
  80. data/lib/trinsic_api/models/yoti_deeplink_provider_output.rb +344 -0
  81. data/lib/trinsic_api/version.rb +1 -1
  82. data/lib/trinsic_api.rb +27 -0
  83. data/spec/api/providers_api_spec.rb +12 -0
  84. data/spec/api/verification_profiles_api_spec.rb +2 -0
  85. data/spec/models/aadhaar_claims_spec.rb +120 -0
  86. data/spec/models/aadhaar_language_spec.rb +42 -0
  87. data/spec/models/aadhaar_localized_claims_spec.rb +102 -0
  88. data/spec/models/apple_wallet_input_spec.rb +6 -0
  89. data/spec/models/connect_id_address_spec.rb +60 -0
  90. data/spec/models/connect_id_age_verification_spec.rb +42 -0
  91. data/spec/models/connect_id_beneficiary_account_spec.rb +54 -0
  92. data/spec/models/connect_id_provider_output_spec.rb +96 -0
  93. data/spec/models/czech_moje_id_address_output_spec.rb +66 -0
  94. data/spec/models/czech_moje_id_provider_output_spec.rb +168 -0
  95. data/spec/models/digilocker_aadhaar_provider_output_spec.rb +72 -0
  96. data/spec/models/fayda_provider_output_spec.rb +18 -0
  97. data/spec/models/finnish_trust_network_provider_output_spec.rb +96 -0
  98. data/spec/models/france_identite_input_spec.rb +36 -0
  99. data/spec/models/france_identite_provider_output_spec.rb +36 -0
  100. data/spec/models/freja_indirect_provider_output_spec.rb +54 -0
  101. data/spec/models/freja_provider_output_spec.rb +88 -4
  102. data/spec/models/get_provider_response_spec.rb +36 -0
  103. data/spec/models/google_wallet_input_spec.rb +6 -0
  104. data/spec/models/nigeria_nin_lookup2_provider_output_spec.rb +102 -0
  105. data/spec/models/norwegian_bank_id_provider_output_spec.rb +78 -0
  106. data/spec/models/one_id_provider_address_spec.rb +60 -0
  107. data/spec/models/one_id_provider_output_spec.rb +66 -0
  108. data/spec/models/output_freja_address_spec.rb +54 -0
  109. data/spec/models/output_freja_document_spec.rb +54 -0
  110. data/spec/models/philippines_digital_nid_provider_output_spec.rb +60 -0
  111. data/spec/models/philippines_physical_nid_provider_output_spec.rb +48 -0
  112. data/spec/models/provider_input_spec.rb +18 -0
  113. data/spec/models/provider_output_spec.rb +66 -0
  114. data/spec/models/raw18013_document_request_spec.rb +42 -0
  115. data/spec/models/raw18013_request_input_spec.rb +36 -0
  116. data/spec/models/recommend_providers_response_spec.rb +6 -0
  117. data/spec/models/samsung_wallet_input_spec.rb +36 -0
  118. data/spec/models/uk_evisa_lookup_input_spec.rb +42 -0
  119. data/spec/models/united_kingdom_evisa_provider_output_spec.rb +96 -0
  120. data/spec/models/verification_profile_response_spec.rb +6 -0
  121. data/spec/models/yoti_deeplink_provider_output_spec.rb +102 -0
  122. metadata +230 -122
@@ -0,0 +1,239 @@
1
+ =begin
2
+ #Trinsic API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ # Exposed properties for the `france-identite` Provider which do not directly map to the normalized IdentityData model.
18
+ class FranceIdentiteProviderOutput
19
+ # The raw output of the 18013-7 exchange performed through France Identité.
20
+ attr_accessor :raw18013_output
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'raw18013_output' => :'raw18013Output'
26
+ }
27
+ end
28
+
29
+ # Returns attribute mapping this model knows about
30
+ def self.acceptable_attribute_map
31
+ attribute_map
32
+ end
33
+
34
+ # Returns all the JSON keys this model knows about
35
+ def self.acceptable_attributes
36
+ acceptable_attribute_map.values
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.openapi_types
41
+ {
42
+ :'raw18013_output' => :'MdlOutput'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::FranceIdentiteProviderOutput` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ acceptable_attribute_map = self.class.acceptable_attribute_map
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!acceptable_attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::FranceIdentiteProviderOutput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'raw18013_output')
69
+ self.raw18013_output = attributes[:'raw18013_output']
70
+ else
71
+ self.raw18013_output = nil
72
+ end
73
+ end
74
+
75
+ # Show invalid properties with the reasons. Usually used together with valid?
76
+ # @return Array for valid properties with the reasons
77
+ def list_invalid_properties
78
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
79
+ invalid_properties = Array.new
80
+ if @raw18013_output.nil?
81
+ invalid_properties.push('invalid value for "raw18013_output", raw18013_output cannot be nil.')
82
+ end
83
+
84
+ invalid_properties
85
+ end
86
+
87
+ # Check to see if the all the properties in the model are valid
88
+ # @return true if the model is valid
89
+ def valid?
90
+ warn '[DEPRECATED] the `valid?` method is obsolete'
91
+ return false if @raw18013_output.nil?
92
+ true
93
+ end
94
+
95
+ # Custom attribute writer method with validation
96
+ # @param [Object] raw18013_output Value to be assigned
97
+ def raw18013_output=(raw18013_output)
98
+ if raw18013_output.nil?
99
+ fail ArgumentError, 'raw18013_output cannot be nil'
100
+ end
101
+
102
+ @raw18013_output = raw18013_output
103
+ end
104
+
105
+ # Checks equality by comparing each attribute.
106
+ # @param [Object] Object to be compared
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ raw18013_output == o.raw18013_output
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [raw18013_output].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def self._deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = TrinsicApi.const_get(type)
187
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end
@@ -0,0 +1,320 @@
1
+ =begin
2
+ #Trinsic API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: v1
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.13.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TrinsicApi
17
+ # Exposed properties for the `a-freja-eid-login` Provider which do not directly map to the normalized IdentityData model.
18
+ class FrejaIndirectProviderOutput
19
+ # The first name of the verified individual
20
+ attr_accessor :first_name
21
+
22
+ # The last name of the verified individual
23
+ attr_accessor :last_name
24
+
25
+ # The value returned by Freja in the \"ssn\" field. 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.
26
+ attr_accessor :personal_number
27
+
28
+ # The 2-digit ISO country code of the country which issued the personal number.
29
+ attr_accessor :personal_number_country
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'first_name' => :'firstName',
35
+ :'last_name' => :'lastName',
36
+ :'personal_number' => :'personalNumber',
37
+ :'personal_number_country' => :'personalNumberCountry'
38
+ }
39
+ end
40
+
41
+ # Returns attribute mapping this model knows about
42
+ def self.acceptable_attribute_map
43
+ attribute_map
44
+ end
45
+
46
+ # Returns all the JSON keys this model knows about
47
+ def self.acceptable_attributes
48
+ acceptable_attribute_map.values
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.openapi_types
53
+ {
54
+ :'first_name' => :'String',
55
+ :'last_name' => :'String',
56
+ :'personal_number' => :'String',
57
+ :'personal_number_country' => :'String'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::FrejaIndirectProviderOutput` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::FrejaIndirectProviderOutput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'first_name')
84
+ self.first_name = attributes[:'first_name']
85
+ else
86
+ self.first_name = nil
87
+ end
88
+
89
+ if attributes.key?(:'last_name')
90
+ self.last_name = attributes[:'last_name']
91
+ else
92
+ self.last_name = nil
93
+ end
94
+
95
+ if attributes.key?(:'personal_number')
96
+ self.personal_number = attributes[:'personal_number']
97
+ else
98
+ self.personal_number = nil
99
+ end
100
+
101
+ if attributes.key?(:'personal_number_country')
102
+ self.personal_number_country = attributes[:'personal_number_country']
103
+ else
104
+ self.personal_number_country = nil
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
112
+ invalid_properties = Array.new
113
+ if @first_name.nil?
114
+ invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
115
+ end
116
+
117
+ if @last_name.nil?
118
+ invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
119
+ end
120
+
121
+ if @personal_number.nil?
122
+ invalid_properties.push('invalid value for "personal_number", personal_number cannot be nil.')
123
+ end
124
+
125
+ if @personal_number_country.nil?
126
+ invalid_properties.push('invalid value for "personal_number_country", personal_number_country cannot be nil.')
127
+ end
128
+
129
+ invalid_properties
130
+ end
131
+
132
+ # Check to see if the all the properties in the model are valid
133
+ # @return true if the model is valid
134
+ def valid?
135
+ warn '[DEPRECATED] the `valid?` method is obsolete'
136
+ return false if @first_name.nil?
137
+ return false if @last_name.nil?
138
+ return false if @personal_number.nil?
139
+ return false if @personal_number_country.nil?
140
+ true
141
+ end
142
+
143
+ # Custom attribute writer method with validation
144
+ # @param [Object] first_name Value to be assigned
145
+ def first_name=(first_name)
146
+ if first_name.nil?
147
+ fail ArgumentError, 'first_name cannot be nil'
148
+ end
149
+
150
+ @first_name = first_name
151
+ end
152
+
153
+ # Custom attribute writer method with validation
154
+ # @param [Object] last_name Value to be assigned
155
+ def last_name=(last_name)
156
+ if last_name.nil?
157
+ fail ArgumentError, 'last_name cannot be nil'
158
+ end
159
+
160
+ @last_name = last_name
161
+ end
162
+
163
+ # Custom attribute writer method with validation
164
+ # @param [Object] personal_number Value to be assigned
165
+ def personal_number=(personal_number)
166
+ if personal_number.nil?
167
+ fail ArgumentError, 'personal_number cannot be nil'
168
+ end
169
+
170
+ @personal_number = personal_number
171
+ end
172
+
173
+ # Custom attribute writer method with validation
174
+ # @param [Object] personal_number_country Value to be assigned
175
+ def personal_number_country=(personal_number_country)
176
+ if personal_number_country.nil?
177
+ fail ArgumentError, 'personal_number_country cannot be nil'
178
+ end
179
+
180
+ @personal_number_country = personal_number_country
181
+ end
182
+
183
+ # Checks equality by comparing each attribute.
184
+ # @param [Object] Object to be compared
185
+ def ==(o)
186
+ return true if self.equal?(o)
187
+ self.class == o.class &&
188
+ first_name == o.first_name &&
189
+ last_name == o.last_name &&
190
+ personal_number == o.personal_number &&
191
+ personal_number_country == o.personal_number_country
192
+ end
193
+
194
+ # @see the `==` method
195
+ # @param [Object] Object to be compared
196
+ def eql?(o)
197
+ self == o
198
+ end
199
+
200
+ # Calculates hash code according to all attributes.
201
+ # @return [Integer] Hash code
202
+ def hash
203
+ [first_name, last_name, personal_number, personal_number_country].hash
204
+ end
205
+
206
+ # Builds the object from hash
207
+ # @param [Hash] attributes Model attributes in the form of hash
208
+ # @return [Object] Returns the model itself
209
+ def self.build_from_hash(attributes)
210
+ return nil unless attributes.is_a?(Hash)
211
+ attributes = attributes.transform_keys(&:to_sym)
212
+ transformed_hash = {}
213
+ openapi_types.each_pair do |key, type|
214
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
215
+ transformed_hash["#{key}"] = nil
216
+ elsif type =~ /\AArray<(.*)>/i
217
+ # check to ensure the input is an array given that the attribute
218
+ # is documented as an array but the input is not
219
+ if attributes[attribute_map[key]].is_a?(Array)
220
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
221
+ end
222
+ elsif !attributes[attribute_map[key]].nil?
223
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
224
+ end
225
+ end
226
+ new(transformed_hash)
227
+ end
228
+
229
+ # Deserializes the data based on type
230
+ # @param string type Data type
231
+ # @param string value Value to be deserialized
232
+ # @return [Object] Deserialized data
233
+ def self._deserialize(type, value)
234
+ case type.to_sym
235
+ when :Time
236
+ Time.parse(value)
237
+ when :Date
238
+ Date.parse(value)
239
+ when :String
240
+ value.to_s
241
+ when :Integer
242
+ value.to_i
243
+ when :Float
244
+ value.to_f
245
+ when :Boolean
246
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
247
+ true
248
+ else
249
+ false
250
+ end
251
+ when :Object
252
+ # generic object (usually a Hash), return directly
253
+ value
254
+ when /\AArray<(?<inner_type>.+)>\z/
255
+ inner_type = Regexp.last_match[:inner_type]
256
+ value.map { |v| _deserialize(inner_type, v) }
257
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
258
+ k_type = Regexp.last_match[:k_type]
259
+ v_type = Regexp.last_match[:v_type]
260
+ {}.tap do |hash|
261
+ value.each do |k, v|
262
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
263
+ end
264
+ end
265
+ else # model
266
+ # models (e.g. Pet) or oneOf
267
+ klass = TrinsicApi.const_get(type)
268
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
269
+ end
270
+ end
271
+
272
+ # Returns the string representation of the object
273
+ # @return [String] String presentation of the object
274
+ def to_s
275
+ to_hash.to_s
276
+ end
277
+
278
+ # to_body is an alias to to_hash (backward compatibility)
279
+ # @return [Hash] Returns the object in the form of hash
280
+ def to_body
281
+ to_hash
282
+ end
283
+
284
+ # Returns the object in the form of hash
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_hash
287
+ hash = {}
288
+ self.class.attribute_map.each_pair do |attr, param|
289
+ value = self.send(attr)
290
+ if value.nil?
291
+ is_nullable = self.class.openapi_nullable.include?(attr)
292
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
293
+ end
294
+
295
+ hash[param] = _to_hash(value)
296
+ end
297
+ hash
298
+ end
299
+
300
+ # Outputs non-array value in the form of hash
301
+ # For object, use to_hash. Otherwise, just return the value
302
+ # @param [Object] value Any valid value
303
+ # @return [Hash] Returns the value in the form of hash
304
+ def _to_hash(value)
305
+ if value.is_a?(Array)
306
+ value.compact.map { |v| _to_hash(v) }
307
+ elsif value.is_a?(Hash)
308
+ {}.tap do |hash|
309
+ value.each { |k, v| hash[k] = _to_hash(v) }
310
+ end
311
+ elsif value.respond_to? :to_hash
312
+ value.to_hash
313
+ else
314
+ value
315
+ end
316
+ end
317
+
318
+ end
319
+
320
+ end