Skip to content

Commit ab2d209

Browse files
SDK regenerated by CI server [ci skip]
1 parent d0d683b commit ab2d209

18 files changed

+1228
-161
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This repository contains Aspose.Words Cloud SDK for Ruby source code. This SDK a
1919
- Implemented DeleteOfficeMathObjects operation to delete all office math objects from document.
2020
- Parameter ProtectionRequest was removed from the UnprotectDocument operation. Now removing protection from a document does not require a password.
2121
- Model ProtectionRequest marked as deprecated, please use ProtectionRequestV2 instead for perform ProtectDocument operation. To change the password or protection type of protected document, the old password is no required.
22-
22+
- Rename aspose-client header.
2323

2424
## Enhancements in Version 23.11
2525

@@ -305,7 +305,7 @@ To use Aspose Words for Cloud Ruby SDK you need to register an account with [Asp
305305
To install this package do the following:
306306
update your Gemfile
307307
```ruby
308-
gem 'aspose_words_cloud', '~> 23.11'
308+
gem 'aspose_words_cloud', '~> 23.12'
309309
```
310310
or install directly
311311
```bash

lib/aspose_words_cloud.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@
277277
require_relative 'aspose_words_cloud/models/tiff_save_options_data'
278278
require_relative 'aspose_words_cloud/models/time_zone_info_data'
279279
require_relative 'aspose_words_cloud/models/user_information'
280+
require_relative 'aspose_words_cloud/models/watermark_data_image'
281+
require_relative 'aspose_words_cloud/models/watermark_data_text'
280282
require_relative 'aspose_words_cloud/models/watermark_text'
281283
require_relative 'aspose_words_cloud/models/word_ml_save_options_data'
282284
require_relative 'aspose_words_cloud/models/words_api_error_response'
@@ -536,8 +538,10 @@
536538
require_relative 'aspose_words_cloud/models/requests/insert_table_online_request'
537539
require_relative 'aspose_words_cloud/models/requests/insert_table_row_request'
538540
require_relative 'aspose_words_cloud/models/requests/insert_table_row_online_request'
541+
require_relative 'aspose_words_cloud/models/requests/insert_watermark_request'
539542
require_relative 'aspose_words_cloud/models/requests/insert_watermark_image_request'
540543
require_relative 'aspose_words_cloud/models/requests/insert_watermark_image_online_request'
544+
require_relative 'aspose_words_cloud/models/requests/insert_watermark_online_request'
541545
require_relative 'aspose_words_cloud/models/requests/insert_watermark_text_request'
542546
require_relative 'aspose_words_cloud/models/requests/insert_watermark_text_online_request'
543547
require_relative 'aspose_words_cloud/models/requests/link_header_footers_to_previous_request'

lib/aspose_words_cloud/api/words_api.rb

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10533,10 +10533,53 @@ def insert_table_row_online(request)
1053310533
[mp_data, status_code, headers]
1053410534
end
1053510535

10536+
# Insert a watermark to the document.
10537+
# @param request InsertWatermarkRequest
10538+
# @return [DocumentResponse]
10539+
def insert_watermark(request)
10540+
begin
10541+
data, _status_code, _headers = insert_watermark_with_http_info(request)
10542+
rescue ApiError => e
10543+
if e.code == 401
10544+
request_token
10545+
data, _status_code, _headers = insert_watermark_with_http_info(request)
10546+
else
10547+
raise
10548+
end
10549+
end
10550+
data
10551+
end
10552+
10553+
# Insert a watermark to the document.
10554+
# @param request InsertWatermarkRequest
10555+
# @return [Array<(DocumentResponse, Fixnum, Hash)>]
10556+
# DocumentResponse, response status code and response headers
10557+
private def insert_watermark_with_http_info(request)
10558+
raise ArgumentError, 'Incorrect request type' unless request.is_a? InsertWatermarkRequest
10559+
10560+
@api_client.config.logger.debug 'Calling API: WordsApi.insert_watermark ...' if @api_client.config.debugging
10561+
request_data = request.create_http_request(@api_client)
10562+
10563+
data, status_code, headers = @api_client.call_api(
10564+
request_data[:'method'],
10565+
request_data[:'path'],
10566+
header_params: request_data[:'header_params'],
10567+
query_params: request_data[:'query_params'],
10568+
body: request_data[:'body'],
10569+
return_type: 'DocumentResponse')
10570+
if @api_client.config.debugging
10571+
@api_client.config.logger.debug "API called:
10572+
WordsApi#insert_watermark\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
10573+
end
10574+
10575+
[data, status_code, headers]
10576+
end
10577+
1053610578
# Inserts a new watermark image to the document.
1053710579
# @param request InsertWatermarkImageRequest
1053810580
# @return [DocumentResponse]
1053910581
def insert_watermark_image(request)
10582+
warn "This operation is deprecated and is used for backward compatibility only. Please use InsertWatermark instead."
1054010583
begin
1054110584
data, _status_code, _headers = insert_watermark_image_with_http_info(request)
1054210585
rescue ApiError => e
@@ -10579,6 +10622,7 @@ def insert_watermark_image(request)
1057910622
# @param request InsertWatermarkImageOnlineRequest
1058010623
# @return [InsertWatermarkImageOnlineResponse]
1058110624
def insert_watermark_image_online(request)
10625+
warn "This operation is deprecated and is used for backward compatibility only. Please use InsertWatermark instead."
1058210626
begin
1058310627
data, _status_code, _headers = insert_watermark_image_online_with_http_info(request)
1058410628
rescue ApiError => e
@@ -10621,10 +10665,57 @@ def insert_watermark_image_online(request)
1062110665
[mp_data, status_code, headers]
1062210666
end
1062310667

10668+
# Insert a watermark to the document.
10669+
# @param request InsertWatermarkOnlineRequest
10670+
# @return [InsertWatermarkOnlineResponse]
10671+
def insert_watermark_online(request)
10672+
begin
10673+
data, _status_code, _headers = insert_watermark_online_with_http_info(request)
10674+
rescue ApiError => e
10675+
if e.code == 401
10676+
request_token
10677+
data, _status_code, _headers = insert_watermark_online_with_http_info(request)
10678+
else
10679+
raise
10680+
end
10681+
end
10682+
data
10683+
end
10684+
10685+
# Insert a watermark to the document.
10686+
# @param request InsertWatermarkOnlineRequest
10687+
# @return [Array<(InsertWatermarkOnlineResponse, Fixnum, Hash)>]
10688+
# InsertWatermarkOnlineResponse, response status code and response headers
10689+
private def insert_watermark_online_with_http_info(request)
10690+
raise ArgumentError, 'Incorrect request type' unless request.is_a? InsertWatermarkOnlineRequest
10691+
10692+
@api_client.config.logger.debug 'Calling API: WordsApi.insert_watermark_online ...' if @api_client.config.debugging
10693+
request_data = request.create_http_request(@api_client)
10694+
10695+
data, status_code, headers = @api_client.call_api(
10696+
request_data[:'method'],
10697+
request_data[:'path'],
10698+
header_params: request_data[:'header_params'],
10699+
query_params: request_data[:'query_params'],
10700+
body: request_data[:'body'],
10701+
multipart_response: true,
10702+
return_type: 'InsertWatermarkOnlineResponse')
10703+
if @api_client.config.debugging
10704+
@api_client.config.logger.debug "API called:
10705+
WordsApi#insert_watermark_online\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
10706+
end
10707+
10708+
mp_data = InsertWatermarkOnlineResponse.new()
10709+
mp_data.model = @api_client.deserialize(data['Model'][:data], data['Model'][:headers], 'DocumentResponse')
10710+
mp_data.document = @api_client.parse_files_collection(data['Document'][:data], data['Document'][:headers])
10711+
[mp_data, status_code, headers]
10712+
end
10713+
1062410714
# Inserts a new watermark text to the document.
1062510715
# @param request InsertWatermarkTextRequest
1062610716
# @return [DocumentResponse]
1062710717
def insert_watermark_text(request)
10718+
warn "This operation is deprecated and is used for backward compatibility only. Please use InsertWatermark instead."
1062810719
begin
1062910720
data, _status_code, _headers = insert_watermark_text_with_http_info(request)
1063010721
rescue ApiError => e
@@ -10667,6 +10758,7 @@ def insert_watermark_text(request)
1066710758
# @param request InsertWatermarkTextOnlineRequest
1066810759
# @return [InsertWatermarkTextOnlineResponse]
1066910760
def insert_watermark_text_online(request)
10761+
warn "This operation is deprecated and is used for backward compatibility only. Please use InsertWatermark instead."
1067010762
begin
1067110763
data, _status_code, _headers = insert_watermark_text_online_with_http_info(request)
1067210764
rescue ApiError => e

lib/aspose_words_cloud/models/compare_data.rb

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class CompareData
4141
# Gets or sets the date and time to use for revisions.
4242
attr_accessor :date_time
4343

44+
# Gets or sets the file reference.
45+
attr_accessor :file_reference
46+
4447
# Gets or sets the result document format.
4548
attr_accessor :result_document_format
4649
# Attribute mapping from ruby-style variable name to JSON key.
@@ -50,6 +53,7 @@ def self.attribute_map
5053
:'compare_options' => :'CompareOptions',
5154
:'comparing_with_document' => :'ComparingWithDocument',
5255
:'date_time' => :'DateTime',
56+
:'file_reference' => :'FileReference',
5357
:'result_document_format' => :'ResultDocumentFormat'
5458
}
5559
end
@@ -61,6 +65,7 @@ def self.swagger_types
6165
:'compare_options' => :'CompareOptions',
6266
:'comparing_with_document' => :'String',
6367
:'date_time' => :'DateTime',
68+
:'file_reference' => :'FileReference',
6469
:'result_document_format' => :'String'
6570
}
6671
end
@@ -89,6 +94,10 @@ def initialize(attributes = {})
8994
self.date_time = attributes[:'DateTime']
9095
end
9196

97+
if attributes.key?(:'FileReference')
98+
self.file_reference = attributes[:'FileReference']
99+
end
100+
92101
if attributes.key?(:'ResultDocumentFormat')
93102
self.result_document_format = attributes[:'ResultDocumentFormat']
94103
end
@@ -109,6 +118,7 @@ def ==(other)
109118
compare_options == other.compare_options &&
110119
comparing_with_document == other.comparing_with_document &&
111120
date_time == other.date_time &&
121+
file_reference == other.file_reference &&
112122
result_document_format == other.result_document_format
113123
end
114124

@@ -121,7 +131,7 @@ def eql?(other)
121131
# Calculates hash code according to all attributes.
122132
# @return [Fixnum] Hash code
123133
def hash
124-
[author, compare_options, comparing_with_document, date_time, result_document_format].hash
134+
[author, compare_options, comparing_with_document, date_time, file_reference, result_document_format].hash
125135
end
126136

127137
# Builds the object from hash
@@ -235,14 +245,22 @@ def _to_hash(value)
235245
end
236246

237247
def collectFilesContent(resultFilesContent)
248+
if self.file_reference
249+
self.file_reference.collectFilesContent(resultFilesContent)
250+
end
251+
252+
238253
end
239254

240255
def validate()
241256
raise ArgumentError, 'Property author in CompareData is required.' if self.author.nil?
242-
raise ArgumentError, 'Property comparing_with_document in CompareData is required.' if self.comparing_with_document.nil?
257+
raise ArgumentError, 'Property file_reference in CompareData is required.' if self.file_reference.nil?
243258
unless self.compare_options.nil?
244259
self.compare_options.validate
245260
end
261+
unless self.file_reference.nil?
262+
self.file_reference.validate
263+
end
246264

247265
end
248266

lib/aspose_words_cloud/models/requests/compare_document_online_request.rb

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ class CompareDocumentOnlineRequest
3535
# Compare data.
3636
attr_accessor :compare_data
3737

38-
# The comparing document.
39-
attr_accessor :comparing_document
40-
4138
# Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
4239
attr_accessor :load_encoding
4340

@@ -57,17 +54,15 @@ class CompareDocumentOnlineRequest
5754
# Initializes a new instance.
5855
# @param document The document.
5956
# @param compare_data Compare data.
60-
# @param comparing_document The comparing document.
6157
# @param load_encoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
6258
# @param password Password of protected Word document. Use the parameter to pass a password via SDK. SDK encrypts it automatically. We don't recommend to use the parameter to pass a plain password for direct call of API.
6359
# @param encrypted_password Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
6460
# @param dest_file_name Result path of the document after the operation. If this parameter is omitted then result of the operation will be saved as the source document.
6561
# @param encrypted_password2 encrypted password for the second document.
6662

67-
def initialize(document:, compare_data:, comparing_document: nil, load_encoding: nil, password: nil, encrypted_password: nil, dest_file_name: nil, encrypted_password2: nil)
63+
def initialize(document:, compare_data:, load_encoding: nil, password: nil, encrypted_password: nil, dest_file_name: nil, encrypted_password2: nil)
6864
self.document = document
6965
self.compare_data = compare_data
70-
self.comparing_document = comparing_document
7166
self.load_encoding = load_encoding
7267
self.password = password
7368
self.encrypted_password = encrypted_password
@@ -123,10 +118,7 @@ def to_batch_part(api_client, requestId, parentRequestId = nil)
123118
end
124119
unless self.compare_data.nil?
125120
form_params.push({:'Name' => 'compareData', :'Data' => self.compare_data.to_body.to_json, :'MimeType' =>'application/json'})
126-
end
127-
128-
unless self.comparing_document.nil?
129-
form_params.push({:'Name' => 'comparingDocument', :'Data' => self.comparing_document, :'MimeType' =>'application/octet-stream'})
121+
self.compare_data.collectFilesContent(files_content)
130122
end
131123

132124

@@ -190,10 +182,7 @@ def create_http_request(api_client)
190182
end
191183
unless self.compare_data.nil?
192184
form_params.push({:'Name' => 'compareData', :'Data' => self.compare_data.to_body.to_json, :'MimeType' =>'application/json'})
193-
end
194-
195-
unless self.comparing_document.nil?
196-
form_params.push({:'Name' => 'comparingDocument', :'Data' => self.comparing_document, :'MimeType' =>'application/octet-stream'})
185+
self.compare_data.collectFilesContent(files_content)
197186
end
198187

199188
body = api_client.build_request_body(header_params, form_params, files_content)

lib/aspose_words_cloud/models/requests/compare_document_request.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def to_batch_part(api_client, requestId, parentRequestId = nil)
124124
end
125125
unless self.compare_data.nil?
126126
form_params.push({:'Name' => 'compareData', :'Data' => self.compare_data.to_body.to_json, :'MimeType' =>'application/json'})
127+
self.compare_data.collectFilesContent(files_content)
127128
end
128129

129130

@@ -183,6 +184,7 @@ def create_http_request(api_client)
183184
end
184185
unless self.compare_data.nil?
185186
form_params.push({:'Name' => 'compareData', :'Data' => self.compare_data.to_body.to_json, :'MimeType' =>'application/json'})
187+
self.compare_data.collectFilesContent(files_content)
186188
end
187189

188190
body = api_client.build_request_body(header_params, form_params, files_content)

0 commit comments

Comments
 (0)