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 PdfStatusResponse
@@ -45,10 +47,15 @@ module TCAClient
45
47
  }
46
48
  end
47
49
 
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ attribute_map.values
53
+ end
54
+
48
55
  # Attribute type mapping.
49
56
  def self.openapi_types
50
57
  {
51
- :'status' => :'Object'
58
+ :'status' => :'String'
52
59
  }
53
60
  end
54
61
 
@@ -57,7 +64,7 @@ module TCAClient
57
64
  Set.new([
58
65
  ])
59
66
  end
60
-
67
+
61
68
  # Initializes the object
62
69
  # @param [Hash] attributes Model attributes in the form of hash
63
70
  def initialize(attributes = {})
@@ -88,7 +95,7 @@ module TCAClient
88
95
  # Check to see if the all the properties in the model are valid
89
96
  # @return true if the model is valid
90
97
  def valid?
91
- status_validator = EnumAttributeValidator.new('Object', ['SUCCESS', 'PENDING', 'FAILED'])
98
+ status_validator = EnumAttributeValidator.new('String', ["SUCCESS", "PENDING", "FAILED"])
92
99
  return false unless status_validator.valid?(@status)
93
100
  true
94
101
  end
@@ -96,7 +103,7 @@ module TCAClient
96
103
  # Custom attribute writer method checking allowed values (enum).
97
104
  # @param [Object] status Object to be assigned
98
105
  def status=(status)
99
- validator = EnumAttributeValidator.new('Object', ['SUCCESS', 'PENDING', 'FAILED'])
106
+ validator = EnumAttributeValidator.new('String', ["SUCCESS", "PENDING", "FAILED"])
100
107
  unless validator.valid?(status)
101
108
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
102
109
  end
@@ -135,8 +142,11 @@ module TCAClient
135
142
  # @return [Object] Returns the model itself
136
143
  def build_from_hash(attributes)
137
144
  return nil unless attributes.is_a?(Hash)
145
+ attributes = attributes.transform_keys(&:to_sym)
138
146
  self.class.openapi_types.each_pair do |key, type|
139
- if type =~ /\AArray<(.*)>/i
147
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
148
+ self.send("#{key}=", nil)
149
+ elsif type =~ /\AArray<(.*)>/i
140
150
  # check to ensure the input is an array given that the attribute
141
151
  # is documented as an array but the input is not
142
152
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -144,8 +154,6 @@ module TCAClient
144
154
  end
145
155
  elsif !attributes[self.class.attribute_map[key]].nil?
146
156
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
147
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
148
- self.send("#{key}=", nil)
149
157
  end
150
158
  end
151
159
 
@@ -158,8 +166,8 @@ module TCAClient
158
166
  # @return [Object] Deserialized data
159
167
  def _deserialize(type, value)
160
168
  case type.to_sym
161
- when :DateTime
162
- DateTime.parse(value)
169
+ when :Time
170
+ Time.parse(value)
163
171
  when :Date
164
172
  Date.parse(value)
165
173
  when :String
@@ -189,7 +197,9 @@ module TCAClient
189
197
  end
190
198
  end
191
199
  else # model
192
- TCAClient.const_get(type).build_from_hash(value)
200
+ # models (e.g. Pet) or oneOf
201
+ klass = TCAClient.const_get(type)
202
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
193
203
  end
194
204
  end
195
205
 
@@ -237,5 +247,8 @@ module TCAClient
237
247
  else
238
248
  value
239
249
  end
240
- end end
250
+ end
251
+
252
+ end
253
+
241
254
  end
@@ -0,0 +1,283 @@
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 PDFStatusWebhookRequest
18
+ # The requesting Pdf status
19
+ attr_accessor :status
20
+
21
+ # the PDF ID
22
+ attr_accessor :id
23
+
24
+ # the associated submission ID
25
+ attr_accessor :submission_id
26
+
27
+ attr_accessor :metadata
28
+
29
+ class EnumAttributeValidator
30
+ attr_reader :datatype
31
+ attr_reader :allowable_values
32
+
33
+ def initialize(datatype, allowable_values)
34
+ @allowable_values = allowable_values.map do |value|
35
+ case datatype.to_s
36
+ when /Integer/i
37
+ value.to_i
38
+ when /Float/i
39
+ value.to_f
40
+ else
41
+ value
42
+ end
43
+ end
44
+ end
45
+
46
+ def valid?(value)
47
+ !value || allowable_values.include?(value)
48
+ end
49
+ end
50
+
51
+ # Attribute mapping from ruby-style variable name to JSON key.
52
+ def self.attribute_map
53
+ {
54
+ :'status' => :'status',
55
+ :'id' => :'id',
56
+ :'submission_id' => :'submission_id',
57
+ :'metadata' => :'metadata'
58
+ }
59
+ end
60
+
61
+ # Returns all the JSON keys this model knows about
62
+ def self.acceptable_attributes
63
+ attribute_map.values
64
+ end
65
+
66
+ # Attribute type mapping.
67
+ def self.openapi_types
68
+ {
69
+ :'status' => :'String',
70
+ :'id' => :'String',
71
+ :'submission_id' => :'String',
72
+ :'metadata' => :'SubmissionCompleteWebhookRequestAllOfMetadata'
73
+ }
74
+ end
75
+
76
+ # List of attributes with nullable: true
77
+ def self.openapi_nullable
78
+ Set.new([
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `TCAClient::PDFStatusWebhookRequest` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!self.class.attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `TCAClient::PDFStatusWebhookRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'status')
98
+ self.status = attributes[:'status']
99
+ end
100
+
101
+ if attributes.key?(:'id')
102
+ self.id = attributes[:'id']
103
+ end
104
+
105
+ if attributes.key?(:'submission_id')
106
+ self.submission_id = attributes[:'submission_id']
107
+ end
108
+
109
+ if attributes.key?(:'metadata')
110
+ self.metadata = attributes[:'metadata']
111
+ end
112
+ end
113
+
114
+ # Show invalid properties with the reasons. Usually used together with valid?
115
+ # @return Array for valid properties with the reasons
116
+ def list_invalid_properties
117
+ invalid_properties = Array.new
118
+ invalid_properties
119
+ end
120
+
121
+ # Check to see if the all the properties in the model are valid
122
+ # @return true if the model is valid
123
+ def valid?
124
+ status_validator = EnumAttributeValidator.new('String', ["SUCCESS", "PENDING", "FAILED"])
125
+ return false unless status_validator.valid?(@status)
126
+ true
127
+ end
128
+
129
+ # Custom attribute writer method checking allowed values (enum).
130
+ # @param [Object] status Object to be assigned
131
+ def status=(status)
132
+ validator = EnumAttributeValidator.new('String', ["SUCCESS", "PENDING", "FAILED"])
133
+ unless validator.valid?(status)
134
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
135
+ end
136
+ @status = status
137
+ end
138
+
139
+ # Checks equality by comparing each attribute.
140
+ # @param [Object] Object to be compared
141
+ def ==(o)
142
+ return true if self.equal?(o)
143
+ self.class == o.class &&
144
+ status == o.status &&
145
+ id == o.id &&
146
+ submission_id == o.submission_id &&
147
+ metadata == o.metadata
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [status, id, submission_id, metadata].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ new.build_from_hash(attributes)
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ attributes = attributes.transform_keys(&:to_sym)
175
+ self.class.openapi_types.each_pair do |key, type|
176
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
177
+ self.send("#{key}=", nil)
178
+ elsif type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
183
+ end
184
+ elsif !attributes[self.class.attribute_map[key]].nil?
185
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ end
187
+ end
188
+
189
+ self
190
+ end
191
+
192
+ # Deserializes the data based on type
193
+ # @param string type Data type
194
+ # @param string value Value to be deserialized
195
+ # @return [Object] Deserialized data
196
+ def _deserialize(type, value)
197
+ case type.to_sym
198
+ when :Time
199
+ Time.parse(value)
200
+ when :Date
201
+ Date.parse(value)
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :Boolean
209
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else # model
229
+ # models (e.g. Pet) or oneOf
230
+ klass = TCAClient.const_get(type)
231
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
232
+ end
233
+ end
234
+
235
+ # Returns the string representation of the object
236
+ # @return [String] String presentation of the object
237
+ def to_s
238
+ to_hash.to_s
239
+ end
240
+
241
+ # to_body is an alias to to_hash (backward compatibility)
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_body
244
+ to_hash
245
+ end
246
+
247
+ # Returns the object in the form of hash
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_hash
250
+ hash = {}
251
+ self.class.attribute_map.each_pair do |attr, param|
252
+ value = self.send(attr)
253
+ if value.nil?
254
+ is_nullable = self.class.openapi_nullable.include?(attr)
255
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
256
+ end
257
+
258
+ hash[param] = _to_hash(value)
259
+ end
260
+ hash
261
+ end
262
+
263
+ # Outputs non-array value in the form of hash
264
+ # For object, use to_hash. Otherwise, just return the value
265
+ # @param [Object] value Any valid value
266
+ # @return [Hash] Returns the value in the form of hash
267
+ def _to_hash(value)
268
+ if value.is_a?(Array)
269
+ value.compact.map { |v| _to_hash(v) }
270
+ elsif value.is_a?(Hash)
271
+ {}.tap do |hash|
272
+ value.each { |k, v| hash[k] = _to_hash(v) }
273
+ end
274
+ elsif value.respond_to? :to_hash
275
+ value.to_hash
276
+ else
277
+ value
278
+ end
279
+ end
280
+
281
+ end
282
+
283
+ 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 RateLimitError
@@ -27,11 +29,16 @@ module TCAClient
27
29
  }
28
30
  end
29
31
 
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
30
37
  # Attribute type mapping.
31
38
  def self.openapi_types
32
39
  {
33
- :'status' => :'',
34
- :'message' => :''
40
+ :'status' => :'String',
41
+ :'message' => :'String'
35
42
  }
36
43
  end
37
44
 
@@ -40,7 +47,14 @@ module TCAClient
40
47
  Set.new([
41
48
  ])
42
49
  end
43
-
50
+
51
+ # List of class defined in allOf (OpenAPI v3)
52
+ def self.openapi_all_of
53
+ [
54
+ :'Error'
55
+ ]
56
+ end
57
+
44
58
  # Initializes the object
45
59
  # @param [Hash] attributes Model attributes in the form of hash
46
60
  def initialize(attributes = {})
@@ -56,9 +70,6 @@ module TCAClient
56
70
  h[k.to_sym] = v
57
71
  }
58
72
 
59
- # call parent's initialize
60
- super(attributes)
61
-
62
73
  if attributes.key?(:'status')
63
74
  self.status = attributes[:'status']
64
75
  end
@@ -71,7 +82,7 @@ module TCAClient
71
82
  # Show invalid properties with the reasons. Usually used together with valid?
72
83
  # @return Array for valid properties with the reasons
73
84
  def list_invalid_properties
74
- invalid_properties = super
85
+ invalid_properties = Array.new
75
86
  invalid_properties
76
87
  end
77
88
 
@@ -87,7 +98,7 @@ module TCAClient
87
98
  return true if self.equal?(o)
88
99
  self.class == o.class &&
89
100
  status == o.status &&
90
- message == o.message && super(o)
101
+ message == o.message
91
102
  end
92
103
 
93
104
  # @see the `==` method
@@ -114,9 +125,11 @@ module TCAClient
114
125
  # @return [Object] Returns the model itself
115
126
  def build_from_hash(attributes)
116
127
  return nil unless attributes.is_a?(Hash)
117
- super(attributes)
128
+ attributes = attributes.transform_keys(&:to_sym)
118
129
  self.class.openapi_types.each_pair do |key, type|
119
- if type =~ /\AArray<(.*)>/i
130
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
131
+ self.send("#{key}=", nil)
132
+ elsif type =~ /\AArray<(.*)>/i
120
133
  # check to ensure the input is an array given that the attribute
121
134
  # is documented as an array but the input is not
122
135
  if attributes[self.class.attribute_map[key]].is_a?(Array)
@@ -124,8 +137,6 @@ module TCAClient
124
137
  end
125
138
  elsif !attributes[self.class.attribute_map[key]].nil?
126
139
  self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
127
- elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
128
- self.send("#{key}=", nil)
129
140
  end
130
141
  end
131
142
 
@@ -138,8 +149,8 @@ module TCAClient
138
149
  # @return [Object] Deserialized data
139
150
  def _deserialize(type, value)
140
151
  case type.to_sym
141
- when :DateTime
142
- DateTime.parse(value)
152
+ when :Time
153
+ Time.parse(value)
143
154
  when :Date
144
155
  Date.parse(value)
145
156
  when :String
@@ -169,7 +180,9 @@ module TCAClient
169
180
  end
170
181
  end
171
182
  else # model
172
- TCAClient.const_get(type).build_from_hash(value)
183
+ # models (e.g. Pet) or oneOf
184
+ klass = TCAClient.const_get(type)
185
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
173
186
  end
174
187
  end
175
188
 
@@ -188,7 +201,7 @@ module TCAClient
188
201
  # Returns the object in the form of hash
189
202
  # @return [Hash] Returns the object in the form of hash
190
203
  def to_hash
191
- hash = super
204
+ hash = {}
192
205
  self.class.attribute_map.each_pair do |attr, param|
193
206
  value = self.send(attr)
194
207
  if value.nil?
@@ -217,5 +230,8 @@ module TCAClient
217
230
  else
218
231
  value
219
232
  end
220
- end end
233
+ end
234
+
235
+ end
236
+
221
237
  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 RequestPdfResponse
@@ -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
- :'id' => :'Object'
36
+ :'id' => :'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