tca_client 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +862 -0
  4. data/Rakefile +8 -0
  5. data/docs/AddGroupAttachmentRequest.md +8 -0
  6. data/docs/AddGroupAttachmentResponse.md +7 -0
  7. data/docs/AggregateGroup.md +12 -0
  8. data/docs/AuthorMetadataOverride.md +8 -0
  9. data/docs/EULAApi.md +241 -0
  10. data/docs/Error.md +8 -0
  11. data/docs/Eula.md +9 -0
  12. data/docs/EulaAcceptListItem.md +10 -0
  13. data/docs/EulaAcceptRequest.md +10 -0
  14. data/docs/EulaVersion.md +11 -0
  15. data/docs/FeaturesApi.md +61 -0
  16. data/docs/FeaturesEnabled.md +10 -0
  17. data/docs/FeaturesGenerationSettings.md +8 -0
  18. data/docs/FeaturesSimilarity.md +9 -0
  19. data/docs/FeaturesSimilarityViewSettings.md +19 -0
  20. data/docs/FeaturesTenant.md +7 -0
  21. data/docs/FeaturesViewerModes.md +8 -0
  22. data/docs/Group.md +9 -0
  23. data/docs/GroupAttachmentResponse.md +10 -0
  24. data/docs/GroupContext.md +9 -0
  25. data/docs/GroupsApi.md +472 -0
  26. data/docs/IndexApi.md +119 -0
  27. data/docs/IndexStateSettings.md +7 -0
  28. data/docs/IndexingSettings.md +7 -0
  29. data/docs/InlineResponse200.md +7 -0
  30. data/docs/PdfStatusResponse.md +7 -0
  31. data/docs/RateLimitError.md +8 -0
  32. data/docs/RequestPdfResponse.md +7 -0
  33. data/docs/Sidebar.md +7 -0
  34. data/docs/SimilarityApi.md +351 -0
  35. data/docs/SimilarityGenerationSettings.md +10 -0
  36. data/docs/SimilarityMetadata.md +16 -0
  37. data/docs/SimilarityMetadataTopMatches.md +13 -0
  38. data/docs/SimilarityPutRequest.md +9 -0
  39. data/docs/SimilarityScoreData.md +10 -0
  40. data/docs/SimilaritySettings.md +9 -0
  41. data/docs/SimilaritySettingsModes.md +8 -0
  42. data/docs/SimilaritySettingsViewSettings.md +7 -0
  43. data/docs/SimilarityViewSettings.md +19 -0
  44. data/docs/SimilarityViewerUrlResponse.md +7 -0
  45. data/docs/SimilarityViewerUrlSettings.md +14 -0
  46. data/docs/SimpleSubmissionResponse.md +6 -0
  47. data/docs/Submission.md +6 -0
  48. data/docs/SubmissionApi.md +296 -0
  49. data/docs/SubmissionBase.md +15 -0
  50. data/docs/SubmissionBaseMetadata.md +12 -0
  51. data/docs/SubmissionSizeError.md +8 -0
  52. data/docs/SuccessMessage.md +7 -0
  53. data/docs/Users.md +10 -0
  54. data/docs/ViewerPermissions.md +11 -0
  55. data/docs/Webhook.md +10 -0
  56. data/docs/WebhookApi.md +286 -0
  57. data/docs/WebhookBase.md +10 -0
  58. data/docs/WebhookPathRequest.md +8 -0
  59. data/docs/WebhookWithSecret.md +10 -0
  60. data/git_push.sh +55 -0
  61. data/lib/tca_client/api/eula_api.rb +312 -0
  62. data/lib/tca_client/api/features_api.rb +82 -0
  63. data/lib/tca_client/api/groups_api.rb +627 -0
  64. data/lib/tca_client/api/index_api.rb +156 -0
  65. data/lib/tca_client/api/similarity_api.rb +456 -0
  66. data/lib/tca_client/api/submission_api.rb +387 -0
  67. data/lib/tca_client/api/webhook_api.rb +364 -0
  68. data/lib/tca_client/api_client.rb +388 -0
  69. data/lib/tca_client/api_error.rb +57 -0
  70. data/lib/tca_client/configuration.rb +205 -0
  71. data/lib/tca_client/models/add_group_attachment_request.rb +220 -0
  72. data/lib/tca_client/models/add_group_attachment_response.rb +208 -0
  73. data/lib/tca_client/models/aggregate_group.rb +299 -0
  74. data/lib/tca_client/models/author_metadata_override.rb +217 -0
  75. data/lib/tca_client/models/error.rb +218 -0
  76. data/lib/tca_client/models/eula.rb +228 -0
  77. data/lib/tca_client/models/eula_accept_list_item.rb +237 -0
  78. data/lib/tca_client/models/eula_accept_request.rb +237 -0
  79. data/lib/tca_client/models/eula_version.rb +272 -0
  80. data/lib/tca_client/models/features_enabled.rb +257 -0
  81. data/lib/tca_client/models/features_generation_settings.rb +240 -0
  82. data/lib/tca_client/models/features_similarity.rb +224 -0
  83. data/lib/tca_client/models/features_similarity_view_settings.rb +327 -0
  84. data/lib/tca_client/models/features_tenant.rb +207 -0
  85. data/lib/tca_client/models/features_viewer_modes.rb +215 -0
  86. data/lib/tca_client/models/group.rb +259 -0
  87. data/lib/tca_client/models/group_attachment_response.rb +272 -0
  88. data/lib/tca_client/models/group_context.rb +227 -0
  89. data/lib/tca_client/models/index_state_settings.rb +207 -0
  90. data/lib/tca_client/models/indexing_settings.rb +207 -0
  91. data/lib/tca_client/models/inline_response_200.rb +208 -0
  92. data/lib/tca_client/models/pdf_status_response.rb +241 -0
  93. data/lib/tca_client/models/rate_limit_error.rb +221 -0
  94. data/lib/tca_client/models/request_pdf_response.rb +207 -0
  95. data/lib/tca_client/models/sidebar.rb +241 -0
  96. data/lib/tca_client/models/similarity_generation_settings.rb +280 -0
  97. data/lib/tca_client/models/similarity_metadata.rb +340 -0
  98. data/lib/tca_client/models/similarity_metadata_top_matches.rb +267 -0
  99. data/lib/tca_client/models/similarity_put_request.rb +229 -0
  100. data/lib/tca_client/models/similarity_score_data.rb +245 -0
  101. data/lib/tca_client/models/similarity_settings.rb +259 -0
  102. data/lib/tca_client/models/similarity_settings_modes.rb +217 -0
  103. data/lib/tca_client/models/similarity_settings_view_settings.rb +207 -0
  104. data/lib/tca_client/models/similarity_view_settings.rb +327 -0
  105. data/lib/tca_client/models/similarity_viewer_url_response.rb +207 -0
  106. data/lib/tca_client/models/similarity_viewer_url_settings.rb +306 -0
  107. data/lib/tca_client/models/simple_submission_response.rb +197 -0
  108. data/lib/tca_client/models/submission.rb +197 -0
  109. data/lib/tca_client/models/submission_base.rb +332 -0
  110. data/lib/tca_client/models/submission_base_metadata.rb +256 -0
  111. data/lib/tca_client/models/submission_size_error.rb +221 -0
  112. data/lib/tca_client/models/success_message.rb +208 -0
  113. data/lib/tca_client/models/users.rb +234 -0
  114. data/lib/tca_client/models/viewer_permissions.rb +247 -0
  115. data/lib/tca_client/models/webhook.rb +271 -0
  116. data/lib/tca_client/models/webhook_base.rb +271 -0
  117. data/lib/tca_client/models/webhook_path_request.rb +246 -0
  118. data/lib/tca_client/models/webhook_with_secret.rb +271 -0
  119. data/lib/tca_client/version.rb +14 -0
  120. data/lib/tca_client.rb +93 -0
  121. data/spec/api/eula_api_spec.rb +90 -0
  122. data/spec/api/features_api_spec.rb +46 -0
  123. data/spec/api/groups_api_spec.rb +147 -0
  124. data/spec/api/index_api_spec.rb +60 -0
  125. data/spec/api/similarity_api_spec.rb +116 -0
  126. data/spec/api/submission_api_spec.rb +103 -0
  127. data/spec/api/webhook_api_spec.rb +99 -0
  128. data/spec/api_client_spec.rb +225 -0
  129. data/spec/base_object_spec.rb +109 -0
  130. data/spec/configuration_spec.rb +41 -0
  131. data/spec/models/add_group_attachment_request_spec.rb +46 -0
  132. data/spec/models/add_group_attachment_response_spec.rb +40 -0
  133. data/spec/models/aggregate_group_spec.rb +78 -0
  134. data/spec/models/author_metadata_override_spec.rb +46 -0
  135. data/spec/models/error_spec.rb +46 -0
  136. data/spec/models/eula_accept_list_item_spec.rb +58 -0
  137. data/spec/models/eula_accept_request_spec.rb +58 -0
  138. data/spec/models/eula_spec.rb +52 -0
  139. data/spec/models/eula_version_spec.rb +68 -0
  140. data/spec/models/features_enabled_spec.rb +62 -0
  141. data/spec/models/features_generation_settings_spec.rb +50 -0
  142. data/spec/models/features_similarity_spec.rb +52 -0
  143. data/spec/models/features_similarity_view_settings_spec.rb +112 -0
  144. data/spec/models/features_tenant_spec.rb +40 -0
  145. data/spec/models/features_viewer_modes_spec.rb +46 -0
  146. data/spec/models/group_attachment_response_spec.rb +62 -0
  147. data/spec/models/group_context_spec.rb +52 -0
  148. data/spec/models/group_spec.rb +56 -0
  149. data/spec/models/index_state_settings_spec.rb +40 -0
  150. data/spec/models/indexing_settings_spec.rb +40 -0
  151. data/spec/models/inline_response_200_spec.rb +40 -0
  152. data/spec/models/pdf_status_response_spec.rb +44 -0
  153. data/spec/models/rate_limit_error_spec.rb +46 -0
  154. data/spec/models/request_pdf_response_spec.rb +40 -0
  155. data/spec/models/sidebar_spec.rb +44 -0
  156. data/spec/models/similarity_generation_settings_spec.rb +66 -0
  157. data/spec/models/similarity_metadata_spec.rb +94 -0
  158. data/spec/models/similarity_metadata_top_matches_spec.rb +76 -0
  159. data/spec/models/similarity_put_request_spec.rb +52 -0
  160. data/spec/models/similarity_score_data_spec.rb +58 -0
  161. data/spec/models/similarity_settings_modes_spec.rb +46 -0
  162. data/spec/models/similarity_settings_spec.rb +56 -0
  163. data/spec/models/similarity_settings_view_settings_spec.rb +40 -0
  164. data/spec/models/similarity_view_settings_spec.rb +112 -0
  165. data/spec/models/similarity_viewer_url_response_spec.rb +40 -0
  166. data/spec/models/similarity_viewer_url_settings_spec.rb +86 -0
  167. data/spec/models/simple_submission_response_spec.rb +34 -0
  168. data/spec/models/submission_base_metadata_spec.rb +70 -0
  169. data/spec/models/submission_base_spec.rb +96 -0
  170. data/spec/models/submission_size_error_spec.rb +46 -0
  171. data/spec/models/submission_spec.rb +34 -0
  172. data/spec/models/success_message_spec.rb +40 -0
  173. data/spec/models/users_spec.rb +58 -0
  174. data/spec/models/viewer_permissions_spec.rb +64 -0
  175. data/spec/models/webhook_base_spec.rb +62 -0
  176. data/spec/models/webhook_path_request_spec.rb +50 -0
  177. data/spec/models/webhook_spec.rb +62 -0
  178. data/spec/models/webhook_with_secret_spec.rb +62 -0
  179. data/spec/spec_helper.rb +110 -0
  180. data/tca_client.gemspec +38 -0
  181. metadata +365 -0
@@ -0,0 +1,10 @@
1
+ # TCAClient::WebhookWithSecret
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **description** | **String** | a human readable description of the webhook | [optional]
7
+ **url** | **String** | the URL to callback with events, this must be https unless (allow_insecure is true) |
8
+ **allow_insecure** | **BOOLEAN** | if using an non https url, this must be set to true | [optional]
9
+ **event_types** | **Array<String>** | an array of the types of callbacks that will be sent to this webhook |
10
+
data/git_push.sh ADDED
@@ -0,0 +1,55 @@
1
+ #!/bin/sh
2
+ #
3
+ # Generated by: https://github.com/swagger-api/swagger-codegen.git
4
+ #
5
+ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
6
+ #
7
+ # Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
8
+
9
+ git_user_id=$1
10
+ git_repo_id=$2
11
+ release_note=$3
12
+
13
+ if [ "$git_user_id" = "" ]; then
14
+ git_user_id="GIT_USER_ID"
15
+ echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
16
+ fi
17
+
18
+ if [ "$git_repo_id" = "" ]; then
19
+ git_repo_id="GIT_REPO_ID"
20
+ echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
21
+ fi
22
+
23
+ if [ "$release_note" = "" ]; then
24
+ release_note="Minor update"
25
+ echo "[INFO] No command line input provided. Set \$release_note to $release_note"
26
+ fi
27
+
28
+ # Initialize the local directory as a Git repository
29
+ git init
30
+
31
+ # Adds the files in the local repository and stages them for commit.
32
+ git add .
33
+
34
+ # Commits the tracked changes and prepares them to be pushed to a remote repository.
35
+ git commit -m "$release_note"
36
+
37
+ # Sets the new remote
38
+ git_remote=`git remote`
39
+ if [ "$git_remote" = "" ]; then # git remote not defined
40
+
41
+ if [ "$GIT_TOKEN" = "" ]; then
42
+ echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
43
+ git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
44
+ else
45
+ git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
46
+ fi
47
+
48
+ fi
49
+
50
+ git pull origin master
51
+
52
+ # Pushes (Forces) the changes in the local repository up to the remote repository
53
+ echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git"
54
+ git push origin master 2>&1 | grep -v 'To https'
55
+
@@ -0,0 +1,312 @@
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 EULAApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.default)
17
+ @api_client = api_client
18
+ end
19
+ # Accepts a particular EULA version on behalf of an external user
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 version_id The EULA version ID (or `latest`)
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [EulaAcceptListItem]
26
+ def eula_version_id_accept_post(body, x_turnitin_integration_name, x_turnitin_integration_version, version_id, opts = {})
27
+ data, _status_code, _headers = eula_version_id_accept_post_with_http_info(body, x_turnitin_integration_name, x_turnitin_integration_version, version_id, opts)
28
+ data
29
+ end
30
+
31
+ # Accepts a particular EULA version on behalf of an external user
32
+ # @param body
33
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
34
+ # @param x_turnitin_integration_version the version of the integration platform being used
35
+ # @param version_id The EULA version ID (or `latest`)
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<(EulaAcceptListItem, Integer, Hash)>] EulaAcceptListItem data, response status code and response headers
38
+ def eula_version_id_accept_post_with_http_info(body, x_turnitin_integration_name, x_turnitin_integration_version, version_id, opts = {})
39
+ if @api_client.config.debugging
40
+ @api_client.config.logger.debug 'Calling API: EULAApi.eula_version_id_accept_post ...'
41
+ end
42
+ # verify the required parameter 'body' is set
43
+ if @api_client.config.client_side_validation && body.nil?
44
+ fail ArgumentError, "Missing the required parameter 'body' when calling EULAApi.eula_version_id_accept_post"
45
+ end
46
+ # verify the required parameter 'x_turnitin_integration_name' is set
47
+ if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
48
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling EULAApi.eula_version_id_accept_post"
49
+ end
50
+ # verify the required parameter 'x_turnitin_integration_version' is set
51
+ if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
52
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling EULAApi.eula_version_id_accept_post"
53
+ end
54
+ # verify the required parameter 'version_id' is set
55
+ if @api_client.config.client_side_validation && version_id.nil?
56
+ fail ArgumentError, "Missing the required parameter 'version_id' when calling EULAApi.eula_version_id_accept_post"
57
+ end
58
+ # resource path
59
+ local_var_path = '/eula/{version_id}/accept'.sub('{' + 'version_id' + '}', version_id.to_s)
60
+
61
+ # query parameters
62
+ query_params = opts[:query_params] || {}
63
+
64
+ # header parameters
65
+ header_params = opts[:header_params] || {}
66
+ # HTTP header 'Accept' (if needed)
67
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
68
+ # HTTP header 'Content-Type'
69
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
70
+ header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
71
+ header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
72
+
73
+ # form parameters
74
+ form_params = opts[:form_params] || {}
75
+
76
+ # http body (model)
77
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
78
+
79
+ return_type = opts[:return_type] || 'EulaAcceptListItem'
80
+
81
+ auth_names = opts[:auth_names] || ['api_key']
82
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
83
+ :header_params => header_params,
84
+ :query_params => query_params,
85
+ :form_params => form_params,
86
+ :body => post_body,
87
+ :auth_names => auth_names,
88
+ :return_type => return_type)
89
+
90
+ if @api_client.config.debugging
91
+ @api_client.config.logger.debug "API called: EULAApi#eula_version_id_accept_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
92
+ end
93
+ return data, status_code, headers
94
+ end
95
+ # Queries the acceptences of a particular EULA version on behalf of an external user
96
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
97
+ # @param x_turnitin_integration_version the version of the integration platform being used
98
+ # @param version_id The EULA version ID (or &#x60;latest&#x60;)
99
+ # @param user_id The user associated with the EULA status
100
+ # @param [Hash] opts the optional parameters
101
+ # @return [Array<EulaAcceptListItem>]
102
+ def eula_version_id_accept_user_id_get(x_turnitin_integration_name, x_turnitin_integration_version, version_id, user_id, opts = {})
103
+ data, _status_code, _headers = eula_version_id_accept_user_id_get_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, version_id, user_id, opts)
104
+ data
105
+ end
106
+
107
+ # Queries the acceptences of a particular EULA version on behalf of an external user
108
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
109
+ # @param x_turnitin_integration_version the version of the integration platform being used
110
+ # @param version_id The EULA version ID (or &#x60;latest&#x60;)
111
+ # @param user_id The user associated with the EULA status
112
+ # @param [Hash] opts the optional parameters
113
+ # @return [Array<(Array<EulaAcceptListItem>, Integer, Hash)>] Array<EulaAcceptListItem> data, response status code and response headers
114
+ def eula_version_id_accept_user_id_get_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, version_id, user_id, opts = {})
115
+ if @api_client.config.debugging
116
+ @api_client.config.logger.debug 'Calling API: EULAApi.eula_version_id_accept_user_id_get ...'
117
+ end
118
+ # verify the required parameter 'x_turnitin_integration_name' is set
119
+ if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
120
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling EULAApi.eula_version_id_accept_user_id_get"
121
+ end
122
+ # verify the required parameter 'x_turnitin_integration_version' is set
123
+ if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
124
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling EULAApi.eula_version_id_accept_user_id_get"
125
+ end
126
+ # verify the required parameter 'version_id' is set
127
+ if @api_client.config.client_side_validation && version_id.nil?
128
+ fail ArgumentError, "Missing the required parameter 'version_id' when calling EULAApi.eula_version_id_accept_user_id_get"
129
+ end
130
+ # verify the required parameter 'user_id' is set
131
+ if @api_client.config.client_side_validation && user_id.nil?
132
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling EULAApi.eula_version_id_accept_user_id_get"
133
+ end
134
+ # resource path
135
+ local_var_path = '/eula/{version_id}/accept/{user_id}'.sub('{' + 'version_id' + '}', version_id.to_s).sub('{' + 'user_id' + '}', user_id.to_s)
136
+
137
+ # query parameters
138
+ query_params = opts[:query_params] || {}
139
+
140
+ # header parameters
141
+ header_params = opts[:header_params] || {}
142
+ # HTTP header 'Accept' (if needed)
143
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
144
+ header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
145
+ header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
146
+
147
+ # form parameters
148
+ form_params = opts[:form_params] || {}
149
+
150
+ # http body (model)
151
+ post_body = opts[:body]
152
+
153
+ return_type = opts[:return_type] || 'Array<EulaAcceptListItem>'
154
+
155
+ auth_names = opts[:auth_names] || ['api_key']
156
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
157
+ :header_params => header_params,
158
+ :query_params => query_params,
159
+ :form_params => form_params,
160
+ :body => post_body,
161
+ :auth_names => auth_names,
162
+ :return_type => return_type)
163
+
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug "API called: EULAApi#eula_version_id_accept_user_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
166
+ end
167
+ return data, status_code, headers
168
+ end
169
+ # Gets information about a particular EULA version
170
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
171
+ # @param x_turnitin_integration_version the version of the integration platform being used
172
+ # @param version_id The EULA version ID (or &#x60;latest&#x60;)
173
+ # @param [Hash] opts the optional parameters
174
+ # @option opts [String] :lang The desired language of the specified EULA version
175
+ # @return [EulaVersion]
176
+ def eula_version_id_get(x_turnitin_integration_name, x_turnitin_integration_version, version_id, opts = {})
177
+ data, _status_code, _headers = eula_version_id_get_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, version_id, opts)
178
+ data
179
+ end
180
+
181
+ # Gets information about a particular EULA version
182
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
183
+ # @param x_turnitin_integration_version the version of the integration platform being used
184
+ # @param version_id The EULA version ID (or &#x60;latest&#x60;)
185
+ # @param [Hash] opts the optional parameters
186
+ # @option opts [String] :lang The desired language of the specified EULA version
187
+ # @return [Array<(EulaVersion, Integer, Hash)>] EulaVersion data, response status code and response headers
188
+ def eula_version_id_get_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, version_id, opts = {})
189
+ if @api_client.config.debugging
190
+ @api_client.config.logger.debug 'Calling API: EULAApi.eula_version_id_get ...'
191
+ end
192
+ # verify the required parameter 'x_turnitin_integration_name' is set
193
+ if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
194
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling EULAApi.eula_version_id_get"
195
+ end
196
+ # verify the required parameter 'x_turnitin_integration_version' is set
197
+ if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
198
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling EULAApi.eula_version_id_get"
199
+ end
200
+ # verify the required parameter 'version_id' is set
201
+ if @api_client.config.client_side_validation && version_id.nil?
202
+ fail ArgumentError, "Missing the required parameter 'version_id' when calling EULAApi.eula_version_id_get"
203
+ end
204
+ # resource path
205
+ local_var_path = '/eula/{version_id}'.sub('{' + 'version_id' + '}', version_id.to_s)
206
+
207
+ # query parameters
208
+ query_params = opts[:query_params] || {}
209
+ query_params[:'lang'] = opts[:'lang'] if !opts[:'lang'].nil?
210
+
211
+ # header parameters
212
+ header_params = opts[:header_params] || {}
213
+ # HTTP header 'Accept' (if needed)
214
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
215
+ header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
216
+ header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
217
+
218
+ # form parameters
219
+ form_params = opts[:form_params] || {}
220
+
221
+ # http body (model)
222
+ post_body = opts[:body]
223
+
224
+ return_type = opts[:return_type] || 'EulaVersion'
225
+
226
+ auth_names = opts[:auth_names] || ['api_key']
227
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
228
+ :header_params => header_params,
229
+ :query_params => query_params,
230
+ :form_params => form_params,
231
+ :body => post_body,
232
+ :auth_names => auth_names,
233
+ :return_type => return_type)
234
+
235
+ if @api_client.config.debugging
236
+ @api_client.config.logger.debug "API called: EULAApi#eula_version_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
237
+ end
238
+ return data, status_code, headers
239
+ end
240
+ # Gets the text of a particular EULA version
241
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
242
+ # @param x_turnitin_integration_version the version of the integration platform being used
243
+ # @param version_id The EULA version ID (or &#x60;latest&#x60;)
244
+ # @param [Hash] opts the optional parameters
245
+ # @option opts [String] :lang The desired language of the specified EULA version
246
+ # @return [String]
247
+ def eula_version_id_view_get(x_turnitin_integration_name, x_turnitin_integration_version, version_id, opts = {})
248
+ data, _status_code, _headers = eula_version_id_view_get_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, version_id, opts)
249
+ data
250
+ end
251
+
252
+ # Gets the text of a particular EULA version
253
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
254
+ # @param x_turnitin_integration_version the version of the integration platform being used
255
+ # @param version_id The EULA version ID (or &#x60;latest&#x60;)
256
+ # @param [Hash] opts the optional parameters
257
+ # @option opts [String] :lang The desired language of the specified EULA version
258
+ # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers
259
+ def eula_version_id_view_get_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, version_id, opts = {})
260
+ if @api_client.config.debugging
261
+ @api_client.config.logger.debug 'Calling API: EULAApi.eula_version_id_view_get ...'
262
+ end
263
+ # verify the required parameter 'x_turnitin_integration_name' is set
264
+ if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
265
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling EULAApi.eula_version_id_view_get"
266
+ end
267
+ # verify the required parameter 'x_turnitin_integration_version' is set
268
+ if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
269
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling EULAApi.eula_version_id_view_get"
270
+ end
271
+ # verify the required parameter 'version_id' is set
272
+ if @api_client.config.client_side_validation && version_id.nil?
273
+ fail ArgumentError, "Missing the required parameter 'version_id' when calling EULAApi.eula_version_id_view_get"
274
+ end
275
+ # resource path
276
+ local_var_path = '/eula/{version_id}/view'.sub('{' + 'version_id' + '}', version_id.to_s)
277
+
278
+ # query parameters
279
+ query_params = opts[:query_params] || {}
280
+ query_params[:'lang'] = opts[:'lang'] if !opts[:'lang'].nil?
281
+
282
+ # header parameters
283
+ header_params = opts[:header_params] || {}
284
+ # HTTP header 'Accept' (if needed)
285
+ header_params['Accept'] = @api_client.select_header_accept(['text/plain; charset=utf-8', 'application/html'])
286
+ header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
287
+ header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
288
+
289
+ # form parameters
290
+ form_params = opts[:form_params] || {}
291
+
292
+ # http body (model)
293
+ post_body = opts[:body]
294
+
295
+ return_type = opts[:return_type] || 'String'
296
+
297
+ auth_names = opts[:auth_names] || ['api_key']
298
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
299
+ :header_params => header_params,
300
+ :query_params => query_params,
301
+ :form_params => form_params,
302
+ :body => post_body,
303
+ :auth_names => auth_names,
304
+ :return_type => return_type)
305
+
306
+ if @api_client.config.debugging
307
+ @api_client.config.logger.debug "API called: EULAApi#eula_version_id_view_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
308
+ end
309
+ return data, status_code, headers
310
+ end
311
+ end
312
+ end
@@ -0,0 +1,82 @@
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 FeaturesApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.default)
17
+ @api_client = api_client
18
+ end
19
+ # Get information about what features are allowed by the current license
20
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
21
+ # @param x_turnitin_integration_version the version of the integration platform being used
22
+ # @param [Hash] opts the optional parameters
23
+ # @return [FeaturesEnabled]
24
+ def features_enabled_get(x_turnitin_integration_name, x_turnitin_integration_version, opts = {})
25
+ data, _status_code, _headers = features_enabled_get_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, opts)
26
+ data
27
+ end
28
+
29
+ # Get information about what features are allowed by the current license
30
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
31
+ # @param x_turnitin_integration_version the version of the integration platform being used
32
+ # @param [Hash] opts the optional parameters
33
+ # @return [Array<(FeaturesEnabled, Integer, Hash)>] FeaturesEnabled data, response status code and response headers
34
+ def features_enabled_get_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, opts = {})
35
+ if @api_client.config.debugging
36
+ @api_client.config.logger.debug 'Calling API: FeaturesApi.features_enabled_get ...'
37
+ end
38
+ # verify the required parameter 'x_turnitin_integration_name' is set
39
+ if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
40
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling FeaturesApi.features_enabled_get"
41
+ end
42
+ # verify the required parameter 'x_turnitin_integration_version' is set
43
+ if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
44
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling FeaturesApi.features_enabled_get"
45
+ end
46
+ # resource path
47
+ local_var_path = '/features-enabled'
48
+
49
+ # query parameters
50
+ query_params = opts[:query_params] || {}
51
+
52
+ # header parameters
53
+ header_params = opts[:header_params] || {}
54
+ # HTTP header 'Accept' (if needed)
55
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
56
+ header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
57
+ header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
58
+
59
+ # form parameters
60
+ form_params = opts[:form_params] || {}
61
+
62
+ # http body (model)
63
+ post_body = opts[:body]
64
+
65
+ return_type = opts[:return_type] || 'FeaturesEnabled'
66
+
67
+ auth_names = opts[:auth_names] || ['api_key']
68
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
69
+ :header_params => header_params,
70
+ :query_params => query_params,
71
+ :form_params => form_params,
72
+ :body => post_body,
73
+ :auth_names => auth_names,
74
+ :return_type => return_type)
75
+
76
+ if @api_client.config.debugging
77
+ @api_client.config.logger.debug "API called: FeaturesApi#features_enabled_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
78
+ end
79
+ return data, status_code, headers
80
+ end
81
+ end
82
+ end