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 SimilarityViewerUrlResponse
@@ -23,10 +25,15 @@ module TCAClient
23
25
  }
24
26
  end
25
27
 
28
+ # Returns all the JSON keys this model knows about
29
+ def self.acceptable_attributes
30
+ attribute_map.values
31
+ end
32
+
26
33
  # Attribute type mapping.
27
34
  def self.openapi_types
28
35
  {
29
- :'viewer_url' => :'Object'
36
+ :'viewer_url' => :'String'
30
37
  }
31
38
  end
32
39
 
@@ -35,7 +42,7 @@ module TCAClient
35
42
  Set.new([
36
43
  ])
37
44
  end
38
-
45
+
39
46
  # Initializes the object
40
47
  # @param [Hash] attributes Model attributes in the form of hash
41
48
  def initialize(attributes = {})
@@ -101,8 +108,11 @@ module TCAClient
101
108
  # @return [Object] Returns the model itself
102
109
  def build_from_hash(attributes)
103
110
  return nil unless attributes.is_a?(Hash)
111
+ attributes = attributes.transform_keys(&:to_sym)
104
112
  self.class.openapi_types.each_pair do |key, type|
105
- if type =~ /\AArray<(.*)>/i
113
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
+ self.send("#{key}=", nil)
115
+ elsif type =~ /\AArray<(.*)>/i
106
116
  # check to ensure the input is an array given that the attribute
107
117
  # is documented as an array but the input is not
108
118
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -110,8 +120,6 @@ module TCAClient
110
120
  end
111
121
  elsif !attributes[self.class.attribute_map[key]].nil?
112
122
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
113
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
114
- self.send("#{key}=", nil)
115
123
  end
116
124
  end
117
125
 
@@ -124,8 +132,8 @@ module TCAClient
124
132
  # @return [Object] Deserialized data
125
133
  def _deserialize(type, value)
126
134
  case type.to_sym
127
- when :DateTime
128
- DateTime.parse(value)
135
+ when :Time
136
+ Time.parse(value)
129
137
  when :Date
130
138
  Date.parse(value)
131
139
  when :String
@@ -155,7 +163,9 @@ module TCAClient
155
163
  end
156
164
  end
157
165
  else # model
158
- TCAClient.const_get(type).build_from_hash(value)
166
+ # models (e.g. Pet) or oneOf
167
+ klass = TCAClient.const_get(type)
168
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
159
169
  end
160
170
  end
161
171
 
@@ -203,5 +213,8 @@ module TCAClient
203
213
  else
204
214
  value
205
215
  end
206
- end end
216
+ end
217
+
218
+ end
219
+
207
220
  end
@@ -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 SimilarityViewerUrlSettings
@@ -32,6 +34,8 @@ module TCAClient
32
34
 
33
35
  attr_accessor :similarity
34
36
 
37
+ attr_accessor :annotations
38
+
35
39
  class EnumAttributeValidator
36
40
  attr_reader :datatype
37
41
  attr_reader :allowable_values
@@ -64,21 +68,28 @@ module TCAClient
64
68
  :'viewer_permissions' => :'viewer_permissions',
65
69
  :'eula' => :'eula',
66
70
  :'sidebar' => :'sidebar',
67
- :'similarity' => :'similarity'
71
+ :'similarity' => :'similarity',
72
+ :'annotations' => :'annotations'
68
73
  }
69
74
  end
70
75
 
76
+ # Returns all the JSON keys this model knows about
77
+ def self.acceptable_attributes
78
+ attribute_map.values
79
+ end
80
+
71
81
  # Attribute type mapping.
72
82
  def self.openapi_types
73
83
  {
74
- :'author_metadata_override' => :'Object',
75
- :'viewer_user_id' => :'Object',
76
- :'locale' => :'Object',
77
- :'viewer_default_permission_set' => :'Object',
78
- :'viewer_permissions' => :'Object',
79
- :'eula' => :'Object',
80
- :'sidebar' => :'Object',
81
- :'similarity' => :'Object'
84
+ :'author_metadata_override' => :'AuthorMetadataOverride',
85
+ :'viewer_user_id' => :'String',
86
+ :'locale' => :'String',
87
+ :'viewer_default_permission_set' => :'String',
88
+ :'viewer_permissions' => :'ViewerPermissions',
89
+ :'eula' => :'Eula',
90
+ :'sidebar' => :'Sidebar',
91
+ :'similarity' => :'SimilaritySettings',
92
+ :'annotations' => :'AnnotationsSettings'
82
93
  }
83
94
  end
84
95
 
@@ -87,7 +98,7 @@ module TCAClient
87
98
  Set.new([
88
99
  ])
89
100
  end
90
-
101
+
91
102
  # Initializes the object
92
103
  # @param [Hash] attributes Model attributes in the form of hash
93
104
  def initialize(attributes = {})
@@ -134,6 +145,10 @@ module TCAClient
134
145
  if attributes.key?(:'similarity')
135
146
  self.similarity = attributes[:'similarity']
136
147
  end
148
+
149
+ if attributes.key?(:'annotations')
150
+ self.annotations = attributes[:'annotations']
151
+ end
137
152
  end
138
153
 
139
154
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -146,7 +161,7 @@ module TCAClient
146
161
  # Check to see if the all the properties in the model are valid
147
162
  # @return true if the model is valid
148
163
  def valid?
149
- locale_validator = EnumAttributeValidator.new('Object', ['ar-SA', 'cs-CZ', 'de-DE', 'el-GR', 'en-US', 'es-MX', 'fi-FI', 'fr-FR', 'it-IT', 'ja-JP', 'ko-KR', 'nl-NL', 'pl-PL', 'pt-BR', 'ro-RO', 'ru-RU', 'sv-SE', 'tr-TR', 'vi-VN', 'zh-CN', 'zh-TW'])
164
+ locale_validator = EnumAttributeValidator.new('String', ["ar-SA", "cs-CZ", "de-DE", "el-GR", "en-US", "es-MX", "fi-FI", "fr-FR", "it-IT", "ja-JP", "ko-KR", "nl-NL", "pl-PL", "pt-BR", "ro-RO", "ru-RU", "sv-SE", "tr-TR", "vi-VN", "zh-CN", "zh-TW"])
150
165
  return false unless locale_validator.valid?(@locale)
151
166
  true
152
167
  end
@@ -154,7 +169,7 @@ module TCAClient
154
169
  # Custom attribute writer method checking allowed values (enum).
155
170
  # @param [Object] locale Object to be assigned
156
171
  def locale=(locale)
157
- validator = EnumAttributeValidator.new('Object', ['ar-SA', 'cs-CZ', 'de-DE', 'el-GR', 'en-US', 'es-MX', 'fi-FI', 'fr-FR', 'it-IT', 'ja-JP', 'ko-KR', 'nl-NL', 'pl-PL', 'pt-BR', 'ro-RO', 'ru-RU', 'sv-SE', 'tr-TR', 'vi-VN', 'zh-CN', 'zh-TW'])
172
+ validator = EnumAttributeValidator.new('String', ["ar-SA", "cs-CZ", "de-DE", "el-GR", "en-US", "es-MX", "fi-FI", "fr-FR", "it-IT", "ja-JP", "ko-KR", "nl-NL", "pl-PL", "pt-BR", "ro-RO", "ru-RU", "sv-SE", "tr-TR", "vi-VN", "zh-CN", "zh-TW"])
158
173
  unless validator.valid?(locale)
159
174
  fail ArgumentError, "invalid value for \"locale\", must be one of #{validator.allowable_values}."
160
175
  end
@@ -173,7 +188,8 @@ module TCAClient
173
188
  viewer_permissions == o.viewer_permissions &&
174
189
  eula == o.eula &&
175
190
  sidebar == o.sidebar &&
176
- similarity == o.similarity
191
+ similarity == o.similarity &&
192
+ annotations == o.annotations
177
193
  end
178
194
 
179
195
  # @see the `==` method
@@ -185,7 +201,7 @@ module TCAClient
185
201
  # Calculates hash code according to all attributes.
186
202
  # @return [Integer] Hash code
187
203
  def hash
188
- [author_metadata_override, viewer_user_id, locale, viewer_default_permission_set, viewer_permissions, eula, sidebar, similarity].hash
204
+ [author_metadata_override, viewer_user_id, locale, viewer_default_permission_set, viewer_permissions, eula, sidebar, similarity, annotations].hash
189
205
  end
190
206
 
191
207
  # Builds the object from hash
@@ -200,8 +216,11 @@ module TCAClient
200
216
  # @return [Object] Returns the model itself
201
217
  def build_from_hash(attributes)
202
218
  return nil unless attributes.is_a?(Hash)
219
+ attributes = attributes.transform_keys(&:to_sym)
203
220
  self.class.openapi_types.each_pair do |key, type|
204
- if type =~ /\AArray<(.*)>/i
221
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
222
+ self.send("#{key}=", nil)
223
+ elsif type =~ /\AArray<(.*)>/i
205
224
  # check to ensure the input is an array given that the attribute
206
225
  # is documented as an array but the input is not
207
226
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -209,8 +228,6 @@ module TCAClient
209
228
  end
210
229
  elsif !attributes[self.class.attribute_map[key]].nil?
211
230
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
212
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
213
- self.send("#{key}=", nil)
214
231
  end
215
232
  end
216
233
 
@@ -223,8 +240,8 @@ module TCAClient
223
240
  # @return [Object] Deserialized data
224
241
  def _deserialize(type, value)
225
242
  case type.to_sym
226
- when :DateTime
227
- DateTime.parse(value)
243
+ when :Time
244
+ Time.parse(value)
228
245
  when :Date
229
246
  Date.parse(value)
230
247
  when :String
@@ -254,7 +271,9 @@ module TCAClient
254
271
  end
255
272
  end
256
273
  else # model
257
- TCAClient.const_get(type).build_from_hash(value)
274
+ # models (e.g. Pet) or oneOf
275
+ klass = TCAClient.const_get(type)
276
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
258
277
  end
259
278
  end
260
279
 
@@ -302,5 +321,8 @@ module TCAClient
302
321
  else
303
322
  value
304
323
  end
305
- end end
324
+ end
325
+
326
+ end
327
+
306
328
  end
@@ -3,25 +3,79 @@
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 SimpleSubmissionResponse
18
+ # the unique ID of the submission
19
+ attr_accessor :id
20
+
21
+ # the owner of the submission
22
+ attr_accessor :owner
23
+
24
+ # the title of the submission
25
+ attr_accessor :title
26
+
27
+ # the current status of the Submission
28
+ attr_accessor :status
29
+
30
+ # RFC3339 timestamp of when this submission was initially created. This is the time at which the POST to /submissions was made.
31
+ attr_accessor :created_time
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
16
55
  # Attribute mapping from ruby-style variable name to JSON key.
17
56
  def self.attribute_map
18
57
  {
58
+ :'id' => :'id',
59
+ :'owner' => :'owner',
60
+ :'title' => :'title',
61
+ :'status' => :'status',
62
+ :'created_time' => :'created_time'
19
63
  }
20
64
  end
21
65
 
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ attribute_map.values
69
+ end
70
+
22
71
  # Attribute type mapping.
23
72
  def self.openapi_types
24
73
  {
74
+ :'id' => :'String',
75
+ :'owner' => :'String',
76
+ :'title' => :'String',
77
+ :'status' => :'String',
78
+ :'created_time' => :'Time'
25
79
  }
26
80
  end
27
81
 
@@ -30,7 +84,14 @@ module TCAClient
30
84
  Set.new([
31
85
  ])
32
86
  end
33
-
87
+
88
+ # List of class defined in allOf (OpenAPI v3)
89
+ def self.openapi_all_of
90
+ [
91
+ :'SimpleSubmissionResponseAllOf'
92
+ ]
93
+ end
94
+
34
95
  # Initializes the object
35
96
  # @param [Hash] attributes Model attributes in the form of hash
36
97
  def initialize(attributes = {})
@@ -45,6 +106,26 @@ module TCAClient
45
106
  end
46
107
  h[k.to_sym] = v
47
108
  }
109
+
110
+ if attributes.key?(:'id')
111
+ self.id = attributes[:'id']
112
+ end
113
+
114
+ if attributes.key?(:'owner')
115
+ self.owner = attributes[:'owner']
116
+ end
117
+
118
+ if attributes.key?(:'title')
119
+ self.title = attributes[:'title']
120
+ end
121
+
122
+ if attributes.key?(:'status')
123
+ self.status = attributes[:'status']
124
+ end
125
+
126
+ if attributes.key?(:'created_time')
127
+ self.created_time = attributes[:'created_time']
128
+ end
48
129
  end
49
130
 
50
131
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -57,14 +138,31 @@ module TCAClient
57
138
  # Check to see if the all the properties in the model are valid
58
139
  # @return true if the model is valid
59
140
  def valid?
141
+ status_validator = EnumAttributeValidator.new('String', ["CREATED", "PROCESSING", "COMPLETE", "DELETED", "ERROR"])
142
+ return false unless status_validator.valid?(@status)
60
143
  true
61
144
  end
62
145
 
146
+ # Custom attribute writer method checking allowed values (enum).
147
+ # @param [Object] status Object to be assigned
148
+ def status=(status)
149
+ validator = EnumAttributeValidator.new('String', ["CREATED", "PROCESSING", "COMPLETE", "DELETED", "ERROR"])
150
+ unless validator.valid?(status)
151
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
152
+ end
153
+ @status = status
154
+ end
155
+
63
156
  # Checks equality by comparing each attribute.
64
157
  # @param [Object] Object to be compared
65
158
  def ==(o)
66
159
  return true if self.equal?(o)
67
- self.class == o.class
160
+ self.class == o.class &&
161
+ id == o.id &&
162
+ owner == o.owner &&
163
+ title == o.title &&
164
+ status == o.status &&
165
+ created_time == o.created_time
68
166
  end
69
167
 
70
168
  # @see the `==` method
@@ -76,7 +174,7 @@ module TCAClient
76
174
  # Calculates hash code according to all attributes.
77
175
  # @return [Integer] Hash code
78
176
  def hash
79
- [].hash
177
+ [id, owner, title, status, created_time].hash
80
178
  end
81
179
 
82
180
  # Builds the object from hash
@@ -91,8 +189,11 @@ module TCAClient
91
189
  # @return [Object] Returns the model itself
92
190
  def build_from_hash(attributes)
93
191
  return nil unless attributes.is_a?(Hash)
192
+ attributes = attributes.transform_keys(&:to_sym)
94
193
  self.class.openapi_types.each_pair do |key, type|
95
- if type =~ /\AArray<(.*)>/i
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
96
197
  # check to ensure the input is an array given that the attribute
97
198
  # is documented as an array but the input is not
98
199
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -100,8 +201,6 @@ module TCAClient
100
201
  end
101
202
  elsif !attributes[self.class.attribute_map[key]].nil?
102
203
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
103
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
104
- self.send("#{key}=", nil)
105
204
  end
106
205
  end
107
206
 
@@ -114,8 +213,8 @@ module TCAClient
114
213
  # @return [Object] Deserialized data
115
214
  def _deserialize(type, value)
116
215
  case type.to_sym
117
- when :DateTime
118
- DateTime.parse(value)
216
+ when :Time
217
+ Time.parse(value)
119
218
  when :Date
120
219
  Date.parse(value)
121
220
  when :String
@@ -145,7 +244,9 @@ module TCAClient
145
244
  end
146
245
  end
147
246
  else # model
148
- TCAClient.const_get(type).build_from_hash(value)
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)
149
250
  end
150
251
  end
151
252
 
@@ -193,5 +294,8 @@ module TCAClient
193
294
  else
194
295
  value
195
296
  end
196
- end end
297
+ end
298
+
299
+ end
300
+
197
301
  end