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.
- checksums.yaml +4 -4
- data/docs/AddGroupAttachmentRequest.md +16 -4
- data/docs/AddGroupAttachmentResponse.md +14 -3
- data/docs/AggregateGroup.md +24 -8
- data/docs/AnnotationsSettings.md +18 -0
- data/docs/AuthorMetadataOverride.md +16 -4
- data/docs/EULAApi.md +166 -92
- data/docs/Error.md +16 -4
- data/docs/Eula.md +18 -5
- data/docs/EulaAcceptListItem.md +20 -6
- data/docs/EulaAcceptRequest.md +20 -6
- data/docs/EulaVersion.md +22 -7
- data/docs/FeaturesApi.md +41 -23
- data/docs/FeaturesEnabled.md +20 -6
- data/docs/FeaturesGenerationSettings.md +16 -4
- data/docs/FeaturesSimilarity.md +18 -5
- data/docs/FeaturesSimilarityViewSettings.md +38 -15
- data/docs/FeaturesTenant.md +14 -3
- data/docs/FeaturesViewerModes.md +16 -4
- data/docs/GenerateSimilarityPDF.md +18 -0
- data/docs/GetGroupAttachments200Response.md +18 -0
- data/docs/Group.md +18 -5
- data/docs/GroupAttachmentResponse.md +20 -6
- data/docs/GroupContext.md +18 -5
- data/docs/GroupsApi.md +321 -177
- data/docs/IndexApi.md +84 -44
- data/docs/IndexStateSettings.md +14 -3
- data/docs/IndexingSettings.md +14 -3
- data/docs/PDFStatusWebhookRequest.md +24 -0
- data/docs/PdfStatusResponse.md +14 -3
- data/docs/RateLimitError.md +16 -4
- data/docs/RequestPdfResponse.md +14 -3
- data/docs/Sidebar.md +14 -3
- data/docs/SimilarityApi.md +239 -129
- data/docs/SimilarityCompleteWebhookRequest.md +38 -0
- data/docs/SimilarityGenerationSettings.md +20 -6
- data/docs/SimilarityMetadata.md +32 -12
- data/docs/SimilarityMetadataAllOf.md +28 -0
- data/docs/SimilarityMetadataAllOfTopMatches.md +30 -0
- data/docs/SimilarityPutRequest.md +18 -5
- data/docs/SimilarityScoreData.md +20 -6
- data/docs/SimilaritySettings.md +18 -5
- data/docs/SimilaritySettingsModes.md +16 -4
- data/docs/SimilaritySettingsViewSettings.md +14 -3
- data/docs/SimilarityViewSettings.md +38 -15
- data/docs/SimilarityViewerUrlResponse.md +14 -3
- data/docs/SimilarityViewerUrlSettings.md +30 -10
- data/docs/SimpleSubmissionResponse.md +22 -2
- data/docs/SimpleSubmissionResponseAllOf.md +26 -0
- data/docs/Submission.md +34 -2
- data/docs/SubmissionAllOf.md +38 -0
- data/docs/SubmissionApi.md +202 -111
- data/docs/SubmissionBase.md +30 -11
- data/docs/SubmissionBaseMetadata.md +24 -8
- data/docs/SubmissionCompleteWebhookRequest.md +40 -0
- data/docs/SubmissionCompleteWebhookRequestAllOf.md +18 -0
- data/docs/SubmissionCompleteWebhookRequestAllOfMetadata.md +18 -0
- data/docs/SubmissionSizeError.md +16 -4
- data/docs/SuccessMessage.md +14 -3
- data/docs/Users.md +20 -6
- data/docs/ViewerPermissions.md +22 -7
- data/docs/Webhook.md +24 -6
- data/docs/WebhookAllOf.md +20 -0
- data/docs/WebhookApi.md +193 -103
- data/docs/WebhookBase.md +20 -6
- data/docs/WebhookPathRequest.md +16 -4
- data/docs/WebhookWithSecret.md +22 -6
- data/docs/WebhookWithSecretAllOf.md +18 -0
- data/lib/tca_client/api/eula_api.rb +96 -63
- data/lib/tca_client/api/features_api.rb +21 -12
- data/lib/tca_client/api/groups_api.rb +225 -155
- data/lib/tca_client/api/index_api.rb +46 -27
- data/lib/tca_client/api/similarity_api.rb +165 -104
- data/lib/tca_client/api/submission_api.rb +132 -89
- data/lib/tca_client/api/webhook_api.rb +120 -77
- data/lib/tca_client/api_client.rb +61 -57
- data/lib/tca_client/api_error.rb +4 -4
- data/lib/tca_client/configuration.rb +93 -13
- data/lib/tca_client/models/add_group_attachment_request.rb +50 -13
- data/lib/tca_client/models/add_group_attachment_response.rb +25 -12
- data/lib/tca_client/models/aggregate_group.rb +34 -21
- data/lib/tca_client/models/annotations_settings.rb +220 -0
- data/lib/tca_client/models/author_metadata_override.rb +26 -13
- data/lib/tca_client/models/error.rb +26 -13
- data/lib/tca_client/models/eula.rb +27 -14
- data/lib/tca_client/models/eula_accept_list_item.rb +28 -15
- data/lib/tca_client/models/eula_accept_request.rb +28 -15
- data/lib/tca_client/models/eula_version.rb +29 -16
- data/lib/tca_client/models/features_enabled.rb +28 -15
- data/lib/tca_client/models/features_generation_settings.rb +26 -13
- data/lib/tca_client/models/features_similarity.rb +27 -14
- data/lib/tca_client/models/features_similarity_view_settings.rb +37 -24
- data/lib/tca_client/models/features_tenant.rb +25 -12
- data/lib/tca_client/models/features_viewer_modes.rb +26 -13
- data/lib/tca_client/models/generate_similarity_pdf.rb +254 -0
- data/lib/tca_client/models/{inline_response_200.rb → get_group_attachments200_response.rb} +28 -15
- data/lib/tca_client/models/group.rb +29 -16
- data/lib/tca_client/models/group_attachment_response.rb +30 -17
- data/lib/tca_client/models/group_context.rb +27 -14
- data/lib/tca_client/models/index_state_settings.rb +25 -12
- data/lib/tca_client/models/indexing_settings.rb +25 -12
- data/lib/tca_client/models/pdf_status_response.rb +27 -14
- data/lib/tca_client/models/pdf_status_webhook_request.rb +283 -0
- data/lib/tca_client/models/rate_limit_error.rb +36 -20
- data/lib/tca_client/models/request_pdf_response.rb +25 -12
- data/lib/tca_client/models/sidebar.rb +27 -14
- data/lib/tca_client/models/similarity_complete_webhook_request.rb +366 -0
- data/lib/tca_client/models/similarity_generation_settings.rb +30 -17
- data/lib/tca_client/models/similarity_metadata.rb +45 -28
- data/lib/tca_client/models/similarity_metadata_all_of.rb +301 -0
- data/lib/tca_client/models/{similarity_metadata_top_matches.rb → similarity_metadata_all_of_top_matches.rb} +34 -21
- data/lib/tca_client/models/similarity_put_request.rb +27 -14
- data/lib/tca_client/models/similarity_score_data.rb +28 -15
- data/lib/tca_client/models/similarity_settings.rb +29 -16
- data/lib/tca_client/models/similarity_settings_modes.rb +26 -13
- data/lib/tca_client/models/similarity_settings_view_settings.rb +25 -12
- data/lib/tca_client/models/similarity_view_settings.rb +37 -24
- data/lib/tca_client/models/similarity_viewer_url_response.rb +25 -12
- data/lib/tca_client/models/similarity_viewer_url_settings.rb +46 -24
- data/lib/tca_client/models/simple_submission_response.rb +117 -13
- data/lib/tca_client/models/simple_submission_response_all_of.rb +294 -0
- data/lib/tca_client/models/submission.rb +191 -13
- data/lib/tca_client/models/submission_all_of.rb +368 -0
- data/lib/tca_client/models/submission_base.rb +82 -23
- data/lib/tca_client/models/submission_base_metadata.rb +30 -17
- data/lib/tca_client/models/submission_complete_webhook_request.rb +385 -0
- data/lib/tca_client/models/submission_complete_webhook_request_all_of.rb +219 -0
- data/lib/tca_client/models/submission_complete_webhook_request_all_of_metadata.rb +219 -0
- data/lib/tca_client/models/submission_size_error.rb +36 -20
- data/lib/tca_client/models/success_message.rb +25 -12
- data/lib/tca_client/models/users.rb +28 -15
- data/lib/tca_client/models/viewer_permissions.rb +29 -16
- data/lib/tca_client/models/webhook.rb +62 -16
- data/lib/tca_client/models/webhook_all_of.rb +235 -0
- data/lib/tca_client/models/webhook_base.rb +28 -15
- data/lib/tca_client/models/webhook_path_request.rb +26 -13
- data/lib/tca_client/models/webhook_with_secret.rb +52 -16
- data/lib/tca_client/models/webhook_with_secret_all_of.rb +225 -0
- data/lib/tca_client/version.rb +5 -4
- data/lib/tca_client.rb +18 -5
- data/tca_client-1.0.0.gem +0 -0
- data/tca_client.gemspec +7 -7
- metadata +34 -29
- data/docs/InlineResponse200.md +0 -7
- data/docs/SimilarityMetadataTopMatches.md +0 -13
@@ -0,0 +1,301 @@
|
|
1
|
+
=begin
|
2
|
+
#Turnitin Core API
|
3
|
+
|
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
|
+
|
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
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module TCAClient
|
17
|
+
class SimilarityMetadataAllOf
|
18
|
+
attr_accessor :submission_id
|
19
|
+
|
20
|
+
# possible values PENDING, COMPLETE
|
21
|
+
attr_accessor :status
|
22
|
+
|
23
|
+
# Time the report finished generating. If not set the report has not finished generating
|
24
|
+
attr_accessor :time_generated
|
25
|
+
|
26
|
+
# Time the report was requested
|
27
|
+
attr_accessor :time_requested
|
28
|
+
|
29
|
+
# Top matches
|
30
|
+
attr_accessor :top_matches
|
31
|
+
|
32
|
+
# Largest individual matched word count, 0 if there isn't a match to this submission.
|
33
|
+
attr_accessor :top_source_largest_matched_word_count
|
34
|
+
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
36
|
+
def self.attribute_map
|
37
|
+
{
|
38
|
+
:'submission_id' => :'submission_id',
|
39
|
+
:'status' => :'status',
|
40
|
+
:'time_generated' => :'time_generated',
|
41
|
+
:'time_requested' => :'time_requested',
|
42
|
+
:'top_matches' => :'top_matches',
|
43
|
+
:'top_source_largest_matched_word_count' => :'top_source_largest_matched_word_count'
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
# Returns all the JSON keys this model knows about
|
48
|
+
def self.acceptable_attributes
|
49
|
+
attribute_map.values
|
50
|
+
end
|
51
|
+
|
52
|
+
# Attribute type mapping.
|
53
|
+
def self.openapi_types
|
54
|
+
{
|
55
|
+
:'submission_id' => :'String',
|
56
|
+
:'status' => :'String',
|
57
|
+
:'time_generated' => :'String',
|
58
|
+
:'time_requested' => :'String',
|
59
|
+
:'top_matches' => :'Array<SimilarityMetadataAllOfTopMatches>',
|
60
|
+
:'top_source_largest_matched_word_count' => :'Integer'
|
61
|
+
}
|
62
|
+
end
|
63
|
+
|
64
|
+
# List of attributes with nullable: true
|
65
|
+
def self.openapi_nullable
|
66
|
+
Set.new([
|
67
|
+
])
|
68
|
+
end
|
69
|
+
|
70
|
+
# Initializes the object
|
71
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
72
|
+
def initialize(attributes = {})
|
73
|
+
if (!attributes.is_a?(Hash))
|
74
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TCAClient::SimilarityMetadataAllOf` initialize method"
|
75
|
+
end
|
76
|
+
|
77
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
78
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
79
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
80
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TCAClient::SimilarityMetadataAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
81
|
+
end
|
82
|
+
h[k.to_sym] = v
|
83
|
+
}
|
84
|
+
|
85
|
+
if attributes.key?(:'submission_id')
|
86
|
+
self.submission_id = attributes[:'submission_id']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'status')
|
90
|
+
self.status = attributes[:'status']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:'time_generated')
|
94
|
+
self.time_generated = attributes[:'time_generated']
|
95
|
+
end
|
96
|
+
|
97
|
+
if attributes.key?(:'time_requested')
|
98
|
+
self.time_requested = attributes[:'time_requested']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'top_matches')
|
102
|
+
if (value = attributes[:'top_matches']).is_a?(Array)
|
103
|
+
self.top_matches = value
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.key?(:'top_source_largest_matched_word_count')
|
108
|
+
self.top_source_largest_matched_word_count = attributes[:'top_source_largest_matched_word_count']
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
113
|
+
# @return Array for valid properties with the reasons
|
114
|
+
def list_invalid_properties
|
115
|
+
invalid_properties = Array.new
|
116
|
+
if @submission_id.nil?
|
117
|
+
invalid_properties.push('invalid value for "submission_id", submission_id cannot be nil.')
|
118
|
+
end
|
119
|
+
|
120
|
+
if @status.nil?
|
121
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
122
|
+
end
|
123
|
+
|
124
|
+
if @time_generated.nil?
|
125
|
+
invalid_properties.push('invalid value for "time_generated", time_generated cannot be nil.')
|
126
|
+
end
|
127
|
+
|
128
|
+
if @time_requested.nil?
|
129
|
+
invalid_properties.push('invalid value for "time_requested", time_requested cannot be nil.')
|
130
|
+
end
|
131
|
+
|
132
|
+
if @top_matches.nil?
|
133
|
+
invalid_properties.push('invalid value for "top_matches", top_matches cannot be nil.')
|
134
|
+
end
|
135
|
+
|
136
|
+
if @top_source_largest_matched_word_count.nil?
|
137
|
+
invalid_properties.push('invalid value for "top_source_largest_matched_word_count", top_source_largest_matched_word_count cannot be nil.')
|
138
|
+
end
|
139
|
+
|
140
|
+
invalid_properties
|
141
|
+
end
|
142
|
+
|
143
|
+
# Check to see if the all the properties in the model are valid
|
144
|
+
# @return true if the model is valid
|
145
|
+
def valid?
|
146
|
+
return false if @submission_id.nil?
|
147
|
+
return false if @status.nil?
|
148
|
+
return false if @time_generated.nil?
|
149
|
+
return false if @time_requested.nil?
|
150
|
+
return false if @top_matches.nil?
|
151
|
+
return false if @top_source_largest_matched_word_count.nil?
|
152
|
+
true
|
153
|
+
end
|
154
|
+
|
155
|
+
# Checks equality by comparing each attribute.
|
156
|
+
# @param [Object] Object to be compared
|
157
|
+
def ==(o)
|
158
|
+
return true if self.equal?(o)
|
159
|
+
self.class == o.class &&
|
160
|
+
submission_id == o.submission_id &&
|
161
|
+
status == o.status &&
|
162
|
+
time_generated == o.time_generated &&
|
163
|
+
time_requested == o.time_requested &&
|
164
|
+
top_matches == o.top_matches &&
|
165
|
+
top_source_largest_matched_word_count == o.top_source_largest_matched_word_count
|
166
|
+
end
|
167
|
+
|
168
|
+
# @see the `==` method
|
169
|
+
# @param [Object] Object to be compared
|
170
|
+
def eql?(o)
|
171
|
+
self == o
|
172
|
+
end
|
173
|
+
|
174
|
+
# Calculates hash code according to all attributes.
|
175
|
+
# @return [Integer] Hash code
|
176
|
+
def hash
|
177
|
+
[submission_id, status, time_generated, time_requested, top_matches, top_source_largest_matched_word_count].hash
|
178
|
+
end
|
179
|
+
|
180
|
+
# Builds the object from hash
|
181
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
182
|
+
# @return [Object] Returns the model itself
|
183
|
+
def self.build_from_hash(attributes)
|
184
|
+
new.build_from_hash(attributes)
|
185
|
+
end
|
186
|
+
|
187
|
+
# Builds the object from hash
|
188
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
189
|
+
# @return [Object] Returns the model itself
|
190
|
+
def build_from_hash(attributes)
|
191
|
+
return nil unless attributes.is_a?(Hash)
|
192
|
+
attributes = attributes.transform_keys(&:to_sym)
|
193
|
+
self.class.openapi_types.each_pair do |key, type|
|
194
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
195
|
+
self.send("#{key}=", nil)
|
196
|
+
elsif type =~ /\AArray<(.*)>/i
|
197
|
+
# check to ensure the input is an array given that the attribute
|
198
|
+
# is documented as an array but the input is not
|
199
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
200
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
201
|
+
end
|
202
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
203
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
self
|
208
|
+
end
|
209
|
+
|
210
|
+
# Deserializes the data based on type
|
211
|
+
# @param string type Data type
|
212
|
+
# @param string value Value to be deserialized
|
213
|
+
# @return [Object] Deserialized data
|
214
|
+
def _deserialize(type, value)
|
215
|
+
case type.to_sym
|
216
|
+
when :Time
|
217
|
+
Time.parse(value)
|
218
|
+
when :Date
|
219
|
+
Date.parse(value)
|
220
|
+
when :String
|
221
|
+
value.to_s
|
222
|
+
when :Integer
|
223
|
+
value.to_i
|
224
|
+
when :Float
|
225
|
+
value.to_f
|
226
|
+
when :Boolean
|
227
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
228
|
+
true
|
229
|
+
else
|
230
|
+
false
|
231
|
+
end
|
232
|
+
when :Object
|
233
|
+
# generic object (usually a Hash), return directly
|
234
|
+
value
|
235
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
236
|
+
inner_type = Regexp.last_match[:inner_type]
|
237
|
+
value.map { |v| _deserialize(inner_type, v) }
|
238
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
239
|
+
k_type = Regexp.last_match[:k_type]
|
240
|
+
v_type = Regexp.last_match[:v_type]
|
241
|
+
{}.tap do |hash|
|
242
|
+
value.each do |k, v|
|
243
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
244
|
+
end
|
245
|
+
end
|
246
|
+
else # model
|
247
|
+
# models (e.g. Pet) or oneOf
|
248
|
+
klass = TCAClient.const_get(type)
|
249
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
# Returns the string representation of the object
|
254
|
+
# @return [String] String presentation of the object
|
255
|
+
def to_s
|
256
|
+
to_hash.to_s
|
257
|
+
end
|
258
|
+
|
259
|
+
# to_body is an alias to to_hash (backward compatibility)
|
260
|
+
# @return [Hash] Returns the object in the form of hash
|
261
|
+
def to_body
|
262
|
+
to_hash
|
263
|
+
end
|
264
|
+
|
265
|
+
# Returns the object in the form of hash
|
266
|
+
# @return [Hash] Returns the object in the form of hash
|
267
|
+
def to_hash
|
268
|
+
hash = {}
|
269
|
+
self.class.attribute_map.each_pair do |attr, param|
|
270
|
+
value = self.send(attr)
|
271
|
+
if value.nil?
|
272
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
273
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
274
|
+
end
|
275
|
+
|
276
|
+
hash[param] = _to_hash(value)
|
277
|
+
end
|
278
|
+
hash
|
279
|
+
end
|
280
|
+
|
281
|
+
# Outputs non-array value in the form of hash
|
282
|
+
# For object, use to_hash. Otherwise, just return the value
|
283
|
+
# @param [Object] value Any valid value
|
284
|
+
# @return [Hash] Returns the value in the form of hash
|
285
|
+
def _to_hash(value)
|
286
|
+
if value.is_a?(Array)
|
287
|
+
value.compact.map { |v| _to_hash(v) }
|
288
|
+
elsif value.is_a?(Hash)
|
289
|
+
{}.tap do |hash|
|
290
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
291
|
+
end
|
292
|
+
elsif value.respond_to? :to_hash
|
293
|
+
value.to_hash
|
294
|
+
else
|
295
|
+
value
|
296
|
+
end
|
297
|
+
end
|
298
|
+
|
299
|
+
end
|
300
|
+
|
301
|
+
end
|
@@ -3,16 +3,18 @@
|
|
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
|
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
|
-
class
|
17
|
+
class SimilarityMetadataAllOfTopMatches
|
16
18
|
# Source name
|
17
19
|
attr_accessor :name
|
18
20
|
|
@@ -47,16 +49,21 @@ module TCAClient
|
|
47
49
|
}
|
48
50
|
end
|
49
51
|
|
52
|
+
# Returns all the JSON keys this model knows about
|
53
|
+
def self.acceptable_attributes
|
54
|
+
attribute_map.values
|
55
|
+
end
|
56
|
+
|
50
57
|
# Attribute type mapping.
|
51
58
|
def self.openapi_types
|
52
59
|
{
|
53
|
-
:'name' => :'
|
54
|
-
:'percentage' => :'
|
55
|
-
:'submission_id' => :'
|
56
|
-
:'source_type' => :'
|
57
|
-
:'matched_word_count_total' => :'
|
58
|
-
:'submitted_date' => :'
|
59
|
-
:'institution_name' => :'
|
60
|
+
:'name' => :'String',
|
61
|
+
:'percentage' => :'Float',
|
62
|
+
:'submission_id' => :'String',
|
63
|
+
:'source_type' => :'String',
|
64
|
+
:'matched_word_count_total' => :'Float',
|
65
|
+
:'submitted_date' => :'String',
|
66
|
+
:'institution_name' => :'String'
|
60
67
|
}
|
61
68
|
end
|
62
69
|
|
@@ -65,18 +72,18 @@ module TCAClient
|
|
65
72
|
Set.new([
|
66
73
|
])
|
67
74
|
end
|
68
|
-
|
75
|
+
|
69
76
|
# Initializes the object
|
70
77
|
# @param [Hash] attributes Model attributes in the form of hash
|
71
78
|
def initialize(attributes = {})
|
72
79
|
if (!attributes.is_a?(Hash))
|
73
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `TCAClient::
|
80
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TCAClient::SimilarityMetadataAllOfTopMatches` initialize method"
|
74
81
|
end
|
75
82
|
|
76
83
|
# check to see if the attribute exists and convert string to symbol for hash key
|
77
84
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
78
85
|
if (!self.class.attribute_map.key?(k.to_sym))
|
79
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `TCAClient::
|
86
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TCAClient::SimilarityMetadataAllOfTopMatches`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
80
87
|
end
|
81
88
|
h[k.to_sym] = v
|
82
89
|
}
|
@@ -161,8 +168,11 @@ module TCAClient
|
|
161
168
|
# @return [Object] Returns the model itself
|
162
169
|
def build_from_hash(attributes)
|
163
170
|
return nil unless attributes.is_a?(Hash)
|
171
|
+
attributes = attributes.transform_keys(&:to_sym)
|
164
172
|
self.class.openapi_types.each_pair do |key, type|
|
165
|
-
if
|
173
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
174
|
+
self.send("#{key}=", nil)
|
175
|
+
elsif type =~ /\AArray<(.*)>/i
|
166
176
|
# check to ensure the input is an array given that the attribute
|
167
177
|
# is documented as an array but the input is not
|
168
178
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -170,8 +180,6 @@ module TCAClient
|
|
170
180
|
end
|
171
181
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
172
182
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
173
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
174
|
-
self.send("#{key}=", nil)
|
175
183
|
end
|
176
184
|
end
|
177
185
|
|
@@ -184,8 +192,8 @@ module TCAClient
|
|
184
192
|
# @return [Object] Deserialized data
|
185
193
|
def _deserialize(type, value)
|
186
194
|
case type.to_sym
|
187
|
-
when :
|
188
|
-
|
195
|
+
when :Time
|
196
|
+
Time.parse(value)
|
189
197
|
when :Date
|
190
198
|
Date.parse(value)
|
191
199
|
when :String
|
@@ -215,7 +223,9 @@ module TCAClient
|
|
215
223
|
end
|
216
224
|
end
|
217
225
|
else # model
|
218
|
-
|
226
|
+
# models (e.g. Pet) or oneOf
|
227
|
+
klass = TCAClient.const_get(type)
|
228
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
219
229
|
end
|
220
230
|
end
|
221
231
|
|
@@ -263,5 +273,8 @@ module TCAClient
|
|
263
273
|
else
|
264
274
|
value
|
265
275
|
end
|
266
|
-
end
|
276
|
+
end
|
277
|
+
|
278
|
+
end
|
279
|
+
|
267
280
|
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
|
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 SimilarityPutRequest
|
@@ -28,12 +30,17 @@ 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
|
-
:'indexing_settings' => :'
|
35
|
-
:'generation_settings' => :'
|
36
|
-
:'view_settings' => :'
|
41
|
+
:'indexing_settings' => :'IndexingSettings',
|
42
|
+
:'generation_settings' => :'SimilarityGenerationSettings',
|
43
|
+
:'view_settings' => :'SimilarityViewSettings'
|
37
44
|
}
|
38
45
|
end
|
39
46
|
|
@@ -42,7 +49,7 @@ module TCAClient
|
|
42
49
|
Set.new([
|
43
50
|
])
|
44
51
|
end
|
45
|
-
|
52
|
+
|
46
53
|
# Initializes the object
|
47
54
|
# @param [Hash] attributes Model attributes in the form of hash
|
48
55
|
def initialize(attributes = {})
|
@@ -123,8 +130,11 @@ module TCAClient
|
|
123
130
|
# @return [Object] Returns the model itself
|
124
131
|
def build_from_hash(attributes)
|
125
132
|
return nil unless attributes.is_a?(Hash)
|
133
|
+
attributes = attributes.transform_keys(&:to_sym)
|
126
134
|
self.class.openapi_types.each_pair do |key, type|
|
127
|
-
if
|
135
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
136
|
+
self.send("#{key}=", nil)
|
137
|
+
elsif type =~ /\AArray<(.*)>/i
|
128
138
|
# check to ensure the input is an array given that the attribute
|
129
139
|
# is documented as an array but the input is not
|
130
140
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -132,8 +142,6 @@ module TCAClient
|
|
132
142
|
end
|
133
143
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
134
144
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
135
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
136
|
-
self.send("#{key}=", nil)
|
137
145
|
end
|
138
146
|
end
|
139
147
|
|
@@ -146,8 +154,8 @@ module TCAClient
|
|
146
154
|
# @return [Object] Deserialized data
|
147
155
|
def _deserialize(type, value)
|
148
156
|
case type.to_sym
|
149
|
-
when :
|
150
|
-
|
157
|
+
when :Time
|
158
|
+
Time.parse(value)
|
151
159
|
when :Date
|
152
160
|
Date.parse(value)
|
153
161
|
when :String
|
@@ -177,7 +185,9 @@ module TCAClient
|
|
177
185
|
end
|
178
186
|
end
|
179
187
|
else # model
|
180
|
-
|
188
|
+
# models (e.g. Pet) or oneOf
|
189
|
+
klass = TCAClient.const_get(type)
|
190
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
181
191
|
end
|
182
192
|
end
|
183
193
|
|
@@ -225,5 +235,8 @@ module TCAClient
|
|
225
235
|
else
|
226
236
|
value
|
227
237
|
end
|
228
|
-
end
|
238
|
+
end
|
239
|
+
|
240
|
+
end
|
241
|
+
|
229
242
|
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
|
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 SimilarityScoreData
|
@@ -35,13 +37,18 @@ module TCAClient
|
|
35
37
|
}
|
36
38
|
end
|
37
39
|
|
40
|
+
# Returns all the JSON keys this model knows about
|
41
|
+
def self.acceptable_attributes
|
42
|
+
attribute_map.values
|
43
|
+
end
|
44
|
+
|
38
45
|
# Attribute type mapping.
|
39
46
|
def self.openapi_types
|
40
47
|
{
|
41
|
-
:'overall_match_percentage' => :'
|
42
|
-
:'internet_match_percentage' => :'
|
43
|
-
:'publication_match_percentage' => :'
|
44
|
-
:'submitted_works_match_percentage' => :'
|
48
|
+
:'overall_match_percentage' => :'Integer',
|
49
|
+
:'internet_match_percentage' => :'Integer',
|
50
|
+
:'publication_match_percentage' => :'Integer',
|
51
|
+
:'submitted_works_match_percentage' => :'Integer'
|
45
52
|
}
|
46
53
|
end
|
47
54
|
|
@@ -53,7 +60,7 @@ module TCAClient
|
|
53
60
|
:'submitted_works_match_percentage'
|
54
61
|
])
|
55
62
|
end
|
56
|
-
|
63
|
+
|
57
64
|
# Initializes the object
|
58
65
|
# @param [Hash] attributes Model attributes in the form of hash
|
59
66
|
def initialize(attributes = {})
|
@@ -139,8 +146,11 @@ module TCAClient
|
|
139
146
|
# @return [Object] Returns the model itself
|
140
147
|
def build_from_hash(attributes)
|
141
148
|
return nil unless attributes.is_a?(Hash)
|
149
|
+
attributes = attributes.transform_keys(&:to_sym)
|
142
150
|
self.class.openapi_types.each_pair do |key, type|
|
143
|
-
if
|
151
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
152
|
+
self.send("#{key}=", nil)
|
153
|
+
elsif type =~ /\AArray<(.*)>/i
|
144
154
|
# check to ensure the input is an array given that the attribute
|
145
155
|
# is documented as an array but the input is not
|
146
156
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -148,8 +158,6 @@ module TCAClient
|
|
148
158
|
end
|
149
159
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
150
160
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
151
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
152
|
-
self.send("#{key}=", nil)
|
153
161
|
end
|
154
162
|
end
|
155
163
|
|
@@ -162,8 +170,8 @@ module TCAClient
|
|
162
170
|
# @return [Object] Deserialized data
|
163
171
|
def _deserialize(type, value)
|
164
172
|
case type.to_sym
|
165
|
-
when :
|
166
|
-
|
173
|
+
when :Time
|
174
|
+
Time.parse(value)
|
167
175
|
when :Date
|
168
176
|
Date.parse(value)
|
169
177
|
when :String
|
@@ -193,7 +201,9 @@ module TCAClient
|
|
193
201
|
end
|
194
202
|
end
|
195
203
|
else # model
|
196
|
-
|
204
|
+
# models (e.g. Pet) or oneOf
|
205
|
+
klass = TCAClient.const_get(type)
|
206
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
197
207
|
end
|
198
208
|
end
|
199
209
|
|
@@ -241,5 +251,8 @@ module TCAClient
|
|
241
251
|
else
|
242
252
|
value
|
243
253
|
end
|
244
|
-
end
|
254
|
+
end
|
255
|
+
|
256
|
+
end
|
257
|
+
|
245
258
|
end
|