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,465 @@
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 `czech-moje-id` Provider which do not directly map to the normalized IdentityData model.
18
+ class CzechMojeIdProviderOutput
19
+ # The subject identifier (sub) of the verified individual's MojeID account. This is a unique identifier that represents the user within the MojeID system.
20
+ attr_accessor :subject_identifier
21
+
22
+ # The individual's full name.
23
+ attr_accessor :name
24
+
25
+ # The individual's given (first) name.
26
+ attr_accessor :given_name
27
+
28
+ # The individual's family (last) name.
29
+ attr_accessor :family_name
30
+
31
+ # The individual's nickname.
32
+ attr_accessor :nickname
33
+
34
+ # The individual's email address.
35
+ attr_accessor :email
36
+
37
+ # Whether the individual's email address has been verified by MojeID. (Verification email and link clicked)
38
+ attr_accessor :email_verified
39
+
40
+ # The individual's phone number.
41
+ attr_accessor :phone_number
42
+
43
+ # An individual's phone number has been verified by MojeID. (SMS verification)
44
+ attr_accessor :phone_number_verified
45
+
46
+ # The individual's date of birth. Formatted as an ISO 8601 Date.
47
+ attr_accessor :date_of_birth
48
+
49
+ # The individual's gender as reported by MojeID.
50
+ attr_accessor :gender
51
+
52
+ # The individual's Czech ID card number.
53
+ attr_accessor :id_card_number
54
+
55
+ # The individual's Czech passport number.
56
+ attr_accessor :passport_number
57
+
58
+ # The individual's Ministry of Labour and Social Affairs identifier (Czech social security equivalent).
59
+ attr_accessor :social_security_number
60
+
61
+ # The individual is an adult (18 years or older).
62
+ attr_accessor :is_adult
63
+
64
+ # The MojeID account has been validated. A validated account indicates the individual's identity has been verified to a higher level of assurance within the MojeID system.
65
+ attr_accessor :account_validated
66
+
67
+ # The individual's or organization's Czech Registration ID (ICO), the Czech company registration number.
68
+ attr_accessor :company_registration_number
69
+
70
+ # The individual's or organization's Danove Identifikacni Cislo (DIC), the Czech tax identification number.
71
+ attr_accessor :tax_identification_number
72
+
73
+ # The individual's identity has been verified through the Czech National Identity Authority (NIA). NIA verification indicates a higher level of identity assurance, typically involving government-issued credentials verified through the Czech eGovernment infrastructure.
74
+ attr_accessor :nia_verified
75
+
76
+ # Unique login transaction identifier
77
+ attr_accessor :transaction_id
78
+
79
+ # The individual's home (default) address, from the `mojeid_address_def` claim.
80
+ attr_accessor :home_address
81
+
82
+ # The individual's billing address, from the `mojeid_address_bill` claim.
83
+ attr_accessor :billing_address
84
+
85
+ # The individual's shipping address, from the `mojeid_address_ship` claim.
86
+ attr_accessor :shipping_address
87
+
88
+ # Attribute mapping from ruby-style variable name to JSON key.
89
+ def self.attribute_map
90
+ {
91
+ :'subject_identifier' => :'subjectIdentifier',
92
+ :'name' => :'name',
93
+ :'given_name' => :'givenName',
94
+ :'family_name' => :'familyName',
95
+ :'nickname' => :'nickname',
96
+ :'email' => :'email',
97
+ :'email_verified' => :'emailVerified',
98
+ :'phone_number' => :'phoneNumber',
99
+ :'phone_number_verified' => :'phoneNumberVerified',
100
+ :'date_of_birth' => :'dateOfBirth',
101
+ :'gender' => :'gender',
102
+ :'id_card_number' => :'idCardNumber',
103
+ :'passport_number' => :'passportNumber',
104
+ :'social_security_number' => :'socialSecurityNumber',
105
+ :'is_adult' => :'isAdult',
106
+ :'account_validated' => :'accountValidated',
107
+ :'company_registration_number' => :'companyRegistrationNumber',
108
+ :'tax_identification_number' => :'taxIdentificationNumber',
109
+ :'nia_verified' => :'niaVerified',
110
+ :'transaction_id' => :'transactionId',
111
+ :'home_address' => :'homeAddress',
112
+ :'billing_address' => :'billingAddress',
113
+ :'shipping_address' => :'shippingAddress'
114
+ }
115
+ end
116
+
117
+ # Returns attribute mapping this model knows about
118
+ def self.acceptable_attribute_map
119
+ attribute_map
120
+ end
121
+
122
+ # Returns all the JSON keys this model knows about
123
+ def self.acceptable_attributes
124
+ acceptable_attribute_map.values
125
+ end
126
+
127
+ # Attribute type mapping.
128
+ def self.openapi_types
129
+ {
130
+ :'subject_identifier' => :'String',
131
+ :'name' => :'String',
132
+ :'given_name' => :'String',
133
+ :'family_name' => :'String',
134
+ :'nickname' => :'String',
135
+ :'email' => :'String',
136
+ :'email_verified' => :'Boolean',
137
+ :'phone_number' => :'String',
138
+ :'phone_number_verified' => :'Boolean',
139
+ :'date_of_birth' => :'Date',
140
+ :'gender' => :'String',
141
+ :'id_card_number' => :'String',
142
+ :'passport_number' => :'String',
143
+ :'social_security_number' => :'String',
144
+ :'is_adult' => :'Boolean',
145
+ :'account_validated' => :'Boolean',
146
+ :'company_registration_number' => :'String',
147
+ :'tax_identification_number' => :'String',
148
+ :'nia_verified' => :'Boolean',
149
+ :'transaction_id' => :'String',
150
+ :'home_address' => :'CzechMojeIdAddressOutput',
151
+ :'billing_address' => :'CzechMojeIdAddressOutput',
152
+ :'shipping_address' => :'CzechMojeIdAddressOutput'
153
+ }
154
+ end
155
+
156
+ # List of attributes with nullable: true
157
+ def self.openapi_nullable
158
+ Set.new([
159
+ :'subject_identifier',
160
+ :'name',
161
+ :'given_name',
162
+ :'family_name',
163
+ :'nickname',
164
+ :'email',
165
+ :'email_verified',
166
+ :'phone_number',
167
+ :'phone_number_verified',
168
+ :'date_of_birth',
169
+ :'gender',
170
+ :'id_card_number',
171
+ :'passport_number',
172
+ :'social_security_number',
173
+ :'is_adult',
174
+ :'account_validated',
175
+ :'company_registration_number',
176
+ :'tax_identification_number',
177
+ :'nia_verified',
178
+ :'transaction_id',
179
+ :'home_address',
180
+ :'billing_address',
181
+ :'shipping_address'
182
+ ])
183
+ end
184
+
185
+ # Initializes the object
186
+ # @param [Hash] attributes Model attributes in the form of hash
187
+ def initialize(attributes = {})
188
+ if (!attributes.is_a?(Hash))
189
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::CzechMojeIdProviderOutput` initialize method"
190
+ end
191
+
192
+ # check to see if the attribute exists and convert string to symbol for hash key
193
+ acceptable_attribute_map = self.class.acceptable_attribute_map
194
+ attributes = attributes.each_with_object({}) { |(k, v), h|
195
+ if (!acceptable_attribute_map.key?(k.to_sym))
196
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::CzechMojeIdProviderOutput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
197
+ end
198
+ h[k.to_sym] = v
199
+ }
200
+
201
+ if attributes.key?(:'subject_identifier')
202
+ self.subject_identifier = attributes[:'subject_identifier']
203
+ end
204
+
205
+ if attributes.key?(:'name')
206
+ self.name = attributes[:'name']
207
+ end
208
+
209
+ if attributes.key?(:'given_name')
210
+ self.given_name = attributes[:'given_name']
211
+ end
212
+
213
+ if attributes.key?(:'family_name')
214
+ self.family_name = attributes[:'family_name']
215
+ end
216
+
217
+ if attributes.key?(:'nickname')
218
+ self.nickname = attributes[:'nickname']
219
+ end
220
+
221
+ if attributes.key?(:'email')
222
+ self.email = attributes[:'email']
223
+ end
224
+
225
+ if attributes.key?(:'email_verified')
226
+ self.email_verified = attributes[:'email_verified']
227
+ end
228
+
229
+ if attributes.key?(:'phone_number')
230
+ self.phone_number = attributes[:'phone_number']
231
+ end
232
+
233
+ if attributes.key?(:'phone_number_verified')
234
+ self.phone_number_verified = attributes[:'phone_number_verified']
235
+ end
236
+
237
+ if attributes.key?(:'date_of_birth')
238
+ self.date_of_birth = attributes[:'date_of_birth']
239
+ end
240
+
241
+ if attributes.key?(:'gender')
242
+ self.gender = attributes[:'gender']
243
+ end
244
+
245
+ if attributes.key?(:'id_card_number')
246
+ self.id_card_number = attributes[:'id_card_number']
247
+ end
248
+
249
+ if attributes.key?(:'passport_number')
250
+ self.passport_number = attributes[:'passport_number']
251
+ end
252
+
253
+ if attributes.key?(:'social_security_number')
254
+ self.social_security_number = attributes[:'social_security_number']
255
+ end
256
+
257
+ if attributes.key?(:'is_adult')
258
+ self.is_adult = attributes[:'is_adult']
259
+ end
260
+
261
+ if attributes.key?(:'account_validated')
262
+ self.account_validated = attributes[:'account_validated']
263
+ end
264
+
265
+ if attributes.key?(:'company_registration_number')
266
+ self.company_registration_number = attributes[:'company_registration_number']
267
+ end
268
+
269
+ if attributes.key?(:'tax_identification_number')
270
+ self.tax_identification_number = attributes[:'tax_identification_number']
271
+ end
272
+
273
+ if attributes.key?(:'nia_verified')
274
+ self.nia_verified = attributes[:'nia_verified']
275
+ end
276
+
277
+ if attributes.key?(:'transaction_id')
278
+ self.transaction_id = attributes[:'transaction_id']
279
+ end
280
+
281
+ if attributes.key?(:'home_address')
282
+ self.home_address = attributes[:'home_address']
283
+ end
284
+
285
+ if attributes.key?(:'billing_address')
286
+ self.billing_address = attributes[:'billing_address']
287
+ end
288
+
289
+ if attributes.key?(:'shipping_address')
290
+ self.shipping_address = attributes[:'shipping_address']
291
+ end
292
+ end
293
+
294
+ # Show invalid properties with the reasons. Usually used together with valid?
295
+ # @return Array for valid properties with the reasons
296
+ def list_invalid_properties
297
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
298
+ invalid_properties = Array.new
299
+ invalid_properties
300
+ end
301
+
302
+ # Check to see if the all the properties in the model are valid
303
+ # @return true if the model is valid
304
+ def valid?
305
+ warn '[DEPRECATED] the `valid?` method is obsolete'
306
+ true
307
+ end
308
+
309
+ # Checks equality by comparing each attribute.
310
+ # @param [Object] Object to be compared
311
+ def ==(o)
312
+ return true if self.equal?(o)
313
+ self.class == o.class &&
314
+ subject_identifier == o.subject_identifier &&
315
+ name == o.name &&
316
+ given_name == o.given_name &&
317
+ family_name == o.family_name &&
318
+ nickname == o.nickname &&
319
+ email == o.email &&
320
+ email_verified == o.email_verified &&
321
+ phone_number == o.phone_number &&
322
+ phone_number_verified == o.phone_number_verified &&
323
+ date_of_birth == o.date_of_birth &&
324
+ gender == o.gender &&
325
+ id_card_number == o.id_card_number &&
326
+ passport_number == o.passport_number &&
327
+ social_security_number == o.social_security_number &&
328
+ is_adult == o.is_adult &&
329
+ account_validated == o.account_validated &&
330
+ company_registration_number == o.company_registration_number &&
331
+ tax_identification_number == o.tax_identification_number &&
332
+ nia_verified == o.nia_verified &&
333
+ transaction_id == o.transaction_id &&
334
+ home_address == o.home_address &&
335
+ billing_address == o.billing_address &&
336
+ shipping_address == o.shipping_address
337
+ end
338
+
339
+ # @see the `==` method
340
+ # @param [Object] Object to be compared
341
+ def eql?(o)
342
+ self == o
343
+ end
344
+
345
+ # Calculates hash code according to all attributes.
346
+ # @return [Integer] Hash code
347
+ def hash
348
+ [subject_identifier, name, given_name, family_name, nickname, email, email_verified, phone_number, phone_number_verified, date_of_birth, gender, id_card_number, passport_number, social_security_number, is_adult, account_validated, company_registration_number, tax_identification_number, nia_verified, transaction_id, home_address, billing_address, shipping_address].hash
349
+ end
350
+
351
+ # Builds the object from hash
352
+ # @param [Hash] attributes Model attributes in the form of hash
353
+ # @return [Object] Returns the model itself
354
+ def self.build_from_hash(attributes)
355
+ return nil unless attributes.is_a?(Hash)
356
+ attributes = attributes.transform_keys(&:to_sym)
357
+ transformed_hash = {}
358
+ openapi_types.each_pair do |key, type|
359
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
360
+ transformed_hash["#{key}"] = nil
361
+ elsif type =~ /\AArray<(.*)>/i
362
+ # check to ensure the input is an array given that the attribute
363
+ # is documented as an array but the input is not
364
+ if attributes[attribute_map[key]].is_a?(Array)
365
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
366
+ end
367
+ elsif !attributes[attribute_map[key]].nil?
368
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
369
+ end
370
+ end
371
+ new(transformed_hash)
372
+ end
373
+
374
+ # Deserializes the data based on type
375
+ # @param string type Data type
376
+ # @param string value Value to be deserialized
377
+ # @return [Object] Deserialized data
378
+ def self._deserialize(type, value)
379
+ case type.to_sym
380
+ when :Time
381
+ Time.parse(value)
382
+ when :Date
383
+ Date.parse(value)
384
+ when :String
385
+ value.to_s
386
+ when :Integer
387
+ value.to_i
388
+ when :Float
389
+ value.to_f
390
+ when :Boolean
391
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
392
+ true
393
+ else
394
+ false
395
+ end
396
+ when :Object
397
+ # generic object (usually a Hash), return directly
398
+ value
399
+ when /\AArray<(?<inner_type>.+)>\z/
400
+ inner_type = Regexp.last_match[:inner_type]
401
+ value.map { |v| _deserialize(inner_type, v) }
402
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
403
+ k_type = Regexp.last_match[:k_type]
404
+ v_type = Regexp.last_match[:v_type]
405
+ {}.tap do |hash|
406
+ value.each do |k, v|
407
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
408
+ end
409
+ end
410
+ else # model
411
+ # models (e.g. Pet) or oneOf
412
+ klass = TrinsicApi.const_get(type)
413
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
414
+ end
415
+ end
416
+
417
+ # Returns the string representation of the object
418
+ # @return [String] String presentation of the object
419
+ def to_s
420
+ to_hash.to_s
421
+ end
422
+
423
+ # to_body is an alias to to_hash (backward compatibility)
424
+ # @return [Hash] Returns the object in the form of hash
425
+ def to_body
426
+ to_hash
427
+ end
428
+
429
+ # Returns the object in the form of hash
430
+ # @return [Hash] Returns the object in the form of hash
431
+ def to_hash
432
+ hash = {}
433
+ self.class.attribute_map.each_pair do |attr, param|
434
+ value = self.send(attr)
435
+ if value.nil?
436
+ is_nullable = self.class.openapi_nullable.include?(attr)
437
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
438
+ end
439
+
440
+ hash[param] = _to_hash(value)
441
+ end
442
+ hash
443
+ end
444
+
445
+ # Outputs non-array value in the form of hash
446
+ # For object, use to_hash. Otherwise, just return the value
447
+ # @param [Object] value Any valid value
448
+ # @return [Hash] Returns the value in the form of hash
449
+ def _to_hash(value)
450
+ if value.is_a?(Array)
451
+ value.compact.map { |v| _to_hash(v) }
452
+ elsif value.is_a?(Hash)
453
+ {}.tap do |hash|
454
+ value.each { |k, v| hash[k] = _to_hash(v) }
455
+ end
456
+ elsif value.respond_to? :to_hash
457
+ value.to_hash
458
+ else
459
+ value
460
+ end
461
+ end
462
+
463
+ end
464
+
465
+ end