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,60 @@
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
+ require 'spec_helper'
13
+ require 'json'
14
+
15
+ # Unit tests for TCAClient::IndexApi
16
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
17
+ # Please update as you see appropriate
18
+ describe 'IndexApi' do
19
+ before do
20
+ # run before each test
21
+ @instance = TCAClient::IndexApi.new
22
+ end
23
+
24
+ after do
25
+ # run after each test
26
+ end
27
+
28
+ describe 'test an instance of IndexApi' do
29
+ it 'should create an instance of IndexApi' do
30
+ expect(@instance).to be_instance_of(TCAClient::IndexApi)
31
+ end
32
+ end
33
+
34
+ # unit tests for get_index_status
35
+ # Return index state of submission
36
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
37
+ # @param x_turnitin_integration_version the version of the integration platform being used
38
+ # @param id The Submission ID (returned upon a successful POST to /submissions)
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [IndexStateSettings]
41
+ describe 'get_index_status test' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ # unit tests for index_submission
48
+ # Index and return index state of submission
49
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
50
+ # @param x_turnitin_integration_version the version of the integration platform being used
51
+ # @param id The Submission ID (returned upon a successful POST to /submissions)
52
+ # @param [Hash] opts the optional parameters
53
+ # @return [IndexStateSettings]
54
+ describe 'index_submission test' do
55
+ it 'should work' do
56
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
57
+ end
58
+ end
59
+
60
+ end
@@ -0,0 +1,116 @@
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
+ require 'spec_helper'
13
+ require 'json'
14
+
15
+ # Unit tests for TCAClient::SimilarityApi
16
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
17
+ # Please update as you see appropriate
18
+ describe 'SimilarityApi' do
19
+ before do
20
+ # run before each test
21
+ @instance = TCAClient::SimilarityApi.new
22
+ end
23
+
24
+ after do
25
+ # run after each test
26
+ end
27
+
28
+ describe 'test an instance of SimilarityApi' do
29
+ it 'should create an instance of SimilarityApi' do
30
+ expect(@instance).to be_instance_of(TCAClient::SimilarityApi)
31
+ end
32
+ end
33
+
34
+ # unit tests for download_similarity_report_pdf
35
+ # GET download pdf
36
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
37
+ # @param x_turnitin_integration_version the version of the integration platform being used
38
+ # @param id The Submission ID (returned upon a successful POST to /submissions)
39
+ # @param pdf_id The Pdf ID (returned upon a successful POST to /submissions/{submission_id}/similarity/pdf)
40
+ # @param [Hash] opts the optional parameters
41
+ # @return [String]
42
+ describe 'download_similarity_report_pdf test' do
43
+ it 'should work' do
44
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
45
+ end
46
+ end
47
+
48
+ # unit tests for get_similarity_report_pdf_status
49
+ # GET pdf download status
50
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
51
+ # @param x_turnitin_integration_version the version of the integration platform being used
52
+ # @param id The Submission ID (returned upon a successful POST to /submissions)
53
+ # @param pdf_id The Pdf ID (returned upon a successful POST to /submissions/{submission_id}/similarity/pdf)
54
+ # @param [Hash] opts the optional parameters
55
+ # @return [PdfStatusResponse]
56
+ describe 'get_similarity_report_pdf_status test' do
57
+ it 'should work' do
58
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
59
+ end
60
+ end
61
+
62
+ # unit tests for get_similarity_report_results
63
+ # Get Similarity Report Results
64
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
65
+ # @param x_turnitin_integration_version the version of the integration platform being used
66
+ # @param id The Submission ID (returned upon a successful POST to /submissions)
67
+ # @param [Hash] opts the optional parameters
68
+ # @return [SimilarityMetadata]
69
+ describe 'get_similarity_report_results test' do
70
+ it 'should work' do
71
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
72
+ end
73
+ end
74
+
75
+ # unit tests for get_similarity_report_url
76
+ # Returns a URL to access Cloud Viewer
77
+ # @param body
78
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
79
+ # @param x_turnitin_integration_version the version of the integration platform being used
80
+ # @param id The Submission ID (returned upon a successful POST to /submissions)
81
+ # @param [Hash] opts the optional parameters
82
+ # @return [SimilarityViewerUrlResponse]
83
+ describe 'get_similarity_report_url test' do
84
+ it 'should work' do
85
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
86
+ end
87
+ end
88
+
89
+ # unit tests for request_similarity_report
90
+ # Request Similarity Report generation
91
+ # @param body
92
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
93
+ # @param x_turnitin_integration_version the version of the integration platform being used
94
+ # @param id The Submission ID (returned upon a successful POST to /submissions)
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [SuccessMessage]
97
+ describe 'request_similarity_report test' do
98
+ it 'should work' do
99
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
100
+ end
101
+ end
102
+
103
+ # unit tests for request_similarity_report_pdf
104
+ # Request Pdf download and returns the Pdf Id
105
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
106
+ # @param x_turnitin_integration_version the version of the integration platform being used
107
+ # @param id The Submission ID (returned upon a successful POST to /submissions)
108
+ # @param [Hash] opts the optional parameters
109
+ # @return [RequestPdfResponse]
110
+ describe 'request_similarity_report_pdf test' do
111
+ it 'should work' do
112
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
113
+ end
114
+ end
115
+
116
+ end
@@ -0,0 +1,103 @@
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
+ require 'spec_helper'
13
+ require 'json'
14
+
15
+ # Unit tests for TCAClient::SubmissionApi
16
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
17
+ # Please update as you see appropriate
18
+ describe 'SubmissionApi' do
19
+ before do
20
+ # run before each test
21
+ @instance = TCAClient::SubmissionApi.new
22
+ end
23
+
24
+ after do
25
+ # run after each test
26
+ end
27
+
28
+ describe 'test an instance of SubmissionApi' do
29
+ it 'should create an instance of SubmissionApi' do
30
+ expect(@instance).to be_instance_of(TCAClient::SubmissionApi)
31
+ end
32
+ end
33
+
34
+ # unit tests for create_submission
35
+ # Create a new Submission
36
+ # @param body
37
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
38
+ # @param x_turnitin_integration_version the version of the integration platform being used
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [SimpleSubmissionResponse]
41
+ describe 'create_submission test' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ # unit tests for delete_submission
48
+ # Deletes a submission and associated similarity report.
49
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
50
+ # @param x_turnitin_integration_version the version of the integration platform being used
51
+ # @param id The Submission ID (returned upon a successful POST to /submissions)
52
+ # @param [Hash] opts the optional parameters
53
+ # @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.
54
+ # @return [SuccessMessage]
55
+ describe 'delete_submission test' do
56
+ it 'should work' do
57
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
58
+ end
59
+ end
60
+
61
+ # unit tests for get_submiddion_details
62
+ # Get Submission Details
63
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
64
+ # @param x_turnitin_integration_version the version of the integration platform being used
65
+ # @param id The Submission ID (returned upon a successful POST to /submissions)
66
+ # @param [Hash] opts the optional parameters
67
+ # @return [Submission]
68
+ describe 'get_submiddion_details test' do
69
+ it 'should work' do
70
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
71
+ end
72
+ end
73
+
74
+ # unit tests for recover_submission
75
+ # Recover a soft deleted submission
76
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
77
+ # @param x_turnitin_integration_version the version of the integration platform being used
78
+ # @param id The Submission ID (returned upon a successful POST to /submissions)
79
+ # @param [Hash] opts the optional parameters
80
+ # @return [SimpleSubmissionResponse]
81
+ describe 'recover_submission test' do
82
+ it 'should work' do
83
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
84
+ end
85
+ end
86
+
87
+ # unit tests for upload_submitted_file
88
+ # Upload Submitted File
89
+ # @param body the user's submitted file
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 content_type *Must be 'binary/octet-stream'
93
+ # @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
94
+ # @param id The Submission ID (returned upon a successful POST to /submissions)
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [SuccessMessage]
97
+ describe 'upload_submitted_file test' do
98
+ it 'should work' do
99
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
100
+ end
101
+ end
102
+
103
+ end
@@ -0,0 +1,99 @@
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
+ require 'spec_helper'
13
+ require 'json'
14
+
15
+ # Unit tests for TCAClient::WebhookApi
16
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
17
+ # Please update as you see appropriate
18
+ describe 'WebhookApi' do
19
+ before do
20
+ # run before each test
21
+ @instance = TCAClient::WebhookApi.new
22
+ end
23
+
24
+ after do
25
+ # run after each test
26
+ end
27
+
28
+ describe 'test an instance of WebhookApi' do
29
+ it 'should create an instance of WebhookApi' do
30
+ expect(@instance).to be_instance_of(TCAClient::WebhookApi)
31
+ end
32
+ end
33
+
34
+ # unit tests for delete_webhook
35
+ # Delete Webhook endpoint
36
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
37
+ # @param x_turnitin_integration_version the version of the integration platform being used
38
+ # @param id
39
+ # @param [Hash] opts the optional parameters
40
+ # @return [nil]
41
+ describe 'delete_webhook test' do
42
+ it 'should work' do
43
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
44
+ end
45
+ end
46
+
47
+ # unit tests for get_webhook
48
+ # Get Webhook endpoint info
49
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
50
+ # @param x_turnitin_integration_version the version of the integration platform being used
51
+ # @param id
52
+ # @param [Hash] opts the optional parameters
53
+ # @return [Webhook]
54
+ describe 'get_webhook test' do
55
+ it 'should work' do
56
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
57
+ end
58
+ end
59
+
60
+ # unit tests for update_webhook
61
+ # Update Webhook endpoint info
62
+ # @param body
63
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
64
+ # @param x_turnitin_integration_version the version of the integration platform being used
65
+ # @param id
66
+ # @param [Hash] opts the optional parameters
67
+ # @return [Webhook]
68
+ describe 'update_webhook test' do
69
+ it 'should work' do
70
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
71
+ end
72
+ end
73
+
74
+ # unit tests for webhooks_get
75
+ # List registered Webhook endpoints
76
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
77
+ # @param x_turnitin_integration_version the version of the integration platform being used
78
+ # @param [Hash] opts the optional parameters
79
+ # @return [Array<Webhook>]
80
+ describe 'webhooks_get test' do
81
+ it 'should work' do
82
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
83
+ end
84
+ end
85
+
86
+ # unit tests for webhooks_post
87
+ # Register a Webhook endpoint
88
+ # @param body
89
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
90
+ # @param x_turnitin_integration_version the version of the integration platform being used
91
+ # @param [Hash] opts the optional parameters
92
+ # @return [Webhook]
93
+ describe 'webhooks_post test' do
94
+ it 'should work' do
95
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
96
+ end
97
+ end
98
+
99
+ end
@@ -0,0 +1,225 @@
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
+ require 'spec_helper'
13
+
14
+ describe TCAClient::ApiClient do
15
+ context 'initialization' do
16
+ context 'URL stuff' do
17
+ context 'host' do
18
+ it 'removes http from host' do
19
+ TCAClient.configure { |c| c.host = 'http://example.com' }
20
+ expect(TCAClient::Configuration.default.host).to eq('example.com')
21
+ end
22
+
23
+ it 'removes https from host' do
24
+ TCAClient.configure { |c| c.host = 'https://wookiee.com' }
25
+ expect(TCAClient::ApiClient.default.config.host).to eq('wookiee.com')
26
+ end
27
+
28
+ it 'removes trailing path from host' do
29
+ TCAClient.configure { |c| c.host = 'hobo.com/v4' }
30
+ expect(TCAClient::Configuration.default.host).to eq('hobo.com')
31
+ end
32
+ end
33
+
34
+ context 'base_path' do
35
+ it "prepends a slash to base_path" do
36
+ TCAClient.configure { |c| c.base_path = 'v4/dog' }
37
+ expect(TCAClient::Configuration.default.base_path).to eq('/v4/dog')
38
+ end
39
+
40
+ it "doesn't prepend a slash if one is already there" do
41
+ TCAClient.configure { |c| c.base_path = '/v4/dog' }
42
+ expect(TCAClient::Configuration.default.base_path).to eq('/v4/dog')
43
+ end
44
+
45
+ it "ends up as a blank string if nil" do
46
+ TCAClient.configure { |c| c.base_path = nil }
47
+ expect(TCAClient::Configuration.default.base_path).to eq('')
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ describe 'params_encoding in #build_request' do
54
+ let(:config) { TCAClient::Configuration.new }
55
+ let(:api_client) { TCAClient::ApiClient.new(config) }
56
+
57
+ it 'defaults to nil' do
58
+ expect(TCAClient::Configuration.default.params_encoding).to eq(nil)
59
+ expect(config.params_encoding).to eq(nil)
60
+
61
+ request = api_client.build_request(:get, '/test')
62
+ expect(request.options[:params_encoding]).to eq(nil)
63
+ end
64
+
65
+ it 'can be customized' do
66
+ config.params_encoding = :multi
67
+ request = api_client.build_request(:get, '/test')
68
+ expect(request.options[:params_encoding]).to eq(:multi)
69
+ end
70
+ end
71
+
72
+ describe 'timeout in #build_request' do
73
+ let(:config) { TCAClient::Configuration.new }
74
+ let(:api_client) { TCAClient::ApiClient.new(config) }
75
+
76
+ it 'defaults to 0' do
77
+ expect(TCAClient::Configuration.default.timeout).to eq(0)
78
+ expect(config.timeout).to eq(0)
79
+
80
+ request = api_client.build_request(:get, '/test')
81
+ expect(request.options[:timeout]).to eq(0)
82
+ end
83
+
84
+ it 'can be customized' do
85
+ config.timeout = 100
86
+ request = api_client.build_request(:get, '/test')
87
+ expect(request.options[:timeout]).to eq(100)
88
+ end
89
+ end
90
+
91
+ describe '#deserialize' do
92
+ it "handles Array<Integer>" do
93
+ api_client = TCAClient::ApiClient.new
94
+ headers = { 'Content-Type' => 'application/json' }
95
+ response = double('response', headers: headers, body: '[12, 34]')
96
+ data = api_client.deserialize(response, 'Array<Integer>')
97
+ expect(data).to be_instance_of(Array)
98
+ expect(data).to eq([12, 34])
99
+ end
100
+
101
+ it 'handles Array<Array<Integer>>' do
102
+ api_client = TCAClient::ApiClient.new
103
+ headers = { 'Content-Type' => 'application/json' }
104
+ response = double('response', headers: headers, body: '[[12, 34], [56]]')
105
+ data = api_client.deserialize(response, 'Array<Array<Integer>>')
106
+ expect(data).to be_instance_of(Array)
107
+ expect(data).to eq([[12, 34], [56]])
108
+ end
109
+
110
+ it 'handles Hash<String, String>' do
111
+ api_client = TCAClient::ApiClient.new
112
+ headers = { 'Content-Type' => 'application/json' }
113
+ response = double('response', headers: headers, body: '{"message": "Hello"}')
114
+ data = api_client.deserialize(response, 'Hash<String, String>')
115
+ expect(data).to be_instance_of(Hash)
116
+ expect(data).to eq(:message => 'Hello')
117
+ end
118
+ end
119
+
120
+ describe "#object_to_hash" do
121
+ it 'ignores nils and includes empty arrays' do
122
+ # uncomment below to test object_to_hash for model
123
+ # api_client = TCAClient::ApiClient.new
124
+ # _model = TCAClient::ModelName.new
125
+ # update the model attribute below
126
+ # _model.id = 1
127
+ # update the expected value (hash) below
128
+ # expected = {id: 1, name: '', tags: []}
129
+ # expect(api_client.object_to_hash(_model)).to eq(expected)
130
+ end
131
+ end
132
+
133
+ describe '#build_collection_param' do
134
+ let(:param) { ['aa', 'bb', 'cc'] }
135
+ let(:api_client) { TCAClient::ApiClient.new }
136
+
137
+ it 'works for csv' do
138
+ expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
139
+ end
140
+
141
+ it 'works for ssv' do
142
+ expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
143
+ end
144
+
145
+ it 'works for tsv' do
146
+ expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
147
+ end
148
+
149
+ it 'works for pipes' do
150
+ expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
151
+ end
152
+
153
+ it 'works for multi' do
154
+ expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
155
+ end
156
+
157
+ it 'fails for invalid collection format' do
158
+ expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
159
+ end
160
+ end
161
+
162
+ describe '#json_mime?' do
163
+ let(:api_client) { TCAClient::ApiClient.new }
164
+
165
+ it 'works' do
166
+ expect(api_client.json_mime?(nil)).to eq false
167
+ expect(api_client.json_mime?('')).to eq false
168
+
169
+ expect(api_client.json_mime?('application/json')).to eq true
170
+ expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
171
+ expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
172
+
173
+ expect(api_client.json_mime?('application/xml')).to eq false
174
+ expect(api_client.json_mime?('text/plain')).to eq false
175
+ expect(api_client.json_mime?('application/jsonp')).to eq false
176
+ end
177
+ end
178
+
179
+ describe '#select_header_accept' do
180
+ let(:api_client) { TCAClient::ApiClient.new }
181
+
182
+ it 'works' do
183
+ expect(api_client.select_header_accept(nil)).to be_nil
184
+ expect(api_client.select_header_accept([])).to be_nil
185
+
186
+ expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
187
+ expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
188
+ expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
189
+
190
+ expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
191
+ expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
192
+ end
193
+ end
194
+
195
+ describe '#select_header_content_type' do
196
+ let(:api_client) { TCAClient::ApiClient.new }
197
+
198
+ it 'works' do
199
+ expect(api_client.select_header_content_type(nil)).to eq('application/json')
200
+ expect(api_client.select_header_content_type([])).to eq('application/json')
201
+
202
+ expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
203
+ expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
204
+ expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
205
+ expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
206
+ expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
207
+ end
208
+ end
209
+
210
+ describe '#sanitize_filename' do
211
+ let(:api_client) { TCAClient::ApiClient.new }
212
+
213
+ it 'works' do
214
+ expect(api_client.sanitize_filename('sun')).to eq('sun')
215
+ expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
216
+ expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
217
+ expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
218
+ expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
219
+ expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
220
+ expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
221
+ expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
222
+ expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
223
+ end
224
+ end
225
+ end