tca_client 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/docs/AddGroupAttachmentRequest.md +16 -4
  4. data/docs/AddGroupAttachmentResponse.md +14 -3
  5. data/docs/AggregateGroup.md +24 -8
  6. data/docs/AnnotationsSettings.md +18 -0
  7. data/docs/AuthorMetadataOverride.md +16 -4
  8. data/docs/EULAApi.md +166 -92
  9. data/docs/Error.md +16 -4
  10. data/docs/Eula.md +18 -5
  11. data/docs/EulaAcceptListItem.md +20 -6
  12. data/docs/EulaAcceptRequest.md +20 -6
  13. data/docs/EulaVersion.md +22 -7
  14. data/docs/FeaturesApi.md +41 -23
  15. data/docs/FeaturesEnabled.md +20 -6
  16. data/docs/FeaturesGenerationSettings.md +16 -4
  17. data/docs/FeaturesSimilarity.md +18 -5
  18. data/docs/FeaturesSimilarityViewSettings.md +38 -15
  19. data/docs/FeaturesTenant.md +14 -3
  20. data/docs/FeaturesViewerModes.md +16 -4
  21. data/docs/GenerateSimilarityPDF.md +18 -0
  22. data/docs/GetGroupAttachments200Response.md +18 -0
  23. data/docs/Group.md +18 -5
  24. data/docs/GroupAttachmentResponse.md +20 -6
  25. data/docs/GroupContext.md +18 -5
  26. data/docs/GroupsApi.md +321 -177
  27. data/docs/IndexApi.md +84 -44
  28. data/docs/IndexStateSettings.md +14 -3
  29. data/docs/IndexingSettings.md +14 -3
  30. data/docs/PDFStatusWebhookRequest.md +24 -0
  31. data/docs/PdfStatusResponse.md +14 -3
  32. data/docs/RateLimitError.md +16 -4
  33. data/docs/RequestPdfResponse.md +14 -3
  34. data/docs/Sidebar.md +14 -3
  35. data/docs/SimilarityApi.md +239 -129
  36. data/docs/SimilarityCompleteWebhookRequest.md +38 -0
  37. data/docs/SimilarityGenerationSettings.md +20 -6
  38. data/docs/SimilarityMetadata.md +32 -12
  39. data/docs/SimilarityMetadataAllOf.md +28 -0
  40. data/docs/SimilarityMetadataAllOfTopMatches.md +30 -0
  41. data/docs/SimilarityPutRequest.md +18 -5
  42. data/docs/SimilarityScoreData.md +20 -6
  43. data/docs/SimilaritySettings.md +18 -5
  44. data/docs/SimilaritySettingsModes.md +16 -4
  45. data/docs/SimilaritySettingsViewSettings.md +14 -3
  46. data/docs/SimilarityViewSettings.md +38 -15
  47. data/docs/SimilarityViewerUrlResponse.md +14 -3
  48. data/docs/SimilarityViewerUrlSettings.md +30 -10
  49. data/docs/SimpleSubmissionResponse.md +22 -2
  50. data/docs/SimpleSubmissionResponseAllOf.md +26 -0
  51. data/docs/Submission.md +34 -2
  52. data/docs/SubmissionAllOf.md +38 -0
  53. data/docs/SubmissionApi.md +203 -112
  54. data/docs/SubmissionBase.md +30 -11
  55. data/docs/SubmissionBaseMetadata.md +24 -8
  56. data/docs/SubmissionCompleteWebhookRequest.md +40 -0
  57. data/docs/SubmissionCompleteWebhookRequestAllOf.md +18 -0
  58. data/docs/SubmissionCompleteWebhookRequestAllOfMetadata.md +18 -0
  59. data/docs/SubmissionSizeError.md +16 -4
  60. data/docs/SuccessMessage.md +14 -3
  61. data/docs/Users.md +20 -6
  62. data/docs/ViewerPermissions.md +22 -7
  63. data/docs/Webhook.md +24 -6
  64. data/docs/WebhookAllOf.md +20 -0
  65. data/docs/WebhookApi.md +193 -103
  66. data/docs/WebhookBase.md +20 -6
  67. data/docs/WebhookPathRequest.md +16 -4
  68. data/docs/WebhookWithSecret.md +22 -6
  69. data/docs/WebhookWithSecretAllOf.md +18 -0
  70. data/lib/tca_client/api/eula_api.rb +96 -63
  71. data/lib/tca_client/api/features_api.rb +21 -12
  72. data/lib/tca_client/api/groups_api.rb +225 -155
  73. data/lib/tca_client/api/index_api.rb +46 -27
  74. data/lib/tca_client/api/similarity_api.rb +165 -104
  75. data/lib/tca_client/api/submission_api.rb +140 -97
  76. data/lib/tca_client/api/webhook_api.rb +120 -77
  77. data/lib/tca_client/api_client.rb +61 -57
  78. data/lib/tca_client/api_error.rb +4 -4
  79. data/lib/tca_client/configuration.rb +93 -13
  80. data/lib/tca_client/models/add_group_attachment_request.rb +50 -13
  81. data/lib/tca_client/models/add_group_attachment_response.rb +25 -12
  82. data/lib/tca_client/models/aggregate_group.rb +34 -21
  83. data/lib/tca_client/models/annotations_settings.rb +220 -0
  84. data/lib/tca_client/models/author_metadata_override.rb +26 -13
  85. data/lib/tca_client/models/error.rb +26 -13
  86. data/lib/tca_client/models/eula.rb +27 -14
  87. data/lib/tca_client/models/eula_accept_list_item.rb +28 -15
  88. data/lib/tca_client/models/eula_accept_request.rb +28 -15
  89. data/lib/tca_client/models/eula_version.rb +29 -16
  90. data/lib/tca_client/models/features_enabled.rb +28 -15
  91. data/lib/tca_client/models/features_generation_settings.rb +26 -13
  92. data/lib/tca_client/models/features_similarity.rb +27 -14
  93. data/lib/tca_client/models/features_similarity_view_settings.rb +37 -24
  94. data/lib/tca_client/models/features_tenant.rb +25 -12
  95. data/lib/tca_client/models/features_viewer_modes.rb +26 -13
  96. data/lib/tca_client/models/generate_similarity_pdf.rb +254 -0
  97. data/lib/tca_client/models/{inline_response_200.rb → get_group_attachments200_response.rb} +28 -15
  98. data/lib/tca_client/models/group.rb +29 -16
  99. data/lib/tca_client/models/group_attachment_response.rb +38 -17
  100. data/lib/tca_client/models/group_context.rb +27 -14
  101. data/lib/tca_client/models/index_state_settings.rb +25 -12
  102. data/lib/tca_client/models/indexing_settings.rb +25 -12
  103. data/lib/tca_client/models/pdf_status_response.rb +27 -14
  104. data/lib/tca_client/models/pdf_status_webhook_request.rb +283 -0
  105. data/lib/tca_client/models/rate_limit_error.rb +36 -20
  106. data/lib/tca_client/models/request_pdf_response.rb +25 -12
  107. data/lib/tca_client/models/sidebar.rb +27 -14
  108. data/lib/tca_client/models/similarity_complete_webhook_request.rb +366 -0
  109. data/lib/tca_client/models/similarity_generation_settings.rb +30 -17
  110. data/lib/tca_client/models/similarity_metadata.rb +45 -28
  111. data/lib/tca_client/models/similarity_metadata_all_of.rb +301 -0
  112. data/lib/tca_client/models/{similarity_metadata_top_matches.rb → similarity_metadata_all_of_top_matches.rb} +34 -21
  113. data/lib/tca_client/models/similarity_put_request.rb +27 -14
  114. data/lib/tca_client/models/similarity_score_data.rb +28 -15
  115. data/lib/tca_client/models/similarity_settings.rb +29 -16
  116. data/lib/tca_client/models/similarity_settings_modes.rb +26 -13
  117. data/lib/tca_client/models/similarity_settings_view_settings.rb +25 -12
  118. data/lib/tca_client/models/similarity_view_settings.rb +37 -24
  119. data/lib/tca_client/models/similarity_viewer_url_response.rb +25 -12
  120. data/lib/tca_client/models/similarity_viewer_url_settings.rb +46 -24
  121. data/lib/tca_client/models/simple_submission_response.rb +117 -13
  122. data/lib/tca_client/models/simple_submission_response_all_of.rb +294 -0
  123. data/lib/tca_client/models/submission.rb +191 -13
  124. data/lib/tca_client/models/submission_all_of.rb +368 -0
  125. data/lib/tca_client/models/submission_base.rb +82 -23
  126. data/lib/tca_client/models/submission_base_metadata.rb +30 -17
  127. data/lib/tca_client/models/submission_complete_webhook_request.rb +385 -0
  128. data/lib/tca_client/models/submission_complete_webhook_request_all_of.rb +219 -0
  129. data/lib/tca_client/models/submission_complete_webhook_request_all_of_metadata.rb +219 -0
  130. data/lib/tca_client/models/submission_size_error.rb +36 -20
  131. data/lib/tca_client/models/success_message.rb +25 -12
  132. data/lib/tca_client/models/users.rb +28 -15
  133. data/lib/tca_client/models/viewer_permissions.rb +29 -16
  134. data/lib/tca_client/models/webhook.rb +62 -16
  135. data/lib/tca_client/models/webhook_all_of.rb +235 -0
  136. data/lib/tca_client/models/webhook_base.rb +28 -15
  137. data/lib/tca_client/models/webhook_path_request.rb +26 -13
  138. data/lib/tca_client/models/webhook_with_secret.rb +52 -16
  139. data/lib/tca_client/models/webhook_with_secret_all_of.rb +225 -0
  140. data/lib/tca_client/version.rb +5 -4
  141. data/lib/tca_client.rb +18 -5
  142. data/spec/api/submission_api_spec.rb +2 -2
  143. data/tca_client-1.0.0.gem +0 -0
  144. data/tca_client-1.0.1.gem +0 -0
  145. data/tca_client.gemspec +7 -7
  146. metadata +44 -38
  147. data/docs/InlineResponse200.md +0 -7
  148. data/docs/SimilarityMetadataTopMatches.md +0 -13
@@ -3,10 +3,11 @@
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
  module TCAClient
@@ -20,6 +21,18 @@ module TCAClient
20
21
  # Defines url base path
21
22
  attr_accessor :base_path
22
23
 
24
+ # Define server configuration index
25
+ attr_accessor :server_index
26
+
27
+ # Define server operation configuration index
28
+ attr_accessor :server_operation_index
29
+
30
+ # Default server variables
31
+ attr_accessor :server_variables
32
+
33
+ # Default server operation variables
34
+ attr_accessor :server_operation_variables
35
+
23
36
  # Defines API keys used with API Key authentications.
24
37
  #
25
38
  # @return [Hash] key: parameter name, value: parameter value (API key)
@@ -120,23 +133,28 @@ module TCAClient
120
133
  # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96
121
134
  attr_accessor :params_encoding
122
135
 
136
+
123
137
  attr_accessor :inject_format
124
138
 
125
139
  attr_accessor :force_ending_format
126
140
 
127
141
  def initialize
128
142
  @scheme = 'https'
129
- @host = '{tenantName}.{hostName}'
130
- @base_path = 'https://{tenantName}.{hostName}/api/v1'
143
+ @host = 'app-us.turnitin.com'
144
+ @base_path = '/api/v1'
145
+ @server_index = 0
146
+ @server_operation_index = {}
147
+ @server_variables = {}
148
+ @server_operation_variables = {}
131
149
  @api_key = {}
132
150
  @api_key_prefix = {}
133
- @timeout = 0
134
151
  @client_side_validation = true
135
152
  @verify_ssl = true
136
153
  @verify_ssl_host = true
137
- @params_encoding = nil
138
154
  @cert_file = nil
139
155
  @key_file = nil
156
+ @timeout = 0
157
+ @params_encoding = nil
140
158
  @debugging = false
141
159
  @inject_format = false
142
160
  @force_ending_format = false
@@ -170,17 +188,23 @@ module TCAClient
170
188
  @base_path = '' if @base_path == '/'
171
189
  end
172
190
 
173
- def base_url
174
- "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '')
191
+ # Returns base URL for specified operation based on server settings
192
+ def base_url(operation = nil)
193
+ index = server_operation_index.fetch(operation, server_index)
194
+ return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if index == nil
195
+
196
+ server_url(index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
175
197
  end
176
198
 
177
199
  # Gets API key (with prefix if set).
178
200
  # @param [String] param_name the parameter name of API key auth
179
- def api_key_with_prefix(param_name)
201
+ def api_key_with_prefix(param_name, param_alias = nil)
202
+ key = @api_key[param_name]
203
+ key = @api_key.fetch(param_alias, key) unless param_alias.nil?
180
204
  if @api_key_prefix[param_name]
181
- "#{@api_key_prefix[param_name]} #{@api_key[param_name]}"
205
+ "#{@api_key_prefix[param_name]} #{key}"
182
206
  else
183
- @api_key[param_name]
207
+ key
184
208
  end
185
209
  end
186
210
 
@@ -197,9 +221,65 @@ module TCAClient
197
221
  type: 'api_key',
198
222
  in: 'header',
199
223
  key: 'Authorization',
200
- value: api_key_with_prefix('Authorization')
224
+ value: api_key_with_prefix('api_key')
201
225
  },
202
226
  }
203
227
  end
228
+
229
+ # Returns an array of Server setting
230
+ def server_settings
231
+ [
232
+ {
233
+ url: "https://{tenantName}.turnitin.com/api/v1",
234
+ description: "No description provided",
235
+ variables: {
236
+ tenantName: {
237
+ description: "Customer tenant name",
238
+ default_value: "app-us",
239
+ }
240
+ }
241
+ }
242
+ ]
243
+ end
244
+
245
+ def operation_server_settings
246
+ {
247
+ }
248
+ end
249
+
250
+ # Returns URL based on server settings
251
+ #
252
+ # @param index array index of the server settings
253
+ # @param variables hash of variable and the corresponding value
254
+ def server_url(index, variables = {}, servers = nil)
255
+ servers = server_settings if servers == nil
256
+
257
+ # check array index out of bound
258
+ if (index < 0 || index >= servers.size)
259
+ fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}"
260
+ end
261
+
262
+ server = servers[index]
263
+ url = server[:url]
264
+
265
+ return url unless server.key? :variables
266
+
267
+ # go through variable and assign a value
268
+ server[:variables].each do |name, variable|
269
+ if variables.key?(name)
270
+ if (!server[:variables][name].key?(:enum_values) || server[:variables][name][:enum_values].include?(variables[name]))
271
+ url.gsub! "{" + name.to_s + "}", variables[name]
272
+ else
273
+ fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}."
274
+ end
275
+ else
276
+ # use default value
277
+ url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value]
278
+ end
279
+ end
280
+
281
+ url
282
+ end
283
+
204
284
  end
205
285
  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
  # Request Object to add group attachment.
@@ -28,11 +30,16 @@ module TCAClient
28
30
  }
29
31
  end
30
32
 
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
31
38
  # Attribute type mapping.
32
39
  def self.openapi_types
33
40
  {
34
- :'title' => :'Object',
35
- :'template' => :'Object'
41
+ :'title' => :'String',
42
+ :'template' => :'Boolean'
36
43
  }
37
44
  end
38
45
 
@@ -41,7 +48,7 @@ module TCAClient
41
48
  Set.new([
42
49
  ])
43
50
  end
44
-
51
+
45
52
  # Initializes the object
46
53
  # @param [Hash] attributes Model attributes in the form of hash
47
54
  def initialize(attributes = {})
@@ -72,15 +79,39 @@ module TCAClient
72
79
  # @return Array for valid properties with the reasons
73
80
  def list_invalid_properties
74
81
  invalid_properties = Array.new
82
+ if !@title.nil? && @title.to_s.length > 500
83
+ invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 500.')
84
+ end
85
+
86
+ if !@title.nil? && @title.to_s.length < 1
87
+ invalid_properties.push('invalid value for "title", the character length must be great than or equal to 1.')
88
+ end
89
+
75
90
  invalid_properties
76
91
  end
77
92
 
78
93
  # Check to see if the all the properties in the model are valid
79
94
  # @return true if the model is valid
80
95
  def valid?
96
+ return false if !@title.nil? && @title.to_s.length > 500
97
+ return false if !@title.nil? && @title.to_s.length < 1
81
98
  true
82
99
  end
83
100
 
101
+ # Custom attribute writer method with validation
102
+ # @param [Object] title Value to be assigned
103
+ def title=(title)
104
+ if !title.nil? && title.to_s.length > 500
105
+ fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 500.'
106
+ end
107
+
108
+ if !title.nil? && title.to_s.length < 1
109
+ fail ArgumentError, 'invalid value for "title", the character length must be great than or equal to 1.'
110
+ end
111
+
112
+ @title = title
113
+ end
114
+
84
115
  # Checks equality by comparing each attribute.
85
116
  # @param [Object] Object to be compared
86
117
  def ==(o)
@@ -114,8 +145,11 @@ module TCAClient
114
145
  # @return [Object] Returns the model itself
115
146
  def build_from_hash(attributes)
116
147
  return nil unless attributes.is_a?(Hash)
148
+ attributes = attributes.transform_keys(&:to_sym)
117
149
  self.class.openapi_types.each_pair do |key, type|
118
- if type =~ /\AArray<(.*)>/i
150
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
151
+ self.send("#{key}=", nil)
152
+ elsif type =~ /\AArray<(.*)>/i
119
153
  # check to ensure the input is an array given that the attribute
120
154
  # is documented as an array but the input is not
121
155
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -123,8 +157,6 @@ module TCAClient
123
157
  end
124
158
  elsif !attributes[self.class.attribute_map[key]].nil?
125
159
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
126
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
127
- self.send("#{key}=", nil)
128
160
  end
129
161
  end
130
162
 
@@ -137,8 +169,8 @@ module TCAClient
137
169
  # @return [Object] Deserialized data
138
170
  def _deserialize(type, value)
139
171
  case type.to_sym
140
- when :DateTime
141
- DateTime.parse(value)
172
+ when :Time
173
+ Time.parse(value)
142
174
  when :Date
143
175
  Date.parse(value)
144
176
  when :String
@@ -168,7 +200,9 @@ module TCAClient
168
200
  end
169
201
  end
170
202
  else # model
171
- TCAClient.const_get(type).build_from_hash(value)
203
+ # models (e.g. Pet) or oneOf
204
+ klass = TCAClient.const_get(type)
205
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
172
206
  end
173
207
  end
174
208
 
@@ -216,5 +250,8 @@ module TCAClient
216
250
  else
217
251
  value
218
252
  end
219
- end end
253
+ end
254
+
255
+ end
256
+
220
257
  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
  # Object returned for add group attachment.
@@ -24,10 +26,15 @@ module TCAClient
24
26
  }
25
27
  end
26
28
 
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
27
34
  # Attribute type mapping.
28
35
  def self.openapi_types
29
36
  {
30
- :'id' => :'Object'
37
+ :'id' => :'String'
31
38
  }
32
39
  end
33
40
 
@@ -36,7 +43,7 @@ module TCAClient
36
43
  Set.new([
37
44
  ])
38
45
  end
39
-
46
+
40
47
  # Initializes the object
41
48
  # @param [Hash] attributes Model attributes in the form of hash
42
49
  def initialize(attributes = {})
@@ -102,8 +109,11 @@ module TCAClient
102
109
  # @return [Object] Returns the model itself
103
110
  def build_from_hash(attributes)
104
111
  return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
105
113
  self.class.openapi_types.each_pair do |key, type|
106
- if type =~ /\AArray<(.*)>/i
114
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
115
+ self.send("#{key}=", nil)
116
+ elsif type =~ /\AArray<(.*)>/i
107
117
  # check to ensure the input is an array given that the attribute
108
118
  # is documented as an array but the input is not
109
119
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -111,8 +121,6 @@ module TCAClient
111
121
  end
112
122
  elsif !attributes[self.class.attribute_map[key]].nil?
113
123
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
114
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
115
- self.send("#{key}=", nil)
116
124
  end
117
125
  end
118
126
 
@@ -125,8 +133,8 @@ module TCAClient
125
133
  # @return [Object] Deserialized data
126
134
  def _deserialize(type, value)
127
135
  case type.to_sym
128
- when :DateTime
129
- DateTime.parse(value)
136
+ when :Time
137
+ Time.parse(value)
130
138
  when :Date
131
139
  Date.parse(value)
132
140
  when :String
@@ -156,7 +164,9 @@ module TCAClient
156
164
  end
157
165
  end
158
166
  else # model
159
- TCAClient.const_get(type).build_from_hash(value)
167
+ # models (e.g. Pet) or oneOf
168
+ klass = TCAClient.const_get(type)
169
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
160
170
  end
161
171
  end
162
172
 
@@ -204,5 +214,8 @@ module TCAClient
204
214
  else
205
215
  value
206
216
  end
207
- end end
217
+ end
218
+
219
+ end
220
+
208
221
  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
  class AggregateGroup
@@ -61,15 +63,20 @@ module TCAClient
61
63
  }
62
64
  end
63
65
 
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ attribute_map.values
69
+ end
70
+
64
71
  # Attribute type mapping.
65
72
  def self.openapi_types
66
73
  {
67
- :'id' => :'Object',
68
- :'name' => :'Object',
69
- :'type' => :'Object',
70
- :'group_context' => :'Object',
71
- :'due_date' => :'Object',
72
- :'report_generation' => :'Object'
74
+ :'id' => :'String',
75
+ :'name' => :'String',
76
+ :'type' => :'String',
77
+ :'group_context' => :'GroupContext',
78
+ :'due_date' => :'Date',
79
+ :'report_generation' => :'String'
73
80
  }
74
81
  end
75
82
 
@@ -78,7 +85,7 @@ module TCAClient
78
85
  Set.new([
79
86
  ])
80
87
  end
81
-
88
+
82
89
  # Initializes the object
83
90
  # @param [Hash] attributes Model attributes in the form of hash
84
91
  def initialize(attributes = {})
@@ -129,9 +136,9 @@ module TCAClient
129
136
  # Check to see if the all the properties in the model are valid
130
137
  # @return true if the model is valid
131
138
  def valid?
132
- type_validator = EnumAttributeValidator.new('Object', ['ASSIGNMENT', 'FOLDER'])
139
+ type_validator = EnumAttributeValidator.new('String', ["ASSIGNMENT", "FOLDER"])
133
140
  return false unless type_validator.valid?(@type)
134
- report_generation_validator = EnumAttributeValidator.new('Object', ['IMMEDIATELY', 'IMMEDIATELY_AND_DUE_DATE'])
141
+ report_generation_validator = EnumAttributeValidator.new('String', ["IMMEDIATELY", "IMMEDIATELY_AND_DUE_DATE"])
135
142
  return false unless report_generation_validator.valid?(@report_generation)
136
143
  true
137
144
  end
@@ -139,7 +146,7 @@ module TCAClient
139
146
  # Custom attribute writer method checking allowed values (enum).
140
147
  # @param [Object] type Object to be assigned
141
148
  def type=(type)
142
- validator = EnumAttributeValidator.new('Object', ['ASSIGNMENT', 'FOLDER'])
149
+ validator = EnumAttributeValidator.new('String', ["ASSIGNMENT", "FOLDER"])
143
150
  unless validator.valid?(type)
144
151
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
145
152
  end
@@ -149,7 +156,7 @@ module TCAClient
149
156
  # Custom attribute writer method checking allowed values (enum).
150
157
  # @param [Object] report_generation Object to be assigned
151
158
  def report_generation=(report_generation)
152
- validator = EnumAttributeValidator.new('Object', ['IMMEDIATELY', 'IMMEDIATELY_AND_DUE_DATE'])
159
+ validator = EnumAttributeValidator.new('String', ["IMMEDIATELY", "IMMEDIATELY_AND_DUE_DATE"])
153
160
  unless validator.valid?(report_generation)
154
161
  fail ArgumentError, "invalid value for \"report_generation\", must be one of #{validator.allowable_values}."
155
162
  end
@@ -193,8 +200,11 @@ module TCAClient
193
200
  # @return [Object] Returns the model itself
194
201
  def build_from_hash(attributes)
195
202
  return nil unless attributes.is_a?(Hash)
203
+ attributes = attributes.transform_keys(&:to_sym)
196
204
  self.class.openapi_types.each_pair do |key, type|
197
- if type =~ /\AArray<(.*)>/i
205
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
206
+ self.send("#{key}=", nil)
207
+ elsif type =~ /\AArray<(.*)>/i
198
208
  # check to ensure the input is an array given that the attribute
199
209
  # is documented as an array but the input is not
200
210
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -202,8 +212,6 @@ module TCAClient
202
212
  end
203
213
  elsif !attributes[self.class.attribute_map[key]].nil?
204
214
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
205
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
206
- self.send("#{key}=", nil)
207
215
  end
208
216
  end
209
217
 
@@ -216,8 +224,8 @@ module TCAClient
216
224
  # @return [Object] Deserialized data
217
225
  def _deserialize(type, value)
218
226
  case type.to_sym
219
- when :DateTime
220
- DateTime.parse(value)
227
+ when :Time
228
+ Time.parse(value)
221
229
  when :Date
222
230
  Date.parse(value)
223
231
  when :String
@@ -247,7 +255,9 @@ module TCAClient
247
255
  end
248
256
  end
249
257
  else # model
250
- TCAClient.const_get(type).build_from_hash(value)
258
+ # models (e.g. Pet) or oneOf
259
+ klass = TCAClient.const_get(type)
260
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
251
261
  end
252
262
  end
253
263
 
@@ -295,5 +305,8 @@ module TCAClient
295
305
  else
296
306
  value
297
307
  end
298
- end end
308
+ end
309
+
310
+ end
311
+
299
312
  end