Skip to content

Commit 5d87c25

Browse files
Merge branch 'master' into release
2 parents 17115a2 + 986d22e commit 5d87c25

File tree

12 files changed

+1158
-4
lines changed

12 files changed

+1158
-4
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ This repository contains Aspose.Words Cloud SDK for Ruby source code. This SDK a
1313
* Watermarks and protection
1414
* Full read & write access to Document Object Model, including sections, paragraphs, text, images, tables, headers/footers and many others
1515

16+
## Enhancements in Version 24.11
17+
18+
- Added GetAllRevisions method to obtain all available revisions in document.
19+
- Added AppendAllEntriesToOneSection parameter to AppendDocument method to append entries to the same section.
20+
21+
1622
## Enhancements in Version 24.9
1723

1824
- Added digital signature methds for DOC, DOCX, XPS, or ODT documents.
@@ -357,7 +363,7 @@ To use Aspose Words for Cloud Ruby SDK you need to register an account with [Asp
357363
To install this package do the following:
358364
update your Gemfile
359365
```ruby
360-
gem 'aspose_words_cloud', '~> 24.10'
366+
gem 'aspose_words_cloud', '~> 24.11'
361367
```
362368
or install directly
363369
```bash
26 KB
Binary file not shown.

lib/aspose_words_cloud.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@
215215
require_relative 'aspose_words_cloud/models/replace_text_response'
216216
require_relative 'aspose_words_cloud/models/report_build_options'
217217
require_relative 'aspose_words_cloud/models/report_engine_settings'
218+
require_relative 'aspose_words_cloud/models/revision'
219+
require_relative 'aspose_words_cloud/models/revision_collection'
218220
require_relative 'aspose_words_cloud/models/revisions_modification_response'
221+
require_relative 'aspose_words_cloud/models/revisions_response'
219222
require_relative 'aspose_words_cloud/models/rtf_save_options_data'
220223
require_relative 'aspose_words_cloud/models/run'
221224
require_relative 'aspose_words_cloud/models/run_insert'
@@ -390,6 +393,8 @@
390393
require_relative 'aspose_words_cloud/models/requests/download_file_request'
391394
require_relative 'aspose_words_cloud/models/requests/execute_mail_merge_request'
392395
require_relative 'aspose_words_cloud/models/requests/execute_mail_merge_online_request'
396+
require_relative 'aspose_words_cloud/models/requests/get_all_revisions_request'
397+
require_relative 'aspose_words_cloud/models/requests/get_all_revisions_online_request'
393398
require_relative 'aspose_words_cloud/models/requests/get_available_fonts_request'
394399
require_relative 'aspose_words_cloud/models/requests/get_bookmark_by_name_request'
395400
require_relative 'aspose_words_cloud/models/requests/get_bookmark_by_name_online_request'

lib/aspose_words_cloud/api/words_api.rb

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3906,6 +3906,90 @@ def execute_mail_merge_online(request)
39063906
[data, status_code, headers]
39073907
end
39083908

3909+
# Get all information about revisions.
3910+
# @param request GetAllRevisionsRequest
3911+
# @return [RevisionsResponse]
3912+
def get_all_revisions(request)
3913+
begin
3914+
data, _status_code, _headers = get_all_revisions_with_http_info(request)
3915+
rescue ApiError => e
3916+
if e.code == 401
3917+
request_token
3918+
data, _status_code, _headers = get_all_revisions_with_http_info(request)
3919+
else
3920+
raise
3921+
end
3922+
end
3923+
data
3924+
end
3925+
3926+
# Get all information about revisions.
3927+
# @param request GetAllRevisionsRequest
3928+
# @return [Array<(RevisionsResponse, Fixnum, Hash)>]
3929+
# RevisionsResponse, response status code and response headers
3930+
private def get_all_revisions_with_http_info(request)
3931+
raise ArgumentError, 'Incorrect request type' unless request.is_a? GetAllRevisionsRequest
3932+
3933+
@api_client.config.logger.debug 'Calling API: WordsApi.get_all_revisions ...' if @api_client.config.debugging
3934+
request_data = request.create_http_request(@api_client)
3935+
3936+
data, status_code, headers = @api_client.call_api(
3937+
request_data[:'method'],
3938+
request_data[:'path'],
3939+
header_params: request_data[:'header_params'],
3940+
query_params: request_data[:'query_params'],
3941+
body: request_data[:'body'],
3942+
return_type: 'RevisionsResponse')
3943+
if @api_client.config.debugging
3944+
@api_client.config.logger.debug "API called:
3945+
WordsApi#get_all_revisions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3946+
end
3947+
3948+
[data, status_code, headers]
3949+
end
3950+
3951+
# Get all information about revisions.
3952+
# @param request GetAllRevisionsOnlineRequest
3953+
# @return [RevisionsResponse]
3954+
def get_all_revisions_online(request)
3955+
begin
3956+
data, _status_code, _headers = get_all_revisions_online_with_http_info(request)
3957+
rescue ApiError => e
3958+
if e.code == 401
3959+
request_token
3960+
data, _status_code, _headers = get_all_revisions_online_with_http_info(request)
3961+
else
3962+
raise
3963+
end
3964+
end
3965+
data
3966+
end
3967+
3968+
# Get all information about revisions.
3969+
# @param request GetAllRevisionsOnlineRequest
3970+
# @return [Array<(RevisionsResponse, Fixnum, Hash)>]
3971+
# RevisionsResponse, response status code and response headers
3972+
private def get_all_revisions_online_with_http_info(request)
3973+
raise ArgumentError, 'Incorrect request type' unless request.is_a? GetAllRevisionsOnlineRequest
3974+
3975+
@api_client.config.logger.debug 'Calling API: WordsApi.get_all_revisions_online ...' if @api_client.config.debugging
3976+
request_data = request.create_http_request(@api_client)
3977+
3978+
data, status_code, headers = @api_client.call_api(
3979+
request_data[:'method'],
3980+
request_data[:'path'],
3981+
header_params: request_data[:'header_params'],
3982+
query_params: request_data[:'query_params'],
3983+
body: request_data[:'body'],
3984+
return_type: 'RevisionsResponse')
3985+
if @api_client.config.debugging
3986+
@api_client.config.logger.debug "API called:
3987+
WordsApi#get_all_revisions_online\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
3988+
end
3989+
3990+
[data, status_code, headers]
3991+
end
3992+
39093993
# Reads available fonts from the document.
39103994
# @param request GetAvailableFontsRequest
39113995
# @return [AvailableFontsResponse]

lib/aspose_words_cloud/models/document_entry_list.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ module AsposeWordsCloud
2929

3030
# Represents a list of documents which will be appended to the original resource document.
3131
class DocumentEntryList
32+
# Gets or sets a value indicating whether to append all documents to the same section.
33+
attr_accessor :append_all_entries_to_one_section
34+
3235
# Gets or sets a value indicating whether to apply headers and footers from base document to appending documents. The default value is true.
3336
attr_accessor :apply_base_document_headers_and_footers_to_appending_documents
3437

@@ -37,6 +40,7 @@ class DocumentEntryList
3740
# Attribute mapping from ruby-style variable name to JSON key.
3841
def self.attribute_map
3942
{
43+
:'append_all_entries_to_one_section' => :'AppendAllEntriesToOneSection',
4044
:'apply_base_document_headers_and_footers_to_appending_documents' => :'ApplyBaseDocumentHeadersAndFootersToAppendingDocuments',
4145
:'document_entries' => :'DocumentEntries'
4246
}
@@ -45,6 +49,7 @@ def self.attribute_map
4549
# Attribute type mapping.
4650
def self.swagger_types
4751
{
52+
:'append_all_entries_to_one_section' => :'BOOLEAN',
4853
:'apply_base_document_headers_and_footers_to_appending_documents' => :'BOOLEAN',
4954
:'document_entries' => :'Array<DocumentEntry>'
5055
}
@@ -58,6 +63,10 @@ def initialize(attributes = {})
5863
# convert string to symbol for hash key
5964
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
6065

66+
if attributes.key?(:'AppendAllEntriesToOneSection')
67+
self.append_all_entries_to_one_section = attributes[:'AppendAllEntriesToOneSection']
68+
end
69+
6170
if attributes.key?(:'ApplyBaseDocumentHeadersAndFootersToAppendingDocuments')
6271
self.apply_base_document_headers_and_footers_to_appending_documents = attributes[:'ApplyBaseDocumentHeadersAndFootersToAppendingDocuments']
6372
end
@@ -80,6 +89,7 @@ def valid?
8089
def ==(other)
8190
return true if self.equal?(other)
8291
self.class == other.class &&
92+
append_all_entries_to_one_section == other.append_all_entries_to_one_section &&
8393
apply_base_document_headers_and_footers_to_appending_documents == other.apply_base_document_headers_and_footers_to_appending_documents &&
8494
document_entries == other.document_entries
8595
end
@@ -93,7 +103,7 @@ def eql?(other)
93103
# Calculates hash code according to all attributes.
94104
# @return [Fixnum] Hash code
95105
def hash
96-
[apply_base_document_headers_and_footers_to_appending_documents, document_entries].hash
106+
[append_all_entries_to_one_section, apply_base_document_headers_and_footers_to_appending_documents, document_entries].hash
97107
end
98108

99109
# Builds the object from hash
Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,179 @@
1+
# ------------------------------------------------------------------------------------
2+
# <copyright company="Aspose" file="get_all_revisions_online_request.rb">
3+
# Copyright (c) 2024 Aspose.Words for Cloud
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+
module AsposeWordsCloud
27+
28+
#
29+
# Request model for get_all_revisions_online operation.
30+
#
31+
class GetAllRevisionsOnlineRequest
32+
# The document.
33+
attr_accessor :document
34+
35+
# Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
36+
attr_accessor :load_encoding
37+
38+
# 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.
39+
attr_accessor :password
40+
41+
# Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
42+
attr_accessor :encrypted_password
43+
44+
# The value indicates whether OpenType support is on.
45+
attr_accessor :open_type_support
46+
47+
#
48+
# Initializes a new instance.
49+
# @param document The document.
50+
# @param load_encoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
51+
# @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.
52+
# @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.
53+
# @param open_type_support The value indicates whether OpenType support is on.
54+
55+
def initialize(document:, load_encoding: nil, password: nil, encrypted_password: nil, open_type_support: nil)
56+
self.document = document
57+
self.load_encoding = load_encoding
58+
self.password = password
59+
self.encrypted_password = encrypted_password
60+
self.open_type_support = open_type_support
61+
end
62+
63+
# Creating batch part from request
64+
def to_batch_part(api_client, requestId, parentRequestId = nil)
65+
# verify the required parameter 'document' is set
66+
raise ArgumentError, 'Missing the required parameter document when calling WordsApi.get_all_revisions_online' if api_client.config.client_side_validation && self.document.nil?
67+
68+
# resource path
69+
local_var_path = '/words/online/get/revisions/getAll'[7..-1]
70+
local_var_path = local_var_path.sub('//', '/')
71+
72+
# query parameters
73+
query_params = {}
74+
query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
75+
query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
76+
query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
77+
query_params[downcase_first_letter('OpenTypeSupport')] = self.open_type_support unless self.open_type_support.nil?
78+
79+
if query_params
80+
query_params.each { |key, value| local_var_path = api_client.add_param_to_query(local_var_path, key, value) }
81+
end
82+
83+
header_params = {}
84+
# header parameters
85+
# HTTP header 'Content-Type'
86+
header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
87+
header_params['RequestId'] = requestId
88+
89+
if parentRequestId != nil
90+
header_params['DependsOn'] = parentRequestId
91+
end
92+
93+
# form parameters
94+
form_params = []
95+
files_content = []
96+
if self.document.nil?
97+
raise "Parameter Document is required."
98+
end
99+
unless self.document.nil?
100+
form_params.push({:'Name' => 'document', :'Data' => self.document, :'MimeType' =>'application/octet-stream'})
101+
end
102+
103+
104+
# http body (model)
105+
body = api_client.build_request_body_batch(header_params, form_params, files_content)
106+
part = ""
107+
part.concat("PUT".force_encoding('UTF-8'))
108+
part.concat(" ".force_encoding('UTF-8'))
109+
part.concat(local_var_path.force_encoding('UTF-8'))
110+
part.concat(" \r\n".force_encoding('UTF-8'))
111+
112+
header_params.each_pair {|key, value| part.concat(key.dup.force_encoding('UTF-8') , ": ".force_encoding('UTF-8'), value.dup.force_encoding('UTF-8'), "\r\n".force_encoding('UTF-8')) }
113+
part.concat("\r\n".force_encoding('UTF-8'))
114+
if body
115+
if body.is_a?(Hash)
116+
body.each do |key, value|
117+
part.concat(value, "\r\n")
118+
end
119+
else
120+
part.concat(body)
121+
end
122+
end
123+
part
124+
end
125+
126+
def create_http_request(api_client)
127+
# verify the required parameter 'document' is set
128+
raise ArgumentError, 'Missing the required parameter document when calling WordsApi.get_all_revisions_online' if api_client.config.client_side_validation && self.document.nil?
129+
130+
# resource path
131+
local_var_path = '/words/online/get/revisions/getAll'[1..-1]
132+
local_var_path = local_var_path.sub('//', '/')
133+
134+
# query parameters
135+
query_params = {}
136+
query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
137+
query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
138+
query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
139+
query_params[downcase_first_letter('OpenTypeSupport')] = self.open_type_support unless self.open_type_support.nil?
140+
141+
# header parameters
142+
header_params = {}
143+
# HTTP header 'Content-Type'
144+
header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
145+
146+
# form parameters
147+
form_params = []
148+
files_content = []
149+
if self.document.nil?
150+
raise "Parameter Document is required."
151+
end
152+
unless self.document.nil?
153+
form_params.push({:'Name' => 'document', :'Data' => self.document, :'MimeType' =>'application/octet-stream'})
154+
end
155+
156+
body = api_client.build_request_body(header_params, form_params, files_content)
157+
{
158+
'method': :PUT,
159+
'path': local_var_path,
160+
'header_params': header_params,
161+
'query_params': query_params,
162+
'body': body,
163+
'auth_names': ['JWT']
164+
}
165+
end
166+
167+
#
168+
# Helper method to convert first letter to downcase
169+
#
170+
def downcase_first_letter(str)
171+
str[0].downcase + str[1..-1]
172+
end
173+
174+
# Get response type
175+
def get_response_type
176+
'RevisionsResponse'
177+
end
178+
end
179+
end

0 commit comments

Comments
 (0)