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,366 @@
|
|
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 SimilarityCompleteWebhookRequest
|
18
|
+
# Represents the percentage match against all sources
|
19
|
+
attr_accessor :overall_match_percentage
|
20
|
+
|
21
|
+
# Represents the percentage match against internet
|
22
|
+
attr_accessor :internet_match_percentage
|
23
|
+
|
24
|
+
# Represents the percentage match against all publications
|
25
|
+
attr_accessor :publication_match_percentage
|
26
|
+
|
27
|
+
# Represents the percentage match against all submitted works
|
28
|
+
attr_accessor :submitted_works_match_percentage
|
29
|
+
|
30
|
+
attr_accessor :submission_id
|
31
|
+
|
32
|
+
# possible values PENDING, COMPLETE
|
33
|
+
attr_accessor :status
|
34
|
+
|
35
|
+
# Time the report finished generating. If not set the report has not finished generating
|
36
|
+
attr_accessor :time_generated
|
37
|
+
|
38
|
+
# Time the report was requested
|
39
|
+
attr_accessor :time_requested
|
40
|
+
|
41
|
+
# Top matches
|
42
|
+
attr_accessor :top_matches
|
43
|
+
|
44
|
+
# Largest individual matched word count, 0 if there isn't a match to this submission.
|
45
|
+
attr_accessor :top_source_largest_matched_word_count
|
46
|
+
|
47
|
+
attr_accessor :metadata
|
48
|
+
|
49
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
50
|
+
def self.attribute_map
|
51
|
+
{
|
52
|
+
:'overall_match_percentage' => :'overall_match_percentage',
|
53
|
+
:'internet_match_percentage' => :'internet_match_percentage',
|
54
|
+
:'publication_match_percentage' => :'publication_match_percentage',
|
55
|
+
:'submitted_works_match_percentage' => :'submitted_works_match_percentage',
|
56
|
+
:'submission_id' => :'submission_id',
|
57
|
+
:'status' => :'status',
|
58
|
+
:'time_generated' => :'time_generated',
|
59
|
+
:'time_requested' => :'time_requested',
|
60
|
+
:'top_matches' => :'top_matches',
|
61
|
+
:'top_source_largest_matched_word_count' => :'top_source_largest_matched_word_count',
|
62
|
+
:'metadata' => :'metadata'
|
63
|
+
}
|
64
|
+
end
|
65
|
+
|
66
|
+
# Returns all the JSON keys this model knows about
|
67
|
+
def self.acceptable_attributes
|
68
|
+
attribute_map.values
|
69
|
+
end
|
70
|
+
|
71
|
+
# Attribute type mapping.
|
72
|
+
def self.openapi_types
|
73
|
+
{
|
74
|
+
:'overall_match_percentage' => :'Integer',
|
75
|
+
:'internet_match_percentage' => :'Integer',
|
76
|
+
:'publication_match_percentage' => :'Integer',
|
77
|
+
:'submitted_works_match_percentage' => :'Integer',
|
78
|
+
:'submission_id' => :'String',
|
79
|
+
:'status' => :'String',
|
80
|
+
:'time_generated' => :'String',
|
81
|
+
:'time_requested' => :'String',
|
82
|
+
:'top_matches' => :'Array<SimilarityMetadataAllOfTopMatches>',
|
83
|
+
:'top_source_largest_matched_word_count' => :'Integer',
|
84
|
+
:'metadata' => :'SubmissionCompleteWebhookRequestAllOfMetadata'
|
85
|
+
}
|
86
|
+
end
|
87
|
+
|
88
|
+
# List of attributes with nullable: true
|
89
|
+
def self.openapi_nullable
|
90
|
+
Set.new([
|
91
|
+
:'internet_match_percentage',
|
92
|
+
:'publication_match_percentage',
|
93
|
+
:'submitted_works_match_percentage',
|
94
|
+
])
|
95
|
+
end
|
96
|
+
|
97
|
+
# List of class defined in allOf (OpenAPI v3)
|
98
|
+
def self.openapi_all_of
|
99
|
+
[
|
100
|
+
:'SimilarityMetadata',
|
101
|
+
:'SubmissionCompleteWebhookRequestAllOf'
|
102
|
+
]
|
103
|
+
end
|
104
|
+
|
105
|
+
# Initializes the object
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
def initialize(attributes = {})
|
108
|
+
if (!attributes.is_a?(Hash))
|
109
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `TCAClient::SimilarityCompleteWebhookRequest` initialize method"
|
110
|
+
end
|
111
|
+
|
112
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
113
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
114
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
115
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `TCAClient::SimilarityCompleteWebhookRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
116
|
+
end
|
117
|
+
h[k.to_sym] = v
|
118
|
+
}
|
119
|
+
|
120
|
+
if attributes.key?(:'overall_match_percentage')
|
121
|
+
self.overall_match_percentage = attributes[:'overall_match_percentage']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'internet_match_percentage')
|
125
|
+
self.internet_match_percentage = attributes[:'internet_match_percentage']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'publication_match_percentage')
|
129
|
+
self.publication_match_percentage = attributes[:'publication_match_percentage']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'submitted_works_match_percentage')
|
133
|
+
self.submitted_works_match_percentage = attributes[:'submitted_works_match_percentage']
|
134
|
+
end
|
135
|
+
|
136
|
+
if attributes.key?(:'submission_id')
|
137
|
+
self.submission_id = attributes[:'submission_id']
|
138
|
+
end
|
139
|
+
|
140
|
+
if attributes.key?(:'status')
|
141
|
+
self.status = attributes[:'status']
|
142
|
+
end
|
143
|
+
|
144
|
+
if attributes.key?(:'time_generated')
|
145
|
+
self.time_generated = attributes[:'time_generated']
|
146
|
+
end
|
147
|
+
|
148
|
+
if attributes.key?(:'time_requested')
|
149
|
+
self.time_requested = attributes[:'time_requested']
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'top_matches')
|
153
|
+
if (value = attributes[:'top_matches']).is_a?(Array)
|
154
|
+
self.top_matches = value
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
if attributes.key?(:'top_source_largest_matched_word_count')
|
159
|
+
self.top_source_largest_matched_word_count = attributes[:'top_source_largest_matched_word_count']
|
160
|
+
end
|
161
|
+
|
162
|
+
if attributes.key?(:'metadata')
|
163
|
+
self.metadata = attributes[:'metadata']
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
168
|
+
# @return Array for valid properties with the reasons
|
169
|
+
def list_invalid_properties
|
170
|
+
invalid_properties = Array.new
|
171
|
+
if @overall_match_percentage.nil?
|
172
|
+
invalid_properties.push('invalid value for "overall_match_percentage", overall_match_percentage cannot be nil.')
|
173
|
+
end
|
174
|
+
|
175
|
+
if @submission_id.nil?
|
176
|
+
invalid_properties.push('invalid value for "submission_id", submission_id cannot be nil.')
|
177
|
+
end
|
178
|
+
|
179
|
+
if @status.nil?
|
180
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
181
|
+
end
|
182
|
+
|
183
|
+
if @time_generated.nil?
|
184
|
+
invalid_properties.push('invalid value for "time_generated", time_generated cannot be nil.')
|
185
|
+
end
|
186
|
+
|
187
|
+
if @time_requested.nil?
|
188
|
+
invalid_properties.push('invalid value for "time_requested", time_requested cannot be nil.')
|
189
|
+
end
|
190
|
+
|
191
|
+
if @top_matches.nil?
|
192
|
+
invalid_properties.push('invalid value for "top_matches", top_matches cannot be nil.')
|
193
|
+
end
|
194
|
+
|
195
|
+
if @top_source_largest_matched_word_count.nil?
|
196
|
+
invalid_properties.push('invalid value for "top_source_largest_matched_word_count", top_source_largest_matched_word_count cannot be nil.')
|
197
|
+
end
|
198
|
+
|
199
|
+
invalid_properties
|
200
|
+
end
|
201
|
+
|
202
|
+
# Check to see if the all the properties in the model are valid
|
203
|
+
# @return true if the model is valid
|
204
|
+
def valid?
|
205
|
+
return false if @overall_match_percentage.nil?
|
206
|
+
return false if @submission_id.nil?
|
207
|
+
return false if @status.nil?
|
208
|
+
return false if @time_generated.nil?
|
209
|
+
return false if @time_requested.nil?
|
210
|
+
return false if @top_matches.nil?
|
211
|
+
return false if @top_source_largest_matched_word_count.nil?
|
212
|
+
true
|
213
|
+
end
|
214
|
+
|
215
|
+
# Checks equality by comparing each attribute.
|
216
|
+
# @param [Object] Object to be compared
|
217
|
+
def ==(o)
|
218
|
+
return true if self.equal?(o)
|
219
|
+
self.class == o.class &&
|
220
|
+
overall_match_percentage == o.overall_match_percentage &&
|
221
|
+
internet_match_percentage == o.internet_match_percentage &&
|
222
|
+
publication_match_percentage == o.publication_match_percentage &&
|
223
|
+
submitted_works_match_percentage == o.submitted_works_match_percentage &&
|
224
|
+
submission_id == o.submission_id &&
|
225
|
+
status == o.status &&
|
226
|
+
time_generated == o.time_generated &&
|
227
|
+
time_requested == o.time_requested &&
|
228
|
+
top_matches == o.top_matches &&
|
229
|
+
top_source_largest_matched_word_count == o.top_source_largest_matched_word_count &&
|
230
|
+
metadata == o.metadata
|
231
|
+
end
|
232
|
+
|
233
|
+
# @see the `==` method
|
234
|
+
# @param [Object] Object to be compared
|
235
|
+
def eql?(o)
|
236
|
+
self == o
|
237
|
+
end
|
238
|
+
|
239
|
+
# Calculates hash code according to all attributes.
|
240
|
+
# @return [Integer] Hash code
|
241
|
+
def hash
|
242
|
+
[overall_match_percentage, internet_match_percentage, publication_match_percentage, submitted_works_match_percentage, submission_id, status, time_generated, time_requested, top_matches, top_source_largest_matched_word_count, metadata].hash
|
243
|
+
end
|
244
|
+
|
245
|
+
# Builds the object from hash
|
246
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
247
|
+
# @return [Object] Returns the model itself
|
248
|
+
def self.build_from_hash(attributes)
|
249
|
+
new.build_from_hash(attributes)
|
250
|
+
end
|
251
|
+
|
252
|
+
# Builds the object from hash
|
253
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
254
|
+
# @return [Object] Returns the model itself
|
255
|
+
def build_from_hash(attributes)
|
256
|
+
return nil unless attributes.is_a?(Hash)
|
257
|
+
attributes = attributes.transform_keys(&:to_sym)
|
258
|
+
self.class.openapi_types.each_pair do |key, type|
|
259
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
260
|
+
self.send("#{key}=", nil)
|
261
|
+
elsif type =~ /\AArray<(.*)>/i
|
262
|
+
# check to ensure the input is an array given that the attribute
|
263
|
+
# is documented as an array but the input is not
|
264
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
265
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
266
|
+
end
|
267
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
268
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
269
|
+
end
|
270
|
+
end
|
271
|
+
|
272
|
+
self
|
273
|
+
end
|
274
|
+
|
275
|
+
# Deserializes the data based on type
|
276
|
+
# @param string type Data type
|
277
|
+
# @param string value Value to be deserialized
|
278
|
+
# @return [Object] Deserialized data
|
279
|
+
def _deserialize(type, value)
|
280
|
+
case type.to_sym
|
281
|
+
when :Time
|
282
|
+
Time.parse(value)
|
283
|
+
when :Date
|
284
|
+
Date.parse(value)
|
285
|
+
when :String
|
286
|
+
value.to_s
|
287
|
+
when :Integer
|
288
|
+
value.to_i
|
289
|
+
when :Float
|
290
|
+
value.to_f
|
291
|
+
when :Boolean
|
292
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
293
|
+
true
|
294
|
+
else
|
295
|
+
false
|
296
|
+
end
|
297
|
+
when :Object
|
298
|
+
# generic object (usually a Hash), return directly
|
299
|
+
value
|
300
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
301
|
+
inner_type = Regexp.last_match[:inner_type]
|
302
|
+
value.map { |v| _deserialize(inner_type, v) }
|
303
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
304
|
+
k_type = Regexp.last_match[:k_type]
|
305
|
+
v_type = Regexp.last_match[:v_type]
|
306
|
+
{}.tap do |hash|
|
307
|
+
value.each do |k, v|
|
308
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
309
|
+
end
|
310
|
+
end
|
311
|
+
else # model
|
312
|
+
# models (e.g. Pet) or oneOf
|
313
|
+
klass = TCAClient.const_get(type)
|
314
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
318
|
+
# Returns the string representation of the object
|
319
|
+
# @return [String] String presentation of the object
|
320
|
+
def to_s
|
321
|
+
to_hash.to_s
|
322
|
+
end
|
323
|
+
|
324
|
+
# to_body is an alias to to_hash (backward compatibility)
|
325
|
+
# @return [Hash] Returns the object in the form of hash
|
326
|
+
def to_body
|
327
|
+
to_hash
|
328
|
+
end
|
329
|
+
|
330
|
+
# Returns the object in the form of hash
|
331
|
+
# @return [Hash] Returns the object in the form of hash
|
332
|
+
def to_hash
|
333
|
+
hash = {}
|
334
|
+
self.class.attribute_map.each_pair do |attr, param|
|
335
|
+
value = self.send(attr)
|
336
|
+
if value.nil?
|
337
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
338
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
339
|
+
end
|
340
|
+
|
341
|
+
hash[param] = _to_hash(value)
|
342
|
+
end
|
343
|
+
hash
|
344
|
+
end
|
345
|
+
|
346
|
+
# Outputs non-array value in the form of hash
|
347
|
+
# For object, use to_hash. Otherwise, just return the value
|
348
|
+
# @param [Object] value Any valid value
|
349
|
+
# @return [Hash] Returns the value in the form of hash
|
350
|
+
def _to_hash(value)
|
351
|
+
if value.is_a?(Array)
|
352
|
+
value.compact.map { |v| _to_hash(v) }
|
353
|
+
elsif value.is_a?(Hash)
|
354
|
+
{}.tap do |hash|
|
355
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
356
|
+
end
|
357
|
+
elsif value.respond_to? :to_hash
|
358
|
+
value.to_hash
|
359
|
+
else
|
360
|
+
value
|
361
|
+
end
|
362
|
+
end
|
363
|
+
|
364
|
+
end
|
365
|
+
|
366
|
+
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 SimilarityGenerationSettings
|
@@ -57,13 +59,18 @@ module TCAClient
|
|
57
59
|
}
|
58
60
|
end
|
59
61
|
|
62
|
+
# Returns all the JSON keys this model knows about
|
63
|
+
def self.acceptable_attributes
|
64
|
+
attribute_map.values
|
65
|
+
end
|
66
|
+
|
60
67
|
# Attribute type mapping.
|
61
68
|
def self.openapi_types
|
62
69
|
{
|
63
|
-
:'search_repositories' => :'
|
64
|
-
:'submission_auto_excludes' => :'
|
65
|
-
:'auto_exclude_self_matching_scope' => :'
|
66
|
-
:'priority' => :'
|
70
|
+
:'search_repositories' => :'Array<String>',
|
71
|
+
:'submission_auto_excludes' => :'Array<String>',
|
72
|
+
:'auto_exclude_self_matching_scope' => :'String',
|
73
|
+
:'priority' => :'Boolean'
|
67
74
|
}
|
68
75
|
end
|
69
76
|
|
@@ -72,7 +79,7 @@ module TCAClient
|
|
72
79
|
Set.new([
|
73
80
|
])
|
74
81
|
end
|
75
|
-
|
82
|
+
|
76
83
|
# Initializes the object
|
77
84
|
# @param [Hash] attributes Model attributes in the form of hash
|
78
85
|
def initialize(attributes = {})
|
@@ -124,7 +131,7 @@ module TCAClient
|
|
124
131
|
# @return true if the model is valid
|
125
132
|
def valid?
|
126
133
|
return false if @search_repositories.nil?
|
127
|
-
auto_exclude_self_matching_scope_validator = EnumAttributeValidator.new('
|
134
|
+
auto_exclude_self_matching_scope_validator = EnumAttributeValidator.new('String', ["ALL", "GROUP", "GROUP_CONTEXT", "NONE"])
|
128
135
|
return false unless auto_exclude_self_matching_scope_validator.valid?(@auto_exclude_self_matching_scope)
|
129
136
|
true
|
130
137
|
end
|
@@ -132,7 +139,7 @@ module TCAClient
|
|
132
139
|
# Custom attribute writer method checking allowed values (enum).
|
133
140
|
# @param [Object] auto_exclude_self_matching_scope Object to be assigned
|
134
141
|
def auto_exclude_self_matching_scope=(auto_exclude_self_matching_scope)
|
135
|
-
validator = EnumAttributeValidator.new('
|
142
|
+
validator = EnumAttributeValidator.new('String', ["ALL", "GROUP", "GROUP_CONTEXT", "NONE"])
|
136
143
|
unless validator.valid?(auto_exclude_self_matching_scope)
|
137
144
|
fail ArgumentError, "invalid value for \"auto_exclude_self_matching_scope\", must be one of #{validator.allowable_values}."
|
138
145
|
end
|
@@ -174,8 +181,11 @@ module TCAClient
|
|
174
181
|
# @return [Object] Returns the model itself
|
175
182
|
def build_from_hash(attributes)
|
176
183
|
return nil unless attributes.is_a?(Hash)
|
184
|
+
attributes = attributes.transform_keys(&:to_sym)
|
177
185
|
self.class.openapi_types.each_pair do |key, type|
|
178
|
-
if
|
186
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
187
|
+
self.send("#{key}=", nil)
|
188
|
+
elsif type =~ /\AArray<(.*)>/i
|
179
189
|
# check to ensure the input is an array given that the attribute
|
180
190
|
# is documented as an array but the input is not
|
181
191
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -183,8 +193,6 @@ module TCAClient
|
|
183
193
|
end
|
184
194
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
185
195
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
186
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
187
|
-
self.send("#{key}=", nil)
|
188
196
|
end
|
189
197
|
end
|
190
198
|
|
@@ -197,8 +205,8 @@ module TCAClient
|
|
197
205
|
# @return [Object] Deserialized data
|
198
206
|
def _deserialize(type, value)
|
199
207
|
case type.to_sym
|
200
|
-
when :
|
201
|
-
|
208
|
+
when :Time
|
209
|
+
Time.parse(value)
|
202
210
|
when :Date
|
203
211
|
Date.parse(value)
|
204
212
|
when :String
|
@@ -228,7 +236,9 @@ module TCAClient
|
|
228
236
|
end
|
229
237
|
end
|
230
238
|
else # model
|
231
|
-
|
239
|
+
# models (e.g. Pet) or oneOf
|
240
|
+
klass = TCAClient.const_get(type)
|
241
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
232
242
|
end
|
233
243
|
end
|
234
244
|
|
@@ -276,5 +286,8 @@ module TCAClient
|
|
276
286
|
else
|
277
287
|
value
|
278
288
|
end
|
279
|
-
end
|
289
|
+
end
|
290
|
+
|
291
|
+
end
|
292
|
+
|
280
293
|
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 SimilarityMetadata
|
@@ -58,19 +60,24 @@ module TCAClient
|
|
58
60
|
}
|
59
61
|
end
|
60
62
|
|
63
|
+
# Returns all the JSON keys this model knows about
|
64
|
+
def self.acceptable_attributes
|
65
|
+
attribute_map.values
|
66
|
+
end
|
67
|
+
|
61
68
|
# Attribute type mapping.
|
62
69
|
def self.openapi_types
|
63
70
|
{
|
64
|
-
:'overall_match_percentage' => :'',
|
65
|
-
:'internet_match_percentage' => :'',
|
66
|
-
:'publication_match_percentage' => :'',
|
67
|
-
:'submitted_works_match_percentage' => :'',
|
68
|
-
:'submission_id' => :'',
|
69
|
-
:'status' => :'',
|
70
|
-
:'time_generated' => :'',
|
71
|
-
:'time_requested' => :'',
|
72
|
-
:'top_matches' => :'',
|
73
|
-
:'top_source_largest_matched_word_count' => :''
|
71
|
+
:'overall_match_percentage' => :'Integer',
|
72
|
+
:'internet_match_percentage' => :'Integer',
|
73
|
+
:'publication_match_percentage' => :'Integer',
|
74
|
+
:'submitted_works_match_percentage' => :'Integer',
|
75
|
+
:'submission_id' => :'String',
|
76
|
+
:'status' => :'String',
|
77
|
+
:'time_generated' => :'String',
|
78
|
+
:'time_requested' => :'String',
|
79
|
+
:'top_matches' => :'Array<SimilarityMetadataAllOfTopMatches>',
|
80
|
+
:'top_source_largest_matched_word_count' => :'Integer'
|
74
81
|
}
|
75
82
|
end
|
76
83
|
|
@@ -82,7 +89,15 @@ module TCAClient
|
|
82
89
|
:'submitted_works_match_percentage',
|
83
90
|
])
|
84
91
|
end
|
85
|
-
|
92
|
+
|
93
|
+
# List of class defined in allOf (OpenAPI v3)
|
94
|
+
def self.openapi_all_of
|
95
|
+
[
|
96
|
+
:'SimilarityMetadataAllOf',
|
97
|
+
:'SimilarityScoreData'
|
98
|
+
]
|
99
|
+
end
|
100
|
+
|
86
101
|
# Initializes the object
|
87
102
|
# @param [Hash] attributes Model attributes in the form of hash
|
88
103
|
def initialize(attributes = {})
|
@@ -98,9 +113,6 @@ module TCAClient
|
|
98
113
|
h[k.to_sym] = v
|
99
114
|
}
|
100
115
|
|
101
|
-
# call parent's initialize
|
102
|
-
super(attributes)
|
103
|
-
|
104
116
|
if attributes.key?(:'overall_match_percentage')
|
105
117
|
self.overall_match_percentage = attributes[:'overall_match_percentage']
|
106
118
|
end
|
@@ -147,7 +159,7 @@ module TCAClient
|
|
147
159
|
# Show invalid properties with the reasons. Usually used together with valid?
|
148
160
|
# @return Array for valid properties with the reasons
|
149
161
|
def list_invalid_properties
|
150
|
-
invalid_properties =
|
162
|
+
invalid_properties = Array.new
|
151
163
|
if @overall_match_percentage.nil?
|
152
164
|
invalid_properties.push('invalid value for "overall_match_percentage", overall_match_percentage cannot be nil.')
|
153
165
|
end
|
@@ -206,7 +218,7 @@ module TCAClient
|
|
206
218
|
time_generated == o.time_generated &&
|
207
219
|
time_requested == o.time_requested &&
|
208
220
|
top_matches == o.top_matches &&
|
209
|
-
top_source_largest_matched_word_count == o.top_source_largest_matched_word_count
|
221
|
+
top_source_largest_matched_word_count == o.top_source_largest_matched_word_count
|
210
222
|
end
|
211
223
|
|
212
224
|
# @see the `==` method
|
@@ -233,9 +245,11 @@ module TCAClient
|
|
233
245
|
# @return [Object] Returns the model itself
|
234
246
|
def build_from_hash(attributes)
|
235
247
|
return nil unless attributes.is_a?(Hash)
|
236
|
-
|
248
|
+
attributes = attributes.transform_keys(&:to_sym)
|
237
249
|
self.class.openapi_types.each_pair do |key, type|
|
238
|
-
if
|
250
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
251
|
+
self.send("#{key}=", nil)
|
252
|
+
elsif type =~ /\AArray<(.*)>/i
|
239
253
|
# check to ensure the input is an array given that the attribute
|
240
254
|
# is documented as an array but the input is not
|
241
255
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
@@ -243,8 +257,6 @@ module TCAClient
|
|
243
257
|
end
|
244
258
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
245
259
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
246
|
-
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
247
|
-
self.send("#{key}=", nil)
|
248
260
|
end
|
249
261
|
end
|
250
262
|
|
@@ -257,8 +269,8 @@ module TCAClient
|
|
257
269
|
# @return [Object] Deserialized data
|
258
270
|
def _deserialize(type, value)
|
259
271
|
case type.to_sym
|
260
|
-
when :
|
261
|
-
|
272
|
+
when :Time
|
273
|
+
Time.parse(value)
|
262
274
|
when :Date
|
263
275
|
Date.parse(value)
|
264
276
|
when :String
|
@@ -288,7 +300,9 @@ module TCAClient
|
|
288
300
|
end
|
289
301
|
end
|
290
302
|
else # model
|
291
|
-
|
303
|
+
# models (e.g. Pet) or oneOf
|
304
|
+
klass = TCAClient.const_get(type)
|
305
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
292
306
|
end
|
293
307
|
end
|
294
308
|
|
@@ -307,7 +321,7 @@ module TCAClient
|
|
307
321
|
# Returns the object in the form of hash
|
308
322
|
# @return [Hash] Returns the object in the form of hash
|
309
323
|
def to_hash
|
310
|
-
hash =
|
324
|
+
hash = {}
|
311
325
|
self.class.attribute_map.each_pair do |attr, param|
|
312
326
|
value = self.send(attr)
|
313
327
|
if value.nil?
|
@@ -336,5 +350,8 @@ module TCAClient
|
|
336
350
|
else
|
337
351
|
value
|
338
352
|
end
|
339
|
-
end
|
353
|
+
end
|
354
|
+
|
355
|
+
end
|
356
|
+
|
340
357
|
end
|