tca_client 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/docs/AddGroupAttachmentRequest.md +16 -4
  3. data/docs/AddGroupAttachmentResponse.md +14 -3
  4. data/docs/AggregateGroup.md +24 -8
  5. data/docs/AnnotationsSettings.md +18 -0
  6. data/docs/AuthorMetadataOverride.md +16 -4
  7. data/docs/EULAApi.md +166 -92
  8. data/docs/Error.md +16 -4
  9. data/docs/Eula.md +18 -5
  10. data/docs/EulaAcceptListItem.md +20 -6
  11. data/docs/EulaAcceptRequest.md +20 -6
  12. data/docs/EulaVersion.md +22 -7
  13. data/docs/FeaturesApi.md +41 -23
  14. data/docs/FeaturesEnabled.md +20 -6
  15. data/docs/FeaturesGenerationSettings.md +16 -4
  16. data/docs/FeaturesSimilarity.md +18 -5
  17. data/docs/FeaturesSimilarityViewSettings.md +38 -15
  18. data/docs/FeaturesTenant.md +14 -3
  19. data/docs/FeaturesViewerModes.md +16 -4
  20. data/docs/GenerateSimilarityPDF.md +18 -0
  21. data/docs/GetGroupAttachments200Response.md +18 -0
  22. data/docs/Group.md +18 -5
  23. data/docs/GroupAttachmentResponse.md +20 -6
  24. data/docs/GroupContext.md +18 -5
  25. data/docs/GroupsApi.md +321 -177
  26. data/docs/IndexApi.md +84 -44
  27. data/docs/IndexStateSettings.md +14 -3
  28. data/docs/IndexingSettings.md +14 -3
  29. data/docs/PDFStatusWebhookRequest.md +24 -0
  30. data/docs/PdfStatusResponse.md +14 -3
  31. data/docs/RateLimitError.md +16 -4
  32. data/docs/RequestPdfResponse.md +14 -3
  33. data/docs/Sidebar.md +14 -3
  34. data/docs/SimilarityApi.md +239 -129
  35. data/docs/SimilarityCompleteWebhookRequest.md +38 -0
  36. data/docs/SimilarityGenerationSettings.md +20 -6
  37. data/docs/SimilarityMetadata.md +32 -12
  38. data/docs/SimilarityMetadataAllOf.md +28 -0
  39. data/docs/SimilarityMetadataAllOfTopMatches.md +30 -0
  40. data/docs/SimilarityPutRequest.md +18 -5
  41. data/docs/SimilarityScoreData.md +20 -6
  42. data/docs/SimilaritySettings.md +18 -5
  43. data/docs/SimilaritySettingsModes.md +16 -4
  44. data/docs/SimilaritySettingsViewSettings.md +14 -3
  45. data/docs/SimilarityViewSettings.md +38 -15
  46. data/docs/SimilarityViewerUrlResponse.md +14 -3
  47. data/docs/SimilarityViewerUrlSettings.md +30 -10
  48. data/docs/SimpleSubmissionResponse.md +22 -2
  49. data/docs/SimpleSubmissionResponseAllOf.md +26 -0
  50. data/docs/Submission.md +34 -2
  51. data/docs/SubmissionAllOf.md +38 -0
  52. data/docs/SubmissionApi.md +202 -111
  53. data/docs/SubmissionBase.md +30 -11
  54. data/docs/SubmissionBaseMetadata.md +24 -8
  55. data/docs/SubmissionCompleteWebhookRequest.md +40 -0
  56. data/docs/SubmissionCompleteWebhookRequestAllOf.md +18 -0
  57. data/docs/SubmissionCompleteWebhookRequestAllOfMetadata.md +18 -0
  58. data/docs/SubmissionSizeError.md +16 -4
  59. data/docs/SuccessMessage.md +14 -3
  60. data/docs/Users.md +20 -6
  61. data/docs/ViewerPermissions.md +22 -7
  62. data/docs/Webhook.md +24 -6
  63. data/docs/WebhookAllOf.md +20 -0
  64. data/docs/WebhookApi.md +193 -103
  65. data/docs/WebhookBase.md +20 -6
  66. data/docs/WebhookPathRequest.md +16 -4
  67. data/docs/WebhookWithSecret.md +22 -6
  68. data/docs/WebhookWithSecretAllOf.md +18 -0
  69. data/lib/tca_client/api/eula_api.rb +96 -63
  70. data/lib/tca_client/api/features_api.rb +21 -12
  71. data/lib/tca_client/api/groups_api.rb +225 -155
  72. data/lib/tca_client/api/index_api.rb +46 -27
  73. data/lib/tca_client/api/similarity_api.rb +165 -104
  74. data/lib/tca_client/api/submission_api.rb +132 -89
  75. data/lib/tca_client/api/webhook_api.rb +120 -77
  76. data/lib/tca_client/api_client.rb +61 -57
  77. data/lib/tca_client/api_error.rb +4 -4
  78. data/lib/tca_client/configuration.rb +93 -13
  79. data/lib/tca_client/models/add_group_attachment_request.rb +50 -13
  80. data/lib/tca_client/models/add_group_attachment_response.rb +25 -12
  81. data/lib/tca_client/models/aggregate_group.rb +34 -21
  82. data/lib/tca_client/models/annotations_settings.rb +220 -0
  83. data/lib/tca_client/models/author_metadata_override.rb +26 -13
  84. data/lib/tca_client/models/error.rb +26 -13
  85. data/lib/tca_client/models/eula.rb +27 -14
  86. data/lib/tca_client/models/eula_accept_list_item.rb +28 -15
  87. data/lib/tca_client/models/eula_accept_request.rb +28 -15
  88. data/lib/tca_client/models/eula_version.rb +29 -16
  89. data/lib/tca_client/models/features_enabled.rb +28 -15
  90. data/lib/tca_client/models/features_generation_settings.rb +26 -13
  91. data/lib/tca_client/models/features_similarity.rb +27 -14
  92. data/lib/tca_client/models/features_similarity_view_settings.rb +37 -24
  93. data/lib/tca_client/models/features_tenant.rb +25 -12
  94. data/lib/tca_client/models/features_viewer_modes.rb +26 -13
  95. data/lib/tca_client/models/generate_similarity_pdf.rb +254 -0
  96. data/lib/tca_client/models/{inline_response_200.rb → get_group_attachments200_response.rb} +28 -15
  97. data/lib/tca_client/models/group.rb +29 -16
  98. data/lib/tca_client/models/group_attachment_response.rb +30 -17
  99. data/lib/tca_client/models/group_context.rb +27 -14
  100. data/lib/tca_client/models/index_state_settings.rb +25 -12
  101. data/lib/tca_client/models/indexing_settings.rb +25 -12
  102. data/lib/tca_client/models/pdf_status_response.rb +27 -14
  103. data/lib/tca_client/models/pdf_status_webhook_request.rb +283 -0
  104. data/lib/tca_client/models/rate_limit_error.rb +36 -20
  105. data/lib/tca_client/models/request_pdf_response.rb +25 -12
  106. data/lib/tca_client/models/sidebar.rb +27 -14
  107. data/lib/tca_client/models/similarity_complete_webhook_request.rb +366 -0
  108. data/lib/tca_client/models/similarity_generation_settings.rb +30 -17
  109. data/lib/tca_client/models/similarity_metadata.rb +45 -28
  110. data/lib/tca_client/models/similarity_metadata_all_of.rb +301 -0
  111. data/lib/tca_client/models/{similarity_metadata_top_matches.rb → similarity_metadata_all_of_top_matches.rb} +34 -21
  112. data/lib/tca_client/models/similarity_put_request.rb +27 -14
  113. data/lib/tca_client/models/similarity_score_data.rb +28 -15
  114. data/lib/tca_client/models/similarity_settings.rb +29 -16
  115. data/lib/tca_client/models/similarity_settings_modes.rb +26 -13
  116. data/lib/tca_client/models/similarity_settings_view_settings.rb +25 -12
  117. data/lib/tca_client/models/similarity_view_settings.rb +37 -24
  118. data/lib/tca_client/models/similarity_viewer_url_response.rb +25 -12
  119. data/lib/tca_client/models/similarity_viewer_url_settings.rb +46 -24
  120. data/lib/tca_client/models/simple_submission_response.rb +117 -13
  121. data/lib/tca_client/models/simple_submission_response_all_of.rb +294 -0
  122. data/lib/tca_client/models/submission.rb +191 -13
  123. data/lib/tca_client/models/submission_all_of.rb +368 -0
  124. data/lib/tca_client/models/submission_base.rb +82 -23
  125. data/lib/tca_client/models/submission_base_metadata.rb +30 -17
  126. data/lib/tca_client/models/submission_complete_webhook_request.rb +385 -0
  127. data/lib/tca_client/models/submission_complete_webhook_request_all_of.rb +219 -0
  128. data/lib/tca_client/models/submission_complete_webhook_request_all_of_metadata.rb +219 -0
  129. data/lib/tca_client/models/submission_size_error.rb +36 -20
  130. data/lib/tca_client/models/success_message.rb +25 -12
  131. data/lib/tca_client/models/users.rb +28 -15
  132. data/lib/tca_client/models/viewer_permissions.rb +29 -16
  133. data/lib/tca_client/models/webhook.rb +62 -16
  134. data/lib/tca_client/models/webhook_all_of.rb +235 -0
  135. data/lib/tca_client/models/webhook_base.rb +28 -15
  136. data/lib/tca_client/models/webhook_path_request.rb +26 -13
  137. data/lib/tca_client/models/webhook_with_secret.rb +52 -16
  138. data/lib/tca_client/models/webhook_with_secret_all_of.rb +225 -0
  139. data/lib/tca_client/version.rb +5 -4
  140. data/lib/tca_client.rb +18 -5
  141. data/tca_client-1.0.0.gem +0 -0
  142. data/tca_client.gemspec +7 -7
  143. metadata +34 -29
  144. data/docs/InlineResponse200.md +0 -7
  145. data/docs/SimilarityMetadataTopMatches.md +0 -13
@@ -3,13 +3,15 @@
3
3
 
4
4
  #Turnitin Core API (TCA) provides direct API access to the core functionality provided by Turnitin. TCA supports file submission, similarity report generation, group management, and visualization of report matches via Cloud Viewer or PDF download. Below is the full flow to successfully set up an integration scope, an API Key, and make calls to TCA. Integration Scope and API Key management is done via the Admin Console UI by logging in as an admin user. For more details, go to our [developer portal documentation page](https://developers.turnitin.com/docs). ## Integration Scope and API Key Management TCA API calls must provide an API Key for authentication, so you must first have at least one integration scope associated with at least one API Key to use TCA. ### Admin Console UI First, login to Admin Console UI as an *Admin* user with permission to create Integration Scopes, under a tenant that is licensed to use the TCA product Integration Scopes (you can create a new one, or add keys to existing) * Click `Integrations` in the side bar --> `+ Add Integration` at top the top of the page --> Enter a name --> `Add` Button API Keys * Click `Integrations` in the side bar --> `Create API Key` Button next to a given Integration Scope --> Enter a name --> click `Create and View button` * Copy/Save the key manually or click save to clipboard button to copy it (this is the only time it will show) ## TCA Flow * Register a webhook * Create a submission * Upload a file for the submission * Wait for the submission upload to process * If you registered a webhook, a callback will be sent to it when upload is complete * The status of the *submission* will also update to `COMPLETE` * Request a Similarity Report * Wait for similarity report to process * If you registered a webhook, a callback will be sent to it when report is complete * The status of the *report* will also be updated to `COMPLETE` * Request a URL with parameters to view the Similarity Report
5
5
 
6
- OpenAPI spec version: 1.0.249
6
+ The version of the OpenAPI document: 1.0.258
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.3.0-SNAPSHOT
7
10
 
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.35
10
11
  =end
11
12
 
12
13
  require 'date'
14
+ require 'time'
13
15
 
14
16
  module TCAClient
15
17
  # A Submission is the base object on which other services (such as similarity) are offered. In order to use other services a Submission must first be created and successfully process, then other service objects can be created.
@@ -76,27 +78,33 @@ module TCAClient
76
78
  }
77
79
  end
78
80
 
81
+ # Returns all the JSON keys this model knows about
82
+ def self.acceptable_attributes
83
+ attribute_map.values
84
+ end
85
+
79
86
  # Attribute type mapping.
80
87
  def self.openapi_types
81
88
  {
82
89
  :'id' => :'Object',
83
- :'owner' => :'Object',
84
- :'owner_default_permission_set' => :'Object',
85
- :'title' => :'Object',
86
- :'submitter' => :'Object',
87
- :'submitter_default_permission_set' => :'Object',
88
- :'eula' => :'Object',
89
- :'metadata' => :'Object',
90
- :'extract_text_only' => :'Object'
90
+ :'owner' => :'String',
91
+ :'owner_default_permission_set' => :'String',
92
+ :'title' => :'String',
93
+ :'submitter' => :'String',
94
+ :'submitter_default_permission_set' => :'String',
95
+ :'eula' => :'Eula',
96
+ :'metadata' => :'SubmissionBaseMetadata',
97
+ :'extract_text_only' => :'Boolean'
91
98
  }
92
99
  end
93
100
 
94
101
  # List of attributes with nullable: true
95
102
  def self.openapi_nullable
96
103
  Set.new([
104
+ :'id',
97
105
  ])
98
106
  end
99
-
107
+
100
108
  # Initializes the object
101
109
  # @param [Hash] attributes Model attributes in the form of hash
102
110
  def initialize(attributes = {})
@@ -153,33 +161,78 @@ module TCAClient
153
161
  # @return Array for valid properties with the reasons
154
162
  def list_invalid_properties
155
163
  invalid_properties = Array.new
164
+ if !@owner.nil? && @owner.to_s.length > 132
165
+ invalid_properties.push('invalid value for "owner", the character length must be smaller than or equal to 132.')
166
+ end
167
+
168
+ if !@title.nil? && @title.to_s.length > 500
169
+ invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 500.')
170
+ end
171
+
172
+ if !@submitter.nil? && @submitter.to_s.length > 132
173
+ invalid_properties.push('invalid value for "submitter", the character length must be smaller than or equal to 132.')
174
+ end
175
+
156
176
  invalid_properties
157
177
  end
158
178
 
159
179
  # Check to see if the all the properties in the model are valid
160
180
  # @return true if the model is valid
161
181
  def valid?
162
- owner_default_permission_set_validator = EnumAttributeValidator.new('Object', ['INSTRUCTOR', 'LEARNER', 'EDITOR', 'USER', 'APPLICANT', 'ADMINISTRATOR', 'UNDEFINED'])
182
+ return false if !@owner.nil? && @owner.to_s.length > 132
183
+ owner_default_permission_set_validator = EnumAttributeValidator.new('String', ["INSTRUCTOR", "LEARNER", "EDITOR", "USER", "APPLICANT", "ADMINISTRATOR", "UNDEFINED"])
163
184
  return false unless owner_default_permission_set_validator.valid?(@owner_default_permission_set)
164
- submitter_default_permission_set_validator = EnumAttributeValidator.new('Object', ['INSTRUCTOR', 'LEARNER', 'EDITOR', 'USER', 'APPLICANT', 'ADMINISTRATOR', 'UNDEFINED'])
185
+ return false if !@title.nil? && @title.to_s.length > 500
186
+ return false if !@submitter.nil? && @submitter.to_s.length > 132
187
+ submitter_default_permission_set_validator = EnumAttributeValidator.new('String', ["INSTRUCTOR", "LEARNER", "EDITOR", "USER", "APPLICANT", "ADMINISTRATOR", "UNDEFINED"])
165
188
  return false unless submitter_default_permission_set_validator.valid?(@submitter_default_permission_set)
166
189
  true
167
190
  end
168
191
 
192
+ # Custom attribute writer method with validation
193
+ # @param [Object] owner Value to be assigned
194
+ def owner=(owner)
195
+ if !owner.nil? && owner.to_s.length > 132
196
+ fail ArgumentError, 'invalid value for "owner", the character length must be smaller than or equal to 132.'
197
+ end
198
+
199
+ @owner = owner
200
+ end
201
+
169
202
  # Custom attribute writer method checking allowed values (enum).
170
203
  # @param [Object] owner_default_permission_set Object to be assigned
171
204
  def owner_default_permission_set=(owner_default_permission_set)
172
- validator = EnumAttributeValidator.new('Object', ['INSTRUCTOR', 'LEARNER', 'EDITOR', 'USER', 'APPLICANT', 'ADMINISTRATOR', 'UNDEFINED'])
205
+ validator = EnumAttributeValidator.new('String', ["INSTRUCTOR", "LEARNER", "EDITOR", "USER", "APPLICANT", "ADMINISTRATOR", "UNDEFINED"])
173
206
  unless validator.valid?(owner_default_permission_set)
174
207
  fail ArgumentError, "invalid value for \"owner_default_permission_set\", must be one of #{validator.allowable_values}."
175
208
  end
176
209
  @owner_default_permission_set = owner_default_permission_set
177
210
  end
178
211
 
212
+ # Custom attribute writer method with validation
213
+ # @param [Object] title Value to be assigned
214
+ def title=(title)
215
+ if !title.nil? && title.to_s.length > 500
216
+ fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 500.'
217
+ end
218
+
219
+ @title = title
220
+ end
221
+
222
+ # Custom attribute writer method with validation
223
+ # @param [Object] submitter Value to be assigned
224
+ def submitter=(submitter)
225
+ if !submitter.nil? && submitter.to_s.length > 132
226
+ fail ArgumentError, 'invalid value for "submitter", the character length must be smaller than or equal to 132.'
227
+ end
228
+
229
+ @submitter = submitter
230
+ end
231
+
179
232
  # Custom attribute writer method checking allowed values (enum).
180
233
  # @param [Object] submitter_default_permission_set Object to be assigned
181
234
  def submitter_default_permission_set=(submitter_default_permission_set)
182
- validator = EnumAttributeValidator.new('Object', ['INSTRUCTOR', 'LEARNER', 'EDITOR', 'USER', 'APPLICANT', 'ADMINISTRATOR', 'UNDEFINED'])
235
+ validator = EnumAttributeValidator.new('String', ["INSTRUCTOR", "LEARNER", "EDITOR", "USER", "APPLICANT", "ADMINISTRATOR", "UNDEFINED"])
183
236
  unless validator.valid?(submitter_default_permission_set)
184
237
  fail ArgumentError, "invalid value for \"submitter_default_permission_set\", must be one of #{validator.allowable_values}."
185
238
  end
@@ -226,8 +279,11 @@ module TCAClient
226
279
  # @return [Object] Returns the model itself
227
280
  def build_from_hash(attributes)
228
281
  return nil unless attributes.is_a?(Hash)
282
+ attributes = attributes.transform_keys(&:to_sym)
229
283
  self.class.openapi_types.each_pair do |key, type|
230
- if type =~ /\AArray<(.*)>/i
284
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
285
+ self.send("#{key}=", nil)
286
+ elsif type =~ /\AArray<(.*)>/i
231
287
  # check to ensure the input is an array given that the attribute
232
288
  # is documented as an array but the input is not
233
289
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -235,8 +291,6 @@ module TCAClient
235
291
  end
236
292
  elsif !attributes[self.class.attribute_map[key]].nil?
237
293
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
238
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
239
- self.send("#{key}=", nil)
240
294
  end
241
295
  end
242
296
 
@@ -249,8 +303,8 @@ module TCAClient
249
303
  # @return [Object] Deserialized data
250
304
  def _deserialize(type, value)
251
305
  case type.to_sym
252
- when :DateTime
253
- DateTime.parse(value)
306
+ when :Time
307
+ Time.parse(value)
254
308
  when :Date
255
309
  Date.parse(value)
256
310
  when :String
@@ -280,7 +334,9 @@ module TCAClient
280
334
  end
281
335
  end
282
336
  else # model
283
- TCAClient.const_get(type).build_from_hash(value)
337
+ # models (e.g. Pet) or oneOf
338
+ klass = TCAClient.const_get(type)
339
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
284
340
  end
285
341
  end
286
342
 
@@ -328,5 +384,8 @@ module TCAClient
328
384
  else
329
385
  value
330
386
  end
331
- end end
387
+ end
388
+
389
+ end
390
+
332
391
  end
@@ -3,13 +3,15 @@
3
3
 
4
4
  #Turnitin Core API (TCA) provides direct API access to the core functionality provided by Turnitin. TCA supports file submission, similarity report generation, group management, and visualization of report matches via Cloud Viewer or PDF download. Below is the full flow to successfully set up an integration scope, an API Key, and make calls to TCA. Integration Scope and API Key management is done via the Admin Console UI by logging in as an admin user. For more details, go to our [developer portal documentation page](https://developers.turnitin.com/docs). ## Integration Scope and API Key Management TCA API calls must provide an API Key for authentication, so you must first have at least one integration scope associated with at least one API Key to use TCA. ### Admin Console UI First, login to Admin Console UI as an *Admin* user with permission to create Integration Scopes, under a tenant that is licensed to use the TCA product Integration Scopes (you can create a new one, or add keys to existing) * Click `Integrations` in the side bar --> `+ Add Integration` at top the top of the page --> Enter a name --> `Add` Button API Keys * Click `Integrations` in the side bar --> `Create API Key` Button next to a given Integration Scope --> Enter a name --> click `Create and View button` * Copy/Save the key manually or click save to clipboard button to copy it (this is the only time it will show) ## TCA Flow * Register a webhook * Create a submission * Upload a file for the submission * Wait for the submission upload to process * If you registered a webhook, a callback will be sent to it when upload is complete * The status of the *submission* will also update to `COMPLETE` * Request a Similarity Report * Wait for similarity report to process * If you registered a webhook, a callback will be sent to it when report is complete * The status of the *report* will also be updated to `COMPLETE` * Request a URL with parameters to view the Similarity Report
5
5
 
6
- OpenAPI spec version: 1.0.249
6
+ The version of the OpenAPI document: 1.0.258
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.3.0-SNAPSHOT
7
10
 
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.35
10
11
  =end
11
12
 
12
13
  require 'date'
14
+ require 'time'
13
15
 
14
16
  module TCAClient
15
17
  # (optional) Submission metadata. If a group context is included, it must be associated to a group
@@ -40,15 +42,20 @@ module TCAClient
40
42
  }
41
43
  end
42
44
 
45
+ # Returns all the JSON keys this model knows about
46
+ def self.acceptable_attributes
47
+ attribute_map.values
48
+ end
49
+
43
50
  # Attribute type mapping.
44
51
  def self.openapi_types
45
52
  {
46
- :'submitter' => :'Object',
47
- :'owners' => :'Object',
48
- :'group' => :'Object',
49
- :'group_context' => :'Object',
50
- :'original_submitted_time' => :'Object',
51
- :'custom' => :'Object'
53
+ :'submitter' => :'Users',
54
+ :'owners' => :'Array<Users>',
55
+ :'group' => :'Group',
56
+ :'group_context' => :'GroupContext',
57
+ :'original_submitted_time' => :'Time',
58
+ :'custom' => :'String'
52
59
  }
53
60
  end
54
61
 
@@ -57,7 +64,7 @@ module TCAClient
57
64
  Set.new([
58
65
  ])
59
66
  end
60
-
67
+
61
68
  # Initializes the object
62
69
  # @param [Hash] attributes Model attributes in the form of hash
63
70
  def initialize(attributes = {})
@@ -150,8 +157,11 @@ module TCAClient
150
157
  # @return [Object] Returns the model itself
151
158
  def build_from_hash(attributes)
152
159
  return nil unless attributes.is_a?(Hash)
160
+ attributes = attributes.transform_keys(&:to_sym)
153
161
  self.class.openapi_types.each_pair do |key, type|
154
- if type =~ /\AArray<(.*)>/i
162
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
163
+ self.send("#{key}=", nil)
164
+ elsif type =~ /\AArray<(.*)>/i
155
165
  # check to ensure the input is an array given that the attribute
156
166
  # is documented as an array but the input is not
157
167
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -159,8 +169,6 @@ module TCAClient
159
169
  end
160
170
  elsif !attributes[self.class.attribute_map[key]].nil?
161
171
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
162
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
163
- self.send("#{key}=", nil)
164
172
  end
165
173
  end
166
174
 
@@ -173,8 +181,8 @@ module TCAClient
173
181
  # @return [Object] Deserialized data
174
182
  def _deserialize(type, value)
175
183
  case type.to_sym
176
- when :DateTime
177
- DateTime.parse(value)
184
+ when :Time
185
+ Time.parse(value)
178
186
  when :Date
179
187
  Date.parse(value)
180
188
  when :String
@@ -204,7 +212,9 @@ module TCAClient
204
212
  end
205
213
  end
206
214
  else # model
207
- TCAClient.const_get(type).build_from_hash(value)
215
+ # models (e.g. Pet) or oneOf
216
+ klass = TCAClient.const_get(type)
217
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
208
218
  end
209
219
  end
210
220
 
@@ -252,5 +262,8 @@ module TCAClient
252
262
  else
253
263
  value
254
264
  end
255
- end end
265
+ end
266
+
267
+ end
268
+
256
269
  end