tca_client 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +862 -0
- data/Rakefile +8 -0
- data/docs/AddGroupAttachmentRequest.md +8 -0
- data/docs/AddGroupAttachmentResponse.md +7 -0
- data/docs/AggregateGroup.md +12 -0
- data/docs/AuthorMetadataOverride.md +8 -0
- data/docs/EULAApi.md +241 -0
- data/docs/Error.md +8 -0
- data/docs/Eula.md +9 -0
- data/docs/EulaAcceptListItem.md +10 -0
- data/docs/EulaAcceptRequest.md +10 -0
- data/docs/EulaVersion.md +11 -0
- data/docs/FeaturesApi.md +61 -0
- data/docs/FeaturesEnabled.md +10 -0
- data/docs/FeaturesGenerationSettings.md +8 -0
- data/docs/FeaturesSimilarity.md +9 -0
- data/docs/FeaturesSimilarityViewSettings.md +19 -0
- data/docs/FeaturesTenant.md +7 -0
- data/docs/FeaturesViewerModes.md +8 -0
- data/docs/Group.md +9 -0
- data/docs/GroupAttachmentResponse.md +10 -0
- data/docs/GroupContext.md +9 -0
- data/docs/GroupsApi.md +472 -0
- data/docs/IndexApi.md +119 -0
- data/docs/IndexStateSettings.md +7 -0
- data/docs/IndexingSettings.md +7 -0
- data/docs/InlineResponse200.md +7 -0
- data/docs/PdfStatusResponse.md +7 -0
- data/docs/RateLimitError.md +8 -0
- data/docs/RequestPdfResponse.md +7 -0
- data/docs/Sidebar.md +7 -0
- data/docs/SimilarityApi.md +351 -0
- data/docs/SimilarityGenerationSettings.md +10 -0
- data/docs/SimilarityMetadata.md +16 -0
- data/docs/SimilarityMetadataTopMatches.md +13 -0
- data/docs/SimilarityPutRequest.md +9 -0
- data/docs/SimilarityScoreData.md +10 -0
- data/docs/SimilaritySettings.md +9 -0
- data/docs/SimilaritySettingsModes.md +8 -0
- data/docs/SimilaritySettingsViewSettings.md +7 -0
- data/docs/SimilarityViewSettings.md +19 -0
- data/docs/SimilarityViewerUrlResponse.md +7 -0
- data/docs/SimilarityViewerUrlSettings.md +14 -0
- data/docs/SimpleSubmissionResponse.md +6 -0
- data/docs/Submission.md +6 -0
- data/docs/SubmissionApi.md +296 -0
- data/docs/SubmissionBase.md +15 -0
- data/docs/SubmissionBaseMetadata.md +12 -0
- data/docs/SubmissionSizeError.md +8 -0
- data/docs/SuccessMessage.md +7 -0
- data/docs/Users.md +10 -0
- data/docs/ViewerPermissions.md +11 -0
- data/docs/Webhook.md +10 -0
- data/docs/WebhookApi.md +286 -0
- data/docs/WebhookBase.md +10 -0
- data/docs/WebhookPathRequest.md +8 -0
- data/docs/WebhookWithSecret.md +10 -0
- data/git_push.sh +55 -0
- data/lib/tca_client/api/eula_api.rb +312 -0
- data/lib/tca_client/api/features_api.rb +82 -0
- data/lib/tca_client/api/groups_api.rb +627 -0
- data/lib/tca_client/api/index_api.rb +156 -0
- data/lib/tca_client/api/similarity_api.rb +456 -0
- data/lib/tca_client/api/submission_api.rb +387 -0
- data/lib/tca_client/api/webhook_api.rb +364 -0
- data/lib/tca_client/api_client.rb +388 -0
- data/lib/tca_client/api_error.rb +57 -0
- data/lib/tca_client/configuration.rb +205 -0
- data/lib/tca_client/models/add_group_attachment_request.rb +220 -0
- data/lib/tca_client/models/add_group_attachment_response.rb +208 -0
- data/lib/tca_client/models/aggregate_group.rb +299 -0
- data/lib/tca_client/models/author_metadata_override.rb +217 -0
- data/lib/tca_client/models/error.rb +218 -0
- data/lib/tca_client/models/eula.rb +228 -0
- data/lib/tca_client/models/eula_accept_list_item.rb +237 -0
- data/lib/tca_client/models/eula_accept_request.rb +237 -0
- data/lib/tca_client/models/eula_version.rb +272 -0
- data/lib/tca_client/models/features_enabled.rb +257 -0
- data/lib/tca_client/models/features_generation_settings.rb +240 -0
- data/lib/tca_client/models/features_similarity.rb +224 -0
- data/lib/tca_client/models/features_similarity_view_settings.rb +327 -0
- data/lib/tca_client/models/features_tenant.rb +207 -0
- data/lib/tca_client/models/features_viewer_modes.rb +215 -0
- data/lib/tca_client/models/group.rb +259 -0
- data/lib/tca_client/models/group_attachment_response.rb +272 -0
- data/lib/tca_client/models/group_context.rb +227 -0
- data/lib/tca_client/models/index_state_settings.rb +207 -0
- data/lib/tca_client/models/indexing_settings.rb +207 -0
- data/lib/tca_client/models/inline_response_200.rb +208 -0
- data/lib/tca_client/models/pdf_status_response.rb +241 -0
- data/lib/tca_client/models/rate_limit_error.rb +221 -0
- data/lib/tca_client/models/request_pdf_response.rb +207 -0
- data/lib/tca_client/models/sidebar.rb +241 -0
- data/lib/tca_client/models/similarity_generation_settings.rb +280 -0
- data/lib/tca_client/models/similarity_metadata.rb +340 -0
- data/lib/tca_client/models/similarity_metadata_top_matches.rb +267 -0
- data/lib/tca_client/models/similarity_put_request.rb +229 -0
- data/lib/tca_client/models/similarity_score_data.rb +245 -0
- data/lib/tca_client/models/similarity_settings.rb +259 -0
- data/lib/tca_client/models/similarity_settings_modes.rb +217 -0
- data/lib/tca_client/models/similarity_settings_view_settings.rb +207 -0
- data/lib/tca_client/models/similarity_view_settings.rb +327 -0
- data/lib/tca_client/models/similarity_viewer_url_response.rb +207 -0
- data/lib/tca_client/models/similarity_viewer_url_settings.rb +306 -0
- data/lib/tca_client/models/simple_submission_response.rb +197 -0
- data/lib/tca_client/models/submission.rb +197 -0
- data/lib/tca_client/models/submission_base.rb +332 -0
- data/lib/tca_client/models/submission_base_metadata.rb +256 -0
- data/lib/tca_client/models/submission_size_error.rb +221 -0
- data/lib/tca_client/models/success_message.rb +208 -0
- data/lib/tca_client/models/users.rb +234 -0
- data/lib/tca_client/models/viewer_permissions.rb +247 -0
- data/lib/tca_client/models/webhook.rb +271 -0
- data/lib/tca_client/models/webhook_base.rb +271 -0
- data/lib/tca_client/models/webhook_path_request.rb +246 -0
- data/lib/tca_client/models/webhook_with_secret.rb +271 -0
- data/lib/tca_client/version.rb +14 -0
- data/lib/tca_client.rb +93 -0
- data/spec/api/eula_api_spec.rb +90 -0
- data/spec/api/features_api_spec.rb +46 -0
- data/spec/api/groups_api_spec.rb +147 -0
- data/spec/api/index_api_spec.rb +60 -0
- data/spec/api/similarity_api_spec.rb +116 -0
- data/spec/api/submission_api_spec.rb +103 -0
- data/spec/api/webhook_api_spec.rb +99 -0
- data/spec/api_client_spec.rb +225 -0
- data/spec/base_object_spec.rb +109 -0
- data/spec/configuration_spec.rb +41 -0
- data/spec/models/add_group_attachment_request_spec.rb +46 -0
- data/spec/models/add_group_attachment_response_spec.rb +40 -0
- data/spec/models/aggregate_group_spec.rb +78 -0
- data/spec/models/author_metadata_override_spec.rb +46 -0
- data/spec/models/error_spec.rb +46 -0
- data/spec/models/eula_accept_list_item_spec.rb +58 -0
- data/spec/models/eula_accept_request_spec.rb +58 -0
- data/spec/models/eula_spec.rb +52 -0
- data/spec/models/eula_version_spec.rb +68 -0
- data/spec/models/features_enabled_spec.rb +62 -0
- data/spec/models/features_generation_settings_spec.rb +50 -0
- data/spec/models/features_similarity_spec.rb +52 -0
- data/spec/models/features_similarity_view_settings_spec.rb +112 -0
- data/spec/models/features_tenant_spec.rb +40 -0
- data/spec/models/features_viewer_modes_spec.rb +46 -0
- data/spec/models/group_attachment_response_spec.rb +62 -0
- data/spec/models/group_context_spec.rb +52 -0
- data/spec/models/group_spec.rb +56 -0
- data/spec/models/index_state_settings_spec.rb +40 -0
- data/spec/models/indexing_settings_spec.rb +40 -0
- data/spec/models/inline_response_200_spec.rb +40 -0
- data/spec/models/pdf_status_response_spec.rb +44 -0
- data/spec/models/rate_limit_error_spec.rb +46 -0
- data/spec/models/request_pdf_response_spec.rb +40 -0
- data/spec/models/sidebar_spec.rb +44 -0
- data/spec/models/similarity_generation_settings_spec.rb +66 -0
- data/spec/models/similarity_metadata_spec.rb +94 -0
- data/spec/models/similarity_metadata_top_matches_spec.rb +76 -0
- data/spec/models/similarity_put_request_spec.rb +52 -0
- data/spec/models/similarity_score_data_spec.rb +58 -0
- data/spec/models/similarity_settings_modes_spec.rb +46 -0
- data/spec/models/similarity_settings_spec.rb +56 -0
- data/spec/models/similarity_settings_view_settings_spec.rb +40 -0
- data/spec/models/similarity_view_settings_spec.rb +112 -0
- data/spec/models/similarity_viewer_url_response_spec.rb +40 -0
- data/spec/models/similarity_viewer_url_settings_spec.rb +86 -0
- data/spec/models/simple_submission_response_spec.rb +34 -0
- data/spec/models/submission_base_metadata_spec.rb +70 -0
- data/spec/models/submission_base_spec.rb +96 -0
- data/spec/models/submission_size_error_spec.rb +46 -0
- data/spec/models/submission_spec.rb +34 -0
- data/spec/models/success_message_spec.rb +40 -0
- data/spec/models/users_spec.rb +58 -0
- data/spec/models/viewer_permissions_spec.rb +64 -0
- data/spec/models/webhook_base_spec.rb +62 -0
- data/spec/models/webhook_path_request_spec.rb +50 -0
- data/spec/models/webhook_spec.rb +62 -0
- data/spec/models/webhook_with_secret_spec.rb +62 -0
- data/spec/spec_helper.rb +110 -0
- data/tca_client.gemspec +38 -0
- metadata +365 -0
@@ -0,0 +1,387 @@
|
|
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
|
+
OpenAPI spec version: 1.0.249
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
Swagger Codegen version: 3.0.35
|
10
|
+
=end
|
11
|
+
|
12
|
+
module TCAClient
|
13
|
+
class SubmissionApi
|
14
|
+
attr_accessor :api_client
|
15
|
+
|
16
|
+
def initialize(api_client = ApiClient.default)
|
17
|
+
@api_client = api_client
|
18
|
+
end
|
19
|
+
# Create a new Submission
|
20
|
+
# @param body
|
21
|
+
# @param x_turnitin_integration_name a human readable string representing the type of integration being used
|
22
|
+
# @param x_turnitin_integration_version the version of the integration platform being used
|
23
|
+
# @param [Hash] opts the optional parameters
|
24
|
+
# @return [SimpleSubmissionResponse]
|
25
|
+
def create_submission(body, x_turnitin_integration_name, x_turnitin_integration_version, opts = {})
|
26
|
+
data, _status_code, _headers = create_submission_with_http_info(body, x_turnitin_integration_name, x_turnitin_integration_version, opts)
|
27
|
+
data
|
28
|
+
end
|
29
|
+
|
30
|
+
# Create a new Submission
|
31
|
+
# @param body
|
32
|
+
# @param x_turnitin_integration_name a human readable string representing the type of integration being used
|
33
|
+
# @param x_turnitin_integration_version the version of the integration platform being used
|
34
|
+
# @param [Hash] opts the optional parameters
|
35
|
+
# @return [Array<(SimpleSubmissionResponse, Integer, Hash)>] SimpleSubmissionResponse data, response status code and response headers
|
36
|
+
def create_submission_with_http_info(body, x_turnitin_integration_name, x_turnitin_integration_version, opts = {})
|
37
|
+
if @api_client.config.debugging
|
38
|
+
@api_client.config.logger.debug 'Calling API: SubmissionApi.create_submission ...'
|
39
|
+
end
|
40
|
+
# verify the required parameter 'body' is set
|
41
|
+
if @api_client.config.client_side_validation && body.nil?
|
42
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling SubmissionApi.create_submission"
|
43
|
+
end
|
44
|
+
# verify the required parameter 'x_turnitin_integration_name' is set
|
45
|
+
if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
|
46
|
+
fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling SubmissionApi.create_submission"
|
47
|
+
end
|
48
|
+
# verify the required parameter 'x_turnitin_integration_version' is set
|
49
|
+
if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
|
50
|
+
fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling SubmissionApi.create_submission"
|
51
|
+
end
|
52
|
+
# resource path
|
53
|
+
local_var_path = '/submissions'
|
54
|
+
|
55
|
+
# query parameters
|
56
|
+
query_params = opts[:query_params] || {}
|
57
|
+
|
58
|
+
# header parameters
|
59
|
+
header_params = opts[:header_params] || {}
|
60
|
+
# HTTP header 'Accept' (if needed)
|
61
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
62
|
+
# HTTP header 'Content-Type'
|
63
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
64
|
+
header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
|
65
|
+
header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
|
66
|
+
|
67
|
+
# form parameters
|
68
|
+
form_params = opts[:form_params] || {}
|
69
|
+
|
70
|
+
# http body (model)
|
71
|
+
post_body = opts[:body] || @api_client.object_to_http_body(body)
|
72
|
+
|
73
|
+
return_type = opts[:return_type] || 'SimpleSubmissionResponse'
|
74
|
+
|
75
|
+
auth_names = opts[:auth_names] || ['api_key']
|
76
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
77
|
+
:header_params => header_params,
|
78
|
+
:query_params => query_params,
|
79
|
+
:form_params => form_params,
|
80
|
+
:body => post_body,
|
81
|
+
:auth_names => auth_names,
|
82
|
+
:return_type => return_type)
|
83
|
+
|
84
|
+
if @api_client.config.debugging
|
85
|
+
@api_client.config.logger.debug "API called: SubmissionApi#create_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
86
|
+
end
|
87
|
+
return data, status_code, headers
|
88
|
+
end
|
89
|
+
# Deletes a submission and associated similarity report.
|
90
|
+
# @param x_turnitin_integration_name a human readable string representing the type of integration being used
|
91
|
+
# @param x_turnitin_integration_version the version of the integration platform being used
|
92
|
+
# @param id The Submission ID (returned upon a successful POST to /submissions)
|
93
|
+
# @param [Hash] opts the optional parameters
|
94
|
+
# @option opts [String] :hard Accepts true or false indicating either hard or soft delete. A soft delete removes the associated submission report/index and changes the saved submission state to DELETED. A hard deletion completely removes the submission information from Panda and TCA and removes the associated report/index, which can not be recovered. (default to false)
|
95
|
+
# @return [SuccessMessage]
|
96
|
+
def delete_submission(x_turnitin_integration_name, x_turnitin_integration_version, id, opts = {})
|
97
|
+
data, _status_code, _headers = delete_submission_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id, opts)
|
98
|
+
data
|
99
|
+
end
|
100
|
+
|
101
|
+
# Deletes a submission and associated similarity report.
|
102
|
+
# @param x_turnitin_integration_name a human readable string representing the type of integration being used
|
103
|
+
# @param x_turnitin_integration_version the version of the integration platform being used
|
104
|
+
# @param id The Submission ID (returned upon a successful POST to /submissions)
|
105
|
+
# @param [Hash] opts the optional parameters
|
106
|
+
# @option opts [String] :hard Accepts true or false indicating either hard or soft delete. A soft delete removes the associated submission report/index and changes the saved submission state to DELETED. A hard deletion completely removes the submission information from Panda and TCA and removes the associated report/index, which can not be recovered.
|
107
|
+
# @return [Array<(SuccessMessage, Integer, Hash)>] SuccessMessage data, response status code and response headers
|
108
|
+
def delete_submission_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id, opts = {})
|
109
|
+
if @api_client.config.debugging
|
110
|
+
@api_client.config.logger.debug 'Calling API: SubmissionApi.delete_submission ...'
|
111
|
+
end
|
112
|
+
# verify the required parameter 'x_turnitin_integration_name' is set
|
113
|
+
if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
|
114
|
+
fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling SubmissionApi.delete_submission"
|
115
|
+
end
|
116
|
+
# verify the required parameter 'x_turnitin_integration_version' is set
|
117
|
+
if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
|
118
|
+
fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling SubmissionApi.delete_submission"
|
119
|
+
end
|
120
|
+
# verify the required parameter 'id' is set
|
121
|
+
if @api_client.config.client_side_validation && id.nil?
|
122
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SubmissionApi.delete_submission"
|
123
|
+
end
|
124
|
+
# resource path
|
125
|
+
local_var_path = '/submissions/{id}'.sub('{' + 'id' + '}', id.to_s)
|
126
|
+
|
127
|
+
# query parameters
|
128
|
+
query_params = opts[:query_params] || {}
|
129
|
+
query_params[:'hard'] = opts[:'hard'] if !opts[:'hard'].nil?
|
130
|
+
|
131
|
+
# header parameters
|
132
|
+
header_params = opts[:header_params] || {}
|
133
|
+
# HTTP header 'Accept' (if needed)
|
134
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
135
|
+
header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
|
136
|
+
header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
|
137
|
+
|
138
|
+
# form parameters
|
139
|
+
form_params = opts[:form_params] || {}
|
140
|
+
|
141
|
+
# http body (model)
|
142
|
+
post_body = opts[:body]
|
143
|
+
|
144
|
+
return_type = opts[:return_type] || 'SuccessMessage'
|
145
|
+
|
146
|
+
auth_names = opts[:auth_names] || ['api_key']
|
147
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
148
|
+
:header_params => header_params,
|
149
|
+
:query_params => query_params,
|
150
|
+
:form_params => form_params,
|
151
|
+
:body => post_body,
|
152
|
+
:auth_names => auth_names,
|
153
|
+
:return_type => return_type)
|
154
|
+
|
155
|
+
if @api_client.config.debugging
|
156
|
+
@api_client.config.logger.debug "API called: SubmissionApi#delete_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
157
|
+
end
|
158
|
+
return data, status_code, headers
|
159
|
+
end
|
160
|
+
# Get Submission Details
|
161
|
+
# @param x_turnitin_integration_name a human readable string representing the type of integration being used
|
162
|
+
# @param x_turnitin_integration_version the version of the integration platform being used
|
163
|
+
# @param id The Submission ID (returned upon a successful POST to /submissions)
|
164
|
+
# @param [Hash] opts the optional parameters
|
165
|
+
# @return [Submission]
|
166
|
+
def get_submiddion_details(x_turnitin_integration_name, x_turnitin_integration_version, id, opts = {})
|
167
|
+
data, _status_code, _headers = get_submiddion_details_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id, opts)
|
168
|
+
data
|
169
|
+
end
|
170
|
+
|
171
|
+
# Get Submission Details
|
172
|
+
# @param x_turnitin_integration_name a human readable string representing the type of integration being used
|
173
|
+
# @param x_turnitin_integration_version the version of the integration platform being used
|
174
|
+
# @param id The Submission ID (returned upon a successful POST to /submissions)
|
175
|
+
# @param [Hash] opts the optional parameters
|
176
|
+
# @return [Array<(Submission, Integer, Hash)>] Submission data, response status code and response headers
|
177
|
+
def get_submiddion_details_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id, opts = {})
|
178
|
+
if @api_client.config.debugging
|
179
|
+
@api_client.config.logger.debug 'Calling API: SubmissionApi.get_submiddion_details ...'
|
180
|
+
end
|
181
|
+
# verify the required parameter 'x_turnitin_integration_name' is set
|
182
|
+
if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
|
183
|
+
fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling SubmissionApi.get_submiddion_details"
|
184
|
+
end
|
185
|
+
# verify the required parameter 'x_turnitin_integration_version' is set
|
186
|
+
if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
|
187
|
+
fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling SubmissionApi.get_submiddion_details"
|
188
|
+
end
|
189
|
+
# verify the required parameter 'id' is set
|
190
|
+
if @api_client.config.client_side_validation && id.nil?
|
191
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SubmissionApi.get_submiddion_details"
|
192
|
+
end
|
193
|
+
# resource path
|
194
|
+
local_var_path = '/submissions/{id}'.sub('{' + 'id' + '}', id.to_s)
|
195
|
+
|
196
|
+
# query parameters
|
197
|
+
query_params = opts[:query_params] || {}
|
198
|
+
|
199
|
+
# header parameters
|
200
|
+
header_params = opts[:header_params] || {}
|
201
|
+
# HTTP header 'Accept' (if needed)
|
202
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
203
|
+
header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
|
204
|
+
header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
|
205
|
+
|
206
|
+
# form parameters
|
207
|
+
form_params = opts[:form_params] || {}
|
208
|
+
|
209
|
+
# http body (model)
|
210
|
+
post_body = opts[:body]
|
211
|
+
|
212
|
+
return_type = opts[:return_type] || 'Submission'
|
213
|
+
|
214
|
+
auth_names = opts[:auth_names] || ['api_key']
|
215
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
216
|
+
:header_params => header_params,
|
217
|
+
:query_params => query_params,
|
218
|
+
:form_params => form_params,
|
219
|
+
:body => post_body,
|
220
|
+
:auth_names => auth_names,
|
221
|
+
:return_type => return_type)
|
222
|
+
|
223
|
+
if @api_client.config.debugging
|
224
|
+
@api_client.config.logger.debug "API called: SubmissionApi#get_submiddion_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
225
|
+
end
|
226
|
+
return data, status_code, headers
|
227
|
+
end
|
228
|
+
# Recover a soft deleted submission
|
229
|
+
# @param x_turnitin_integration_name a human readable string representing the type of integration being used
|
230
|
+
# @param x_turnitin_integration_version the version of the integration platform being used
|
231
|
+
# @param id The Submission ID (returned upon a successful POST to /submissions)
|
232
|
+
# @param [Hash] opts the optional parameters
|
233
|
+
# @return [SimpleSubmissionResponse]
|
234
|
+
def recover_submission(x_turnitin_integration_name, x_turnitin_integration_version, id, opts = {})
|
235
|
+
data, _status_code, _headers = recover_submission_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id, opts)
|
236
|
+
data
|
237
|
+
end
|
238
|
+
|
239
|
+
# Recover a soft deleted submission
|
240
|
+
# @param x_turnitin_integration_name a human readable string representing the type of integration being used
|
241
|
+
# @param x_turnitin_integration_version the version of the integration platform being used
|
242
|
+
# @param id The Submission ID (returned upon a successful POST to /submissions)
|
243
|
+
# @param [Hash] opts the optional parameters
|
244
|
+
# @return [Array<(SimpleSubmissionResponse, Integer, Hash)>] SimpleSubmissionResponse data, response status code and response headers
|
245
|
+
def recover_submission_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id, opts = {})
|
246
|
+
if @api_client.config.debugging
|
247
|
+
@api_client.config.logger.debug 'Calling API: SubmissionApi.recover_submission ...'
|
248
|
+
end
|
249
|
+
# verify the required parameter 'x_turnitin_integration_name' is set
|
250
|
+
if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
|
251
|
+
fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling SubmissionApi.recover_submission"
|
252
|
+
end
|
253
|
+
# verify the required parameter 'x_turnitin_integration_version' is set
|
254
|
+
if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
|
255
|
+
fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling SubmissionApi.recover_submission"
|
256
|
+
end
|
257
|
+
# verify the required parameter 'id' is set
|
258
|
+
if @api_client.config.client_side_validation && id.nil?
|
259
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SubmissionApi.recover_submission"
|
260
|
+
end
|
261
|
+
# resource path
|
262
|
+
local_var_path = '/submissions/{id}/recover'.sub('{' + 'id' + '}', id.to_s)
|
263
|
+
|
264
|
+
# query parameters
|
265
|
+
query_params = opts[:query_params] || {}
|
266
|
+
|
267
|
+
# header parameters
|
268
|
+
header_params = opts[:header_params] || {}
|
269
|
+
# HTTP header 'Accept' (if needed)
|
270
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
271
|
+
header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
|
272
|
+
header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
|
273
|
+
|
274
|
+
# form parameters
|
275
|
+
form_params = opts[:form_params] || {}
|
276
|
+
|
277
|
+
# http body (model)
|
278
|
+
post_body = opts[:body]
|
279
|
+
|
280
|
+
return_type = opts[:return_type] || 'SimpleSubmissionResponse'
|
281
|
+
|
282
|
+
auth_names = opts[:auth_names] || ['api_key']
|
283
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
284
|
+
:header_params => header_params,
|
285
|
+
:query_params => query_params,
|
286
|
+
:form_params => form_params,
|
287
|
+
:body => post_body,
|
288
|
+
:auth_names => auth_names,
|
289
|
+
:return_type => return_type)
|
290
|
+
|
291
|
+
if @api_client.config.debugging
|
292
|
+
@api_client.config.logger.debug "API called: SubmissionApi#recover_submission\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
293
|
+
end
|
294
|
+
return data, status_code, headers
|
295
|
+
end
|
296
|
+
# Upload Submitted File
|
297
|
+
# @param body the user's submitted file
|
298
|
+
# @param x_turnitin_integration_name a human readable string representing the type of integration being used
|
299
|
+
# @param x_turnitin_integration_version the version of the integration platform being used
|
300
|
+
# @param content_type *Must be 'binary/octet-stream'
|
301
|
+
# @param content_disposition *must include the \"filename\" parameter, e.g. `inline; filename=\"MyFile.docx\"`. To support UTF-8 filenames, you must URL encode the header
|
302
|
+
# @param id The Submission ID (returned upon a successful POST to /submissions)
|
303
|
+
# @param [Hash] opts the optional parameters
|
304
|
+
# @return [SuccessMessage]
|
305
|
+
def upload_submitted_file(body, x_turnitin_integration_name, x_turnitin_integration_version, content_type, content_disposition, id, opts = {})
|
306
|
+
data, _status_code, _headers = upload_submitted_file_with_http_info(body, x_turnitin_integration_name, x_turnitin_integration_version, content_type, content_disposition, id, opts)
|
307
|
+
data
|
308
|
+
end
|
309
|
+
|
310
|
+
# Upload Submitted File
|
311
|
+
# @param body the user's submitted file
|
312
|
+
# @param x_turnitin_integration_name a human readable string representing the type of integration being used
|
313
|
+
# @param x_turnitin_integration_version the version of the integration platform being used
|
314
|
+
# @param content_type *Must be 'binary/octet-stream'
|
315
|
+
# @param content_disposition *must include the \"filename\" parameter, e.g. `inline; filename=\"MyFile.docx\"`. To support UTF-8 filenames, you must URL encode the header
|
316
|
+
# @param id The Submission ID (returned upon a successful POST to /submissions)
|
317
|
+
# @param [Hash] opts the optional parameters
|
318
|
+
# @return [Array<(SuccessMessage, Integer, Hash)>] SuccessMessage data, response status code and response headers
|
319
|
+
def upload_submitted_file_with_http_info(body, x_turnitin_integration_name, x_turnitin_integration_version, content_type, content_disposition, id, opts = {})
|
320
|
+
if @api_client.config.debugging
|
321
|
+
@api_client.config.logger.debug 'Calling API: SubmissionApi.upload_submitted_file ...'
|
322
|
+
end
|
323
|
+
# verify the required parameter 'body' is set
|
324
|
+
if @api_client.config.client_side_validation && body.nil?
|
325
|
+
fail ArgumentError, "Missing the required parameter 'body' when calling SubmissionApi.upload_submitted_file"
|
326
|
+
end
|
327
|
+
# verify the required parameter 'x_turnitin_integration_name' is set
|
328
|
+
if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
|
329
|
+
fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling SubmissionApi.upload_submitted_file"
|
330
|
+
end
|
331
|
+
# verify the required parameter 'x_turnitin_integration_version' is set
|
332
|
+
if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
|
333
|
+
fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling SubmissionApi.upload_submitted_file"
|
334
|
+
end
|
335
|
+
# verify the required parameter 'content_type' is set
|
336
|
+
if @api_client.config.client_side_validation && content_type.nil?
|
337
|
+
fail ArgumentError, "Missing the required parameter 'content_type' when calling SubmissionApi.upload_submitted_file"
|
338
|
+
end
|
339
|
+
# verify the required parameter 'content_disposition' is set
|
340
|
+
if @api_client.config.client_side_validation && content_disposition.nil?
|
341
|
+
fail ArgumentError, "Missing the required parameter 'content_disposition' when calling SubmissionApi.upload_submitted_file"
|
342
|
+
end
|
343
|
+
# verify the required parameter 'id' is set
|
344
|
+
if @api_client.config.client_side_validation && id.nil?
|
345
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling SubmissionApi.upload_submitted_file"
|
346
|
+
end
|
347
|
+
# resource path
|
348
|
+
local_var_path = '/submissions/{id}/original'.sub('{' + 'id' + '}', id.to_s)
|
349
|
+
|
350
|
+
# query parameters
|
351
|
+
query_params = opts[:query_params] || {}
|
352
|
+
|
353
|
+
# header parameters
|
354
|
+
header_params = opts[:header_params] || {}
|
355
|
+
# HTTP header 'Accept' (if needed)
|
356
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
357
|
+
# HTTP header 'Content-Type'
|
358
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['binary/octet-stream'])
|
359
|
+
header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
|
360
|
+
header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
|
361
|
+
header_params[:'Content-Type'] = content_type
|
362
|
+
header_params[:'Content-Disposition'] = content_disposition
|
363
|
+
|
364
|
+
# form parameters
|
365
|
+
form_params = opts[:form_params] || {}
|
366
|
+
|
367
|
+
# http body (model)
|
368
|
+
post_body = opts[:body] || @api_client.object_to_http_body(body)
|
369
|
+
|
370
|
+
return_type = opts[:return_type] || 'SuccessMessage'
|
371
|
+
|
372
|
+
auth_names = opts[:auth_names] || ['api_key']
|
373
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
374
|
+
:header_params => header_params,
|
375
|
+
:query_params => query_params,
|
376
|
+
:form_params => form_params,
|
377
|
+
:body => post_body,
|
378
|
+
:auth_names => auth_names,
|
379
|
+
:return_type => return_type)
|
380
|
+
|
381
|
+
if @api_client.config.debugging
|
382
|
+
@api_client.config.logger.debug "API called: SubmissionApi#upload_submitted_file\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
383
|
+
end
|
384
|
+
return data, status_code, headers
|
385
|
+
end
|
386
|
+
end
|
387
|
+
end
|