aspose_words_cloud 24.4.0 → 24.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38eca3c5f33ea476de0166ef8f64a84f443db2b9369a0b9b4d9b8fcbdbf036fc
4
- data.tar.gz: 43ec85528312163e9ac1e24f9114cd7247988e3836bf47c38917ace568641bd2
3
+ metadata.gz: aaf48a209a0184af904a4c1a50f42c746e37efdbc09bf2f7abd90dd52d00642f
4
+ data.tar.gz: fa921f417b9c30f99e4b829a05a1f6c81dca61531d4b638177ef09c938012bea
5
5
  SHA512:
6
- metadata.gz: 8e846e25fea5e0d97567ef1b4af527162b97326b0e731ceadda5515c4959af73aec73ef8510891f2f90dc7ad474e6ba80776d2baa636653800eefe1853012291
7
- data.tar.gz: 46c049989a4fb799f40f714bafbc3ba95114623aac67c31cab52e530f532d0b484f1afc9e65e3c0eced4cc0cf89ba616a61a495f62c569067f1a6e36946026b7
6
+ metadata.gz: 025aa99a627f0daa171c1ae6d055b76431997632ae6ebb99ebd793539acc9dfbd7c2c1c7a66b653c12becd728b63f282ca60605062618cb9fc5e7995415e8b23
7
+ data.tar.gz: beea4d054471e7e1ecc0c3ebd2417bba4f23bd22162006b3454249f403d30984b6056ffcba47b7c9523e8c1d23564e42d60b94eb3e2739d2fb4c26421116ee93
@@ -12474,6 +12474,90 @@ module AsposeWordsCloud
12474
12474
  [mp_data, status_code, headers]
12475
12475
  end
12476
12476
 
12477
+ # Translate a node id to a node path.
12478
+ # @param request TranslateNodeIdRequest
12479
+ # @return [TranslateNodeIdResponse]
12480
+ def translate_node_id(request)
12481
+ begin
12482
+ data, _status_code, _headers = translate_node_id_with_http_info(request)
12483
+ rescue ApiError => e
12484
+ if e.code == 401
12485
+ request_token
12486
+ data, _status_code, _headers = translate_node_id_with_http_info(request)
12487
+ else
12488
+ raise
12489
+ end
12490
+ end
12491
+ data
12492
+ end
12493
+
12494
+ # Translate a node id to a node path.
12495
+ # @param request TranslateNodeIdRequest
12496
+ # @return [Array<(TranslateNodeIdResponse, Fixnum, Hash)>]
12497
+ # TranslateNodeIdResponse, response status code and response headers
12498
+ private def translate_node_id_with_http_info(request)
12499
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? TranslateNodeIdRequest
12500
+
12501
+ @api_client.config.logger.debug 'Calling API: WordsApi.translate_node_id ...' if @api_client.config.debugging
12502
+ request_data = request.create_http_request(@api_client)
12503
+
12504
+ data, status_code, headers = @api_client.call_api(
12505
+ request_data[:'method'],
12506
+ request_data[:'path'],
12507
+ header_params: request_data[:'header_params'],
12508
+ query_params: request_data[:'query_params'],
12509
+ body: request_data[:'body'],
12510
+ return_type: 'TranslateNodeIdResponse')
12511
+ if @api_client.config.debugging
12512
+ @api_client.config.logger.debug "API called:
12513
+ WordsApi#translate_node_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
12514
+ end
12515
+
12516
+ [data, status_code, headers]
12517
+ end
12518
+
12519
+ # Translate a node id to a node path.
12520
+ # @param request TranslateNodeIdOnlineRequest
12521
+ # @return [TranslateNodeIdResponse]
12522
+ def translate_node_id_online(request)
12523
+ begin
12524
+ data, _status_code, _headers = translate_node_id_online_with_http_info(request)
12525
+ rescue ApiError => e
12526
+ if e.code == 401
12527
+ request_token
12528
+ data, _status_code, _headers = translate_node_id_online_with_http_info(request)
12529
+ else
12530
+ raise
12531
+ end
12532
+ end
12533
+ data
12534
+ end
12535
+
12536
+ # Translate a node id to a node path.
12537
+ # @param request TranslateNodeIdOnlineRequest
12538
+ # @return [Array<(TranslateNodeIdResponse, Fixnum, Hash)>]
12539
+ # TranslateNodeIdResponse, response status code and response headers
12540
+ private def translate_node_id_online_with_http_info(request)
12541
+ raise ArgumentError, 'Incorrect request type' unless request.is_a? TranslateNodeIdOnlineRequest
12542
+
12543
+ @api_client.config.logger.debug 'Calling API: WordsApi.translate_node_id_online ...' if @api_client.config.debugging
12544
+ request_data = request.create_http_request(@api_client)
12545
+
12546
+ data, status_code, headers = @api_client.call_api(
12547
+ request_data[:'method'],
12548
+ request_data[:'path'],
12549
+ header_params: request_data[:'header_params'],
12550
+ query_params: request_data[:'query_params'],
12551
+ body: request_data[:'body'],
12552
+ return_type: 'TranslateNodeIdResponse')
12553
+ if @api_client.config.debugging
12554
+ @api_client.config.logger.debug "API called:
12555
+ WordsApi#translate_node_id_online\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
12556
+ end
12557
+
12558
+ [data, status_code, headers]
12559
+ end
12560
+
12477
12561
  # Removes protection from the document.
12478
12562
  # @param request UnprotectDocumentRequest
12479
12563
  # @return [ProtectionDataResponse]
@@ -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
@@ -24,5 +24,5 @@
24
24
  # ------------------------------------------------------------------------------------
25
25
 
26
26
  module AsposeWordsCloud
27
- VERSION = "24.4.0".freeze
27
+ VERSION = "24.6.0".freeze
28
28
  end
@@ -278,6 +278,7 @@ require_relative 'aspose_words_cloud/models/tab_stops_response'
278
278
  require_relative 'aspose_words_cloud/models/text_save_options_data'
279
279
  require_relative 'aspose_words_cloud/models/tiff_save_options_data'
280
280
  require_relative 'aspose_words_cloud/models/time_zone_info_data'
281
+ require_relative 'aspose_words_cloud/models/translate_node_id_response'
281
282
  require_relative 'aspose_words_cloud/models/user_information'
282
283
  require_relative 'aspose_words_cloud/models/watermark_data_image'
283
284
  require_relative 'aspose_words_cloud/models/watermark_data_text'
@@ -585,6 +586,8 @@ require_relative 'aspose_words_cloud/models/requests/search_request'
585
586
  require_relative 'aspose_words_cloud/models/requests/search_online_request'
586
587
  require_relative 'aspose_words_cloud/models/requests/split_document_request'
587
588
  require_relative 'aspose_words_cloud/models/requests/split_document_online_request'
589
+ require_relative 'aspose_words_cloud/models/requests/translate_node_id_request'
590
+ require_relative 'aspose_words_cloud/models/requests/translate_node_id_online_request'
588
591
  require_relative 'aspose_words_cloud/models/requests/unprotect_document_request'
589
592
  require_relative 'aspose_words_cloud/models/requests/unprotect_document_online_request'
590
593
  require_relative 'aspose_words_cloud/models/requests/update_bookmark_request'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aspose_words_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 24.4.0
4
+ version: 24.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - YaroslawEkimov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-15 00:00:00.000000000 Z
11
+ date: 2024-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -564,6 +564,8 @@ files:
564
564
  - lib/aspose_words_cloud/models/requests/search_request.rb
565
565
  - lib/aspose_words_cloud/models/requests/split_document_online_request.rb
566
566
  - lib/aspose_words_cloud/models/requests/split_document_request.rb
567
+ - lib/aspose_words_cloud/models/requests/translate_node_id_online_request.rb
568
+ - lib/aspose_words_cloud/models/requests/translate_node_id_request.rb
567
569
  - lib/aspose_words_cloud/models/requests/unprotect_document_online_request.rb
568
570
  - lib/aspose_words_cloud/models/requests/unprotect_document_request.rb
569
571
  - lib/aspose_words_cloud/models/requests/update_bookmark_online_request.rb
@@ -740,6 +742,7 @@ files:
740
742
  - lib/aspose_words_cloud/models/text_save_options_data.rb
741
743
  - lib/aspose_words_cloud/models/tiff_save_options_data.rb
742
744
  - lib/aspose_words_cloud/models/time_zone_info_data.rb
745
+ - lib/aspose_words_cloud/models/translate_node_id_response.rb
743
746
  - lib/aspose_words_cloud/models/user_information.rb
744
747
  - lib/aspose_words_cloud/models/watermark_data_image.rb
745
748
  - lib/aspose_words_cloud/models/watermark_data_text.rb