groupdocs_comparison_cloud 18.9 → 21.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/groupdocs_comparison_cloud.rb +34 -42
- data/lib/groupdocs_comparison_cloud/api/compare_api.rb +411 -0
- data/lib/groupdocs_comparison_cloud/api/file_api.rb +729 -0
- data/lib/groupdocs_comparison_cloud/api/folder_api.rb +694 -0
- data/lib/groupdocs_comparison_cloud/api/info_api.rb +266 -0
- data/lib/groupdocs_comparison_cloud/api/review_api.rb +314 -0
- data/lib/groupdocs_comparison_cloud/api/storage_api.rb +541 -0
- data/lib/groupdocs_comparison_cloud/api_client.rb +7 -17
- data/lib/groupdocs_comparison_cloud/api_error.rb +19 -4
- data/lib/groupdocs_comparison_cloud/configuration.rb +3 -3
- data/lib/groupdocs_comparison_cloud/models/{comparison_change.rb → apply_revisions_options.rb} +65 -64
- data/lib/groupdocs_comparison_cloud/models/change_info.rb +371 -0
- data/lib/groupdocs_comparison_cloud/models/comparison_options.rb +298 -0
- data/lib/groupdocs_comparison_cloud/models/diagram_master_setting.rb +229 -0
- data/lib/groupdocs_comparison_cloud/models/disc_usage.rb +234 -0
- data/lib/groupdocs_comparison_cloud/models/error.rb +244 -0
- data/lib/groupdocs_comparison_cloud/models/{comparison_file_info.rb → error_details.rb} +39 -36
- data/lib/groupdocs_comparison_cloud/models/{style_settings_values.rb → file_info.rb} +51 -38
- data/lib/groupdocs_comparison_cloud/models/file_version.rb +289 -0
- data/lib/groupdocs_comparison_cloud/models/{value_type.rb → file_versions.rb} +33 -13
- data/lib/groupdocs_comparison_cloud/models/{comparison_changes_category_dto.rb → files_list.rb} +28 -30
- data/lib/groupdocs_comparison_cloud/models/files_upload_result.rb +228 -0
- data/lib/groupdocs_comparison_cloud/models/format.rb +224 -0
- data/lib/groupdocs_comparison_cloud/models/{comparison_style_change.rb → formats_result.rb} +29 -19
- data/lib/groupdocs_comparison_cloud/models/info_result.rb +254 -0
- data/lib/groupdocs_comparison_cloud/models/items_style.rb +304 -0
- data/lib/groupdocs_comparison_cloud/models/link.rb +16 -8
- data/lib/groupdocs_comparison_cloud/models/{comparison_metadata_values.rb → metadata.rb} +28 -20
- data/lib/groupdocs_comparison_cloud/models/object_exist.rb +234 -0
- data/lib/groupdocs_comparison_cloud/models/{comparison_request.rb → page_info.rb} +56 -47
- data/lib/groupdocs_comparison_cloud/models/rectangle.rb +264 -0
- data/lib/groupdocs_comparison_cloud/models/revision_info.rb +322 -0
- data/lib/groupdocs_comparison_cloud/models/settings.rb +581 -0
- data/lib/groupdocs_comparison_cloud/models/size.rb +234 -0
- data/lib/groupdocs_comparison_cloud/models/storage_exist.rb +219 -0
- data/lib/groupdocs_comparison_cloud/models/storage_file.rb +264 -0
- data/lib/groupdocs_comparison_cloud/models/style_change_info.rb +234 -0
- data/lib/groupdocs_comparison_cloud/models/updates_options.rb +310 -0
- data/lib/groupdocs_comparison_cloud/version.rb +2 -2
- metadata +35 -58
- data/lib/groupdocs_comparison_cloud/api/changes_api.rb +0 -470
- data/lib/groupdocs_comparison_cloud/api/comparison_api.rb +0 -365
- data/lib/groupdocs_comparison_cloud/models/color.rb +0 -1404
- data/lib/groupdocs_comparison_cloud/models/comparison_request_settings.rb +0 -378
- data/lib/groupdocs_comparison_cloud/models/requests/comparison_images_request.rb +0 -49
- data/lib/groupdocs_comparison_cloud/models/requests/comparison_images_stream_request.rb +0 -45
- data/lib/groupdocs_comparison_cloud/models/requests/comparison_request.rb +0 -49
- data/lib/groupdocs_comparison_cloud/models/requests/comparison_stream_request.rb +0 -45
- data/lib/groupdocs_comparison_cloud/models/requests/post_categories_changes_request.rb +0 -49
- data/lib/groupdocs_comparison_cloud/models/requests/post_changes_request.rb +0 -45
- data/lib/groupdocs_comparison_cloud/models/requests/put_changes_document_request.rb +0 -49
- data/lib/groupdocs_comparison_cloud/models/requests/put_changes_document_stream_request.rb +0 -45
- data/lib/groupdocs_comparison_cloud/models/requests/put_changes_images_request.rb +0 -49
- data/lib/groupdocs_comparison_cloud/models/requests/put_changes_images_stream_request.rb +0 -45
@@ -0,0 +1,266 @@
|
|
1
|
+
# -----------------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose Pty Ltd" file="info.rb">
|
3
|
+
# Copyright (c) 2003-2021 Aspose Pty Ltd
|
4
|
+
# </copyright>
|
5
|
+
# <summary>
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
# </summary>
|
24
|
+
# -----------------------------------------------------------------------------------
|
25
|
+
|
26
|
+
require 'uri'
|
27
|
+
require 'date'
|
28
|
+
|
29
|
+
module GroupDocsComparisonCloud
|
30
|
+
#
|
31
|
+
# GroupDocs.Comparison Cloud API
|
32
|
+
#
|
33
|
+
class InfoApi
|
34
|
+
attr_accessor :config
|
35
|
+
|
36
|
+
#make InfoApi.new private
|
37
|
+
private_class_method :new
|
38
|
+
|
39
|
+
# Initializes new instance of InfoApi
|
40
|
+
#
|
41
|
+
# @param [config] Configuration
|
42
|
+
# @return [InfoApi] New instance of InfoApi
|
43
|
+
def initialize(config)
|
44
|
+
@config = config
|
45
|
+
@api_client = ApiClient.new(config)
|
46
|
+
@access_token = nil
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes new instance of InfoApi
|
50
|
+
#
|
51
|
+
# @param [app_sid] Application identifier (App SID)
|
52
|
+
# @param [app_key] Application private key (App Key)
|
53
|
+
# @return [InfoApi] New instance of InfoApi
|
54
|
+
def self.from_keys(app_sid, app_key)
|
55
|
+
config = Configuration.new(app_sid, app_key)
|
56
|
+
return new(config)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Initializes new instance of InfoApi
|
60
|
+
#
|
61
|
+
# @param [config] Configuration
|
62
|
+
# @return [InfoApi] New instance of InfoApi
|
63
|
+
def self.from_config(config)
|
64
|
+
return new(config)
|
65
|
+
end
|
66
|
+
|
67
|
+
# Gets document information
|
68
|
+
#
|
69
|
+
# @param request get_document_info_request
|
70
|
+
# @return [InfoResult]
|
71
|
+
def get_document_info(request)
|
72
|
+
data, _status_code, _headers = get_document_info_with_http_info(request)
|
73
|
+
data
|
74
|
+
end
|
75
|
+
|
76
|
+
# Gets document information
|
77
|
+
#
|
78
|
+
# @param request get_document_info_request
|
79
|
+
# @return [Array<(InfoResult, Fixnum, Hash)>]
|
80
|
+
# InfoResult data, response status code and response headers
|
81
|
+
def get_document_info_with_http_info(request)
|
82
|
+
raise ArgumentError, 'Incorrect request type' unless request.is_a? GetDocumentInfoRequest
|
83
|
+
|
84
|
+
@api_client.config.logger.debug 'Calling API: InfoApi.get_document_info ...' if @api_client.config.debugging
|
85
|
+
# verify the required parameter 'file_info' is set
|
86
|
+
raise ArgumentError, 'Missing the required parameter file_info when calling InfoApi.get_document_info' if @api_client.config.client_side_validation && request.file_info.nil?
|
87
|
+
# resource path
|
88
|
+
local_var_path = '/comparison/info'
|
89
|
+
|
90
|
+
# query parameters
|
91
|
+
query_params = {}
|
92
|
+
|
93
|
+
# header parameters
|
94
|
+
header_params = {}
|
95
|
+
# HTTP header 'Accept' (if needed)
|
96
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
97
|
+
# HTTP header 'Content-Type'
|
98
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
99
|
+
|
100
|
+
# form parameters
|
101
|
+
form_params = {}
|
102
|
+
|
103
|
+
# http body (model)
|
104
|
+
post_body = @api_client.object_to_http_body(request.file_info)
|
105
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
106
|
+
header_params: header_params,
|
107
|
+
query_params: query_params,
|
108
|
+
form_params: form_params,
|
109
|
+
body: post_body,
|
110
|
+
access_token: get_access_token,
|
111
|
+
return_type: 'InfoResult')
|
112
|
+
if @api_client.config.debugging
|
113
|
+
@api_client.config.logger.debug "API called:
|
114
|
+
InfoApi#get_document_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
115
|
+
end
|
116
|
+
[data, status_code, headers]
|
117
|
+
end
|
118
|
+
|
119
|
+
# Retrieves supported file formats list
|
120
|
+
#
|
121
|
+
# @return [FormatsResult]
|
122
|
+
def get_supported_file_formats()
|
123
|
+
data, _status_code, _headers = get_supported_file_formats_with_http_info()
|
124
|
+
data
|
125
|
+
end
|
126
|
+
|
127
|
+
# Retrieves supported file formats list
|
128
|
+
#
|
129
|
+
|
130
|
+
# @return [Array<(FormatsResult, Fixnum, Hash)>]
|
131
|
+
# FormatsResult data, response status code and response headers
|
132
|
+
def get_supported_file_formats_with_http_info()
|
133
|
+
|
134
|
+
|
135
|
+
@api_client.config.logger.debug 'Calling API: InfoApi.get_supported_file_formats ...' if @api_client.config.debugging
|
136
|
+
# resource path
|
137
|
+
local_var_path = '/comparison/formats'
|
138
|
+
|
139
|
+
# query parameters
|
140
|
+
query_params = {}
|
141
|
+
|
142
|
+
# header parameters
|
143
|
+
header_params = {}
|
144
|
+
# HTTP header 'Accept' (if needed)
|
145
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
146
|
+
# HTTP header 'Content-Type'
|
147
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
148
|
+
|
149
|
+
# form parameters
|
150
|
+
form_params = {}
|
151
|
+
|
152
|
+
# http body (model)
|
153
|
+
post_body = nil
|
154
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
155
|
+
header_params: header_params,
|
156
|
+
query_params: query_params,
|
157
|
+
form_params: form_params,
|
158
|
+
body: post_body,
|
159
|
+
access_token: get_access_token,
|
160
|
+
return_type: 'FormatsResult')
|
161
|
+
if @api_client.config.debugging
|
162
|
+
@api_client.config.logger.debug "API called:
|
163
|
+
InfoApi#get_supported_file_formats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
164
|
+
end
|
165
|
+
[data, status_code, headers]
|
166
|
+
end
|
167
|
+
|
168
|
+
#
|
169
|
+
# Helper method to convert first letter to downcase
|
170
|
+
#
|
171
|
+
private def downcase_first_letter(str)
|
172
|
+
value = str[0].downcase + str[1..-1]
|
173
|
+
value
|
174
|
+
end
|
175
|
+
|
176
|
+
#
|
177
|
+
# Retrieves access token
|
178
|
+
#
|
179
|
+
private def get_access_token
|
180
|
+
if @access_token.nil? then
|
181
|
+
request_access_token
|
182
|
+
end
|
183
|
+
|
184
|
+
@access_token
|
185
|
+
end
|
186
|
+
|
187
|
+
#
|
188
|
+
# Gets a access token from server
|
189
|
+
#
|
190
|
+
private def request_access_token
|
191
|
+
auth_config = Configuration.new(@config.app_sid, @config.app_key)
|
192
|
+
auth_config.api_base_url = @config.api_base_url
|
193
|
+
auth_config.debugging = @config.debugging
|
194
|
+
auth_config.logger = @config.logger
|
195
|
+
auth_config.temp_folder_path = @config.temp_folder_path
|
196
|
+
auth_config.client_side_validation = @config.client_side_validation
|
197
|
+
auth_config.api_version = ''
|
198
|
+
|
199
|
+
auth_api_client = ApiClient.new(auth_config)
|
200
|
+
|
201
|
+
request_url = "/connect/token"
|
202
|
+
post_data = "grant_type=client_credentials&client_id=#{@config.app_sid}&client_secret=#{@config.app_key}"
|
203
|
+
|
204
|
+
data, _status_code, _header = auth_api_client.call_api(:POST, request_url, :body => post_data, :return_type => 'Object')
|
205
|
+
|
206
|
+
@access_token = data[:access_token]
|
207
|
+
|
208
|
+
expires_in_seconds = data[:expires_in].to_i - 5 * 60
|
209
|
+
expires_in_days = Rational(expires_in_seconds, 60 * 60 * 24)
|
210
|
+
@access_token_expires_at = DateTime.now + expires_in_days
|
211
|
+
end
|
212
|
+
|
213
|
+
# requires all files inside a directory from current dir
|
214
|
+
# @param _dir can be relative path like '/lib' or "../lib"
|
215
|
+
private def require_all(_dir)
|
216
|
+
Dir[File.expand_path(File.join(File.dirname(File.absolute_path(__FILE__)), _dir)) + "/*.rb"].each do |file|
|
217
|
+
require file
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
#
|
223
|
+
# --------------------------------------------------------------------------------------------------------------------
|
224
|
+
# <copyright company="Aspose Pty Ltd" file="get_document_info_request.rb">
|
225
|
+
# Copyright (c) 2003-2021 Aspose Pty Ltd
|
226
|
+
# </copyright>
|
227
|
+
# <summary>
|
228
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
229
|
+
# of this software and associated documentation files (the "Software"), to deal
|
230
|
+
# in the Software without restriction, including without limitation the rights
|
231
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
232
|
+
# copies of the Software, and to permit persons to whom the Software is
|
233
|
+
# furnished to do so, subject to the following conditions:
|
234
|
+
#
|
235
|
+
# The above copyright notice and this permission notice shall be included in all
|
236
|
+
# copies or substantial portions of the Software.
|
237
|
+
#
|
238
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
239
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
240
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
241
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
242
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
243
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
244
|
+
# SOFTWARE.
|
245
|
+
# </summary>
|
246
|
+
# --------------------------------------------------------------------------------------------------------------------
|
247
|
+
#
|
248
|
+
|
249
|
+
module GroupDocsComparisonCloud
|
250
|
+
|
251
|
+
#
|
252
|
+
# Request model for get_document_info operation.
|
253
|
+
#
|
254
|
+
class GetDocumentInfoRequest
|
255
|
+
|
256
|
+
# Gets or sets file_info
|
257
|
+
attr_accessor :file_info
|
258
|
+
|
259
|
+
#
|
260
|
+
# Initializes a new instance.
|
261
|
+
# @param file_info
|
262
|
+
def initialize(file_info)
|
263
|
+
self.file_info = file_info
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
@@ -0,0 +1,314 @@
|
|
1
|
+
# -----------------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose Pty Ltd" file="review.rb">
|
3
|
+
# Copyright (c) 2003-2021 Aspose Pty Ltd
|
4
|
+
# </copyright>
|
5
|
+
# <summary>
|
6
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
7
|
+
# of this software and associated documentation files (the "Software"), to deal
|
8
|
+
# in the Software without restriction, including without limitation the rights
|
9
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
10
|
+
# copies of the Software, and to permit persons to whom the Software is
|
11
|
+
# furnished to do so, subject to the following conditions:
|
12
|
+
#
|
13
|
+
# The above copyright notice and this permission notice shall be included in all
|
14
|
+
# copies or substantial portions of the Software.
|
15
|
+
#
|
16
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
17
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
18
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
19
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
20
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
21
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
22
|
+
# SOFTWARE.
|
23
|
+
# </summary>
|
24
|
+
# -----------------------------------------------------------------------------------
|
25
|
+
|
26
|
+
require 'uri'
|
27
|
+
require 'date'
|
28
|
+
|
29
|
+
module GroupDocsComparisonCloud
|
30
|
+
#
|
31
|
+
# GroupDocs.Comparison Cloud API
|
32
|
+
#
|
33
|
+
class ReviewApi
|
34
|
+
attr_accessor :config
|
35
|
+
|
36
|
+
#make ReviewApi.new private
|
37
|
+
private_class_method :new
|
38
|
+
|
39
|
+
# Initializes new instance of ReviewApi
|
40
|
+
#
|
41
|
+
# @param [config] Configuration
|
42
|
+
# @return [ReviewApi] New instance of ReviewApi
|
43
|
+
def initialize(config)
|
44
|
+
@config = config
|
45
|
+
@api_client = ApiClient.new(config)
|
46
|
+
@access_token = nil
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes new instance of ReviewApi
|
50
|
+
#
|
51
|
+
# @param [app_sid] Application identifier (App SID)
|
52
|
+
# @param [app_key] Application private key (App Key)
|
53
|
+
# @return [ReviewApi] New instance of ReviewApi
|
54
|
+
def self.from_keys(app_sid, app_key)
|
55
|
+
config = Configuration.new(app_sid, app_key)
|
56
|
+
return new(config)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Initializes new instance of ReviewApi
|
60
|
+
#
|
61
|
+
# @param [config] Configuration
|
62
|
+
# @return [ReviewApi] New instance of ReviewApi
|
63
|
+
def self.from_config(config)
|
64
|
+
return new(config)
|
65
|
+
end
|
66
|
+
|
67
|
+
# Accepts or rejects revisions in DOCX document
|
68
|
+
#
|
69
|
+
# @param request apply_revisions_request
|
70
|
+
# @return [Link]
|
71
|
+
def apply_revisions(request)
|
72
|
+
data, _status_code, _headers = apply_revisions_with_http_info(request)
|
73
|
+
data
|
74
|
+
end
|
75
|
+
|
76
|
+
# Accepts or rejects revisions in DOCX document
|
77
|
+
#
|
78
|
+
# @param request apply_revisions_request
|
79
|
+
# @return [Array<(Link, Fixnum, Hash)>]
|
80
|
+
# Link data, response status code and response headers
|
81
|
+
def apply_revisions_with_http_info(request)
|
82
|
+
raise ArgumentError, 'Incorrect request type' unless request.is_a? ApplyRevisionsRequest
|
83
|
+
|
84
|
+
@api_client.config.logger.debug 'Calling API: ReviewApi.apply_revisions ...' if @api_client.config.debugging
|
85
|
+
# verify the required parameter 'revision_options' is set
|
86
|
+
raise ArgumentError, 'Missing the required parameter revision_options when calling ReviewApi.apply_revisions' if @api_client.config.client_side_validation && request.revision_options.nil?
|
87
|
+
# resource path
|
88
|
+
local_var_path = '/comparison/revisions'
|
89
|
+
|
90
|
+
# query parameters
|
91
|
+
query_params = {}
|
92
|
+
|
93
|
+
# header parameters
|
94
|
+
header_params = {}
|
95
|
+
# HTTP header 'Accept' (if needed)
|
96
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
97
|
+
# HTTP header 'Content-Type'
|
98
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
99
|
+
|
100
|
+
# form parameters
|
101
|
+
form_params = {}
|
102
|
+
|
103
|
+
# http body (model)
|
104
|
+
post_body = @api_client.object_to_http_body(request.revision_options)
|
105
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
106
|
+
header_params: header_params,
|
107
|
+
query_params: query_params,
|
108
|
+
form_params: form_params,
|
109
|
+
body: post_body,
|
110
|
+
access_token: get_access_token,
|
111
|
+
return_type: 'Link')
|
112
|
+
if @api_client.config.debugging
|
113
|
+
@api_client.config.logger.debug "API called:
|
114
|
+
ReviewApi#apply_revisions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
115
|
+
end
|
116
|
+
[data, status_code, headers]
|
117
|
+
end
|
118
|
+
|
119
|
+
# Get list of DOCX document revisions.
|
120
|
+
#
|
121
|
+
# @param request get_revisions_request
|
122
|
+
# @return [Array<RevisionInfo>]
|
123
|
+
def get_revisions(request)
|
124
|
+
data, _status_code, _headers = get_revisions_with_http_info(request)
|
125
|
+
data
|
126
|
+
end
|
127
|
+
|
128
|
+
# Get list of DOCX document revisions.
|
129
|
+
#
|
130
|
+
# @param request get_revisions_request
|
131
|
+
# @return [Array<(Array<RevisionInfo>, Fixnum, Hash)>]
|
132
|
+
# Array<RevisionInfo> data, response status code and response headers
|
133
|
+
def get_revisions_with_http_info(request)
|
134
|
+
raise ArgumentError, 'Incorrect request type' unless request.is_a? GetRevisionsRequest
|
135
|
+
|
136
|
+
@api_client.config.logger.debug 'Calling API: ReviewApi.get_revisions ...' if @api_client.config.debugging
|
137
|
+
# verify the required parameter 'file_info' is set
|
138
|
+
raise ArgumentError, 'Missing the required parameter file_info when calling ReviewApi.get_revisions' if @api_client.config.client_side_validation && request.file_info.nil?
|
139
|
+
# resource path
|
140
|
+
local_var_path = '/comparison/revisions'
|
141
|
+
|
142
|
+
# query parameters
|
143
|
+
query_params = {}
|
144
|
+
|
145
|
+
# header parameters
|
146
|
+
header_params = {}
|
147
|
+
# HTTP header 'Accept' (if needed)
|
148
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
149
|
+
# HTTP header 'Content-Type'
|
150
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
151
|
+
|
152
|
+
# form parameters
|
153
|
+
form_params = {}
|
154
|
+
|
155
|
+
# http body (model)
|
156
|
+
post_body = @api_client.object_to_http_body(request.file_info)
|
157
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
158
|
+
header_params: header_params,
|
159
|
+
query_params: query_params,
|
160
|
+
form_params: form_params,
|
161
|
+
body: post_body,
|
162
|
+
access_token: get_access_token,
|
163
|
+
return_type: 'Array<RevisionInfo>')
|
164
|
+
if @api_client.config.debugging
|
165
|
+
@api_client.config.logger.debug "API called:
|
166
|
+
ReviewApi#get_revisions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
167
|
+
end
|
168
|
+
[data, status_code, headers]
|
169
|
+
end
|
170
|
+
|
171
|
+
#
|
172
|
+
# Helper method to convert first letter to downcase
|
173
|
+
#
|
174
|
+
private def downcase_first_letter(str)
|
175
|
+
value = str[0].downcase + str[1..-1]
|
176
|
+
value
|
177
|
+
end
|
178
|
+
|
179
|
+
#
|
180
|
+
# Retrieves access token
|
181
|
+
#
|
182
|
+
private def get_access_token
|
183
|
+
if @access_token.nil? then
|
184
|
+
request_access_token
|
185
|
+
end
|
186
|
+
|
187
|
+
@access_token
|
188
|
+
end
|
189
|
+
|
190
|
+
#
|
191
|
+
# Gets a access token from server
|
192
|
+
#
|
193
|
+
private def request_access_token
|
194
|
+
auth_config = Configuration.new(@config.app_sid, @config.app_key)
|
195
|
+
auth_config.api_base_url = @config.api_base_url
|
196
|
+
auth_config.debugging = @config.debugging
|
197
|
+
auth_config.logger = @config.logger
|
198
|
+
auth_config.temp_folder_path = @config.temp_folder_path
|
199
|
+
auth_config.client_side_validation = @config.client_side_validation
|
200
|
+
auth_config.api_version = ''
|
201
|
+
|
202
|
+
auth_api_client = ApiClient.new(auth_config)
|
203
|
+
|
204
|
+
request_url = "/connect/token"
|
205
|
+
post_data = "grant_type=client_credentials&client_id=#{@config.app_sid}&client_secret=#{@config.app_key}"
|
206
|
+
|
207
|
+
data, _status_code, _header = auth_api_client.call_api(:POST, request_url, :body => post_data, :return_type => 'Object')
|
208
|
+
|
209
|
+
@access_token = data[:access_token]
|
210
|
+
|
211
|
+
expires_in_seconds = data[:expires_in].to_i - 5 * 60
|
212
|
+
expires_in_days = Rational(expires_in_seconds, 60 * 60 * 24)
|
213
|
+
@access_token_expires_at = DateTime.now + expires_in_days
|
214
|
+
end
|
215
|
+
|
216
|
+
# requires all files inside a directory from current dir
|
217
|
+
# @param _dir can be relative path like '/lib' or "../lib"
|
218
|
+
private def require_all(_dir)
|
219
|
+
Dir[File.expand_path(File.join(File.dirname(File.absolute_path(__FILE__)), _dir)) + "/*.rb"].each do |file|
|
220
|
+
require file
|
221
|
+
end
|
222
|
+
end
|
223
|
+
end
|
224
|
+
end
|
225
|
+
#
|
226
|
+
# --------------------------------------------------------------------------------------------------------------------
|
227
|
+
# <copyright company="Aspose Pty Ltd" file="apply_revisions_request.rb">
|
228
|
+
# Copyright (c) 2003-2021 Aspose Pty Ltd
|
229
|
+
# </copyright>
|
230
|
+
# <summary>
|
231
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
232
|
+
# of this software and associated documentation files (the "Software"), to deal
|
233
|
+
# in the Software without restriction, including without limitation the rights
|
234
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
235
|
+
# copies of the Software, and to permit persons to whom the Software is
|
236
|
+
# furnished to do so, subject to the following conditions:
|
237
|
+
#
|
238
|
+
# The above copyright notice and this permission notice shall be included in all
|
239
|
+
# copies or substantial portions of the Software.
|
240
|
+
#
|
241
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
242
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
243
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
244
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
245
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
246
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
247
|
+
# SOFTWARE.
|
248
|
+
# </summary>
|
249
|
+
# --------------------------------------------------------------------------------------------------------------------
|
250
|
+
#
|
251
|
+
|
252
|
+
module GroupDocsComparisonCloud
|
253
|
+
|
254
|
+
#
|
255
|
+
# Request model for apply_revisions operation.
|
256
|
+
#
|
257
|
+
class ApplyRevisionsRequest
|
258
|
+
|
259
|
+
# Apply revisions options
|
260
|
+
attr_accessor :revision_options
|
261
|
+
|
262
|
+
#
|
263
|
+
# Initializes a new instance.
|
264
|
+
# @param revision_options Apply revisions options
|
265
|
+
def initialize(revision_options)
|
266
|
+
self.revision_options = revision_options
|
267
|
+
end
|
268
|
+
end
|
269
|
+
end
|
270
|
+
#
|
271
|
+
# --------------------------------------------------------------------------------------------------------------------
|
272
|
+
# <copyright company="Aspose Pty Ltd" file="get_revisions_request.rb">
|
273
|
+
# Copyright (c) 2003-2021 Aspose Pty Ltd
|
274
|
+
# </copyright>
|
275
|
+
# <summary>
|
276
|
+
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
277
|
+
# of this software and associated documentation files (the "Software"), to deal
|
278
|
+
# in the Software without restriction, including without limitation the rights
|
279
|
+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
280
|
+
# copies of the Software, and to permit persons to whom the Software is
|
281
|
+
# furnished to do so, subject to the following conditions:
|
282
|
+
#
|
283
|
+
# The above copyright notice and this permission notice shall be included in all
|
284
|
+
# copies or substantial portions of the Software.
|
285
|
+
#
|
286
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
287
|
+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
288
|
+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
289
|
+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
290
|
+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
291
|
+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
292
|
+
# SOFTWARE.
|
293
|
+
# </summary>
|
294
|
+
# --------------------------------------------------------------------------------------------------------------------
|
295
|
+
#
|
296
|
+
|
297
|
+
module GroupDocsComparisonCloud
|
298
|
+
|
299
|
+
#
|
300
|
+
# Request model for get_revisions operation.
|
301
|
+
#
|
302
|
+
class GetRevisionsRequest
|
303
|
+
|
304
|
+
# File information
|
305
|
+
attr_accessor :file_info
|
306
|
+
|
307
|
+
#
|
308
|
+
# Initializes a new instance.
|
309
|
+
# @param file_info File information
|
310
|
+
def initialize(file_info)
|
311
|
+
self.file_info = file_info
|
312
|
+
end
|
313
|
+
end
|
314
|
+
end
|