trinsic_api 2.2.0 → 2.3.0.pre.alpha2
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/docs/AddRedirectUriResponse.md +18 -0
- data/docs/AttachmentAccessKeys.md +2 -0
- data/docs/ContractField.md +2 -0
- data/docs/ContractIdentifierField.md +22 -0
- data/docs/CreateHostedProviderSessionResponse.md +1 -1
- data/docs/CreateVerificationProfileResponse.md +18 -0
- data/docs/CreateWidgetSessionResponse.md +1 -1
- data/docs/EnvironmentRedirectUrisAddRequest.md +18 -0
- data/docs/EnvironmentRedirectUrisApi.md +222 -0
- data/docs/FaydaProviderOutput.md +18 -0
- data/docs/Identifier.md +22 -0
- data/docs/IdentityData.md +5 -1
- data/docs/IntegrationStep.md +1 -1
- data/docs/KenyaNidBiometric2Input.md +22 -0
- data/docs/KenyaNidInput.md +1 -1
- data/docs/KenyaNidLookup2Input.md +18 -0
- data/docs/KenyaNidMatch2Input.md +28 -0
- data/docs/ListEnvironmentRedirectUrisResponse.md +20 -0
- data/docs/ListVerificationProfilesResponse.md +20 -0
- data/docs/MexicoCurpProviderOutput.md +18 -0
- data/docs/NigeriaNinInput.md +1 -1
- data/docs/PhilippinesDigitalNidProviderOutput.md +18 -0
- data/docs/PhilippinesPhysicalNidProviderOutput.md +18 -0
- data/docs/ProviderContract.md +2 -0
- data/docs/ProviderInput.md +8 -0
- data/docs/ProviderOutput.md +26 -0
- data/docs/RedirectUriResponse.md +20 -0
- data/docs/SexV1.md +15 -0
- data/docs/SouthAfricaNidInput.md +1 -1
- data/docs/SouthAfricaNidLookup2Input.md +18 -0
- data/docs/SpidBillingInformation.md +22 -0
- data/docs/SpidInput.md +3 -1
- data/docs/SpidProviderOutput.md +44 -0
- data/docs/VerificationProfileResponse.md +28 -0
- data/docs/VerificationProfilesApi.md +231 -0
- data/lib/trinsic_api/api/environment_redirect_uris_api.rb +228 -0
- data/lib/trinsic_api/api/verification_profiles_api.rb +273 -0
- data/lib/trinsic_api/models/add_redirect_uri_response.rb +237 -0
- data/lib/trinsic_api/models/attachment_access_keys.rb +11 -1
- data/lib/trinsic_api/models/contract_field.rb +28 -1
- data/lib/trinsic_api/models/contract_identifier_field.rb +315 -0
- data/lib/trinsic_api/models/create_verification_profile_response.rb +238 -0
- data/lib/trinsic_api/models/environment_redirect_uris_add_request.rb +237 -0
- data/lib/trinsic_api/models/fayda_provider_output.rb +222 -0
- data/lib/trinsic_api/models/identifier.rb +289 -0
- data/lib/trinsic_api/models/identity_data.rb +43 -5
- data/lib/trinsic_api/models/kenya_nid_biometric2_input.rb +246 -0
- data/lib/trinsic_api/models/kenya_nid_input.rb +1 -1
- data/lib/trinsic_api/models/kenya_nid_lookup2_input.rb +222 -0
- data/lib/trinsic_api/models/kenya_nid_match2_input.rb +299 -0
- data/lib/trinsic_api/models/list_environment_redirect_uris_response.rb +268 -0
- data/lib/trinsic_api/models/list_verification_profiles_response.rb +266 -0
- data/lib/trinsic_api/models/mexico_curp_provider_output.rb +222 -0
- data/lib/trinsic_api/models/nigeria_nin_input.rb +1 -1
- data/lib/trinsic_api/models/philippines_digital_nid_provider_output.rb +238 -0
- data/lib/trinsic_api/models/philippines_physical_nid_provider_output.rb +238 -0
- data/lib/trinsic_api/models/provider_contract.rb +14 -1
- data/lib/trinsic_api/models/provider_input.rb +45 -1
- data/lib/trinsic_api/models/provider_output.rb +261 -0
- data/lib/trinsic_api/models/redirect_uri_response.rb +263 -0
- data/lib/trinsic_api/models/sex_v1.rb +42 -0
- data/lib/trinsic_api/models/south_africa_nid_input.rb +1 -1
- data/lib/trinsic_api/models/south_africa_nid_lookup2_input.rb +222 -0
- data/lib/trinsic_api/models/spid_billing_information.rb +293 -0
- data/lib/trinsic_api/models/spid_input.rb +16 -5
- data/lib/trinsic_api/models/spid_provider_output.rb +397 -0
- data/lib/trinsic_api/models/verification_profile_response.rb +375 -0
- data/lib/trinsic_api/version.rb +1 -1
- data/lib/trinsic_api.rb +23 -0
- data/spec/api/environment_redirect_uris_api_spec.rb +72 -0
- data/spec/api/verification_profiles_api_spec.rb +76 -0
- data/spec/models/add_redirect_uri_response_spec.rb +36 -0
- data/spec/models/attachment_access_keys_spec.rb +6 -0
- data/spec/models/contract_field_spec.rb +6 -0
- data/spec/models/contract_identifier_field_spec.rb +48 -0
- data/spec/models/create_verification_profile_response_spec.rb +36 -0
- data/spec/models/environment_redirect_uris_add_request_spec.rb +36 -0
- data/spec/models/fayda_provider_output_spec.rb +36 -0
- data/spec/models/identifier_spec.rb +48 -0
- data/spec/models/identity_data_spec.rb +12 -0
- data/spec/models/kenya_nid_biometric2_input_spec.rb +48 -0
- data/spec/models/kenya_nid_lookup2_input_spec.rb +36 -0
- data/spec/models/kenya_nid_match2_input_spec.rb +66 -0
- data/spec/models/list_environment_redirect_uris_response_spec.rb +42 -0
- data/spec/models/list_verification_profiles_response_spec.rb +42 -0
- data/spec/models/mexico_curp_provider_output_spec.rb +36 -0
- data/spec/models/philippines_digital_nid_provider_output_spec.rb +36 -0
- data/spec/models/philippines_physical_nid_provider_output_spec.rb +36 -0
- data/spec/models/provider_contract_spec.rb +6 -0
- data/spec/models/provider_input_spec.rb +24 -0
- data/spec/models/provider_output_spec.rb +60 -0
- data/spec/models/redirect_uri_response_spec.rb +42 -0
- data/spec/models/sex_v1_spec.rb +30 -0
- data/spec/models/south_africa_nid_lookup2_input_spec.rb +36 -0
- data/spec/models/spid_billing_information_spec.rb +48 -0
- data/spec/models/spid_input_spec.rb +6 -0
- data/spec/models/spid_provider_output_spec.rb +114 -0
- data/spec/models/verification_profile_response_spec.rb +66 -0
- metadata +94 -2
|
@@ -0,0 +1,397 @@
|
|
|
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
|
+
class SpidProviderOutput
|
|
18
|
+
# Information about the billable status of this SPID Verification. Present only if your account has period-based billing enabled for SPID. Contact Trinsic to enable this.
|
|
19
|
+
attr_accessor :billing_information
|
|
20
|
+
|
|
21
|
+
# The SPID Entity ID of the Identity Provider which issued the SPID identity. This is an HTTPS URI which uniquely identifies the IdP within the SPID federation. A normalized / simplified representation of this value is present in the `originatingSubProviderId` field in Trinsic's normalized data model.
|
|
22
|
+
attr_accessor :identity_provider_entity_id
|
|
23
|
+
|
|
24
|
+
# The identifier of the user's SPID credential. This uniquely identifies the credential within the SPID federation.
|
|
25
|
+
attr_accessor :spid_code
|
|
26
|
+
|
|
27
|
+
# Expiration date of the user's SPID credential. This is not the same as the expiration date of the underlying identity document (such as a passport) which was used to create the SPID identity.
|
|
28
|
+
attr_accessor :spid_credential_expiration_date
|
|
29
|
+
|
|
30
|
+
# The user's place of birth.
|
|
31
|
+
attr_accessor :place_of_birth
|
|
32
|
+
|
|
33
|
+
# The user's county of birth.
|
|
34
|
+
attr_accessor :county_of_birth
|
|
35
|
+
|
|
36
|
+
# The raw, space-separated string value for the \"IdCard\" field from the SPID identity. Trinsic additionally parses this field and uses it to populate the `Document` object in the normalized data model.
|
|
37
|
+
attr_accessor :raw_id_card
|
|
38
|
+
|
|
39
|
+
# The email address of the user.
|
|
40
|
+
attr_accessor :email
|
|
41
|
+
|
|
42
|
+
# The digital address of the user.
|
|
43
|
+
attr_accessor :digital_address
|
|
44
|
+
|
|
45
|
+
# Fiscal tax number for the subject.
|
|
46
|
+
attr_accessor :fiscal_number
|
|
47
|
+
|
|
48
|
+
# VAT number for the subject.
|
|
49
|
+
attr_accessor :iva_code
|
|
50
|
+
|
|
51
|
+
# The name of the company which the user is associated with.
|
|
52
|
+
attr_accessor :company_name
|
|
53
|
+
|
|
54
|
+
# The fiscal tax number of the company which the user is associated with.
|
|
55
|
+
attr_accessor :company_fiscal_number
|
|
56
|
+
|
|
57
|
+
# The registered office address of the company which the user is associated with.
|
|
58
|
+
attr_accessor :registered_office
|
|
59
|
+
|
|
60
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
61
|
+
def self.attribute_map
|
|
62
|
+
{
|
|
63
|
+
:'billing_information' => :'billingInformation',
|
|
64
|
+
:'identity_provider_entity_id' => :'identityProviderEntityId',
|
|
65
|
+
:'spid_code' => :'spidCode',
|
|
66
|
+
:'spid_credential_expiration_date' => :'spidCredentialExpirationDate',
|
|
67
|
+
:'place_of_birth' => :'placeOfBirth',
|
|
68
|
+
:'county_of_birth' => :'countyOfBirth',
|
|
69
|
+
:'raw_id_card' => :'rawIdCard',
|
|
70
|
+
:'email' => :'email',
|
|
71
|
+
:'digital_address' => :'digitalAddress',
|
|
72
|
+
:'fiscal_number' => :'fiscalNumber',
|
|
73
|
+
:'iva_code' => :'ivaCode',
|
|
74
|
+
:'company_name' => :'companyName',
|
|
75
|
+
:'company_fiscal_number' => :'companyFiscalNumber',
|
|
76
|
+
:'registered_office' => :'registeredOffice'
|
|
77
|
+
}
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Returns attribute mapping this model knows about
|
|
81
|
+
def self.acceptable_attribute_map
|
|
82
|
+
attribute_map
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Returns all the JSON keys this model knows about
|
|
86
|
+
def self.acceptable_attributes
|
|
87
|
+
acceptable_attribute_map.values
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Attribute type mapping.
|
|
91
|
+
def self.openapi_types
|
|
92
|
+
{
|
|
93
|
+
:'billing_information' => :'SpidBillingInformation',
|
|
94
|
+
:'identity_provider_entity_id' => :'String',
|
|
95
|
+
:'spid_code' => :'String',
|
|
96
|
+
:'spid_credential_expiration_date' => :'Date',
|
|
97
|
+
:'place_of_birth' => :'String',
|
|
98
|
+
:'county_of_birth' => :'String',
|
|
99
|
+
:'raw_id_card' => :'String',
|
|
100
|
+
:'email' => :'String',
|
|
101
|
+
:'digital_address' => :'String',
|
|
102
|
+
:'fiscal_number' => :'String',
|
|
103
|
+
:'iva_code' => :'String',
|
|
104
|
+
:'company_name' => :'String',
|
|
105
|
+
:'company_fiscal_number' => :'String',
|
|
106
|
+
:'registered_office' => :'String'
|
|
107
|
+
}
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# List of attributes with nullable: true
|
|
111
|
+
def self.openapi_nullable
|
|
112
|
+
Set.new([
|
|
113
|
+
:'billing_information',
|
|
114
|
+
:'spid_credential_expiration_date',
|
|
115
|
+
:'place_of_birth',
|
|
116
|
+
:'county_of_birth',
|
|
117
|
+
:'raw_id_card',
|
|
118
|
+
:'email',
|
|
119
|
+
:'digital_address',
|
|
120
|
+
:'fiscal_number',
|
|
121
|
+
:'iva_code',
|
|
122
|
+
:'company_name',
|
|
123
|
+
:'company_fiscal_number',
|
|
124
|
+
:'registered_office'
|
|
125
|
+
])
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Initializes the object
|
|
129
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
130
|
+
def initialize(attributes = {})
|
|
131
|
+
if (!attributes.is_a?(Hash))
|
|
132
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::SpidProviderOutput` initialize method"
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
136
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
137
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
138
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
139
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::SpidProviderOutput`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
140
|
+
end
|
|
141
|
+
h[k.to_sym] = v
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if attributes.key?(:'billing_information')
|
|
145
|
+
self.billing_information = attributes[:'billing_information']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes.key?(:'identity_provider_entity_id')
|
|
149
|
+
self.identity_provider_entity_id = attributes[:'identity_provider_entity_id']
|
|
150
|
+
else
|
|
151
|
+
self.identity_provider_entity_id = nil
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
if attributes.key?(:'spid_code')
|
|
155
|
+
self.spid_code = attributes[:'spid_code']
|
|
156
|
+
else
|
|
157
|
+
self.spid_code = nil
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
if attributes.key?(:'spid_credential_expiration_date')
|
|
161
|
+
self.spid_credential_expiration_date = attributes[:'spid_credential_expiration_date']
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
if attributes.key?(:'place_of_birth')
|
|
165
|
+
self.place_of_birth = attributes[:'place_of_birth']
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
if attributes.key?(:'county_of_birth')
|
|
169
|
+
self.county_of_birth = attributes[:'county_of_birth']
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
if attributes.key?(:'raw_id_card')
|
|
173
|
+
self.raw_id_card = attributes[:'raw_id_card']
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
if attributes.key?(:'email')
|
|
177
|
+
self.email = attributes[:'email']
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
if attributes.key?(:'digital_address')
|
|
181
|
+
self.digital_address = attributes[:'digital_address']
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
if attributes.key?(:'fiscal_number')
|
|
185
|
+
self.fiscal_number = attributes[:'fiscal_number']
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
if attributes.key?(:'iva_code')
|
|
189
|
+
self.iva_code = attributes[:'iva_code']
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
if attributes.key?(:'company_name')
|
|
193
|
+
self.company_name = attributes[:'company_name']
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
if attributes.key?(:'company_fiscal_number')
|
|
197
|
+
self.company_fiscal_number = attributes[:'company_fiscal_number']
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
if attributes.key?(:'registered_office')
|
|
201
|
+
self.registered_office = attributes[:'registered_office']
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
206
|
+
# @return Array for valid properties with the reasons
|
|
207
|
+
def list_invalid_properties
|
|
208
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
209
|
+
invalid_properties = Array.new
|
|
210
|
+
if @identity_provider_entity_id.nil?
|
|
211
|
+
invalid_properties.push('invalid value for "identity_provider_entity_id", identity_provider_entity_id cannot be nil.')
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
if @spid_code.nil?
|
|
215
|
+
invalid_properties.push('invalid value for "spid_code", spid_code cannot be nil.')
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
invalid_properties
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Check to see if the all the properties in the model are valid
|
|
222
|
+
# @return true if the model is valid
|
|
223
|
+
def valid?
|
|
224
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
225
|
+
return false if @identity_provider_entity_id.nil?
|
|
226
|
+
return false if @spid_code.nil?
|
|
227
|
+
true
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Custom attribute writer method with validation
|
|
231
|
+
# @param [Object] identity_provider_entity_id Value to be assigned
|
|
232
|
+
def identity_provider_entity_id=(identity_provider_entity_id)
|
|
233
|
+
if identity_provider_entity_id.nil?
|
|
234
|
+
fail ArgumentError, 'identity_provider_entity_id cannot be nil'
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
@identity_provider_entity_id = identity_provider_entity_id
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Custom attribute writer method with validation
|
|
241
|
+
# @param [Object] spid_code Value to be assigned
|
|
242
|
+
def spid_code=(spid_code)
|
|
243
|
+
if spid_code.nil?
|
|
244
|
+
fail ArgumentError, 'spid_code cannot be nil'
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
@spid_code = spid_code
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Checks equality by comparing each attribute.
|
|
251
|
+
# @param [Object] Object to be compared
|
|
252
|
+
def ==(o)
|
|
253
|
+
return true if self.equal?(o)
|
|
254
|
+
self.class == o.class &&
|
|
255
|
+
billing_information == o.billing_information &&
|
|
256
|
+
identity_provider_entity_id == o.identity_provider_entity_id &&
|
|
257
|
+
spid_code == o.spid_code &&
|
|
258
|
+
spid_credential_expiration_date == o.spid_credential_expiration_date &&
|
|
259
|
+
place_of_birth == o.place_of_birth &&
|
|
260
|
+
county_of_birth == o.county_of_birth &&
|
|
261
|
+
raw_id_card == o.raw_id_card &&
|
|
262
|
+
email == o.email &&
|
|
263
|
+
digital_address == o.digital_address &&
|
|
264
|
+
fiscal_number == o.fiscal_number &&
|
|
265
|
+
iva_code == o.iva_code &&
|
|
266
|
+
company_name == o.company_name &&
|
|
267
|
+
company_fiscal_number == o.company_fiscal_number &&
|
|
268
|
+
registered_office == o.registered_office
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
# @see the `==` method
|
|
272
|
+
# @param [Object] Object to be compared
|
|
273
|
+
def eql?(o)
|
|
274
|
+
self == o
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
# Calculates hash code according to all attributes.
|
|
278
|
+
# @return [Integer] Hash code
|
|
279
|
+
def hash
|
|
280
|
+
[billing_information, identity_provider_entity_id, spid_code, spid_credential_expiration_date, place_of_birth, county_of_birth, raw_id_card, email, digital_address, fiscal_number, iva_code, company_name, company_fiscal_number, registered_office].hash
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Builds the object from hash
|
|
284
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
285
|
+
# @return [Object] Returns the model itself
|
|
286
|
+
def self.build_from_hash(attributes)
|
|
287
|
+
return nil unless attributes.is_a?(Hash)
|
|
288
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
289
|
+
transformed_hash = {}
|
|
290
|
+
openapi_types.each_pair do |key, type|
|
|
291
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
292
|
+
transformed_hash["#{key}"] = nil
|
|
293
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
294
|
+
# check to ensure the input is an array given that the attribute
|
|
295
|
+
# is documented as an array but the input is not
|
|
296
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
297
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
298
|
+
end
|
|
299
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
300
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
301
|
+
end
|
|
302
|
+
end
|
|
303
|
+
new(transformed_hash)
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
# Deserializes the data based on type
|
|
307
|
+
# @param string type Data type
|
|
308
|
+
# @param string value Value to be deserialized
|
|
309
|
+
# @return [Object] Deserialized data
|
|
310
|
+
def self._deserialize(type, value)
|
|
311
|
+
case type.to_sym
|
|
312
|
+
when :Time
|
|
313
|
+
Time.parse(value)
|
|
314
|
+
when :Date
|
|
315
|
+
Date.parse(value)
|
|
316
|
+
when :String
|
|
317
|
+
value.to_s
|
|
318
|
+
when :Integer
|
|
319
|
+
value.to_i
|
|
320
|
+
when :Float
|
|
321
|
+
value.to_f
|
|
322
|
+
when :Boolean
|
|
323
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
324
|
+
true
|
|
325
|
+
else
|
|
326
|
+
false
|
|
327
|
+
end
|
|
328
|
+
when :Object
|
|
329
|
+
# generic object (usually a Hash), return directly
|
|
330
|
+
value
|
|
331
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
332
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
333
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
334
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
335
|
+
k_type = Regexp.last_match[:k_type]
|
|
336
|
+
v_type = Regexp.last_match[:v_type]
|
|
337
|
+
{}.tap do |hash|
|
|
338
|
+
value.each do |k, v|
|
|
339
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
340
|
+
end
|
|
341
|
+
end
|
|
342
|
+
else # model
|
|
343
|
+
# models (e.g. Pet) or oneOf
|
|
344
|
+
klass = TrinsicApi.const_get(type)
|
|
345
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
346
|
+
end
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
# Returns the string representation of the object
|
|
350
|
+
# @return [String] String presentation of the object
|
|
351
|
+
def to_s
|
|
352
|
+
to_hash.to_s
|
|
353
|
+
end
|
|
354
|
+
|
|
355
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
356
|
+
# @return [Hash] Returns the object in the form of hash
|
|
357
|
+
def to_body
|
|
358
|
+
to_hash
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
# Returns the object in the form of hash
|
|
362
|
+
# @return [Hash] Returns the object in the form of hash
|
|
363
|
+
def to_hash
|
|
364
|
+
hash = {}
|
|
365
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
366
|
+
value = self.send(attr)
|
|
367
|
+
if value.nil?
|
|
368
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
369
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
370
|
+
end
|
|
371
|
+
|
|
372
|
+
hash[param] = _to_hash(value)
|
|
373
|
+
end
|
|
374
|
+
hash
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
# Outputs non-array value in the form of hash
|
|
378
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
379
|
+
# @param [Object] value Any valid value
|
|
380
|
+
# @return [Hash] Returns the value in the form of hash
|
|
381
|
+
def _to_hash(value)
|
|
382
|
+
if value.is_a?(Array)
|
|
383
|
+
value.compact.map { |v| _to_hash(v) }
|
|
384
|
+
elsif value.is_a?(Hash)
|
|
385
|
+
{}.tap do |hash|
|
|
386
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
387
|
+
end
|
|
388
|
+
elsif value.respond_to? :to_hash
|
|
389
|
+
value.to_hash
|
|
390
|
+
else
|
|
391
|
+
value
|
|
392
|
+
end
|
|
393
|
+
end
|
|
394
|
+
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
end
|