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,271 @@
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 'date'
13
+
14
+ module TCAClient
15
+ class WebhookWithSecret
16
+ # a human readable description of the webhook
17
+ attr_accessor :description
18
+
19
+ # the URL to callback with events, this must be https unless (allow_insecure is true)
20
+ attr_accessor :url
21
+
22
+ # if using an non https url, this must be set to true
23
+ attr_accessor :allow_insecure
24
+
25
+ # an array of the types of callbacks that will be sent to this webhook
26
+ attr_accessor :event_types
27
+
28
+ class EnumAttributeValidator
29
+ attr_reader :datatype
30
+ attr_reader :allowable_values
31
+
32
+ def initialize(datatype, allowable_values)
33
+ @allowable_values = allowable_values.map do |value|
34
+ case datatype.to_s
35
+ when /Integer/i
36
+ value.to_i
37
+ when /Float/i
38
+ value.to_f
39
+ else
40
+ value
41
+ end
42
+ end
43
+ end
44
+
45
+ def valid?(value)
46
+ !value || allowable_values.include?(value)
47
+ end
48
+ end
49
+
50
+ # Attribute mapping from ruby-style variable name to JSON key.
51
+ def self.attribute_map
52
+ {
53
+ :'description' => :'description',
54
+ :'url' => :'url',
55
+ :'allow_insecure' => :'allow_insecure',
56
+ :'event_types' => :'event_types'
57
+ }
58
+ end
59
+
60
+ # Attribute type mapping.
61
+ def self.openapi_types
62
+ {
63
+ :'description' => :'',
64
+ :'url' => :'',
65
+ :'allow_insecure' => :'',
66
+ :'event_types' => :''
67
+ }
68
+ end
69
+
70
+ # List of attributes with nullable: true
71
+ def self.openapi_nullable
72
+ Set.new([
73
+ ])
74
+ end
75
+
76
+ # Initializes the object
77
+ # @param [Hash] attributes Model attributes in the form of hash
78
+ def initialize(attributes = {})
79
+ if (!attributes.is_a?(Hash))
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TCAClient::WebhookWithSecret` initialize method"
81
+ end
82
+
83
+ # check to see if the attribute exists and convert string to symbol for hash key
84
+ attributes = attributes.each_with_object({}) { |(k, v), h|
85
+ if (!self.class.attribute_map.key?(k.to_sym))
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TCAClient::WebhookWithSecret`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
87
+ end
88
+ h[k.to_sym] = v
89
+ }
90
+
91
+ if attributes.key?(:'description')
92
+ self.description = attributes[:'description']
93
+ end
94
+
95
+ if attributes.key?(:'url')
96
+ self.url = attributes[:'url']
97
+ end
98
+
99
+ if attributes.key?(:'allow_insecure')
100
+ self.allow_insecure = attributes[:'allow_insecure']
101
+ end
102
+
103
+ if attributes.key?(:'event_types')
104
+ if (value = attributes[:'event_types']).is_a?(Array)
105
+ self.event_types = value
106
+ end
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ invalid_properties = Array.new
114
+ if @url.nil?
115
+ invalid_properties.push('invalid value for "url", url cannot be nil.')
116
+ end
117
+
118
+ if @event_types.nil?
119
+ invalid_properties.push('invalid value for "event_types", event_types cannot be nil.')
120
+ end
121
+
122
+ invalid_properties
123
+ end
124
+
125
+ # Check to see if the all the properties in the model are valid
126
+ # @return true if the model is valid
127
+ def valid?
128
+ return false if @url.nil?
129
+ return false if @event_types.nil?
130
+ true
131
+ end
132
+
133
+ # Checks equality by comparing each attribute.
134
+ # @param [Object] Object to be compared
135
+ def ==(o)
136
+ return true if self.equal?(o)
137
+ self.class == o.class &&
138
+ description == o.description &&
139
+ url == o.url &&
140
+ allow_insecure == o.allow_insecure &&
141
+ event_types == o.event_types
142
+ end
143
+
144
+ # @see the `==` method
145
+ # @param [Object] Object to be compared
146
+ def eql?(o)
147
+ self == o
148
+ end
149
+
150
+ # Calculates hash code according to all attributes.
151
+ # @return [Integer] Hash code
152
+ def hash
153
+ [description, url, allow_insecure, event_types].hash
154
+ end
155
+
156
+ # Builds the object from hash
157
+ # @param [Hash] attributes Model attributes in the form of hash
158
+ # @return [Object] Returns the model itself
159
+ def self.build_from_hash(attributes)
160
+ new.build_from_hash(attributes)
161
+ end
162
+
163
+ # Builds the object from hash
164
+ # @param [Hash] attributes Model attributes in the form of hash
165
+ # @return [Object] Returns the model itself
166
+ def build_from_hash(attributes)
167
+ return nil unless attributes.is_a?(Hash)
168
+ self.class.openapi_types.each_pair do |key, type|
169
+ if type =~ /\AArray<(.*)>/i
170
+ # check to ensure the input is an array given that the attribute
171
+ # is documented as an array but the input is not
172
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
173
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
174
+ end
175
+ elsif !attributes[self.class.attribute_map[key]].nil?
176
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
+ elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
178
+ self.send("#{key}=", nil)
179
+ end
180
+ end
181
+
182
+ self
183
+ end
184
+
185
+ # Deserializes the data based on type
186
+ # @param string type Data type
187
+ # @param string value Value to be deserialized
188
+ # @return [Object] Deserialized data
189
+ def _deserialize(type, value)
190
+ case type.to_sym
191
+ when :DateTime
192
+ DateTime.parse(value)
193
+ when :Date
194
+ Date.parse(value)
195
+ when :String
196
+ value.to_s
197
+ when :Integer
198
+ value.to_i
199
+ when :Float
200
+ value.to_f
201
+ when :Boolean
202
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
203
+ true
204
+ else
205
+ false
206
+ end
207
+ when :Object
208
+ # generic object (usually a Hash), return directly
209
+ value
210
+ when /\AArray<(?<inner_type>.+)>\z/
211
+ inner_type = Regexp.last_match[:inner_type]
212
+ value.map { |v| _deserialize(inner_type, v) }
213
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
214
+ k_type = Regexp.last_match[:k_type]
215
+ v_type = Regexp.last_match[:v_type]
216
+ {}.tap do |hash|
217
+ value.each do |k, v|
218
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
219
+ end
220
+ end
221
+ else # model
222
+ TCAClient.const_get(type).build_from_hash(value)
223
+ end
224
+ end
225
+
226
+ # Returns the string representation of the object
227
+ # @return [String] String presentation of the object
228
+ def to_s
229
+ to_hash.to_s
230
+ end
231
+
232
+ # to_body is an alias to to_hash (backward compatibility)
233
+ # @return [Hash] Returns the object in the form of hash
234
+ def to_body
235
+ to_hash
236
+ end
237
+
238
+ # Returns the object in the form of hash
239
+ # @return [Hash] Returns the object in the form of hash
240
+ def to_hash
241
+ hash = {}
242
+ self.class.attribute_map.each_pair do |attr, param|
243
+ value = self.send(attr)
244
+ if value.nil?
245
+ is_nullable = self.class.openapi_nullable.include?(attr)
246
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
247
+ end
248
+
249
+ hash[param] = _to_hash(value)
250
+ end
251
+ hash
252
+ end
253
+
254
+ # Outputs non-array value in the form of hash
255
+ # For object, use to_hash. Otherwise, just return the value
256
+ # @param [Object] value Any valid value
257
+ # @return [Hash] Returns the value in the form of hash
258
+ def _to_hash(value)
259
+ if value.is_a?(Array)
260
+ value.compact.map { |v| _to_hash(v) }
261
+ elsif value.is_a?(Hash)
262
+ {}.tap do |hash|
263
+ value.each { |k, v| hash[k] = _to_hash(v) }
264
+ end
265
+ elsif value.respond_to? :to_hash
266
+ value.to_hash
267
+ else
268
+ value
269
+ end
270
+ end end
271
+ end
@@ -0,0 +1,14 @@
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
+ VERSION = '1.0.0'
14
+ end
data/lib/tca_client.rb ADDED
@@ -0,0 +1,93 @@
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
+ # Common files
13
+ require 'tca_client/api_client'
14
+ require 'tca_client/api_error'
15
+ require 'tca_client/version'
16
+ require 'tca_client/configuration'
17
+
18
+ # Models
19
+ require 'tca_client/models/add_group_attachment_request'
20
+ require 'tca_client/models/add_group_attachment_response'
21
+ require 'tca_client/models/aggregate_group'
22
+ require 'tca_client/models/author_metadata_override'
23
+ require 'tca_client/models/error'
24
+ require 'tca_client/models/eula'
25
+ require 'tca_client/models/eula_accept_list_item'
26
+ require 'tca_client/models/eula_accept_request'
27
+ require 'tca_client/models/eula_version'
28
+ require 'tca_client/models/features_enabled'
29
+ require 'tca_client/models/features_generation_settings'
30
+ require 'tca_client/models/features_similarity'
31
+ require 'tca_client/models/features_similarity_view_settings'
32
+ require 'tca_client/models/features_tenant'
33
+ require 'tca_client/models/features_viewer_modes'
34
+ require 'tca_client/models/group'
35
+ require 'tca_client/models/group_attachment_response'
36
+ require 'tca_client/models/group_context'
37
+ require 'tca_client/models/index_state_settings'
38
+ require 'tca_client/models/indexing_settings'
39
+ require 'tca_client/models/inline_response_200'
40
+ require 'tca_client/models/pdf_status_response'
41
+ require 'tca_client/models/rate_limit_error'
42
+ require 'tca_client/models/request_pdf_response'
43
+ require 'tca_client/models/sidebar'
44
+ require 'tca_client/models/similarity_generation_settings'
45
+ require 'tca_client/models/similarity_metadata'
46
+ require 'tca_client/models/similarity_metadata_top_matches'
47
+ require 'tca_client/models/similarity_put_request'
48
+ require 'tca_client/models/similarity_score_data'
49
+ require 'tca_client/models/similarity_settings'
50
+ require 'tca_client/models/similarity_settings_modes'
51
+ require 'tca_client/models/similarity_settings_view_settings'
52
+ require 'tca_client/models/similarity_view_settings'
53
+ require 'tca_client/models/similarity_viewer_url_response'
54
+ require 'tca_client/models/similarity_viewer_url_settings'
55
+ require 'tca_client/models/simple_submission_response'
56
+ require 'tca_client/models/submission'
57
+ require 'tca_client/models/submission_base'
58
+ require 'tca_client/models/submission_base_metadata'
59
+ require 'tca_client/models/submission_size_error'
60
+ require 'tca_client/models/success_message'
61
+ require 'tca_client/models/users'
62
+ require 'tca_client/models/viewer_permissions'
63
+ require 'tca_client/models/webhook'
64
+ require 'tca_client/models/webhook_base'
65
+ require 'tca_client/models/webhook_path_request'
66
+ require 'tca_client/models/webhook_with_secret'
67
+
68
+ # APIs
69
+ require 'tca_client/api/eula_api'
70
+ require 'tca_client/api/features_api'
71
+ require 'tca_client/api/groups_api'
72
+ require 'tca_client/api/index_api'
73
+ require 'tca_client/api/similarity_api'
74
+ require 'tca_client/api/submission_api'
75
+ require 'tca_client/api/webhook_api'
76
+
77
+ module TCAClient
78
+ class << self
79
+ # Customize default settings for the SDK using block.
80
+ # TCAClient.configure do |config|
81
+ # config.username = "xxx"
82
+ # config.password = "xxx"
83
+ # end
84
+ # If no block given, return the default Configuration object.
85
+ def configure
86
+ if block_given?
87
+ yield(Configuration.default)
88
+ else
89
+ Configuration.default
90
+ end
91
+ end
92
+ end
93
+ end
@@ -0,0 +1,90 @@
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::EULAApi
16
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
17
+ # Please update as you see appropriate
18
+ describe 'EULAApi' do
19
+ before do
20
+ # run before each test
21
+ @instance = TCAClient::EULAApi.new
22
+ end
23
+
24
+ after do
25
+ # run after each test
26
+ end
27
+
28
+ describe 'test an instance of EULAApi' do
29
+ it 'should create an instance of EULAApi' do
30
+ expect(@instance).to be_instance_of(TCAClient::EULAApi)
31
+ end
32
+ end
33
+
34
+ # unit tests for eula_version_id_accept_post
35
+ # Accepts a particular EULA version on behalf of an external user
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 version_id The EULA version ID (or &#x60;latest&#x60;)
40
+ # @param [Hash] opts the optional parameters
41
+ # @return [EulaAcceptListItem]
42
+ describe 'eula_version_id_accept_post 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 eula_version_id_accept_user_id_get
49
+ # Queries the acceptences of a particular EULA version on behalf of an external user
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 version_id The EULA version ID (or &#x60;latest&#x60;)
53
+ # @param user_id The user associated with the EULA status
54
+ # @param [Hash] opts the optional parameters
55
+ # @return [Array<EulaAcceptListItem>]
56
+ describe 'eula_version_id_accept_user_id_get 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 eula_version_id_get
63
+ # Gets information about a particular EULA version
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 version_id The EULA version ID (or &#x60;latest&#x60;)
67
+ # @param [Hash] opts the optional parameters
68
+ # @option opts [String] :lang The desired language of the specified EULA version
69
+ # @return [EulaVersion]
70
+ describe 'eula_version_id_get test' do
71
+ it 'should work' do
72
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
73
+ end
74
+ end
75
+
76
+ # unit tests for eula_version_id_view_get
77
+ # Gets the text of a particular EULA version
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 version_id The EULA version ID (or &#x60;latest&#x60;)
81
+ # @param [Hash] opts the optional parameters
82
+ # @option opts [String] :lang The desired language of the specified EULA version
83
+ # @return [String]
84
+ describe 'eula_version_id_view_get test' do
85
+ it 'should work' do
86
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
87
+ end
88
+ end
89
+
90
+ end
@@ -0,0 +1,46 @@
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::FeaturesApi
16
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
17
+ # Please update as you see appropriate
18
+ describe 'FeaturesApi' do
19
+ before do
20
+ # run before each test
21
+ @instance = TCAClient::FeaturesApi.new
22
+ end
23
+
24
+ after do
25
+ # run after each test
26
+ end
27
+
28
+ describe 'test an instance of FeaturesApi' do
29
+ it 'should create an instance of FeaturesApi' do
30
+ expect(@instance).to be_instance_of(TCAClient::FeaturesApi)
31
+ end
32
+ end
33
+
34
+ # unit tests for features_enabled_get
35
+ # Get information about what features are allowed by the current license
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 [Hash] opts the optional parameters
39
+ # @return [FeaturesEnabled]
40
+ describe 'features_enabled_get test' do
41
+ it 'should work' do
42
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
43
+ end
44
+ end
45
+
46
+ end
@@ -0,0 +1,147 @@
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::GroupsApi
16
+ # Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
17
+ # Please update as you see appropriate
18
+ describe 'GroupsApi' do
19
+ before do
20
+ # run before each test
21
+ @instance = TCAClient::GroupsApi.new
22
+ end
23
+
24
+ after do
25
+ # run after each test
26
+ end
27
+
28
+ describe 'test an instance of GroupsApi' do
29
+ it 'should create an instance of GroupsApi' do
30
+ expect(@instance).to be_instance_of(TCAClient::GroupsApi)
31
+ end
32
+ end
33
+
34
+ # unit tests for add_group_attachment
35
+ # Add attachment to a group. will create a group if it does not exist.
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 group_id group_id
40
+ # @param [Hash] opts the optional parameters
41
+ # @return [AddGroupAttachmentResponse]
42
+ describe 'add_group_attachment 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 delete_group_attachment
49
+ # Hard delete group attachment
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 group_id group_id
53
+ # @param attach_id The attachment ID (returned from a successful group attachment request)
54
+ # @param [Hash] opts the optional parameters
55
+ # @return [nil]
56
+ describe 'delete_group_attachment 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_group
63
+ # Get group, group context and group context owners info
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 group_id group_id
67
+ # @param [Hash] opts the optional parameters
68
+ # @return [AggregateGroup]
69
+ describe 'get_group 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_group_attachment
76
+ # Get group attachment
77
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
78
+ # @param x_turnitin_integration_version the version of the integration platform being used
79
+ # @param group_id group_id
80
+ # @param attach_id The attachment ID (returned from a successful group attachment request)
81
+ # @param [Hash] opts the optional parameters
82
+ # @return [GroupAttachmentResponse]
83
+ describe 'get_group_attachment 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 get_group_attachments
90
+ # Get all attachments
91
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
92
+ # @param x_turnitin_integration_version the version of the integration platform being used
93
+ # @param group_id group_id
94
+ # @param [Hash] opts the optional parameters
95
+ # @return [InlineResponse200]
96
+ describe 'get_group_attachments test' do
97
+ it 'should work' do
98
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
99
+ end
100
+ end
101
+
102
+ # unit tests for groups_group_id_put
103
+ # upsert group, group context and group context owners info
104
+ # @param body
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 group_id group_id
108
+ # @param [Hash] opts the optional parameters
109
+ # @return [AggregateGroup]
110
+ describe 'groups_group_id_put 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
+ # unit tests for update_group_attachment
117
+ # Patch a group attachment
118
+ # @param body
119
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
120
+ # @param x_turnitin_integration_version the version of the integration platform being used
121
+ # @param group_id group_id
122
+ # @param attach_id The attachment ID (returned from a successful group attachment request)
123
+ # @param [Hash] opts the optional parameters
124
+ # @return [GroupAttachmentResponse]
125
+ describe 'update_group_attachment test' do
126
+ it 'should work' do
127
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
128
+ end
129
+ end
130
+
131
+ # unit tests for upload_group_attachment
132
+ # Upload Submitted File
133
+ # @param body the attachment file
134
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
135
+ # @param x_turnitin_integration_version the version of the integration platform being used
136
+ # @param content_disposition *must include the \&quot;filename\&quot; parameter, e.g. &#x60;inline; filename&#x3D;\&quot;MyFile.docx\&quot;&#x60;
137
+ # @param group_id The Group ID (required to already exist)
138
+ # @param attach_id The attachment ID (returned from a successful group attachment request)
139
+ # @param [Hash] opts the optional parameters
140
+ # @return [SuccessMessage]
141
+ describe 'upload_group_attachment test' do
142
+ it 'should work' do
143
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
144
+ end
145
+ end
146
+
147
+ end