trinsic_api 2.0.0.pre.alpha3 → 2.0.0
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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/docs/AttachmentsApi.md +1 -1
- data/docs/BrazilDigitalCnhInput.md +2 -2
- data/docs/CreateAdvancedProviderSessionRequest.md +3 -3
- data/docs/CreateHostedProviderSessionResponse.md +4 -2
- data/docs/CreateWidgetSessionRequest.md +3 -3
- data/docs/CreateWidgetSessionResponse.md +4 -2
- data/docs/IdentityData.md +2 -0
- data/docs/IdinInput.md +18 -0
- data/docs/Language.md +15 -0
- data/docs/ListProviderContractsResponse.md +18 -0
- data/docs/MobileIdInput.md +22 -0
- data/docs/NetworkApi.md +71 -4
- data/docs/ProviderContract.md +46 -0
- data/docs/ProviderInfo.md +1 -3
- data/docs/ProviderInformation.md +3 -3
- data/docs/ProviderInput.md +24 -12
- data/docs/RecommendRequest.md +2 -10
- data/docs/RecommendationInfo.md +24 -0
- data/docs/ResultCollection.md +2 -2
- data/docs/Session.md +3 -3
- data/docs/SessionsApi.md +2 -2
- data/docs/SmartIdInput.md +18 -0
- data/docs/SpidInput.md +18 -0
- data/docs/StepRefreshInfo.md +1 -1
- data/docs/SubProviderMetadata.md +24 -0
- data/docs/TrinsicTestDatabaseLookupInput.md +24 -0
- data/docs/TrinsicTestSubProvidersInput.md +18 -0
- data/lib/trinsic_api/api/attachments_api.rb +2 -2
- data/lib/trinsic_api/api/network_api.rb +59 -2
- data/lib/trinsic_api/api/sessions_api.rb +4 -4
- data/lib/trinsic_api/models/brazil_digital_cnh_input.rb +2 -2
- data/lib/trinsic_api/models/create_advanced_provider_session_request.rb +3 -3
- data/lib/trinsic_api/models/create_hosted_provider_session_response.rb +29 -6
- data/lib/trinsic_api/models/create_widget_session_request.rb +10 -10
- data/lib/trinsic_api/models/create_widget_session_response.rb +29 -6
- data/lib/trinsic_api/models/identity_data.rb +11 -1
- data/lib/trinsic_api/models/{known_identity_data.rb → idin_input.rb} +12 -13
- data/lib/trinsic_api/models/integration_launch_method.rb +2 -2
- data/lib/trinsic_api/models/language.rb +42 -0
- data/lib/trinsic_api/models/list_provider_contracts_response.rb +224 -0
- data/lib/trinsic_api/models/mobile_id_input.rb +260 -0
- data/lib/trinsic_api/models/provider_contract.rb +482 -0
- data/lib/trinsic_api/models/provider_info.rb +4 -17
- data/lib/trinsic_api/models/provider_input.rb +82 -16
- data/lib/trinsic_api/models/recommend_request.rb +9 -59
- data/lib/trinsic_api/models/recommendation_info.rb +256 -0
- data/lib/trinsic_api/models/result_collection.rb +8 -2
- data/lib/trinsic_api/models/session.rb +3 -3
- data/lib/trinsic_api/models/smart_id_input.rb +216 -0
- data/lib/trinsic_api/models/spid_input.rb +216 -0
- data/lib/trinsic_api/models/step_refresh_info.rb +1 -1
- data/lib/trinsic_api/models/{known_address.rb → sub_provider_metadata.rb} +59 -72
- data/lib/trinsic_api/models/{known_person_data.rb → trinsic_test_database_lookup_input.rb} +22 -66
- data/lib/trinsic_api/models/trinsic_test_sub_providers_input.rb +216 -0
- data/lib/trinsic_api/version.rb +1 -1
- data/lib/trinsic_api.rb +11 -3
- data/spec/api/attachments_api_spec.rb +1 -1
- data/spec/api/network_api_spec.rb +12 -1
- data/spec/api/sessions_api_spec.rb +2 -2
- data/spec/models/create_hosted_provider_session_response_spec.rb +6 -0
- data/spec/models/create_widget_session_request_spec.rb +1 -1
- data/spec/models/create_widget_session_response_spec.rb +6 -0
- data/spec/models/identity_data_spec.rb +6 -0
- data/spec/models/{known_identity_data_spec.rb → idin_input_spec.rb} +7 -7
- data/spec/models/language_spec.rb +30 -0
- data/spec/models/list_provider_contracts_response_spec.rb +36 -0
- data/spec/models/mobile_id_input_spec.rb +48 -0
- data/spec/models/provider_contract_spec.rb +120 -0
- data/spec/models/provider_info_spec.rb +0 -6
- data/spec/models/provider_input_spec.rb +36 -0
- data/spec/models/recommend_request_spec.rb +1 -25
- data/spec/models/recommendation_info_spec.rb +54 -0
- data/spec/models/smart_id_input_spec.rb +36 -0
- data/spec/models/spid_input_spec.rb +36 -0
- data/spec/models/sub_provider_metadata_spec.rb +54 -0
- data/spec/models/{known_person_data_spec.rb → trinsic_test_database_lookup_input_spec.rb} +8 -32
- data/spec/models/trinsic_test_sub_providers_input_spec.rb +36 -0
- metadata +46 -14
- data/docs/KnownAddress.md +0 -32
- data/docs/KnownIdentityData.md +0 -18
- data/docs/KnownPersonData.md +0 -32
- data/spec/models/known_address_spec.rb +0 -78
@@ -0,0 +1,482 @@
|
|
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.8.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module TrinsicApi
|
17
|
+
class ProviderContract
|
18
|
+
# The ID of the Provider for this contract.
|
19
|
+
attr_accessor :id
|
20
|
+
|
21
|
+
# The Provider's Name as it appears in Trinsic's Dashboard and Widget
|
22
|
+
attr_accessor :name
|
23
|
+
|
24
|
+
# The Provider's description as it appears in Trinsic's Widget. This is flavor text, not a full, human-readable description of the provider.
|
25
|
+
attr_accessor :description
|
26
|
+
|
27
|
+
# A URL pointing to the Provider's logo on Trinsic's CDN. May be a PNG, JPG, or SVG image.
|
28
|
+
attr_accessor :logo_url
|
29
|
+
|
30
|
+
# Whether the Provider is available for use in your App. If `false`, you will need to contact Trinsic to enable this Provider for your App.
|
31
|
+
attr_accessor :available
|
32
|
+
|
33
|
+
# The geographies within the Regions the Provider is available.
|
34
|
+
attr_accessor :geography
|
35
|
+
|
36
|
+
# The regions within which the Provider is available.
|
37
|
+
attr_accessor :regions
|
38
|
+
|
39
|
+
# Relevant only to Advanced Provider Sessions. The `LaunchMethod` which must be supported to launch the Provider Session in Advanced Provider Sessions.
|
40
|
+
attr_accessor :launch_method
|
41
|
+
|
42
|
+
# Relevant only to Advanced Provider Sessions. The `CollectionMethod` which must be supported to launch the Provider Session in Advanced Provider Sessions.
|
43
|
+
attr_accessor :collection_method
|
44
|
+
|
45
|
+
# If `true`, then the results for this Provider may not be available immediately after the user is redirected back to your application. In this case, the `GetSessionResults` API must be called until results are available. This is an uncommon scenario, and typically only applies to Providers which use a biometric check or traditional document scan.
|
46
|
+
attr_accessor :results_may_be_delayed_after_redirect
|
47
|
+
|
48
|
+
# Relevant only to Advanced Provider Sessions. Whether the Provider requires the `RefreshStepContent` capability. For example, Samsung Wallet's deep links expire every 30 seconds, and must be refreshed periodically for a resilient user flow.
|
49
|
+
attr_accessor :has_refreshable_content
|
50
|
+
|
51
|
+
# Relevant to Hosted Provider Sessions and Advanced Provider Sessions. If `true`, this Provider requires provider-specific input on Session creation. If this input is not provided, Trinsic's Hosted UI will be invoked to collect the input from the user.
|
52
|
+
attr_accessor :requires_input
|
53
|
+
|
54
|
+
# Whether there exists a Trinsic-hosted UI for this Provider. This is `true` for any Provider which is not a simple, OIDC-like redirect flow.
|
55
|
+
attr_accessor :has_trinsic_interface
|
56
|
+
|
57
|
+
# Whether this Provider can be fully whitelabeled/OEMed through the Advanced Provider Sessions API. If `false`, the Provider may still be launched through Advanced Provider Sessions; however, it will necessarily require a Trinsic-hosted UI to function.
|
58
|
+
attr_accessor :supports_advanced_provider_sessions
|
59
|
+
|
60
|
+
# Metadata about the sub-providers which are available for this Provider. For example, Italy's SPID is a Provider which aggregates access to multiple sub-providers.
|
61
|
+
attr_accessor :sub_providers
|
62
|
+
|
63
|
+
class EnumAttributeValidator
|
64
|
+
attr_reader :datatype
|
65
|
+
attr_reader :allowable_values
|
66
|
+
|
67
|
+
def initialize(datatype, allowable_values)
|
68
|
+
@allowable_values = allowable_values.map do |value|
|
69
|
+
case datatype.to_s
|
70
|
+
when /Integer/i
|
71
|
+
value.to_i
|
72
|
+
when /Float/i
|
73
|
+
value.to_f
|
74
|
+
else
|
75
|
+
value
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def valid?(value)
|
81
|
+
!value || allowable_values.include?(value)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
86
|
+
def self.attribute_map
|
87
|
+
{
|
88
|
+
:'id' => :'id',
|
89
|
+
:'name' => :'name',
|
90
|
+
:'description' => :'description',
|
91
|
+
:'logo_url' => :'logoUrl',
|
92
|
+
:'available' => :'available',
|
93
|
+
:'geography' => :'geography',
|
94
|
+
:'regions' => :'regions',
|
95
|
+
:'launch_method' => :'launchMethod',
|
96
|
+
:'collection_method' => :'collectionMethod',
|
97
|
+
:'results_may_be_delayed_after_redirect' => :'resultsMayBeDelayedAfterRedirect',
|
98
|
+
:'has_refreshable_content' => :'hasRefreshableContent',
|
99
|
+
:'requires_input' => :'requiresInput',
|
100
|
+
:'has_trinsic_interface' => :'hasTrinsicInterface',
|
101
|
+
:'supports_advanced_provider_sessions' => :'supportsAdvancedProviderSessions',
|
102
|
+
:'sub_providers' => :'subProviders'
|
103
|
+
}
|
104
|
+
end
|
105
|
+
|
106
|
+
# Returns all the JSON keys this model knows about
|
107
|
+
def self.acceptable_attributes
|
108
|
+
attribute_map.values
|
109
|
+
end
|
110
|
+
|
111
|
+
# Attribute type mapping.
|
112
|
+
def self.openapi_types
|
113
|
+
{
|
114
|
+
:'id' => :'String',
|
115
|
+
:'name' => :'String',
|
116
|
+
:'description' => :'String',
|
117
|
+
:'logo_url' => :'String',
|
118
|
+
:'available' => :'Boolean',
|
119
|
+
:'geography' => :'Array<String>',
|
120
|
+
:'regions' => :'Array<String>',
|
121
|
+
:'launch_method' => :'IntegrationLaunchMethod',
|
122
|
+
:'collection_method' => :'ResultCollectionMethod',
|
123
|
+
:'results_may_be_delayed_after_redirect' => :'Boolean',
|
124
|
+
:'has_refreshable_content' => :'Boolean',
|
125
|
+
:'requires_input' => :'Boolean',
|
126
|
+
:'has_trinsic_interface' => :'Boolean',
|
127
|
+
:'supports_advanced_provider_sessions' => :'Boolean',
|
128
|
+
:'sub_providers' => :'Array<SubProviderMetadata>'
|
129
|
+
}
|
130
|
+
end
|
131
|
+
|
132
|
+
# List of attributes with nullable: true
|
133
|
+
def self.openapi_nullable
|
134
|
+
Set.new([
|
135
|
+
:'sub_providers'
|
136
|
+
])
|
137
|
+
end
|
138
|
+
|
139
|
+
# Initializes the object
|
140
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
141
|
+
def initialize(attributes = {})
|
142
|
+
if (!attributes.is_a?(Hash))
|
143
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::ProviderContract` initialize method"
|
144
|
+
end
|
145
|
+
|
146
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
147
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
148
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
149
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::ProviderContract`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
150
|
+
end
|
151
|
+
h[k.to_sym] = v
|
152
|
+
}
|
153
|
+
|
154
|
+
if attributes.key?(:'id')
|
155
|
+
self.id = attributes[:'id']
|
156
|
+
else
|
157
|
+
self.id = nil
|
158
|
+
end
|
159
|
+
|
160
|
+
if attributes.key?(:'name')
|
161
|
+
self.name = attributes[:'name']
|
162
|
+
else
|
163
|
+
self.name = nil
|
164
|
+
end
|
165
|
+
|
166
|
+
if attributes.key?(:'description')
|
167
|
+
self.description = attributes[:'description']
|
168
|
+
else
|
169
|
+
self.description = nil
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.key?(:'logo_url')
|
173
|
+
self.logo_url = attributes[:'logo_url']
|
174
|
+
else
|
175
|
+
self.logo_url = nil
|
176
|
+
end
|
177
|
+
|
178
|
+
if attributes.key?(:'available')
|
179
|
+
self.available = attributes[:'available']
|
180
|
+
else
|
181
|
+
self.available = nil
|
182
|
+
end
|
183
|
+
|
184
|
+
if attributes.key?(:'geography')
|
185
|
+
if (value = attributes[:'geography']).is_a?(Array)
|
186
|
+
self.geography = value
|
187
|
+
end
|
188
|
+
else
|
189
|
+
self.geography = nil
|
190
|
+
end
|
191
|
+
|
192
|
+
if attributes.key?(:'regions')
|
193
|
+
if (value = attributes[:'regions']).is_a?(Array)
|
194
|
+
self.regions = value
|
195
|
+
end
|
196
|
+
else
|
197
|
+
self.regions = nil
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.key?(:'launch_method')
|
201
|
+
self.launch_method = attributes[:'launch_method']
|
202
|
+
else
|
203
|
+
self.launch_method = nil
|
204
|
+
end
|
205
|
+
|
206
|
+
if attributes.key?(:'collection_method')
|
207
|
+
self.collection_method = attributes[:'collection_method']
|
208
|
+
else
|
209
|
+
self.collection_method = nil
|
210
|
+
end
|
211
|
+
|
212
|
+
if attributes.key?(:'results_may_be_delayed_after_redirect')
|
213
|
+
self.results_may_be_delayed_after_redirect = attributes[:'results_may_be_delayed_after_redirect']
|
214
|
+
else
|
215
|
+
self.results_may_be_delayed_after_redirect = nil
|
216
|
+
end
|
217
|
+
|
218
|
+
if attributes.key?(:'has_refreshable_content')
|
219
|
+
self.has_refreshable_content = attributes[:'has_refreshable_content']
|
220
|
+
else
|
221
|
+
self.has_refreshable_content = nil
|
222
|
+
end
|
223
|
+
|
224
|
+
if attributes.key?(:'requires_input')
|
225
|
+
self.requires_input = attributes[:'requires_input']
|
226
|
+
else
|
227
|
+
self.requires_input = nil
|
228
|
+
end
|
229
|
+
|
230
|
+
if attributes.key?(:'has_trinsic_interface')
|
231
|
+
self.has_trinsic_interface = attributes[:'has_trinsic_interface']
|
232
|
+
else
|
233
|
+
self.has_trinsic_interface = nil
|
234
|
+
end
|
235
|
+
|
236
|
+
if attributes.key?(:'supports_advanced_provider_sessions')
|
237
|
+
self.supports_advanced_provider_sessions = attributes[:'supports_advanced_provider_sessions']
|
238
|
+
else
|
239
|
+
self.supports_advanced_provider_sessions = nil
|
240
|
+
end
|
241
|
+
|
242
|
+
if attributes.key?(:'sub_providers')
|
243
|
+
if (value = attributes[:'sub_providers']).is_a?(Array)
|
244
|
+
self.sub_providers = value
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
250
|
+
# @return Array for valid properties with the reasons
|
251
|
+
def list_invalid_properties
|
252
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
253
|
+
invalid_properties = Array.new
|
254
|
+
if @id.nil?
|
255
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
256
|
+
end
|
257
|
+
|
258
|
+
if @name.nil?
|
259
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
260
|
+
end
|
261
|
+
|
262
|
+
if @description.nil?
|
263
|
+
invalid_properties.push('invalid value for "description", description cannot be nil.')
|
264
|
+
end
|
265
|
+
|
266
|
+
if @logo_url.nil?
|
267
|
+
invalid_properties.push('invalid value for "logo_url", logo_url cannot be nil.')
|
268
|
+
end
|
269
|
+
|
270
|
+
if @available.nil?
|
271
|
+
invalid_properties.push('invalid value for "available", available cannot be nil.')
|
272
|
+
end
|
273
|
+
|
274
|
+
if @geography.nil?
|
275
|
+
invalid_properties.push('invalid value for "geography", geography cannot be nil.')
|
276
|
+
end
|
277
|
+
|
278
|
+
if @regions.nil?
|
279
|
+
invalid_properties.push('invalid value for "regions", regions cannot be nil.')
|
280
|
+
end
|
281
|
+
|
282
|
+
if @launch_method.nil?
|
283
|
+
invalid_properties.push('invalid value for "launch_method", launch_method cannot be nil.')
|
284
|
+
end
|
285
|
+
|
286
|
+
if @collection_method.nil?
|
287
|
+
invalid_properties.push('invalid value for "collection_method", collection_method cannot be nil.')
|
288
|
+
end
|
289
|
+
|
290
|
+
if @results_may_be_delayed_after_redirect.nil?
|
291
|
+
invalid_properties.push('invalid value for "results_may_be_delayed_after_redirect", results_may_be_delayed_after_redirect cannot be nil.')
|
292
|
+
end
|
293
|
+
|
294
|
+
if @has_refreshable_content.nil?
|
295
|
+
invalid_properties.push('invalid value for "has_refreshable_content", has_refreshable_content cannot be nil.')
|
296
|
+
end
|
297
|
+
|
298
|
+
if @requires_input.nil?
|
299
|
+
invalid_properties.push('invalid value for "requires_input", requires_input cannot be nil.')
|
300
|
+
end
|
301
|
+
|
302
|
+
if @has_trinsic_interface.nil?
|
303
|
+
invalid_properties.push('invalid value for "has_trinsic_interface", has_trinsic_interface cannot be nil.')
|
304
|
+
end
|
305
|
+
|
306
|
+
if @supports_advanced_provider_sessions.nil?
|
307
|
+
invalid_properties.push('invalid value for "supports_advanced_provider_sessions", supports_advanced_provider_sessions cannot be nil.')
|
308
|
+
end
|
309
|
+
|
310
|
+
invalid_properties
|
311
|
+
end
|
312
|
+
|
313
|
+
# Check to see if the all the properties in the model are valid
|
314
|
+
# @return true if the model is valid
|
315
|
+
def valid?
|
316
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
317
|
+
return false if @id.nil?
|
318
|
+
return false if @name.nil?
|
319
|
+
return false if @description.nil?
|
320
|
+
return false if @logo_url.nil?
|
321
|
+
return false if @available.nil?
|
322
|
+
return false if @geography.nil?
|
323
|
+
return false if @regions.nil?
|
324
|
+
return false if @launch_method.nil?
|
325
|
+
return false if @collection_method.nil?
|
326
|
+
return false if @results_may_be_delayed_after_redirect.nil?
|
327
|
+
return false if @has_refreshable_content.nil?
|
328
|
+
return false if @requires_input.nil?
|
329
|
+
return false if @has_trinsic_interface.nil?
|
330
|
+
return false if @supports_advanced_provider_sessions.nil?
|
331
|
+
true
|
332
|
+
end
|
333
|
+
|
334
|
+
# Checks equality by comparing each attribute.
|
335
|
+
# @param [Object] Object to be compared
|
336
|
+
def ==(o)
|
337
|
+
return true if self.equal?(o)
|
338
|
+
self.class == o.class &&
|
339
|
+
id == o.id &&
|
340
|
+
name == o.name &&
|
341
|
+
description == o.description &&
|
342
|
+
logo_url == o.logo_url &&
|
343
|
+
available == o.available &&
|
344
|
+
geography == o.geography &&
|
345
|
+
regions == o.regions &&
|
346
|
+
launch_method == o.launch_method &&
|
347
|
+
collection_method == o.collection_method &&
|
348
|
+
results_may_be_delayed_after_redirect == o.results_may_be_delayed_after_redirect &&
|
349
|
+
has_refreshable_content == o.has_refreshable_content &&
|
350
|
+
requires_input == o.requires_input &&
|
351
|
+
has_trinsic_interface == o.has_trinsic_interface &&
|
352
|
+
supports_advanced_provider_sessions == o.supports_advanced_provider_sessions &&
|
353
|
+
sub_providers == o.sub_providers
|
354
|
+
end
|
355
|
+
|
356
|
+
# @see the `==` method
|
357
|
+
# @param [Object] Object to be compared
|
358
|
+
def eql?(o)
|
359
|
+
self == o
|
360
|
+
end
|
361
|
+
|
362
|
+
# Calculates hash code according to all attributes.
|
363
|
+
# @return [Integer] Hash code
|
364
|
+
def hash
|
365
|
+
[id, name, description, logo_url, available, geography, regions, launch_method, collection_method, results_may_be_delayed_after_redirect, has_refreshable_content, requires_input, has_trinsic_interface, supports_advanced_provider_sessions, sub_providers].hash
|
366
|
+
end
|
367
|
+
|
368
|
+
# Builds the object from hash
|
369
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
370
|
+
# @return [Object] Returns the model itself
|
371
|
+
def self.build_from_hash(attributes)
|
372
|
+
return nil unless attributes.is_a?(Hash)
|
373
|
+
attributes = attributes.transform_keys(&:to_sym)
|
374
|
+
transformed_hash = {}
|
375
|
+
openapi_types.each_pair do |key, type|
|
376
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
377
|
+
transformed_hash["#{key}"] = nil
|
378
|
+
elsif type =~ /\AArray<(.*)>/i
|
379
|
+
# check to ensure the input is an array given that the attribute
|
380
|
+
# is documented as an array but the input is not
|
381
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
382
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
383
|
+
end
|
384
|
+
elsif !attributes[attribute_map[key]].nil?
|
385
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
386
|
+
end
|
387
|
+
end
|
388
|
+
new(transformed_hash)
|
389
|
+
end
|
390
|
+
|
391
|
+
# Deserializes the data based on type
|
392
|
+
# @param string type Data type
|
393
|
+
# @param string value Value to be deserialized
|
394
|
+
# @return [Object] Deserialized data
|
395
|
+
def self._deserialize(type, value)
|
396
|
+
case type.to_sym
|
397
|
+
when :Time
|
398
|
+
Time.parse(value)
|
399
|
+
when :Date
|
400
|
+
Date.parse(value)
|
401
|
+
when :String
|
402
|
+
value.to_s
|
403
|
+
when :Integer
|
404
|
+
value.to_i
|
405
|
+
when :Float
|
406
|
+
value.to_f
|
407
|
+
when :Boolean
|
408
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
409
|
+
true
|
410
|
+
else
|
411
|
+
false
|
412
|
+
end
|
413
|
+
when :Object
|
414
|
+
# generic object (usually a Hash), return directly
|
415
|
+
value
|
416
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
417
|
+
inner_type = Regexp.last_match[:inner_type]
|
418
|
+
value.map { |v| _deserialize(inner_type, v) }
|
419
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
420
|
+
k_type = Regexp.last_match[:k_type]
|
421
|
+
v_type = Regexp.last_match[:v_type]
|
422
|
+
{}.tap do |hash|
|
423
|
+
value.each do |k, v|
|
424
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
425
|
+
end
|
426
|
+
end
|
427
|
+
else # model
|
428
|
+
# models (e.g. Pet) or oneOf
|
429
|
+
klass = TrinsicApi.const_get(type)
|
430
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
431
|
+
end
|
432
|
+
end
|
433
|
+
|
434
|
+
# Returns the string representation of the object
|
435
|
+
# @return [String] String presentation of the object
|
436
|
+
def to_s
|
437
|
+
to_hash.to_s
|
438
|
+
end
|
439
|
+
|
440
|
+
# to_body is an alias to to_hash (backward compatibility)
|
441
|
+
# @return [Hash] Returns the object in the form of hash
|
442
|
+
def to_body
|
443
|
+
to_hash
|
444
|
+
end
|
445
|
+
|
446
|
+
# Returns the object in the form of hash
|
447
|
+
# @return [Hash] Returns the object in the form of hash
|
448
|
+
def to_hash
|
449
|
+
hash = {}
|
450
|
+
self.class.attribute_map.each_pair do |attr, param|
|
451
|
+
value = self.send(attr)
|
452
|
+
if value.nil?
|
453
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
454
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
455
|
+
end
|
456
|
+
|
457
|
+
hash[param] = _to_hash(value)
|
458
|
+
end
|
459
|
+
hash
|
460
|
+
end
|
461
|
+
|
462
|
+
# Outputs non-array value in the form of hash
|
463
|
+
# For object, use to_hash. Otherwise, just return the value
|
464
|
+
# @param [Object] value Any valid value
|
465
|
+
# @return [Hash] Returns the value in the form of hash
|
466
|
+
def _to_hash(value)
|
467
|
+
if value.is_a?(Array)
|
468
|
+
value.compact.map { |v| _to_hash(v) }
|
469
|
+
elsif value.is_a?(Hash)
|
470
|
+
{}.tap do |hash|
|
471
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
472
|
+
end
|
473
|
+
elsif value.respond_to? :to_hash
|
474
|
+
value.to_hash
|
475
|
+
else
|
476
|
+
value
|
477
|
+
end
|
478
|
+
end
|
479
|
+
|
480
|
+
end
|
481
|
+
|
482
|
+
end
|
@@ -25,16 +25,12 @@ module TrinsicApi
|
|
25
25
|
# A URL pointing to the provider's logo
|
26
26
|
attr_accessor :logo_url
|
27
27
|
|
28
|
-
# List of child provider id's where the provider allows deep-launching of a specific provider.
|
29
|
-
attr_accessor :child_provider_ids
|
30
|
-
|
31
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
32
29
|
def self.attribute_map
|
33
30
|
{
|
34
31
|
:'id' => :'id',
|
35
32
|
:'name' => :'name',
|
36
|
-
:'logo_url' => :'logoUrl'
|
37
|
-
:'child_provider_ids' => :'childProviderIds'
|
33
|
+
:'logo_url' => :'logoUrl'
|
38
34
|
}
|
39
35
|
end
|
40
36
|
|
@@ -48,15 +44,13 @@ module TrinsicApi
|
|
48
44
|
{
|
49
45
|
:'id' => :'String',
|
50
46
|
:'name' => :'String',
|
51
|
-
:'logo_url' => :'String'
|
52
|
-
:'child_provider_ids' => :'Array<String>'
|
47
|
+
:'logo_url' => :'String'
|
53
48
|
}
|
54
49
|
end
|
55
50
|
|
56
51
|
# List of attributes with nullable: true
|
57
52
|
def self.openapi_nullable
|
58
53
|
Set.new([
|
59
|
-
:'child_provider_ids'
|
60
54
|
])
|
61
55
|
end
|
62
56
|
|
@@ -92,12 +86,6 @@ module TrinsicApi
|
|
92
86
|
else
|
93
87
|
self.logo_url = nil
|
94
88
|
end
|
95
|
-
|
96
|
-
if attributes.key?(:'child_provider_ids')
|
97
|
-
if (value = attributes[:'child_provider_ids']).is_a?(Array)
|
98
|
-
self.child_provider_ids = value
|
99
|
-
end
|
100
|
-
end
|
101
89
|
end
|
102
90
|
|
103
91
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -137,8 +125,7 @@ module TrinsicApi
|
|
137
125
|
self.class == o.class &&
|
138
126
|
id == o.id &&
|
139
127
|
name == o.name &&
|
140
|
-
logo_url == o.logo_url
|
141
|
-
child_provider_ids == o.child_provider_ids
|
128
|
+
logo_url == o.logo_url
|
142
129
|
end
|
143
130
|
|
144
131
|
# @see the `==` method
|
@@ -150,7 +137,7 @@ module TrinsicApi
|
|
150
137
|
# Calculates hash code according to all attributes.
|
151
138
|
# @return [Integer] Hash code
|
152
139
|
def hash
|
153
|
-
[id, name, logo_url
|
140
|
+
[id, name, logo_url].hash
|
154
141
|
end
|
155
142
|
|
156
143
|
# Builds the object from hash
|