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,364 @@
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 WebhookApi
14
+ attr_accessor :api_client
15
+
16
+ def initialize(api_client = ApiClient.default)
17
+ @api_client = api_client
18
+ end
19
+ # Delete Webhook endpoint
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 id
23
+ # @param [Hash] opts the optional parameters
24
+ # @return [nil]
25
+ def delete_webhook(x_turnitin_integration_name, x_turnitin_integration_version, id, opts = {})
26
+ delete_webhook_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id, opts)
27
+ nil
28
+ end
29
+
30
+ # Delete Webhook endpoint
31
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
32
+ # @param x_turnitin_integration_version the version of the integration platform being used
33
+ # @param id
34
+ # @param [Hash] opts the optional parameters
35
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
36
+ def delete_webhook_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id, opts = {})
37
+ if @api_client.config.debugging
38
+ @api_client.config.logger.debug 'Calling API: WebhookApi.delete_webhook ...'
39
+ end
40
+ # verify the required parameter 'x_turnitin_integration_name' is set
41
+ if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
42
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling WebhookApi.delete_webhook"
43
+ end
44
+ # verify the required parameter 'x_turnitin_integration_version' is set
45
+ if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
46
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling WebhookApi.delete_webhook"
47
+ end
48
+ # verify the required parameter 'id' is set
49
+ if @api_client.config.client_side_validation && id.nil?
50
+ fail ArgumentError, "Missing the required parameter 'id' when calling WebhookApi.delete_webhook"
51
+ end
52
+ # resource path
53
+ local_var_path = '/webhooks/{id}'.sub('{' + 'id' + '}', id.to_s)
54
+
55
+ # query parameters
56
+ query_params = opts[:query_params] || {}
57
+
58
+ # header parameters
59
+ header_params = opts[:header_params] || {}
60
+ # HTTP header 'Accept' (if needed)
61
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
62
+ header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
63
+ header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
64
+
65
+ # form parameters
66
+ form_params = opts[:form_params] || {}
67
+
68
+ # http body (model)
69
+ post_body = opts[:body]
70
+
71
+ return_type = opts[:return_type]
72
+
73
+ auth_names = opts[:auth_names] || ['api_key']
74
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type)
81
+
82
+ if @api_client.config.debugging
83
+ @api_client.config.logger.debug "API called: WebhookApi#delete_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
84
+ end
85
+ return data, status_code, headers
86
+ end
87
+ # Get Webhook endpoint info
88
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
89
+ # @param x_turnitin_integration_version the version of the integration platform being used
90
+ # @param id
91
+ # @param [Hash] opts the optional parameters
92
+ # @return [Webhook]
93
+ def get_webhook(x_turnitin_integration_name, x_turnitin_integration_version, id, opts = {})
94
+ data, _status_code, _headers = get_webhook_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id, opts)
95
+ data
96
+ end
97
+
98
+ # Get Webhook endpoint info
99
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
100
+ # @param x_turnitin_integration_version the version of the integration platform being used
101
+ # @param id
102
+ # @param [Hash] opts the optional parameters
103
+ # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
104
+ def get_webhook_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, id, opts = {})
105
+ if @api_client.config.debugging
106
+ @api_client.config.logger.debug 'Calling API: WebhookApi.get_webhook ...'
107
+ end
108
+ # verify the required parameter 'x_turnitin_integration_name' is set
109
+ if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
110
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling WebhookApi.get_webhook"
111
+ end
112
+ # verify the required parameter 'x_turnitin_integration_version' is set
113
+ if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
114
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling WebhookApi.get_webhook"
115
+ end
116
+ # verify the required parameter 'id' is set
117
+ if @api_client.config.client_side_validation && id.nil?
118
+ fail ArgumentError, "Missing the required parameter 'id' when calling WebhookApi.get_webhook"
119
+ end
120
+ # resource path
121
+ local_var_path = '/webhooks/{id}'.sub('{' + 'id' + '}', id.to_s)
122
+
123
+ # query parameters
124
+ query_params = opts[:query_params] || {}
125
+
126
+ # header parameters
127
+ header_params = opts[:header_params] || {}
128
+ # HTTP header 'Accept' (if needed)
129
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
130
+ header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
131
+ header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
132
+
133
+ # form parameters
134
+ form_params = opts[:form_params] || {}
135
+
136
+ # http body (model)
137
+ post_body = opts[:body]
138
+
139
+ return_type = opts[:return_type] || 'Webhook'
140
+
141
+ auth_names = opts[:auth_names] || ['api_key']
142
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
143
+ :header_params => header_params,
144
+ :query_params => query_params,
145
+ :form_params => form_params,
146
+ :body => post_body,
147
+ :auth_names => auth_names,
148
+ :return_type => return_type)
149
+
150
+ if @api_client.config.debugging
151
+ @api_client.config.logger.debug "API called: WebhookApi#get_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
152
+ end
153
+ return data, status_code, headers
154
+ end
155
+ # Update Webhook endpoint info
156
+ # @param body
157
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
158
+ # @param x_turnitin_integration_version the version of the integration platform being used
159
+ # @param id
160
+ # @param [Hash] opts the optional parameters
161
+ # @return [Webhook]
162
+ def update_webhook(body, x_turnitin_integration_name, x_turnitin_integration_version, id, opts = {})
163
+ data, _status_code, _headers = update_webhook_with_http_info(body, x_turnitin_integration_name, x_turnitin_integration_version, id, opts)
164
+ data
165
+ end
166
+
167
+ # Update Webhook endpoint info
168
+ # @param body
169
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
170
+ # @param x_turnitin_integration_version the version of the integration platform being used
171
+ # @param id
172
+ # @param [Hash] opts the optional parameters
173
+ # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
174
+ def update_webhook_with_http_info(body, x_turnitin_integration_name, x_turnitin_integration_version, id, opts = {})
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug 'Calling API: WebhookApi.update_webhook ...'
177
+ end
178
+ # verify the required parameter 'body' is set
179
+ if @api_client.config.client_side_validation && body.nil?
180
+ fail ArgumentError, "Missing the required parameter 'body' when calling WebhookApi.update_webhook"
181
+ end
182
+ # verify the required parameter 'x_turnitin_integration_name' is set
183
+ if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
184
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling WebhookApi.update_webhook"
185
+ end
186
+ # verify the required parameter 'x_turnitin_integration_version' is set
187
+ if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
188
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling WebhookApi.update_webhook"
189
+ end
190
+ # verify the required parameter 'id' is set
191
+ if @api_client.config.client_side_validation && id.nil?
192
+ fail ArgumentError, "Missing the required parameter 'id' when calling WebhookApi.update_webhook"
193
+ end
194
+ # resource path
195
+ local_var_path = '/webhooks/{id}'.sub('{' + 'id' + '}', id.to_s)
196
+
197
+ # query parameters
198
+ query_params = opts[:query_params] || {}
199
+
200
+ # header parameters
201
+ header_params = opts[:header_params] || {}
202
+ # HTTP header 'Accept' (if needed)
203
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
204
+ # HTTP header 'Content-Type'
205
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
206
+ header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
207
+ header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
208
+
209
+ # form parameters
210
+ form_params = opts[:form_params] || {}
211
+
212
+ # http body (model)
213
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
214
+
215
+ return_type = opts[:return_type] || 'Webhook'
216
+
217
+ auth_names = opts[:auth_names] || ['api_key']
218
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path,
219
+ :header_params => header_params,
220
+ :query_params => query_params,
221
+ :form_params => form_params,
222
+ :body => post_body,
223
+ :auth_names => auth_names,
224
+ :return_type => return_type)
225
+
226
+ if @api_client.config.debugging
227
+ @api_client.config.logger.debug "API called: WebhookApi#update_webhook\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
228
+ end
229
+ return data, status_code, headers
230
+ end
231
+ # List registered Webhook endpoints
232
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
233
+ # @param x_turnitin_integration_version the version of the integration platform being used
234
+ # @param [Hash] opts the optional parameters
235
+ # @return [Array<Webhook>]
236
+ def webhooks_get(x_turnitin_integration_name, x_turnitin_integration_version, opts = {})
237
+ data, _status_code, _headers = webhooks_get_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, opts)
238
+ data
239
+ end
240
+
241
+ # List registered Webhook endpoints
242
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
243
+ # @param x_turnitin_integration_version the version of the integration platform being used
244
+ # @param [Hash] opts the optional parameters
245
+ # @return [Array<(Array<Webhook>, Integer, Hash)>] Array<Webhook> data, response status code and response headers
246
+ def webhooks_get_with_http_info(x_turnitin_integration_name, x_turnitin_integration_version, opts = {})
247
+ if @api_client.config.debugging
248
+ @api_client.config.logger.debug 'Calling API: WebhookApi.webhooks_get ...'
249
+ end
250
+ # verify the required parameter 'x_turnitin_integration_name' is set
251
+ if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
252
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling WebhookApi.webhooks_get"
253
+ end
254
+ # verify the required parameter 'x_turnitin_integration_version' is set
255
+ if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
256
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling WebhookApi.webhooks_get"
257
+ end
258
+ # resource path
259
+ local_var_path = '/webhooks'
260
+
261
+ # query parameters
262
+ query_params = opts[:query_params] || {}
263
+
264
+ # header parameters
265
+ header_params = opts[:header_params] || {}
266
+ # HTTP header 'Accept' (if needed)
267
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
268
+ header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
269
+ header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
270
+
271
+ # form parameters
272
+ form_params = opts[:form_params] || {}
273
+
274
+ # http body (model)
275
+ post_body = opts[:body]
276
+
277
+ return_type = opts[:return_type] || 'Array<Webhook>'
278
+
279
+ auth_names = opts[:auth_names] || ['api_key']
280
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
281
+ :header_params => header_params,
282
+ :query_params => query_params,
283
+ :form_params => form_params,
284
+ :body => post_body,
285
+ :auth_names => auth_names,
286
+ :return_type => return_type)
287
+
288
+ if @api_client.config.debugging
289
+ @api_client.config.logger.debug "API called: WebhookApi#webhooks_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
290
+ end
291
+ return data, status_code, headers
292
+ end
293
+ # Register a Webhook endpoint
294
+ # @param body
295
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
296
+ # @param x_turnitin_integration_version the version of the integration platform being used
297
+ # @param [Hash] opts the optional parameters
298
+ # @return [Webhook]
299
+ def webhooks_post(body, x_turnitin_integration_name, x_turnitin_integration_version, opts = {})
300
+ data, _status_code, _headers = webhooks_post_with_http_info(body, x_turnitin_integration_name, x_turnitin_integration_version, opts)
301
+ data
302
+ end
303
+
304
+ # Register a Webhook endpoint
305
+ # @param body
306
+ # @param x_turnitin_integration_name a human readable string representing the type of integration being used
307
+ # @param x_turnitin_integration_version the version of the integration platform being used
308
+ # @param [Hash] opts the optional parameters
309
+ # @return [Array<(Webhook, Integer, Hash)>] Webhook data, response status code and response headers
310
+ def webhooks_post_with_http_info(body, x_turnitin_integration_name, x_turnitin_integration_version, opts = {})
311
+ if @api_client.config.debugging
312
+ @api_client.config.logger.debug 'Calling API: WebhookApi.webhooks_post ...'
313
+ end
314
+ # verify the required parameter 'body' is set
315
+ if @api_client.config.client_side_validation && body.nil?
316
+ fail ArgumentError, "Missing the required parameter 'body' when calling WebhookApi.webhooks_post"
317
+ end
318
+ # verify the required parameter 'x_turnitin_integration_name' is set
319
+ if @api_client.config.client_side_validation && x_turnitin_integration_name.nil?
320
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_name' when calling WebhookApi.webhooks_post"
321
+ end
322
+ # verify the required parameter 'x_turnitin_integration_version' is set
323
+ if @api_client.config.client_side_validation && x_turnitin_integration_version.nil?
324
+ fail ArgumentError, "Missing the required parameter 'x_turnitin_integration_version' when calling WebhookApi.webhooks_post"
325
+ end
326
+ # resource path
327
+ local_var_path = '/webhooks'
328
+
329
+ # query parameters
330
+ query_params = opts[:query_params] || {}
331
+
332
+ # header parameters
333
+ header_params = opts[:header_params] || {}
334
+ # HTTP header 'Accept' (if needed)
335
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
336
+ # HTTP header 'Content-Type'
337
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
338
+ header_params[:'X-Turnitin-Integration-Name'] = x_turnitin_integration_name
339
+ header_params[:'X-Turnitin-Integration-Version'] = x_turnitin_integration_version
340
+
341
+ # form parameters
342
+ form_params = opts[:form_params] || {}
343
+
344
+ # http body (model)
345
+ post_body = opts[:body] || @api_client.object_to_http_body(body)
346
+
347
+ return_type = opts[:return_type] || 'Webhook'
348
+
349
+ auth_names = opts[:auth_names] || ['api_key']
350
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
351
+ :header_params => header_params,
352
+ :query_params => query_params,
353
+ :form_params => form_params,
354
+ :body => post_body,
355
+ :auth_names => auth_names,
356
+ :return_type => return_type)
357
+
358
+ if @api_client.config.debugging
359
+ @api_client.config.logger.debug "API called: WebhookApi#webhooks_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
360
+ end
361
+ return data, status_code, headers
362
+ end
363
+ end
364
+ end