tca_client 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -3
  3. data/docs/AddGroupAttachmentRequest.md +16 -4
  4. data/docs/AddGroupAttachmentResponse.md +14 -3
  5. data/docs/AggregateGroup.md +24 -8
  6. data/docs/AnnotationsSettings.md +18 -0
  7. data/docs/AuthorMetadataOverride.md +16 -4
  8. data/docs/EULAApi.md +166 -92
  9. data/docs/Error.md +16 -4
  10. data/docs/Eula.md +18 -5
  11. data/docs/EulaAcceptListItem.md +20 -6
  12. data/docs/EulaAcceptRequest.md +20 -6
  13. data/docs/EulaVersion.md +22 -7
  14. data/docs/FeaturesApi.md +41 -23
  15. data/docs/FeaturesEnabled.md +20 -6
  16. data/docs/FeaturesGenerationSettings.md +16 -4
  17. data/docs/FeaturesSimilarity.md +18 -5
  18. data/docs/FeaturesSimilarityViewSettings.md +38 -15
  19. data/docs/FeaturesTenant.md +14 -3
  20. data/docs/FeaturesViewerModes.md +16 -4
  21. data/docs/GenerateSimilarityPDF.md +18 -0
  22. data/docs/GetGroupAttachments200Response.md +18 -0
  23. data/docs/Group.md +18 -5
  24. data/docs/GroupAttachmentResponse.md +20 -6
  25. data/docs/GroupContext.md +18 -5
  26. data/docs/GroupsApi.md +321 -177
  27. data/docs/IndexApi.md +84 -44
  28. data/docs/IndexStateSettings.md +14 -3
  29. data/docs/IndexingSettings.md +14 -3
  30. data/docs/PDFStatusWebhookRequest.md +24 -0
  31. data/docs/PdfStatusResponse.md +14 -3
  32. data/docs/RateLimitError.md +16 -4
  33. data/docs/RequestPdfResponse.md +14 -3
  34. data/docs/Sidebar.md +14 -3
  35. data/docs/SimilarityApi.md +239 -129
  36. data/docs/SimilarityCompleteWebhookRequest.md +38 -0
  37. data/docs/SimilarityGenerationSettings.md +20 -6
  38. data/docs/SimilarityMetadata.md +32 -12
  39. data/docs/SimilarityMetadataAllOf.md +28 -0
  40. data/docs/SimilarityMetadataAllOfTopMatches.md +30 -0
  41. data/docs/SimilarityPutRequest.md +18 -5
  42. data/docs/SimilarityScoreData.md +20 -6
  43. data/docs/SimilaritySettings.md +18 -5
  44. data/docs/SimilaritySettingsModes.md +16 -4
  45. data/docs/SimilaritySettingsViewSettings.md +14 -3
  46. data/docs/SimilarityViewSettings.md +38 -15
  47. data/docs/SimilarityViewerUrlResponse.md +14 -3
  48. data/docs/SimilarityViewerUrlSettings.md +30 -10
  49. data/docs/SimpleSubmissionResponse.md +22 -2
  50. data/docs/SimpleSubmissionResponseAllOf.md +26 -0
  51. data/docs/Submission.md +34 -2
  52. data/docs/SubmissionAllOf.md +38 -0
  53. data/docs/SubmissionApi.md +203 -112
  54. data/docs/SubmissionBase.md +30 -11
  55. data/docs/SubmissionBaseMetadata.md +24 -8
  56. data/docs/SubmissionCompleteWebhookRequest.md +40 -0
  57. data/docs/SubmissionCompleteWebhookRequestAllOf.md +18 -0
  58. data/docs/SubmissionCompleteWebhookRequestAllOfMetadata.md +18 -0
  59. data/docs/SubmissionSizeError.md +16 -4
  60. data/docs/SuccessMessage.md +14 -3
  61. data/docs/Users.md +20 -6
  62. data/docs/ViewerPermissions.md +22 -7
  63. data/docs/Webhook.md +24 -6
  64. data/docs/WebhookAllOf.md +20 -0
  65. data/docs/WebhookApi.md +193 -103
  66. data/docs/WebhookBase.md +20 -6
  67. data/docs/WebhookPathRequest.md +16 -4
  68. data/docs/WebhookWithSecret.md +22 -6
  69. data/docs/WebhookWithSecretAllOf.md +18 -0
  70. data/lib/tca_client/api/eula_api.rb +96 -63
  71. data/lib/tca_client/api/features_api.rb +21 -12
  72. data/lib/tca_client/api/groups_api.rb +225 -155
  73. data/lib/tca_client/api/index_api.rb +46 -27
  74. data/lib/tca_client/api/similarity_api.rb +165 -104
  75. data/lib/tca_client/api/submission_api.rb +140 -97
  76. data/lib/tca_client/api/webhook_api.rb +120 -77
  77. data/lib/tca_client/api_client.rb +61 -57
  78. data/lib/tca_client/api_error.rb +4 -4
  79. data/lib/tca_client/configuration.rb +93 -13
  80. data/lib/tca_client/models/add_group_attachment_request.rb +50 -13
  81. data/lib/tca_client/models/add_group_attachment_response.rb +25 -12
  82. data/lib/tca_client/models/aggregate_group.rb +34 -21
  83. data/lib/tca_client/models/annotations_settings.rb +220 -0
  84. data/lib/tca_client/models/author_metadata_override.rb +26 -13
  85. data/lib/tca_client/models/error.rb +26 -13
  86. data/lib/tca_client/models/eula.rb +27 -14
  87. data/lib/tca_client/models/eula_accept_list_item.rb +28 -15
  88. data/lib/tca_client/models/eula_accept_request.rb +28 -15
  89. data/lib/tca_client/models/eula_version.rb +29 -16
  90. data/lib/tca_client/models/features_enabled.rb +28 -15
  91. data/lib/tca_client/models/features_generation_settings.rb +26 -13
  92. data/lib/tca_client/models/features_similarity.rb +27 -14
  93. data/lib/tca_client/models/features_similarity_view_settings.rb +37 -24
  94. data/lib/tca_client/models/features_tenant.rb +25 -12
  95. data/lib/tca_client/models/features_viewer_modes.rb +26 -13
  96. data/lib/tca_client/models/generate_similarity_pdf.rb +254 -0
  97. data/lib/tca_client/models/{inline_response_200.rb → get_group_attachments200_response.rb} +28 -15
  98. data/lib/tca_client/models/group.rb +29 -16
  99. data/lib/tca_client/models/group_attachment_response.rb +38 -17
  100. data/lib/tca_client/models/group_context.rb +27 -14
  101. data/lib/tca_client/models/index_state_settings.rb +25 -12
  102. data/lib/tca_client/models/indexing_settings.rb +25 -12
  103. data/lib/tca_client/models/pdf_status_response.rb +27 -14
  104. data/lib/tca_client/models/pdf_status_webhook_request.rb +283 -0
  105. data/lib/tca_client/models/rate_limit_error.rb +36 -20
  106. data/lib/tca_client/models/request_pdf_response.rb +25 -12
  107. data/lib/tca_client/models/sidebar.rb +27 -14
  108. data/lib/tca_client/models/similarity_complete_webhook_request.rb +366 -0
  109. data/lib/tca_client/models/similarity_generation_settings.rb +30 -17
  110. data/lib/tca_client/models/similarity_metadata.rb +45 -28
  111. data/lib/tca_client/models/similarity_metadata_all_of.rb +301 -0
  112. data/lib/tca_client/models/{similarity_metadata_top_matches.rb → similarity_metadata_all_of_top_matches.rb} +34 -21
  113. data/lib/tca_client/models/similarity_put_request.rb +27 -14
  114. data/lib/tca_client/models/similarity_score_data.rb +28 -15
  115. data/lib/tca_client/models/similarity_settings.rb +29 -16
  116. data/lib/tca_client/models/similarity_settings_modes.rb +26 -13
  117. data/lib/tca_client/models/similarity_settings_view_settings.rb +25 -12
  118. data/lib/tca_client/models/similarity_view_settings.rb +37 -24
  119. data/lib/tca_client/models/similarity_viewer_url_response.rb +25 -12
  120. data/lib/tca_client/models/similarity_viewer_url_settings.rb +46 -24
  121. data/lib/tca_client/models/simple_submission_response.rb +117 -13
  122. data/lib/tca_client/models/simple_submission_response_all_of.rb +294 -0
  123. data/lib/tca_client/models/submission.rb +191 -13
  124. data/lib/tca_client/models/submission_all_of.rb +368 -0
  125. data/lib/tca_client/models/submission_base.rb +82 -23
  126. data/lib/tca_client/models/submission_base_metadata.rb +30 -17
  127. data/lib/tca_client/models/submission_complete_webhook_request.rb +385 -0
  128. data/lib/tca_client/models/submission_complete_webhook_request_all_of.rb +219 -0
  129. data/lib/tca_client/models/submission_complete_webhook_request_all_of_metadata.rb +219 -0
  130. data/lib/tca_client/models/submission_size_error.rb +36 -20
  131. data/lib/tca_client/models/success_message.rb +25 -12
  132. data/lib/tca_client/models/users.rb +28 -15
  133. data/lib/tca_client/models/viewer_permissions.rb +29 -16
  134. data/lib/tca_client/models/webhook.rb +62 -16
  135. data/lib/tca_client/models/webhook_all_of.rb +235 -0
  136. data/lib/tca_client/models/webhook_base.rb +28 -15
  137. data/lib/tca_client/models/webhook_path_request.rb +26 -13
  138. data/lib/tca_client/models/webhook_with_secret.rb +52 -16
  139. data/lib/tca_client/models/webhook_with_secret_all_of.rb +225 -0
  140. data/lib/tca_client/version.rb +5 -4
  141. data/lib/tca_client.rb +18 -5
  142. data/spec/api/submission_api_spec.rb +2 -2
  143. data/tca_client-1.0.0.gem +0 -0
  144. data/tca_client-1.0.1.gem +0 -0
  145. data/tca_client.gemspec +7 -7
  146. metadata +44 -38
  147. data/docs/InlineResponse200.md +0 -7
  148. data/docs/SimilarityMetadataTopMatches.md +0 -13
@@ -3,13 +3,15 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 1.0.249
6
+ The version of the OpenAPI document: 1.0.258
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.3.0-SNAPSHOT
7
10
 
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.35
10
11
  =end
11
12
 
12
13
  require 'date'
14
+ require 'time'
13
15
 
14
16
  module TCAClient
15
17
  class SimilarityMetadata
@@ -58,19 +60,24 @@ module TCAClient
58
60
  }
59
61
  end
60
62
 
63
+ # Returns all the JSON keys this model knows about
64
+ def self.acceptable_attributes
65
+ attribute_map.values
66
+ end
67
+
61
68
  # Attribute type mapping.
62
69
  def self.openapi_types
63
70
  {
64
- :'overall_match_percentage' => :'',
65
- :'internet_match_percentage' => :'',
66
- :'publication_match_percentage' => :'',
67
- :'submitted_works_match_percentage' => :'',
68
- :'submission_id' => :'',
69
- :'status' => :'',
70
- :'time_generated' => :'',
71
- :'time_requested' => :'',
72
- :'top_matches' => :'',
73
- :'top_source_largest_matched_word_count' => :''
71
+ :'overall_match_percentage' => :'Integer',
72
+ :'internet_match_percentage' => :'Integer',
73
+ :'publication_match_percentage' => :'Integer',
74
+ :'submitted_works_match_percentage' => :'Integer',
75
+ :'submission_id' => :'String',
76
+ :'status' => :'String',
77
+ :'time_generated' => :'String',
78
+ :'time_requested' => :'String',
79
+ :'top_matches' => :'Array<SimilarityMetadataAllOfTopMatches>',
80
+ :'top_source_largest_matched_word_count' => :'Integer'
74
81
  }
75
82
  end
76
83
 
@@ -82,7 +89,15 @@ module TCAClient
82
89
  :'submitted_works_match_percentage',
83
90
  ])
84
91
  end
85
-
92
+
93
+ # List of class defined in allOf (OpenAPI v3)
94
+ def self.openapi_all_of
95
+ [
96
+ :'SimilarityMetadataAllOf',
97
+ :'SimilarityScoreData'
98
+ ]
99
+ end
100
+
86
101
  # Initializes the object
87
102
  # @param [Hash] attributes Model attributes in the form of hash
88
103
  def initialize(attributes = {})
@@ -98,9 +113,6 @@ module TCAClient
98
113
  h[k.to_sym] = v
99
114
  }
100
115
 
101
- # call parent's initialize
102
- super(attributes)
103
-
104
116
  if attributes.key?(:'overall_match_percentage')
105
117
  self.overall_match_percentage = attributes[:'overall_match_percentage']
106
118
  end
@@ -147,7 +159,7 @@ module TCAClient
147
159
  # Show invalid properties with the reasons. Usually used together with valid?
148
160
  # @return Array for valid properties with the reasons
149
161
  def list_invalid_properties
150
- invalid_properties = super
162
+ invalid_properties = Array.new
151
163
  if @overall_match_percentage.nil?
152
164
  invalid_properties.push('invalid value for "overall_match_percentage", overall_match_percentage cannot be nil.')
153
165
  end
@@ -206,7 +218,7 @@ module TCAClient
206
218
  time_generated == o.time_generated &&
207
219
  time_requested == o.time_requested &&
208
220
  top_matches == o.top_matches &&
209
- top_source_largest_matched_word_count == o.top_source_largest_matched_word_count && super(o)
221
+ top_source_largest_matched_word_count == o.top_source_largest_matched_word_count
210
222
  end
211
223
 
212
224
  # @see the `==` method
@@ -233,9 +245,11 @@ module TCAClient
233
245
  # @return [Object] Returns the model itself
234
246
  def build_from_hash(attributes)
235
247
  return nil unless attributes.is_a?(Hash)
236
- super(attributes)
248
+ attributes = attributes.transform_keys(&:to_sym)
237
249
  self.class.openapi_types.each_pair do |key, type|
238
- if type =~ /\AArray<(.*)>/i
250
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
251
+ self.send("#{key}=", nil)
252
+ elsif type =~ /\AArray<(.*)>/i
239
253
  # check to ensure the input is an array given that the attribute
240
254
  # is documented as an array but the input is not
241
255
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -243,8 +257,6 @@ module TCAClient
243
257
  end
244
258
  elsif !attributes[self.class.attribute_map[key]].nil?
245
259
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
246
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
247
- self.send("#{key}=", nil)
248
260
  end
249
261
  end
250
262
 
@@ -257,8 +269,8 @@ module TCAClient
257
269
  # @return [Object] Deserialized data
258
270
  def _deserialize(type, value)
259
271
  case type.to_sym
260
- when :DateTime
261
- DateTime.parse(value)
272
+ when :Time
273
+ Time.parse(value)
262
274
  when :Date
263
275
  Date.parse(value)
264
276
  when :String
@@ -288,7 +300,9 @@ module TCAClient
288
300
  end
289
301
  end
290
302
  else # model
291
- TCAClient.const_get(type).build_from_hash(value)
303
+ # models (e.g. Pet) or oneOf
304
+ klass = TCAClient.const_get(type)
305
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
292
306
  end
293
307
  end
294
308
 
@@ -307,7 +321,7 @@ module TCAClient
307
321
  # Returns the object in the form of hash
308
322
  # @return [Hash] Returns the object in the form of hash
309
323
  def to_hash
310
- hash = super
324
+ hash = {}
311
325
  self.class.attribute_map.each_pair do |attr, param|
312
326
  value = self.send(attr)
313
327
  if value.nil?
@@ -336,5 +350,8 @@ module TCAClient
336
350
  else
337
351
  value
338
352
  end
339
- end end
353
+ end
354
+
355
+ end
356
+
340
357
  end
@@ -0,0 +1,301 @@
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
+ The version of the OpenAPI document: 1.0.258
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.3.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module TCAClient
17
+ class SimilarityMetadataAllOf
18
+ attr_accessor :submission_id
19
+
20
+ # possible values PENDING, COMPLETE
21
+ attr_accessor :status
22
+
23
+ # Time the report finished generating. If not set the report has not finished generating
24
+ attr_accessor :time_generated
25
+
26
+ # Time the report was requested
27
+ attr_accessor :time_requested
28
+
29
+ # Top matches
30
+ attr_accessor :top_matches
31
+
32
+ # Largest individual matched word count, 0 if there isn't a match to this submission.
33
+ attr_accessor :top_source_largest_matched_word_count
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'submission_id' => :'submission_id',
39
+ :'status' => :'status',
40
+ :'time_generated' => :'time_generated',
41
+ :'time_requested' => :'time_requested',
42
+ :'top_matches' => :'top_matches',
43
+ :'top_source_largest_matched_word_count' => :'top_source_largest_matched_word_count'
44
+ }
45
+ end
46
+
47
+ # Returns all the JSON keys this model knows about
48
+ def self.acceptable_attributes
49
+ attribute_map.values
50
+ end
51
+
52
+ # Attribute type mapping.
53
+ def self.openapi_types
54
+ {
55
+ :'submission_id' => :'String',
56
+ :'status' => :'String',
57
+ :'time_generated' => :'String',
58
+ :'time_requested' => :'String',
59
+ :'top_matches' => :'Array<SimilarityMetadataAllOfTopMatches>',
60
+ :'top_source_largest_matched_word_count' => :'Integer'
61
+ }
62
+ end
63
+
64
+ # List of attributes with nullable: true
65
+ def self.openapi_nullable
66
+ Set.new([
67
+ ])
68
+ end
69
+
70
+ # Initializes the object
71
+ # @param [Hash] attributes Model attributes in the form of hash
72
+ def initialize(attributes = {})
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TCAClient::SimilarityMetadataAllOf` initialize method"
75
+ end
76
+
77
+ # check to see if the attribute exists and convert string to symbol for hash key
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TCAClient::SimilarityMetadataAllOf`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
82
+ h[k.to_sym] = v
83
+ }
84
+
85
+ if attributes.key?(:'submission_id')
86
+ self.submission_id = attributes[:'submission_id']
87
+ end
88
+
89
+ if attributes.key?(:'status')
90
+ self.status = attributes[:'status']
91
+ end
92
+
93
+ if attributes.key?(:'time_generated')
94
+ self.time_generated = attributes[:'time_generated']
95
+ end
96
+
97
+ if attributes.key?(:'time_requested')
98
+ self.time_requested = attributes[:'time_requested']
99
+ end
100
+
101
+ if attributes.key?(:'top_matches')
102
+ if (value = attributes[:'top_matches']).is_a?(Array)
103
+ self.top_matches = value
104
+ end
105
+ end
106
+
107
+ if attributes.key?(:'top_source_largest_matched_word_count')
108
+ self.top_source_largest_matched_word_count = attributes[:'top_source_largest_matched_word_count']
109
+ end
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properties with the reasons
114
+ def list_invalid_properties
115
+ invalid_properties = Array.new
116
+ if @submission_id.nil?
117
+ invalid_properties.push('invalid value for "submission_id", submission_id cannot be nil.')
118
+ end
119
+
120
+ if @status.nil?
121
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
122
+ end
123
+
124
+ if @time_generated.nil?
125
+ invalid_properties.push('invalid value for "time_generated", time_generated cannot be nil.')
126
+ end
127
+
128
+ if @time_requested.nil?
129
+ invalid_properties.push('invalid value for "time_requested", time_requested cannot be nil.')
130
+ end
131
+
132
+ if @top_matches.nil?
133
+ invalid_properties.push('invalid value for "top_matches", top_matches cannot be nil.')
134
+ end
135
+
136
+ if @top_source_largest_matched_word_count.nil?
137
+ invalid_properties.push('invalid value for "top_source_largest_matched_word_count", top_source_largest_matched_word_count cannot be nil.')
138
+ end
139
+
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ return false if @submission_id.nil?
147
+ return false if @status.nil?
148
+ return false if @time_generated.nil?
149
+ return false if @time_requested.nil?
150
+ return false if @top_matches.nil?
151
+ return false if @top_source_largest_matched_word_count.nil?
152
+ true
153
+ end
154
+
155
+ # Checks equality by comparing each attribute.
156
+ # @param [Object] Object to be compared
157
+ def ==(o)
158
+ return true if self.equal?(o)
159
+ self.class == o.class &&
160
+ submission_id == o.submission_id &&
161
+ status == o.status &&
162
+ time_generated == o.time_generated &&
163
+ time_requested == o.time_requested &&
164
+ top_matches == o.top_matches &&
165
+ top_source_largest_matched_word_count == o.top_source_largest_matched_word_count
166
+ end
167
+
168
+ # @see the `==` method
169
+ # @param [Object] Object to be compared
170
+ def eql?(o)
171
+ self == o
172
+ end
173
+
174
+ # Calculates hash code according to all attributes.
175
+ # @return [Integer] Hash code
176
+ def hash
177
+ [submission_id, status, time_generated, time_requested, top_matches, top_source_largest_matched_word_count].hash
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def self.build_from_hash(attributes)
184
+ new.build_from_hash(attributes)
185
+ end
186
+
187
+ # Builds the object from hash
188
+ # @param [Hash] attributes Model attributes in the form of hash
189
+ # @return [Object] Returns the model itself
190
+ def build_from_hash(attributes)
191
+ return nil unless attributes.is_a?(Hash)
192
+ attributes = attributes.transform_keys(&:to_sym)
193
+ self.class.openapi_types.each_pair do |key, type|
194
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
195
+ self.send("#{key}=", nil)
196
+ elsif type =~ /\AArray<(.*)>/i
197
+ # check to ensure the input is an array given that the attribute
198
+ # is documented as an array but the input is not
199
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
200
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
201
+ end
202
+ elsif !attributes[self.class.attribute_map[key]].nil?
203
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
204
+ end
205
+ end
206
+
207
+ self
208
+ end
209
+
210
+ # Deserializes the data based on type
211
+ # @param string type Data type
212
+ # @param string value Value to be deserialized
213
+ # @return [Object] Deserialized data
214
+ def _deserialize(type, value)
215
+ case type.to_sym
216
+ when :Time
217
+ Time.parse(value)
218
+ when :Date
219
+ Date.parse(value)
220
+ when :String
221
+ value.to_s
222
+ when :Integer
223
+ value.to_i
224
+ when :Float
225
+ value.to_f
226
+ when :Boolean
227
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
228
+ true
229
+ else
230
+ false
231
+ end
232
+ when :Object
233
+ # generic object (usually a Hash), return directly
234
+ value
235
+ when /\AArray<(?<inner_type>.+)>\z/
236
+ inner_type = Regexp.last_match[:inner_type]
237
+ value.map { |v| _deserialize(inner_type, v) }
238
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
239
+ k_type = Regexp.last_match[:k_type]
240
+ v_type = Regexp.last_match[:v_type]
241
+ {}.tap do |hash|
242
+ value.each do |k, v|
243
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
244
+ end
245
+ end
246
+ else # model
247
+ # models (e.g. Pet) or oneOf
248
+ klass = TCAClient.const_get(type)
249
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
250
+ end
251
+ end
252
+
253
+ # Returns the string representation of the object
254
+ # @return [String] String presentation of the object
255
+ def to_s
256
+ to_hash.to_s
257
+ end
258
+
259
+ # to_body is an alias to to_hash (backward compatibility)
260
+ # @return [Hash] Returns the object in the form of hash
261
+ def to_body
262
+ to_hash
263
+ end
264
+
265
+ # Returns the object in the form of hash
266
+ # @return [Hash] Returns the object in the form of hash
267
+ def to_hash
268
+ hash = {}
269
+ self.class.attribute_map.each_pair do |attr, param|
270
+ value = self.send(attr)
271
+ if value.nil?
272
+ is_nullable = self.class.openapi_nullable.include?(attr)
273
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
274
+ end
275
+
276
+ hash[param] = _to_hash(value)
277
+ end
278
+ hash
279
+ end
280
+
281
+ # Outputs non-array value in the form of hash
282
+ # For object, use to_hash. Otherwise, just return the value
283
+ # @param [Object] value Any valid value
284
+ # @return [Hash] Returns the value in the form of hash
285
+ def _to_hash(value)
286
+ if value.is_a?(Array)
287
+ value.compact.map { |v| _to_hash(v) }
288
+ elsif value.is_a?(Hash)
289
+ {}.tap do |hash|
290
+ value.each { |k, v| hash[k] = _to_hash(v) }
291
+ end
292
+ elsif value.respond_to? :to_hash
293
+ value.to_hash
294
+ else
295
+ value
296
+ end
297
+ end
298
+
299
+ end
300
+
301
+ end
@@ -3,16 +3,18 @@
3
3
 
4
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
5
 
6
- OpenAPI spec version: 1.0.249
6
+ The version of the OpenAPI document: 1.0.258
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.3.0-SNAPSHOT
7
10
 
8
- Generated by: https://github.com/swagger-api/swagger-codegen.git
9
- Swagger Codegen version: 3.0.35
10
11
  =end
11
12
 
12
13
  require 'date'
14
+ require 'time'
13
15
 
14
16
  module TCAClient
15
- class SimilarityMetadataTopMatches
17
+ class SimilarityMetadataAllOfTopMatches
16
18
  # Source name
17
19
  attr_accessor :name
18
20
 
@@ -47,16 +49,21 @@ module TCAClient
47
49
  }
48
50
  end
49
51
 
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ attribute_map.values
55
+ end
56
+
50
57
  # Attribute type mapping.
51
58
  def self.openapi_types
52
59
  {
53
- :'name' => :'Object',
54
- :'percentage' => :'Object',
55
- :'submission_id' => :'Object',
56
- :'source_type' => :'Object',
57
- :'matched_word_count_total' => :'Object',
58
- :'submitted_date' => :'Object',
59
- :'institution_name' => :'Object'
60
+ :'name' => :'String',
61
+ :'percentage' => :'Float',
62
+ :'submission_id' => :'String',
63
+ :'source_type' => :'String',
64
+ :'matched_word_count_total' => :'Float',
65
+ :'submitted_date' => :'String',
66
+ :'institution_name' => :'String'
60
67
  }
61
68
  end
62
69
 
@@ -65,18 +72,18 @@ module TCAClient
65
72
  Set.new([
66
73
  ])
67
74
  end
68
-
75
+
69
76
  # Initializes the object
70
77
  # @param [Hash] attributes Model attributes in the form of hash
71
78
  def initialize(attributes = {})
72
79
  if (!attributes.is_a?(Hash))
73
- fail ArgumentError, "The input argument (attributes) must be a hash in `TCAClient::SimilarityMetadataTopMatches` initialize method"
80
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TCAClient::SimilarityMetadataAllOfTopMatches` initialize method"
74
81
  end
75
82
 
76
83
  # check to see if the attribute exists and convert string to symbol for hash key
77
84
  attributes = attributes.each_with_object({}) { |(k, v), h|
78
85
  if (!self.class.attribute_map.key?(k.to_sym))
79
- fail ArgumentError, "`#{k}` is not a valid attribute in `TCAClient::SimilarityMetadataTopMatches`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
86
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TCAClient::SimilarityMetadataAllOfTopMatches`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
80
87
  end
81
88
  h[k.to_sym] = v
82
89
  }
@@ -161,8 +168,11 @@ module TCAClient
161
168
  # @return [Object] Returns the model itself
162
169
  def build_from_hash(attributes)
163
170
  return nil unless attributes.is_a?(Hash)
171
+ attributes = attributes.transform_keys(&:to_sym)
164
172
  self.class.openapi_types.each_pair do |key, type|
165
- if type =~ /\AArray<(.*)>/i
173
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
174
+ self.send("#{key}=", nil)
175
+ elsif type =~ /\AArray<(.*)>/i
166
176
  # check to ensure the input is an array given that the attribute
167
177
  # is documented as an array but the input is not
168
178
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -170,8 +180,6 @@ module TCAClient
170
180
  end
171
181
  elsif !attributes[self.class.attribute_map[key]].nil?
172
182
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
173
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
174
- self.send("#{key}=", nil)
175
183
  end
176
184
  end
177
185
 
@@ -184,8 +192,8 @@ module TCAClient
184
192
  # @return [Object] Deserialized data
185
193
  def _deserialize(type, value)
186
194
  case type.to_sym
187
- when :DateTime
188
- DateTime.parse(value)
195
+ when :Time
196
+ Time.parse(value)
189
197
  when :Date
190
198
  Date.parse(value)
191
199
  when :String
@@ -215,7 +223,9 @@ module TCAClient
215
223
  end
216
224
  end
217
225
  else # model
218
- TCAClient.const_get(type).build_from_hash(value)
226
+ # models (e.g. Pet) or oneOf
227
+ klass = TCAClient.const_get(type)
228
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
219
229
  end
220
230
  end
221
231
 
@@ -263,5 +273,8 @@ module TCAClient
263
273
  else
264
274
  value
265
275
  end
266
- end end
276
+ end
277
+
278
+ end
279
+
267
280
  end