aspose_words_cloud 24.5.0 → 24.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aspose_words_cloud/api/words_api.rb +84 -0
- data/lib/aspose_words_cloud/models/azw3_save_options_data.rb +963 -0
- data/lib/aspose_words_cloud/models/document.rb +2 -2
- data/lib/aspose_words_cloud/models/pdf_save_options_data.rb +2 -2
- data/lib/aspose_words_cloud/models/requests/translate_node_id_online_request.rb +183 -0
- data/lib/aspose_words_cloud/models/requests/translate_node_id_request.rb +182 -0
- data/lib/aspose_words_cloud/models/translate_node_id_response.rb +215 -0
- data/lib/aspose_words_cloud/version.rb +1 -1
- data/lib/aspose_words_cloud.rb +4 -0
- metadata +6 -2
@@ -131,7 +131,7 @@ module AsposeWordsCloud
|
|
131
131
|
# Check to see if the all the properties in the model are valid
|
132
132
|
# @return true if the model is valid
|
133
133
|
def valid?
|
134
|
-
source_format_validator = EnumAttributeValidator.new('String', ["Unknown", "Doc", "Dot", "DocPreWord60", "Docx", "Docm", "Dotx", "Dotm", "FlatOpc", "Rtf", "WordML", "Html", "Mhtml", "Epub", "Text", "Odt", "Ott", "Pdf", "Xps", "Tiff", "Svg"])
|
134
|
+
source_format_validator = EnumAttributeValidator.new('String', ["Unknown", "Doc", "Dot", "DocPreWord60", "Docx", "Docm", "Dotx", "Dotm", "FlatOpc", "Rtf", "WordML", "Html", "Mhtml", "Epub", "Text", "Odt", "Ott", "Pdf", "Xps", "Tiff", "Svg", "Azw3"])
|
135
135
|
return false unless source_format_validator.valid?(@source_format)
|
136
136
|
|
137
137
|
return true
|
@@ -140,7 +140,7 @@ module AsposeWordsCloud
|
|
140
140
|
# Custom attribute writer method checking allowed values (enum).
|
141
141
|
# @param [Object] source_format Object to be assigned
|
142
142
|
def source_format=(source_format)
|
143
|
-
validator = EnumAttributeValidator.new('String', ["Unknown", "Doc", "Dot", "DocPreWord60", "Docx", "Docm", "Dotx", "Dotm", "FlatOpc", "Rtf", "WordML", "Html", "Mhtml", "Epub", "Text", "Odt", "Ott", "Pdf", "Xps", "Tiff", "Svg"])
|
143
|
+
validator = EnumAttributeValidator.new('String', ["Unknown", "Doc", "Dot", "DocPreWord60", "Docx", "Docm", "Dotx", "Dotm", "FlatOpc", "Rtf", "WordML", "Html", "Mhtml", "Epub", "Text", "Odt", "Ott", "Pdf", "Xps", "Tiff", "Svg", "Azw3"])
|
144
144
|
if source_format.to_i == 0
|
145
145
|
unless validator.valid?(source_format)
|
146
146
|
raise ArgumentError, "invalid value for 'source_format', must be one of #{validator.allowable_values}."
|
@@ -547,7 +547,7 @@ module AsposeWordsCloud
|
|
547
547
|
return false unless color_mode_validator.valid?(@color_mode)
|
548
548
|
numeral_format_validator = EnumAttributeValidator.new('String', ["European", "ArabicIndic", "EasternArabicIndic", "Context", "System"])
|
549
549
|
return false unless numeral_format_validator.valid?(@numeral_format)
|
550
|
-
compliance_validator = EnumAttributeValidator.new('String', ["Pdf17", "Pdf20", "PdfA1a", "PdfA1b", "PdfA2a", "PdfA2u", "PdfA4", "PdfUa1"])
|
550
|
+
compliance_validator = EnumAttributeValidator.new('String', ["Pdf17", "Pdf20", "PdfA1a", "PdfA1b", "PdfA2a", "PdfA2u", "PdfA4", "PdfA4Ua2", "PdfUa1", "PdfUa2"])
|
551
551
|
return false unless compliance_validator.valid?(@compliance)
|
552
552
|
custom_properties_export_validator = EnumAttributeValidator.new('String', ["None", "Standard", "Metadata"])
|
553
553
|
return false unless custom_properties_export_validator.valid?(@custom_properties_export)
|
@@ -654,7 +654,7 @@ module AsposeWordsCloud
|
|
654
654
|
# Custom attribute writer method checking allowed values (enum).
|
655
655
|
# @param [Object] compliance Object to be assigned
|
656
656
|
def compliance=(compliance)
|
657
|
-
validator = EnumAttributeValidator.new('String', ["Pdf17", "Pdf20", "PdfA1a", "PdfA1b", "PdfA2a", "PdfA2u", "PdfA4", "PdfUa1"])
|
657
|
+
validator = EnumAttributeValidator.new('String', ["Pdf17", "Pdf20", "PdfA1a", "PdfA1b", "PdfA2a", "PdfA2u", "PdfA4", "PdfA4Ua2", "PdfUa1", "PdfUa2"])
|
658
658
|
if compliance.to_i == 0
|
659
659
|
unless validator.valid?(compliance)
|
660
660
|
raise ArgumentError, "invalid value for 'compliance', must be one of #{validator.allowable_values}."
|
@@ -0,0 +1,183 @@
|
|
1
|
+
# ------------------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="translate_node_id_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 translate_node_id_online operation.
|
30
|
+
#
|
31
|
+
class TranslateNodeIdOnlineRequest
|
32
|
+
# The document.
|
33
|
+
attr_accessor :document
|
34
|
+
|
35
|
+
# The node identifier. Identifier examples: id0.0.0.
|
36
|
+
attr_accessor :node_id
|
37
|
+
|
38
|
+
# Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
|
39
|
+
attr_accessor :load_encoding
|
40
|
+
|
41
|
+
# 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.
|
42
|
+
attr_accessor :password
|
43
|
+
|
44
|
+
# Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
|
45
|
+
attr_accessor :encrypted_password
|
46
|
+
|
47
|
+
#
|
48
|
+
# Initializes a new instance.
|
49
|
+
# @param document The document.
|
50
|
+
# @param node_id The node identifier. Identifier examples: id0.0.0.
|
51
|
+
# @param load_encoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
|
52
|
+
# @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.
|
53
|
+
# @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.
|
54
|
+
|
55
|
+
def initialize(document:, node_id:, load_encoding: nil, password: nil, encrypted_password: nil)
|
56
|
+
self.document = document
|
57
|
+
self.node_id = node_id
|
58
|
+
self.load_encoding = load_encoding
|
59
|
+
self.password = password
|
60
|
+
self.encrypted_password = encrypted_password
|
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.translate_node_id_online' if api_client.config.client_side_validation && self.document.nil?
|
67
|
+
# verify the required parameter 'node_id' is set
|
68
|
+
raise ArgumentError, 'Missing the required parameter node_id when calling WordsApi.translate_node_id_online' if api_client.config.client_side_validation && self.node_id.nil?
|
69
|
+
|
70
|
+
# resource path
|
71
|
+
local_var_path = '/words/online/get/translate/{nodeId}'[7..-1]
|
72
|
+
local_var_path = local_var_path.sub('{' + downcase_first_letter('NodeId') + '}', self.node_id.nil? ? '' : self.node_id.to_s)
|
73
|
+
local_var_path = local_var_path.sub('//', '/')
|
74
|
+
|
75
|
+
# query parameters
|
76
|
+
query_params = {}
|
77
|
+
query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
|
78
|
+
query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
|
79
|
+
query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
|
80
|
+
|
81
|
+
if query_params
|
82
|
+
query_params.each { |key, value| local_var_path = api_client.add_param_to_query(local_var_path, key, value) }
|
83
|
+
end
|
84
|
+
|
85
|
+
header_params = {}
|
86
|
+
# header parameters
|
87
|
+
# HTTP header 'Content-Type'
|
88
|
+
header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
|
89
|
+
header_params['RequestId'] = requestId
|
90
|
+
|
91
|
+
if parentRequestId != nil
|
92
|
+
header_params['DependsOn'] = parentRequestId
|
93
|
+
end
|
94
|
+
|
95
|
+
# form parameters
|
96
|
+
form_params = []
|
97
|
+
files_content = []
|
98
|
+
if self.document.nil?
|
99
|
+
raise "Parameter Document is required."
|
100
|
+
end
|
101
|
+
unless self.document.nil?
|
102
|
+
form_params.push({:'Name' => 'document', :'Data' => self.document, :'MimeType' =>'application/octet-stream'})
|
103
|
+
end
|
104
|
+
|
105
|
+
|
106
|
+
# http body (model)
|
107
|
+
body = api_client.build_request_body_batch(header_params, form_params, files_content)
|
108
|
+
part = ""
|
109
|
+
part.concat("PUT".force_encoding('UTF-8'))
|
110
|
+
part.concat(" ".force_encoding('UTF-8'))
|
111
|
+
part.concat(local_var_path.force_encoding('UTF-8'))
|
112
|
+
part.concat(" \r\n".force_encoding('UTF-8'))
|
113
|
+
|
114
|
+
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')) }
|
115
|
+
part.concat("\r\n".force_encoding('UTF-8'))
|
116
|
+
if body
|
117
|
+
if body.is_a?(Hash)
|
118
|
+
body.each do |key, value|
|
119
|
+
part.concat(value, "\r\n")
|
120
|
+
end
|
121
|
+
else
|
122
|
+
part.concat(body)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
part
|
126
|
+
end
|
127
|
+
|
128
|
+
def create_http_request(api_client)
|
129
|
+
# verify the required parameter 'document' is set
|
130
|
+
raise ArgumentError, 'Missing the required parameter document when calling WordsApi.translate_node_id_online' if api_client.config.client_side_validation && self.document.nil?
|
131
|
+
# verify the required parameter 'node_id' is set
|
132
|
+
raise ArgumentError, 'Missing the required parameter node_id when calling WordsApi.translate_node_id_online' if api_client.config.client_side_validation && self.node_id.nil?
|
133
|
+
|
134
|
+
# resource path
|
135
|
+
local_var_path = '/words/online/get/translate/{nodeId}'[1..-1]
|
136
|
+
local_var_path = local_var_path.sub('{' + downcase_first_letter('NodeId') + '}', self.node_id.nil? ? '' : self.node_id.to_s)
|
137
|
+
local_var_path = local_var_path.sub('//', '/')
|
138
|
+
|
139
|
+
# query parameters
|
140
|
+
query_params = {}
|
141
|
+
query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
|
142
|
+
query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
|
143
|
+
query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
|
144
|
+
|
145
|
+
# header parameters
|
146
|
+
header_params = {}
|
147
|
+
# HTTP header 'Content-Type'
|
148
|
+
header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
|
149
|
+
|
150
|
+
# form parameters
|
151
|
+
form_params = []
|
152
|
+
files_content = []
|
153
|
+
if self.document.nil?
|
154
|
+
raise "Parameter Document is required."
|
155
|
+
end
|
156
|
+
unless self.document.nil?
|
157
|
+
form_params.push({:'Name' => 'document', :'Data' => self.document, :'MimeType' =>'application/octet-stream'})
|
158
|
+
end
|
159
|
+
|
160
|
+
body = api_client.build_request_body(header_params, form_params, files_content)
|
161
|
+
{
|
162
|
+
'method': :PUT,
|
163
|
+
'path': local_var_path,
|
164
|
+
'header_params': header_params,
|
165
|
+
'query_params': query_params,
|
166
|
+
'body': body,
|
167
|
+
'auth_names': ['JWT']
|
168
|
+
}
|
169
|
+
end
|
170
|
+
|
171
|
+
#
|
172
|
+
# Helper method to convert first letter to downcase
|
173
|
+
#
|
174
|
+
def downcase_first_letter(str)
|
175
|
+
str[0].downcase + str[1..-1]
|
176
|
+
end
|
177
|
+
|
178
|
+
# Get response type
|
179
|
+
def get_response_type
|
180
|
+
'TranslateNodeIdResponse'
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
@@ -0,0 +1,182 @@
|
|
1
|
+
# ------------------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="translate_node_id_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 translate_node_id operation.
|
30
|
+
#
|
31
|
+
class TranslateNodeIdRequest
|
32
|
+
# The filename of the input document.
|
33
|
+
attr_accessor :name
|
34
|
+
|
35
|
+
# The node identifier. Identifier examples: id0.0.0.
|
36
|
+
attr_accessor :node_id
|
37
|
+
|
38
|
+
# Original document folder.
|
39
|
+
attr_accessor :folder
|
40
|
+
|
41
|
+
# Original document storage.
|
42
|
+
attr_accessor :storage
|
43
|
+
|
44
|
+
# Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
|
45
|
+
attr_accessor :load_encoding
|
46
|
+
|
47
|
+
# 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.
|
48
|
+
attr_accessor :password
|
49
|
+
|
50
|
+
# Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
|
51
|
+
attr_accessor :encrypted_password
|
52
|
+
|
53
|
+
#
|
54
|
+
# Initializes a new instance.
|
55
|
+
# @param name The filename of the input document.
|
56
|
+
# @param node_id The node identifier. Identifier examples: id0.0.0.
|
57
|
+
# @param folder Original document folder.
|
58
|
+
# @param storage Original document storage.
|
59
|
+
# @param load_encoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
|
60
|
+
# @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.
|
61
|
+
# @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.
|
62
|
+
|
63
|
+
def initialize(name:, node_id:, folder: nil, storage: nil, load_encoding: nil, password: nil, encrypted_password: nil)
|
64
|
+
self.name = name
|
65
|
+
self.node_id = node_id
|
66
|
+
self.folder = folder
|
67
|
+
self.storage = storage
|
68
|
+
self.load_encoding = load_encoding
|
69
|
+
self.password = password
|
70
|
+
self.encrypted_password = encrypted_password
|
71
|
+
end
|
72
|
+
|
73
|
+
# Creating batch part from request
|
74
|
+
def to_batch_part(api_client, requestId, parentRequestId = nil)
|
75
|
+
# verify the required parameter 'name' is set
|
76
|
+
raise ArgumentError, 'Missing the required parameter name when calling WordsApi.translate_node_id' if api_client.config.client_side_validation && self.name.nil?
|
77
|
+
# verify the required parameter 'node_id' is set
|
78
|
+
raise ArgumentError, 'Missing the required parameter node_id when calling WordsApi.translate_node_id' if api_client.config.client_side_validation && self.node_id.nil?
|
79
|
+
|
80
|
+
# resource path
|
81
|
+
local_var_path = '/words/{name}/translate/{nodeId}'[7..-1]
|
82
|
+
local_var_path = local_var_path.sub('{' + downcase_first_letter('Name') + '}', self.name.nil? ? '' : self.name.to_s)
|
83
|
+
local_var_path = local_var_path.sub('{' + downcase_first_letter('NodeId') + '}', self.node_id.nil? ? '' : self.node_id.to_s)
|
84
|
+
local_var_path = local_var_path.sub('//', '/')
|
85
|
+
|
86
|
+
# query parameters
|
87
|
+
query_params = {}
|
88
|
+
query_params[downcase_first_letter('Folder')] = self.folder unless self.folder.nil?
|
89
|
+
query_params[downcase_first_letter('Storage')] = self.storage unless self.storage.nil?
|
90
|
+
query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
|
91
|
+
query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
|
92
|
+
query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
|
93
|
+
|
94
|
+
if query_params
|
95
|
+
query_params.each { |key, value| local_var_path = api_client.add_param_to_query(local_var_path, key, value) }
|
96
|
+
end
|
97
|
+
|
98
|
+
header_params = {}
|
99
|
+
header_params['RequestId'] = requestId
|
100
|
+
|
101
|
+
if parentRequestId != nil
|
102
|
+
header_params['DependsOn'] = parentRequestId
|
103
|
+
end
|
104
|
+
|
105
|
+
# form parameters
|
106
|
+
form_params = []
|
107
|
+
files_content = []
|
108
|
+
|
109
|
+
# http body (model)
|
110
|
+
body = api_client.build_request_body_batch(header_params, form_params, files_content)
|
111
|
+
part = ""
|
112
|
+
part.concat("GET".force_encoding('UTF-8'))
|
113
|
+
part.concat(" ".force_encoding('UTF-8'))
|
114
|
+
part.concat(local_var_path.force_encoding('UTF-8'))
|
115
|
+
part.concat(" \r\n".force_encoding('UTF-8'))
|
116
|
+
|
117
|
+
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')) }
|
118
|
+
part.concat("\r\n".force_encoding('UTF-8'))
|
119
|
+
if body
|
120
|
+
if body.is_a?(Hash)
|
121
|
+
body.each do |key, value|
|
122
|
+
part.concat(value, "\r\n")
|
123
|
+
end
|
124
|
+
else
|
125
|
+
part.concat(body)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
part
|
129
|
+
end
|
130
|
+
|
131
|
+
def create_http_request(api_client)
|
132
|
+
# verify the required parameter 'name' is set
|
133
|
+
raise ArgumentError, 'Missing the required parameter name when calling WordsApi.translate_node_id' if api_client.config.client_side_validation && self.name.nil?
|
134
|
+
# verify the required parameter 'node_id' is set
|
135
|
+
raise ArgumentError, 'Missing the required parameter node_id when calling WordsApi.translate_node_id' if api_client.config.client_side_validation && self.node_id.nil?
|
136
|
+
|
137
|
+
# resource path
|
138
|
+
local_var_path = '/words/{name}/translate/{nodeId}'[1..-1]
|
139
|
+
local_var_path = local_var_path.sub('{' + downcase_first_letter('Name') + '}', self.name.nil? ? '' : self.name.to_s)
|
140
|
+
local_var_path = local_var_path.sub('{' + downcase_first_letter('NodeId') + '}', self.node_id.nil? ? '' : self.node_id.to_s)
|
141
|
+
local_var_path = local_var_path.sub('//', '/')
|
142
|
+
|
143
|
+
# query parameters
|
144
|
+
query_params = {}
|
145
|
+
query_params[downcase_first_letter('Folder')] = self.folder unless self.folder.nil?
|
146
|
+
query_params[downcase_first_letter('Storage')] = self.storage unless self.storage.nil?
|
147
|
+
query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
|
148
|
+
query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
|
149
|
+
query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
|
150
|
+
|
151
|
+
# header parameters
|
152
|
+
header_params = {}
|
153
|
+
# HTTP header 'Content-Type'
|
154
|
+
header_params['Content-Type'] = api_client.select_header_content_type(['application/xml', 'application/json'])
|
155
|
+
|
156
|
+
# form parameters
|
157
|
+
form_params = []
|
158
|
+
files_content = []
|
159
|
+
body = api_client.build_request_body(header_params, form_params, files_content)
|
160
|
+
{
|
161
|
+
'method': :GET,
|
162
|
+
'path': local_var_path,
|
163
|
+
'header_params': header_params,
|
164
|
+
'query_params': query_params,
|
165
|
+
'body': body,
|
166
|
+
'auth_names': ['JWT']
|
167
|
+
}
|
168
|
+
end
|
169
|
+
|
170
|
+
#
|
171
|
+
# Helper method to convert first letter to downcase
|
172
|
+
#
|
173
|
+
def downcase_first_letter(str)
|
174
|
+
str[0].downcase + str[1..-1]
|
175
|
+
end
|
176
|
+
|
177
|
+
# Get response type
|
178
|
+
def get_response_type
|
179
|
+
'TranslateNodeIdResponse'
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
@@ -0,0 +1,215 @@
|
|
1
|
+
# ------------------------------------------------------------------------------------
|
2
|
+
# <copyright company="Aspose" file="translate_node_id_response.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
|
+
require 'date'
|
27
|
+
|
28
|
+
module AsposeWordsCloud
|
29
|
+
|
30
|
+
# The REST response with a node path.
|
31
|
+
# This response is returned by the Service when handling "GET https://api.aspose.cloud/v4.0/words/Test.doc/translate/{0}" REST API requests.
|
32
|
+
class TranslateNodeIdResponse
|
33
|
+
# Gets or sets the request Id.
|
34
|
+
attr_accessor :request_id
|
35
|
+
|
36
|
+
# Gets or sets the node path.
|
37
|
+
attr_accessor :path
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
:'request_id' => :'RequestId',
|
42
|
+
:'path' => :'Path'
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
# Attribute type mapping.
|
47
|
+
def self.swagger_types
|
48
|
+
{
|
49
|
+
:'request_id' => :'String',
|
50
|
+
:'path' => :'String'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Initializes the object
|
55
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
56
|
+
def initialize(attributes = {})
|
57
|
+
return unless attributes.is_a?(Hash)
|
58
|
+
|
59
|
+
# convert string to symbol for hash key
|
60
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
61
|
+
|
62
|
+
if attributes.key?(:'RequestId')
|
63
|
+
self.request_id = attributes[:'RequestId']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes.key?(:'Path')
|
67
|
+
self.path = attributes[:'Path']
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# Check to see if the all the properties in the model are valid
|
72
|
+
# @return true if the model is valid
|
73
|
+
def valid?
|
74
|
+
return true
|
75
|
+
end
|
76
|
+
|
77
|
+
# Checks equality by comparing each attribute.
|
78
|
+
# @param [Object] Object to be compared
|
79
|
+
def ==(other)
|
80
|
+
return true if self.equal?(other)
|
81
|
+
self.class == other.class &&
|
82
|
+
request_id == other.request_id &&
|
83
|
+
path == other.path
|
84
|
+
end
|
85
|
+
|
86
|
+
# @see the `==` method
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def eql?(other)
|
89
|
+
self == other
|
90
|
+
end
|
91
|
+
|
92
|
+
# Calculates hash code according to all attributes.
|
93
|
+
# @return [Fixnum] Hash code
|
94
|
+
def hash
|
95
|
+
[request_id, path].hash
|
96
|
+
end
|
97
|
+
|
98
|
+
# Builds the object from hash
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
+
# @return [Object] Returns the model itself
|
101
|
+
def build_from_hash(attributes)
|
102
|
+
return nil unless attributes.is_a?(Hash)
|
103
|
+
self.class.swagger_types.each_pair do |key, type|
|
104
|
+
if type =~ /\AArray<(.*)>/i
|
105
|
+
# check to ensure the input is an array given that the the attribute
|
106
|
+
# is documented as an array but the input is not
|
107
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
108
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
109
|
+
end
|
110
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
111
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
112
|
+
end
|
113
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
114
|
+
end
|
115
|
+
|
116
|
+
self
|
117
|
+
end
|
118
|
+
|
119
|
+
# Deserializes the data based on type
|
120
|
+
# @param string type Data type
|
121
|
+
# @param string value Value to be deserialized
|
122
|
+
# @return [Object] Deserialized data
|
123
|
+
def _deserialize(type, value)
|
124
|
+
case type.to_sym
|
125
|
+
when :DateTime
|
126
|
+
Time.at(/\d/.match(value)[0].to_f).to_datetime
|
127
|
+
when :Date
|
128
|
+
Time.at(/\d/.match(value)[0].to_f).to_date
|
129
|
+
when :String
|
130
|
+
value.to_s
|
131
|
+
when :Integer
|
132
|
+
value.to_i
|
133
|
+
when :Float
|
134
|
+
value.to_f
|
135
|
+
when :BOOLEAN
|
136
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
137
|
+
true
|
138
|
+
else
|
139
|
+
false
|
140
|
+
end
|
141
|
+
when :Object
|
142
|
+
# generic object (usually a Hash), return directly
|
143
|
+
value
|
144
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
145
|
+
inner_type = Regexp.last_match[:inner_type]
|
146
|
+
value.map { |v| _deserialize(inner_type, v) }
|
147
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
148
|
+
k_type = Regexp.last_match[:k_type]
|
149
|
+
v_type = Regexp.last_match[:v_type]
|
150
|
+
{}.tap do |hash|
|
151
|
+
value.each do |k, v|
|
152
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
else
|
156
|
+
# model
|
157
|
+
if value[:'$type']
|
158
|
+
type = value[:'$type'][0..-4]
|
159
|
+
end
|
160
|
+
|
161
|
+
temp_model = AsposeWordsCloud.const_get(type).new
|
162
|
+
temp_model.build_from_hash(value)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# Returns the string representation of the object
|
167
|
+
# @return [String] String presentation of the object
|
168
|
+
def to_s
|
169
|
+
to_hash.to_s
|
170
|
+
end
|
171
|
+
|
172
|
+
# to_body is an alias to to_hash (backward compatibility)
|
173
|
+
# @return [Hash] Returns the object in the form of hash
|
174
|
+
def to_body
|
175
|
+
to_hash
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns the object in the form of hash
|
179
|
+
# @return [Hash] Returns the object in the form of hash
|
180
|
+
def to_hash
|
181
|
+
hash = {}
|
182
|
+
self.class.attribute_map.each_pair do |attr, param|
|
183
|
+
value = self.send(attr)
|
184
|
+
next if value.nil?
|
185
|
+
hash[param] = _to_hash(value)
|
186
|
+
end
|
187
|
+
hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Outputs non-array value in the form of hash
|
191
|
+
# For object, use to_hash. Otherwise, just return the value
|
192
|
+
# @param [Object] value Any valid value
|
193
|
+
# @return [Hash] Returns the value in the form of hash
|
194
|
+
def _to_hash(value)
|
195
|
+
if value.is_a?(Array)
|
196
|
+
value.compact.map { |v| _to_hash(v) }
|
197
|
+
elsif value.is_a?(Hash)
|
198
|
+
{}.tap do |hash|
|
199
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
200
|
+
end
|
201
|
+
elsif value.respond_to? :to_hash
|
202
|
+
value.to_hash
|
203
|
+
else
|
204
|
+
value
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
def collectFilesContent(resultFilesContent)
|
209
|
+
end
|
210
|
+
|
211
|
+
def validate()
|
212
|
+
end
|
213
|
+
|
214
|
+
end
|
215
|
+
end
|
data/lib/aspose_words_cloud.rb
CHANGED
@@ -33,6 +33,7 @@ require_relative 'aspose_words_cloud/configuration'
|
|
33
33
|
require_relative 'aspose_words_cloud/models/file_reference'
|
34
34
|
require_relative 'aspose_words_cloud/models/response_error'
|
35
35
|
require_relative 'aspose_words_cloud/models/available_fonts_response'
|
36
|
+
require_relative 'aspose_words_cloud/models/azw3_save_options_data'
|
36
37
|
require_relative 'aspose_words_cloud/models/bmp_save_options_data'
|
37
38
|
require_relative 'aspose_words_cloud/models/bookmark'
|
38
39
|
require_relative 'aspose_words_cloud/models/bookmark_data'
|
@@ -278,6 +279,7 @@ require_relative 'aspose_words_cloud/models/tab_stops_response'
|
|
278
279
|
require_relative 'aspose_words_cloud/models/text_save_options_data'
|
279
280
|
require_relative 'aspose_words_cloud/models/tiff_save_options_data'
|
280
281
|
require_relative 'aspose_words_cloud/models/time_zone_info_data'
|
282
|
+
require_relative 'aspose_words_cloud/models/translate_node_id_response'
|
281
283
|
require_relative 'aspose_words_cloud/models/user_information'
|
282
284
|
require_relative 'aspose_words_cloud/models/watermark_data_image'
|
283
285
|
require_relative 'aspose_words_cloud/models/watermark_data_text'
|
@@ -585,6 +587,8 @@ require_relative 'aspose_words_cloud/models/requests/search_request'
|
|
585
587
|
require_relative 'aspose_words_cloud/models/requests/search_online_request'
|
586
588
|
require_relative 'aspose_words_cloud/models/requests/split_document_request'
|
587
589
|
require_relative 'aspose_words_cloud/models/requests/split_document_online_request'
|
590
|
+
require_relative 'aspose_words_cloud/models/requests/translate_node_id_request'
|
591
|
+
require_relative 'aspose_words_cloud/models/requests/translate_node_id_online_request'
|
588
592
|
require_relative 'aspose_words_cloud/models/requests/unprotect_document_request'
|
589
593
|
require_relative 'aspose_words_cloud/models/requests/unprotect_document_online_request'
|
590
594
|
require_relative 'aspose_words_cloud/models/requests/update_bookmark_request'
|