trinsic_api 2.1.1.pre.alpha2 → 2.2.0.pre.alpha1

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 (82) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AppleWalletInput.md +18 -0
  3. data/docs/AttachmentsApi.md +1 -1
  4. data/docs/{CreateAdvancedProviderSessionRequest.md → CreateDirectProviderSessionRequest.md} +5 -3
  5. data/docs/{CreateAdvancedProviderSessionResponse.md → CreateDirectProviderSessionResponse.md} +2 -2
  6. data/docs/CreateHostedProviderSessionRequest.md +3 -1
  7. data/docs/CreateMdlExchangeRequest.md +32 -0
  8. data/docs/CreateMdlExchangeResponse.md +22 -0
  9. data/docs/CreateWidgetSessionRequest.md +3 -1
  10. data/docs/ExternalMdlFieldData.md +20 -0
  11. data/docs/FinalizeMdlExchangeRequest.md +24 -0
  12. data/docs/FinalizeMdlExchangeResponse.md +24 -0
  13. data/docs/GetAttachmentRequest.md +3 -1
  14. data/docs/GoogleWalletInput.md +18 -0
  15. data/docs/MdlApi.md +151 -0
  16. data/docs/MdlCertificateData.md +26 -0
  17. data/docs/MdlExchangeMechanism.md +15 -0
  18. data/docs/MdlFieldDataType.md +15 -0
  19. data/docs/MdlIdentityData.md +22 -0
  20. data/docs/NetworkApi.md +21 -18
  21. data/docs/ProviderContract.md +7 -5
  22. data/docs/ProviderInput.md +4 -0
  23. data/docs/RecommendRequest.md +2 -0
  24. data/docs/SessionsApi.md +103 -27
  25. data/docs/SubmitNativeChallengeResponseRequest.md +20 -0
  26. data/docs/SubmitNativeChallengeResponseResponse.md +18 -0
  27. data/lib/trinsic_api/api/mdl_api.rb +150 -0
  28. data/lib/trinsic_api/api/network_api.rb +22 -14
  29. data/lib/trinsic_api/api/sessions_api.rb +99 -23
  30. data/lib/trinsic_api/models/apple_wallet_input.rb +244 -0
  31. data/lib/trinsic_api/models/{create_advanced_provider_session_request.rb → create_direct_provider_session_request.rb} +32 -5
  32. data/lib/trinsic_api/models/{create_advanced_provider_session_response.rb → create_direct_provider_session_response.rb} +3 -3
  33. data/lib/trinsic_api/models/create_hosted_provider_session_request.rb +29 -2
  34. data/lib/trinsic_api/models/create_mdl_exchange_request.rb +404 -0
  35. data/lib/trinsic_api/models/create_mdl_exchange_response.rb +292 -0
  36. data/lib/trinsic_api/models/create_widget_session_request.rb +29 -2
  37. data/lib/trinsic_api/models/external_mdl_field_data.rb +287 -0
  38. data/lib/trinsic_api/models/finalize_mdl_exchange_request.rb +319 -0
  39. data/lib/trinsic_api/models/finalize_mdl_exchange_response.rb +287 -0
  40. data/lib/trinsic_api/models/get_attachment_request.rb +31 -4
  41. data/lib/trinsic_api/models/google_wallet_input.rb +244 -0
  42. data/lib/trinsic_api/models/integration_capability.rb +2 -1
  43. data/lib/trinsic_api/models/integration_launch_method.rb +2 -1
  44. data/lib/trinsic_api/models/integration_step.rb +1 -1
  45. data/lib/trinsic_api/models/mdl_certificate_data.rb +346 -0
  46. data/lib/trinsic_api/models/mdl_exchange_mechanism.rb +40 -0
  47. data/lib/trinsic_api/models/mdl_field_data_type.rb +43 -0
  48. data/lib/trinsic_api/models/mdl_identity_data.rb +294 -0
  49. data/lib/trinsic_api/models/provider_contract.rb +33 -6
  50. data/lib/trinsic_api/models/provider_input.rb +23 -1
  51. data/lib/trinsic_api/models/recommend_request.rb +28 -1
  52. data/lib/trinsic_api/models/result_collection_method.rb +2 -1
  53. data/lib/trinsic_api/models/session_error_code.rb +3 -1
  54. data/lib/trinsic_api/models/submit_native_challenge_response_request.rb +283 -0
  55. data/lib/trinsic_api/models/submit_native_challenge_response_response.rb +238 -0
  56. data/lib/trinsic_api/version.rb +1 -1
  57. data/lib/trinsic_api.rb +16 -2
  58. data/spec/api/mdl_api_spec.rb +59 -0
  59. data/spec/api/network_api_spec.rb +3 -3
  60. data/spec/api/sessions_api_spec.rb +21 -7
  61. data/spec/models/apple_wallet_input_spec.rb +36 -0
  62. data/spec/models/{create_advanced_provider_session_request_spec.rb → create_direct_provider_session_request_spec.rb} +12 -6
  63. data/spec/models/{create_advanced_provider_session_response_spec.rb → create_direct_provider_session_response_spec.rb} +6 -6
  64. data/spec/models/create_hosted_provider_session_request_spec.rb +6 -0
  65. data/spec/models/create_mdl_exchange_request_spec.rb +78 -0
  66. data/spec/models/create_mdl_exchange_response_spec.rb +48 -0
  67. data/spec/models/create_widget_session_request_spec.rb +6 -0
  68. data/spec/models/external_mdl_field_data_spec.rb +42 -0
  69. data/spec/models/finalize_mdl_exchange_request_spec.rb +54 -0
  70. data/spec/models/finalize_mdl_exchange_response_spec.rb +54 -0
  71. data/spec/models/get_attachment_request_spec.rb +6 -0
  72. data/spec/models/google_wallet_input_spec.rb +36 -0
  73. data/spec/models/mdl_certificate_data_spec.rb +60 -0
  74. data/spec/models/mdl_exchange_mechanism_spec.rb +30 -0
  75. data/spec/models/mdl_field_data_type_spec.rb +30 -0
  76. data/spec/models/mdl_identity_data_spec.rb +48 -0
  77. data/spec/models/provider_contract_spec.rb +6 -0
  78. data/spec/models/provider_input_spec.rb +12 -0
  79. data/spec/models/recommend_request_spec.rb +6 -0
  80. data/spec/models/submit_native_challenge_response_request_spec.rb +42 -0
  81. data/spec/models/submit_native_challenge_response_response_spec.rb +36 -0
  82. metadata +124 -68
@@ -0,0 +1,319 @@
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 FinalizeMdlExchangeRequest
18
+ # The ID of the VerificationProfile which was used to create the mDL exchange.
19
+ attr_accessor :verification_profile_id
20
+
21
+ # The ID of the mDL exchange to finalize.
22
+ attr_accessor :exchange_id
23
+
24
+ # The encrypted exchange context which was returned when the mDL exchange was created.
25
+ attr_accessor :exchange_context
26
+
27
+ # The response token returned by Trinsic's SDK after a successful mDL exchange.
28
+ attr_accessor :response_token
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'verification_profile_id' => :'verificationProfileId',
34
+ :'exchange_id' => :'exchangeId',
35
+ :'exchange_context' => :'exchangeContext',
36
+ :'response_token' => :'responseToken'
37
+ }
38
+ end
39
+
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ acceptable_attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'verification_profile_id' => :'String',
54
+ :'exchange_id' => :'String',
55
+ :'exchange_context' => :'String',
56
+ :'response_token' => :'String'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::FinalizeMdlExchangeRequest` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ acceptable_attribute_map = self.class.acceptable_attribute_map
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!acceptable_attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::FinalizeMdlExchangeRequest`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'verification_profile_id')
83
+ self.verification_profile_id = attributes[:'verification_profile_id']
84
+ else
85
+ self.verification_profile_id = nil
86
+ end
87
+
88
+ if attributes.key?(:'exchange_id')
89
+ self.exchange_id = attributes[:'exchange_id']
90
+ else
91
+ self.exchange_id = nil
92
+ end
93
+
94
+ if attributes.key?(:'exchange_context')
95
+ self.exchange_context = attributes[:'exchange_context']
96
+ else
97
+ self.exchange_context = nil
98
+ end
99
+
100
+ if attributes.key?(:'response_token')
101
+ self.response_token = attributes[:'response_token']
102
+ else
103
+ self.response_token = nil
104
+ end
105
+ end
106
+
107
+ # Show invalid properties with the reasons. Usually used together with valid?
108
+ # @return Array for valid properties with the reasons
109
+ def list_invalid_properties
110
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
111
+ invalid_properties = Array.new
112
+ if @verification_profile_id.nil?
113
+ invalid_properties.push('invalid value for "verification_profile_id", verification_profile_id cannot be nil.')
114
+ end
115
+
116
+ if @exchange_id.nil?
117
+ invalid_properties.push('invalid value for "exchange_id", exchange_id cannot be nil.')
118
+ end
119
+
120
+ if @exchange_context.nil?
121
+ invalid_properties.push('invalid value for "exchange_context", exchange_context cannot be nil.')
122
+ end
123
+
124
+ if @response_token.nil?
125
+ invalid_properties.push('invalid value for "response_token", response_token cannot be nil.')
126
+ end
127
+
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ warn '[DEPRECATED] the `valid?` method is obsolete'
135
+ return false if @verification_profile_id.nil?
136
+ return false if @exchange_id.nil?
137
+ return false if @exchange_context.nil?
138
+ return false if @response_token.nil?
139
+ true
140
+ end
141
+
142
+ # Custom attribute writer method with validation
143
+ # @param [Object] verification_profile_id Value to be assigned
144
+ def verification_profile_id=(verification_profile_id)
145
+ if verification_profile_id.nil?
146
+ fail ArgumentError, 'verification_profile_id cannot be nil'
147
+ end
148
+
149
+ @verification_profile_id = verification_profile_id
150
+ end
151
+
152
+ # Custom attribute writer method with validation
153
+ # @param [Object] exchange_id Value to be assigned
154
+ def exchange_id=(exchange_id)
155
+ if exchange_id.nil?
156
+ fail ArgumentError, 'exchange_id cannot be nil'
157
+ end
158
+
159
+ @exchange_id = exchange_id
160
+ end
161
+
162
+ # Custom attribute writer method with validation
163
+ # @param [Object] exchange_context Value to be assigned
164
+ def exchange_context=(exchange_context)
165
+ if exchange_context.nil?
166
+ fail ArgumentError, 'exchange_context cannot be nil'
167
+ end
168
+
169
+ @exchange_context = exchange_context
170
+ end
171
+
172
+ # Custom attribute writer method with validation
173
+ # @param [Object] response_token Value to be assigned
174
+ def response_token=(response_token)
175
+ if response_token.nil?
176
+ fail ArgumentError, 'response_token cannot be nil'
177
+ end
178
+
179
+ @response_token = response_token
180
+ end
181
+
182
+ # Checks equality by comparing each attribute.
183
+ # @param [Object] Object to be compared
184
+ def ==(o)
185
+ return true if self.equal?(o)
186
+ self.class == o.class &&
187
+ verification_profile_id == o.verification_profile_id &&
188
+ exchange_id == o.exchange_id &&
189
+ exchange_context == o.exchange_context &&
190
+ response_token == o.response_token
191
+ end
192
+
193
+ # @see the `==` method
194
+ # @param [Object] Object to be compared
195
+ def eql?(o)
196
+ self == o
197
+ end
198
+
199
+ # Calculates hash code according to all attributes.
200
+ # @return [Integer] Hash code
201
+ def hash
202
+ [verification_profile_id, exchange_id, exchange_context, response_token].hash
203
+ end
204
+
205
+ # Builds the object from hash
206
+ # @param [Hash] attributes Model attributes in the form of hash
207
+ # @return [Object] Returns the model itself
208
+ def self.build_from_hash(attributes)
209
+ return nil unless attributes.is_a?(Hash)
210
+ attributes = attributes.transform_keys(&:to_sym)
211
+ transformed_hash = {}
212
+ openapi_types.each_pair do |key, type|
213
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
214
+ transformed_hash["#{key}"] = nil
215
+ elsif type =~ /\AArray<(.*)>/i
216
+ # check to ensure the input is an array given that the attribute
217
+ # is documented as an array but the input is not
218
+ if attributes[attribute_map[key]].is_a?(Array)
219
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
220
+ end
221
+ elsif !attributes[attribute_map[key]].nil?
222
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
223
+ end
224
+ end
225
+ new(transformed_hash)
226
+ end
227
+
228
+ # Deserializes the data based on type
229
+ # @param string type Data type
230
+ # @param string value Value to be deserialized
231
+ # @return [Object] Deserialized data
232
+ def self._deserialize(type, value)
233
+ case type.to_sym
234
+ when :Time
235
+ Time.parse(value)
236
+ when :Date
237
+ Date.parse(value)
238
+ when :String
239
+ value.to_s
240
+ when :Integer
241
+ value.to_i
242
+ when :Float
243
+ value.to_f
244
+ when :Boolean
245
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
246
+ true
247
+ else
248
+ false
249
+ end
250
+ when :Object
251
+ # generic object (usually a Hash), return directly
252
+ value
253
+ when /\AArray<(?<inner_type>.+)>\z/
254
+ inner_type = Regexp.last_match[:inner_type]
255
+ value.map { |v| _deserialize(inner_type, v) }
256
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
257
+ k_type = Regexp.last_match[:k_type]
258
+ v_type = Regexp.last_match[:v_type]
259
+ {}.tap do |hash|
260
+ value.each do |k, v|
261
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
262
+ end
263
+ end
264
+ else # model
265
+ # models (e.g. Pet) or oneOf
266
+ klass = TrinsicApi.const_get(type)
267
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
268
+ end
269
+ end
270
+
271
+ # Returns the string representation of the object
272
+ # @return [String] String presentation of the object
273
+ def to_s
274
+ to_hash.to_s
275
+ end
276
+
277
+ # to_body is an alias to to_hash (backward compatibility)
278
+ # @return [Hash] Returns the object in the form of hash
279
+ def to_body
280
+ to_hash
281
+ end
282
+
283
+ # Returns the object in the form of hash
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_hash
286
+ hash = {}
287
+ self.class.attribute_map.each_pair do |attr, param|
288
+ value = self.send(attr)
289
+ if value.nil?
290
+ is_nullable = self.class.openapi_nullable.include?(attr)
291
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
292
+ end
293
+
294
+ hash[param] = _to_hash(value)
295
+ end
296
+ hash
297
+ end
298
+
299
+ # Outputs non-array value in the form of hash
300
+ # For object, use to_hash. Otherwise, just return the value
301
+ # @param [Object] value Any valid value
302
+ # @return [Hash] Returns the value in the form of hash
303
+ def _to_hash(value)
304
+ if value.is_a?(Array)
305
+ value.compact.map { |v| _to_hash(v) }
306
+ elsif value.is_a?(Hash)
307
+ {}.tap do |hash|
308
+ value.each { |k, v| hash[k] = _to_hash(v) }
309
+ end
310
+ elsif value.respond_to? :to_hash
311
+ value.to_hash
312
+ else
313
+ value
314
+ end
315
+ end
316
+
317
+ end
318
+
319
+ end
@@ -0,0 +1,287 @@
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 FinalizeMdlExchangeResponse
18
+ # The Exchange ID of the mDL exchange which was just finalized.
19
+ attr_accessor :exchange_id
20
+
21
+ # The AcceptanceSession which was created as a result of finalizing this mDL exchange.
22
+ attr_accessor :created_session
23
+
24
+ # The identity data from the mDL exchange, in a semi-normalized format. Supports all possible fields and namespaces, but does not map them to Trinsic's common data model.
25
+ attr_accessor :mdl_data
26
+
27
+ # The identity data from the mDL exchange, normalized into Trinsic's common data model.
28
+ attr_accessor :normalized_identity_data
29
+
30
+ # Attribute mapping from ruby-style variable name to JSON key.
31
+ def self.attribute_map
32
+ {
33
+ :'exchange_id' => :'exchangeId',
34
+ :'created_session' => :'createdSession',
35
+ :'mdl_data' => :'mdlData',
36
+ :'normalized_identity_data' => :'normalizedIdentityData'
37
+ }
38
+ end
39
+
40
+ # Returns attribute mapping this model knows about
41
+ def self.acceptable_attribute_map
42
+ attribute_map
43
+ end
44
+
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ acceptable_attribute_map.values
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.openapi_types
52
+ {
53
+ :'exchange_id' => :'String',
54
+ :'created_session' => :'Session',
55
+ :'mdl_data' => :'MdlIdentityData',
56
+ :'normalized_identity_data' => :'IdentityData'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ :'mdl_data',
64
+ :'normalized_identity_data'
65
+ ])
66
+ end
67
+
68
+ # Initializes the object
69
+ # @param [Hash] attributes Model attributes in the form of hash
70
+ def initialize(attributes = {})
71
+ if (!attributes.is_a?(Hash))
72
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TrinsicApi::FinalizeMdlExchangeResponse` initialize method"
73
+ end
74
+
75
+ # check to see if the attribute exists and convert string to symbol for hash key
76
+ acceptable_attribute_map = self.class.acceptable_attribute_map
77
+ attributes = attributes.each_with_object({}) { |(k, v), h|
78
+ if (!acceptable_attribute_map.key?(k.to_sym))
79
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TrinsicApi::FinalizeMdlExchangeResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
80
+ end
81
+ h[k.to_sym] = v
82
+ }
83
+
84
+ if attributes.key?(:'exchange_id')
85
+ self.exchange_id = attributes[:'exchange_id']
86
+ else
87
+ self.exchange_id = nil
88
+ end
89
+
90
+ if attributes.key?(:'created_session')
91
+ self.created_session = attributes[:'created_session']
92
+ else
93
+ self.created_session = nil
94
+ end
95
+
96
+ if attributes.key?(:'mdl_data')
97
+ self.mdl_data = attributes[:'mdl_data']
98
+ end
99
+
100
+ if attributes.key?(:'normalized_identity_data')
101
+ self.normalized_identity_data = attributes[:'normalized_identity_data']
102
+ end
103
+ end
104
+
105
+ # Show invalid properties with the reasons. Usually used together with valid?
106
+ # @return Array for valid properties with the reasons
107
+ def list_invalid_properties
108
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
109
+ invalid_properties = Array.new
110
+ if @exchange_id.nil?
111
+ invalid_properties.push('invalid value for "exchange_id", exchange_id cannot be nil.')
112
+ end
113
+
114
+ if @created_session.nil?
115
+ invalid_properties.push('invalid value for "created_session", created_session cannot be nil.')
116
+ end
117
+
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ warn '[DEPRECATED] the `valid?` method is obsolete'
125
+ return false if @exchange_id.nil?
126
+ return false if @created_session.nil?
127
+ true
128
+ end
129
+
130
+ # Custom attribute writer method with validation
131
+ # @param [Object] exchange_id Value to be assigned
132
+ def exchange_id=(exchange_id)
133
+ if exchange_id.nil?
134
+ fail ArgumentError, 'exchange_id cannot be nil'
135
+ end
136
+
137
+ @exchange_id = exchange_id
138
+ end
139
+
140
+ # Custom attribute writer method with validation
141
+ # @param [Object] created_session Value to be assigned
142
+ def created_session=(created_session)
143
+ if created_session.nil?
144
+ fail ArgumentError, 'created_session cannot be nil'
145
+ end
146
+
147
+ @created_session = created_session
148
+ end
149
+
150
+ # Checks equality by comparing each attribute.
151
+ # @param [Object] Object to be compared
152
+ def ==(o)
153
+ return true if self.equal?(o)
154
+ self.class == o.class &&
155
+ exchange_id == o.exchange_id &&
156
+ created_session == o.created_session &&
157
+ mdl_data == o.mdl_data &&
158
+ normalized_identity_data == o.normalized_identity_data
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ def hash
170
+ [exchange_id, created_session, mdl_data, normalized_identity_data].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def self.build_from_hash(attributes)
177
+ return nil unless attributes.is_a?(Hash)
178
+ attributes = attributes.transform_keys(&:to_sym)
179
+ transformed_hash = {}
180
+ openapi_types.each_pair do |key, type|
181
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
182
+ transformed_hash["#{key}"] = nil
183
+ elsif type =~ /\AArray<(.*)>/i
184
+ # check to ensure the input is an array given that the attribute
185
+ # is documented as an array but the input is not
186
+ if attributes[attribute_map[key]].is_a?(Array)
187
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
188
+ end
189
+ elsif !attributes[attribute_map[key]].nil?
190
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
191
+ end
192
+ end
193
+ new(transformed_hash)
194
+ end
195
+
196
+ # Deserializes the data based on type
197
+ # @param string type Data type
198
+ # @param string value Value to be deserialized
199
+ # @return [Object] Deserialized data
200
+ def self._deserialize(type, value)
201
+ case type.to_sym
202
+ when :Time
203
+ Time.parse(value)
204
+ when :Date
205
+ Date.parse(value)
206
+ when :String
207
+ value.to_s
208
+ when :Integer
209
+ value.to_i
210
+ when :Float
211
+ value.to_f
212
+ when :Boolean
213
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
214
+ true
215
+ else
216
+ false
217
+ end
218
+ when :Object
219
+ # generic object (usually a Hash), return directly
220
+ value
221
+ when /\AArray<(?<inner_type>.+)>\z/
222
+ inner_type = Regexp.last_match[:inner_type]
223
+ value.map { |v| _deserialize(inner_type, v) }
224
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
225
+ k_type = Regexp.last_match[:k_type]
226
+ v_type = Regexp.last_match[:v_type]
227
+ {}.tap do |hash|
228
+ value.each do |k, v|
229
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
230
+ end
231
+ end
232
+ else # model
233
+ # models (e.g. Pet) or oneOf
234
+ klass = TrinsicApi.const_get(type)
235
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
236
+ end
237
+ end
238
+
239
+ # Returns the string representation of the object
240
+ # @return [String] String presentation of the object
241
+ def to_s
242
+ to_hash.to_s
243
+ end
244
+
245
+ # to_body is an alias to to_hash (backward compatibility)
246
+ # @return [Hash] Returns the object in the form of hash
247
+ def to_body
248
+ to_hash
249
+ end
250
+
251
+ # Returns the object in the form of hash
252
+ # @return [Hash] Returns the object in the form of hash
253
+ def to_hash
254
+ hash = {}
255
+ self.class.attribute_map.each_pair do |attr, param|
256
+ value = self.send(attr)
257
+ if value.nil?
258
+ is_nullable = self.class.openapi_nullable.include?(attr)
259
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
260
+ end
261
+
262
+ hash[param] = _to_hash(value)
263
+ end
264
+ hash
265
+ end
266
+
267
+ # Outputs non-array value in the form of hash
268
+ # For object, use to_hash. Otherwise, just return the value
269
+ # @param [Object] value Any valid value
270
+ # @return [Hash] Returns the value in the form of hash
271
+ def _to_hash(value)
272
+ if value.is_a?(Array)
273
+ value.compact.map { |v| _to_hash(v) }
274
+ elsif value.is_a?(Hash)
275
+ {}.tap do |hash|
276
+ value.each { |k, v| hash[k] = _to_hash(v) }
277
+ end
278
+ elsif value.respond_to? :to_hash
279
+ value.to_hash
280
+ else
281
+ value
282
+ end
283
+ end
284
+
285
+ end
286
+
287
+ end
@@ -18,10 +18,14 @@ module TrinsicApi
18
18
  # The Attachment Access Key to exchange for the raw file contents of the related Attachment
19
19
  attr_accessor :attachment_access_key
20
20
 
21
+ # The ID of the Acceptance Session for which the Attachment is being requested.
22
+ attr_accessor :session_id
23
+
21
24
  # Attribute mapping from ruby-style variable name to JSON key.
22
25
  def self.attribute_map
23
26
  {
24
- :'attachment_access_key' => :'attachmentAccessKey'
27
+ :'attachment_access_key' => :'attachmentAccessKey',
28
+ :'session_id' => :'sessionId'
25
29
  }
26
30
  end
27
31
 
@@ -38,7 +42,8 @@ module TrinsicApi
38
42
  # Attribute type mapping.
39
43
  def self.openapi_types
40
44
  {
41
- :'attachment_access_key' => :'String'
45
+ :'attachment_access_key' => :'String',
46
+ :'session_id' => :'String'
42
47
  }
43
48
  end
44
49
 
@@ -69,6 +74,12 @@ module TrinsicApi
69
74
  else
70
75
  self.attachment_access_key = nil
71
76
  end
77
+
78
+ if attributes.key?(:'session_id')
79
+ self.session_id = attributes[:'session_id']
80
+ else
81
+ self.session_id = nil
82
+ end
72
83
  end
73
84
 
74
85
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -84,6 +95,10 @@ module TrinsicApi
84
95
  invalid_properties.push('invalid value for "attachment_access_key", the character length must be great than or equal to 1.')
85
96
  end
86
97
 
98
+ if @session_id.nil?
99
+ invalid_properties.push('invalid value for "session_id", session_id cannot be nil.')
100
+ end
101
+
87
102
  invalid_properties
88
103
  end
89
104
 
@@ -93,6 +108,7 @@ module TrinsicApi
93
108
  warn '[DEPRECATED] the `valid?` method is obsolete'
94
109
  return false if @attachment_access_key.nil?
95
110
  return false if @attachment_access_key.to_s.length < 1
111
+ return false if @session_id.nil?
96
112
  true
97
113
  end
98
114
 
@@ -110,12 +126,23 @@ module TrinsicApi
110
126
  @attachment_access_key = attachment_access_key
111
127
  end
112
128
 
129
+ # Custom attribute writer method with validation
130
+ # @param [Object] session_id Value to be assigned
131
+ def session_id=(session_id)
132
+ if session_id.nil?
133
+ fail ArgumentError, 'session_id cannot be nil'
134
+ end
135
+
136
+ @session_id = session_id
137
+ end
138
+
113
139
  # Checks equality by comparing each attribute.
114
140
  # @param [Object] Object to be compared
115
141
  def ==(o)
116
142
  return true if self.equal?(o)
117
143
  self.class == o.class &&
118
- attachment_access_key == o.attachment_access_key
144
+ attachment_access_key == o.attachment_access_key &&
145
+ session_id == o.session_id
119
146
  end
120
147
 
121
148
  # @see the `==` method
@@ -127,7 +154,7 @@ module TrinsicApi
127
154
  # Calculates hash code according to all attributes.
128
155
  # @return [Integer] Hash code
129
156
  def hash
130
- [attachment_access_key].hash
157
+ [attachment_access_key, session_id].hash
131
158
  end
132
159
 
133
160
  # Builds the object from hash