aspose_words_cloud 23.1.0 → 23.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (24) hide show
  1. checksums.yaml +4 -4
  2. data/lib/aspose_words_cloud/api/words_api.rb +428 -0
  3. data/lib/aspose_words_cloud/models/requests/delete_structured_document_tag_online_request.rb +211 -0
  4. data/lib/aspose_words_cloud/models/requests/delete_structured_document_tag_request.rb +210 -0
  5. data/lib/aspose_words_cloud/models/requests/get_structured_document_tag_online_request.rb +190 -0
  6. data/lib/aspose_words_cloud/models/requests/get_structured_document_tag_request.rb +189 -0
  7. data/lib/aspose_words_cloud/models/requests/get_structured_document_tags_online_request.rb +179 -0
  8. data/lib/aspose_words_cloud/models/requests/get_structured_document_tags_request.rb +178 -0
  9. data/lib/aspose_words_cloud/models/requests/insert_structured_document_tag_online_request.rb +223 -0
  10. data/lib/aspose_words_cloud/models/requests/insert_structured_document_tag_request.rb +225 -0
  11. data/lib/aspose_words_cloud/models/requests/update_structured_document_tag_online_request.rb +234 -0
  12. data/lib/aspose_words_cloud/models/requests/update_structured_document_tag_request.rb +236 -0
  13. data/lib/aspose_words_cloud/models/responses/insert_structured_document_tag_online_response.rb +46 -0
  14. data/lib/aspose_words_cloud/models/responses/update_structured_document_tag_online_response.rb +46 -0
  15. data/lib/aspose_words_cloud/models/structured_document_tag.rb +564 -0
  16. data/lib/aspose_words_cloud/models/structured_document_tag_collection.rb +216 -0
  17. data/lib/aspose_words_cloud/models/structured_document_tag_insert.rb +564 -0
  18. data/lib/aspose_words_cloud/models/structured_document_tag_list_item.rb +214 -0
  19. data/lib/aspose_words_cloud/models/structured_document_tag_response.rb +214 -0
  20. data/lib/aspose_words_cloud/models/structured_document_tag_update.rb +564 -0
  21. data/lib/aspose_words_cloud/models/structured_document_tags_response.rb +214 -0
  22. data/lib/aspose_words_cloud/version.rb +1 -1
  23. data/lib/aspose_words_cloud.rb +17 -0
  24. metadata +21 -2
@@ -0,0 +1,211 @@
1
+ # ------------------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="delete_structured_document_tag_online_request.rb">
3
+ # Copyright (c) 2023 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 delete_structured_document_tag_online operation.
30
+ #
31
+ class DeleteStructuredDocumentTagOnlineRequest
32
+ # The document.
33
+ attr_accessor :document
34
+
35
+ # Object index.
36
+ attr_accessor :index
37
+
38
+ # The path to the node in the document tree.
39
+ attr_accessor :node_path
40
+
41
+ # Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
42
+ attr_accessor :load_encoding
43
+
44
+ # 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.
45
+ attr_accessor :password
46
+
47
+ # Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
48
+ attr_accessor :encrypted_password
49
+
50
+ # 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.
51
+ attr_accessor :dest_file_name
52
+
53
+ # Initials of the author to use for revisions.If you set this parameter and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.
54
+ attr_accessor :revision_author
55
+
56
+ # The date and time to use for revisions.
57
+ attr_accessor :revision_date_time
58
+
59
+ #
60
+ # Initializes a new instance.
61
+ # @param document The document.
62
+ # @param index Object index.
63
+ # @param node_path The path to the node in the document tree.
64
+ # @param load_encoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
65
+ # @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.
66
+ # @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.
67
+ # @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.
68
+ # @param revision_author Initials of the author to use for revisions.If you set this parameter and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.
69
+ # @param revision_date_time The date and time to use for revisions.
70
+
71
+ def initialize(document:, index:, node_path: nil, load_encoding: nil, password: nil, encrypted_password: nil, dest_file_name: nil, revision_author: nil, revision_date_time: nil)
72
+ self.document = document
73
+ self.index = index
74
+ self.node_path = node_path
75
+ self.load_encoding = load_encoding
76
+ self.password = password
77
+ self.encrypted_password = encrypted_password
78
+ self.dest_file_name = dest_file_name
79
+ self.revision_author = revision_author
80
+ self.revision_date_time = revision_date_time
81
+ end
82
+
83
+ # Creating batch part from request
84
+ def to_batch_part(api_client, requestId, parentRequestId = nil)
85
+ # verify the required parameter 'document' is set
86
+ raise ArgumentError, 'Missing the required parameter document when calling WordsApi.delete_structured_document_tag_online' if api_client.config.client_side_validation && self.document.nil?
87
+ # verify the required parameter 'index' is set
88
+ raise ArgumentError, 'Missing the required parameter index when calling WordsApi.delete_structured_document_tag_online' if api_client.config.client_side_validation && self.index.nil?
89
+
90
+ # resource path
91
+ local_var_path = '/words/online/delete/{nodePath}/sdt/{index}'[7..-1]
92
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('Index') + '}', self.index.nil? ? '' : self.index.to_s)
93
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('NodePath') + '}', self.node_path.nil? ? '' : self.node_path.to_s)
94
+ local_var_path = local_var_path.sub('//', '/')
95
+
96
+ # query parameters
97
+ query_params = {}
98
+ query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
99
+ query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
100
+ query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
101
+ query_params[downcase_first_letter('DestFileName')] = self.dest_file_name unless self.dest_file_name.nil?
102
+ query_params[downcase_first_letter('RevisionAuthor')] = self.revision_author unless self.revision_author.nil?
103
+ query_params[downcase_first_letter('RevisionDateTime')] = self.revision_date_time unless self.revision_date_time.nil?
104
+
105
+ if query_params
106
+ query_params.each { |key, value| local_var_path = api_client.add_param_to_query(local_var_path, key, value) }
107
+ end
108
+
109
+ header_params = {}
110
+ # header parameters
111
+ # HTTP header 'Content-Type'
112
+ header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
113
+ header_params['RequestId'] = requestId
114
+
115
+ if parentRequestId != nil
116
+ header_params['DependsOn'] = parentRequestId
117
+ end
118
+
119
+ # form parameters
120
+ form_params = []
121
+ files_content = []
122
+ if self.document.nil?
123
+ raise "Parameter Document is required."
124
+ end
125
+ unless self.document.nil?
126
+ form_params.push({:'Name' => 'document', :'Data' => self.document, :'MimeType' =>'application/octet-stream'})
127
+ end
128
+
129
+
130
+ # http body (model)
131
+ body = api_client.build_request_body_batch(header_params, form_params, files_content)
132
+ part = ""
133
+ part.concat("PUT".force_encoding('UTF-8'))
134
+ part.concat(" ".force_encoding('UTF-8'))
135
+ part.concat(local_var_path.force_encoding('UTF-8'))
136
+ part.concat(" \r\n".force_encoding('UTF-8'))
137
+
138
+ 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')) }
139
+ part.concat("\r\n".force_encoding('UTF-8'))
140
+ if body
141
+ if body.is_a?(Hash)
142
+ body.each do |key, value|
143
+ part.concat(value, "\r\n")
144
+ end
145
+ else
146
+ part.concat(body)
147
+ end
148
+ end
149
+ part
150
+ end
151
+
152
+ def create_http_request(api_client)
153
+ # verify the required parameter 'document' is set
154
+ raise ArgumentError, 'Missing the required parameter document when calling WordsApi.delete_structured_document_tag_online' if api_client.config.client_side_validation && self.document.nil?
155
+ # verify the required parameter 'index' is set
156
+ raise ArgumentError, 'Missing the required parameter index when calling WordsApi.delete_structured_document_tag_online' if api_client.config.client_side_validation && self.index.nil?
157
+
158
+ # resource path
159
+ local_var_path = '/words/online/delete/{nodePath}/sdt/{index}'[1..-1]
160
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('Index') + '}', self.index.nil? ? '' : self.index.to_s)
161
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('NodePath') + '}', self.node_path.nil? ? '' : self.node_path.to_s)
162
+ local_var_path = local_var_path.sub('//', '/')
163
+
164
+ # query parameters
165
+ query_params = {}
166
+ query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
167
+ query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
168
+ query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
169
+ query_params[downcase_first_letter('DestFileName')] = self.dest_file_name unless self.dest_file_name.nil?
170
+ query_params[downcase_first_letter('RevisionAuthor')] = self.revision_author unless self.revision_author.nil?
171
+ query_params[downcase_first_letter('RevisionDateTime')] = self.revision_date_time unless self.revision_date_time.nil?
172
+
173
+ # header parameters
174
+ header_params = {}
175
+ # HTTP header 'Content-Type'
176
+ header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
177
+
178
+ # form parameters
179
+ form_params = []
180
+ files_content = []
181
+ if self.document.nil?
182
+ raise "Parameter Document is required."
183
+ end
184
+ unless self.document.nil?
185
+ form_params.push({:'Name' => 'document', :'Data' => self.document, :'MimeType' =>'application/octet-stream'})
186
+ end
187
+
188
+ body = api_client.build_request_body(header_params, form_params, files_content)
189
+ {
190
+ 'method': :PUT,
191
+ 'path': local_var_path,
192
+ 'header_params': header_params,
193
+ 'query_params': query_params,
194
+ 'body': body,
195
+ 'auth_names': ['JWT']
196
+ }
197
+ end
198
+
199
+ #
200
+ # Helper method to convert first letter to downcase
201
+ #
202
+ def downcase_first_letter(str)
203
+ str[0].downcase + str[1..-1]
204
+ end
205
+
206
+ # Get response type
207
+ def get_response_type
208
+ 'FILES_COLLECTION'
209
+ end
210
+ end
211
+ end
@@ -0,0 +1,210 @@
1
+ # ------------------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="delete_structured_document_tag_request.rb">
3
+ # Copyright (c) 2023 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 delete_structured_document_tag operation.
30
+ #
31
+ class DeleteStructuredDocumentTagRequest
32
+ # The filename of the input document.
33
+ attr_accessor :name
34
+
35
+ # Object index.
36
+ attr_accessor :index
37
+
38
+ # The path to the node in the document tree.
39
+ attr_accessor :node_path
40
+
41
+ # Original document folder.
42
+ attr_accessor :folder
43
+
44
+ # Original document storage.
45
+ attr_accessor :storage
46
+
47
+ # Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
48
+ attr_accessor :load_encoding
49
+
50
+ # 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.
51
+ attr_accessor :password
52
+
53
+ # 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
+ attr_accessor :encrypted_password
55
+
56
+ # 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.
57
+ attr_accessor :dest_file_name
58
+
59
+ # Initials of the author to use for revisions.If you set this parameter and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.
60
+ attr_accessor :revision_author
61
+
62
+ # The date and time to use for revisions.
63
+ attr_accessor :revision_date_time
64
+
65
+ #
66
+ # Initializes a new instance.
67
+ # @param name The filename of the input document.
68
+ # @param index Object index.
69
+ # @param node_path The path to the node in the document tree.
70
+ # @param folder Original document folder.
71
+ # @param storage Original document storage.
72
+ # @param load_encoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
73
+ # @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.
74
+ # @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.
75
+ # @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.
76
+ # @param revision_author Initials of the author to use for revisions.If you set this parameter and then make some changes to the document programmatically, save the document and later open the document in MS Word you will see these changes as revisions.
77
+ # @param revision_date_time The date and time to use for revisions.
78
+
79
+ def initialize(name:, index:, node_path: nil, folder: nil, storage: nil, load_encoding: nil, password: nil, encrypted_password: nil, dest_file_name: nil, revision_author: nil, revision_date_time: nil)
80
+ self.name = name
81
+ self.index = index
82
+ self.node_path = node_path
83
+ self.folder = folder
84
+ self.storage = storage
85
+ self.load_encoding = load_encoding
86
+ self.password = password
87
+ self.encrypted_password = encrypted_password
88
+ self.dest_file_name = dest_file_name
89
+ self.revision_author = revision_author
90
+ self.revision_date_time = revision_date_time
91
+ end
92
+
93
+ # Creating batch part from request
94
+ def to_batch_part(api_client, requestId, parentRequestId = nil)
95
+ # verify the required parameter 'name' is set
96
+ raise ArgumentError, 'Missing the required parameter name when calling WordsApi.delete_structured_document_tag' if api_client.config.client_side_validation && self.name.nil?
97
+ # verify the required parameter 'index' is set
98
+ raise ArgumentError, 'Missing the required parameter index when calling WordsApi.delete_structured_document_tag' if api_client.config.client_side_validation && self.index.nil?
99
+
100
+ # resource path
101
+ local_var_path = '/words/{name}/{nodePath}/sdt/{index}'[7..-1]
102
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('Name') + '}', self.name.nil? ? '' : self.name.to_s)
103
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('Index') + '}', self.index.nil? ? '' : self.index.to_s)
104
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('NodePath') + '}', self.node_path.nil? ? '' : self.node_path.to_s)
105
+ local_var_path = local_var_path.sub('//', '/')
106
+
107
+ # query parameters
108
+ query_params = {}
109
+ query_params[downcase_first_letter('Folder')] = self.folder unless self.folder.nil?
110
+ query_params[downcase_first_letter('Storage')] = self.storage unless self.storage.nil?
111
+ query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
112
+ query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
113
+ query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
114
+ query_params[downcase_first_letter('DestFileName')] = self.dest_file_name unless self.dest_file_name.nil?
115
+ query_params[downcase_first_letter('RevisionAuthor')] = self.revision_author unless self.revision_author.nil?
116
+ query_params[downcase_first_letter('RevisionDateTime')] = self.revision_date_time unless self.revision_date_time.nil?
117
+
118
+ if query_params
119
+ query_params.each { |key, value| local_var_path = api_client.add_param_to_query(local_var_path, key, value) }
120
+ end
121
+
122
+ header_params = {}
123
+ header_params['RequestId'] = requestId
124
+
125
+ if parentRequestId != nil
126
+ header_params['DependsOn'] = parentRequestId
127
+ end
128
+
129
+ # form parameters
130
+ form_params = []
131
+ files_content = []
132
+
133
+ # http body (model)
134
+ body = api_client.build_request_body_batch(header_params, form_params, files_content)
135
+ part = ""
136
+ part.concat("DELETE".force_encoding('UTF-8'))
137
+ part.concat(" ".force_encoding('UTF-8'))
138
+ part.concat(local_var_path.force_encoding('UTF-8'))
139
+ part.concat(" \r\n".force_encoding('UTF-8'))
140
+
141
+ 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')) }
142
+ part.concat("\r\n".force_encoding('UTF-8'))
143
+ if body
144
+ if body.is_a?(Hash)
145
+ body.each do |key, value|
146
+ part.concat(value, "\r\n")
147
+ end
148
+ else
149
+ part.concat(body)
150
+ end
151
+ end
152
+ part
153
+ end
154
+
155
+ def create_http_request(api_client)
156
+ # verify the required parameter 'name' is set
157
+ raise ArgumentError, 'Missing the required parameter name when calling WordsApi.delete_structured_document_tag' if api_client.config.client_side_validation && self.name.nil?
158
+ # verify the required parameter 'index' is set
159
+ raise ArgumentError, 'Missing the required parameter index when calling WordsApi.delete_structured_document_tag' if api_client.config.client_side_validation && self.index.nil?
160
+
161
+ # resource path
162
+ local_var_path = '/words/{name}/{nodePath}/sdt/{index}'[1..-1]
163
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('Name') + '}', self.name.nil? ? '' : self.name.to_s)
164
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('Index') + '}', self.index.nil? ? '' : self.index.to_s)
165
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('NodePath') + '}', self.node_path.nil? ? '' : self.node_path.to_s)
166
+ local_var_path = local_var_path.sub('//', '/')
167
+
168
+ # query parameters
169
+ query_params = {}
170
+ query_params[downcase_first_letter('Folder')] = self.folder unless self.folder.nil?
171
+ query_params[downcase_first_letter('Storage')] = self.storage unless self.storage.nil?
172
+ query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
173
+ query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
174
+ query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
175
+ query_params[downcase_first_letter('DestFileName')] = self.dest_file_name unless self.dest_file_name.nil?
176
+ query_params[downcase_first_letter('RevisionAuthor')] = self.revision_author unless self.revision_author.nil?
177
+ query_params[downcase_first_letter('RevisionDateTime')] = self.revision_date_time unless self.revision_date_time.nil?
178
+
179
+ # header parameters
180
+ header_params = {}
181
+ # HTTP header 'Content-Type'
182
+ header_params['Content-Type'] = api_client.select_header_content_type(['application/xml', 'application/json'])
183
+
184
+ # form parameters
185
+ form_params = []
186
+ files_content = []
187
+ body = api_client.build_request_body(header_params, form_params, files_content)
188
+ {
189
+ 'method': :DELETE,
190
+ 'path': local_var_path,
191
+ 'header_params': header_params,
192
+ 'query_params': query_params,
193
+ 'body': body,
194
+ 'auth_names': ['JWT']
195
+ }
196
+ end
197
+
198
+ #
199
+ # Helper method to convert first letter to downcase
200
+ #
201
+ def downcase_first_letter(str)
202
+ str[0].downcase + str[1..-1]
203
+ end
204
+
205
+ # Get response type
206
+ def get_response_type
207
+ nil
208
+ end
209
+ end
210
+ end
@@ -0,0 +1,190 @@
1
+ # ------------------------------------------------------------------------------------
2
+ # <copyright company="Aspose" file="get_structured_document_tag_online_request.rb">
3
+ # Copyright (c) 2023 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_structured_document_tag_online operation.
30
+ #
31
+ class GetStructuredDocumentTagOnlineRequest
32
+ # The document.
33
+ attr_accessor :document
34
+
35
+ # Object index.
36
+ attr_accessor :index
37
+
38
+ # The path to the node in the document tree.
39
+ attr_accessor :node_path
40
+
41
+ # Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
42
+ attr_accessor :load_encoding
43
+
44
+ # 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.
45
+ attr_accessor :password
46
+
47
+ # Password of protected Word document. Use the parameter to pass an encrypted password for direct calls of API. See SDK code for encyption details.
48
+ attr_accessor :encrypted_password
49
+
50
+ #
51
+ # Initializes a new instance.
52
+ # @param document The document.
53
+ # @param index Object index.
54
+ # @param node_path The path to the node in the document tree.
55
+ # @param load_encoding Encoding that will be used to load an HTML (or TXT) document if the encoding is not specified in HTML.
56
+ # @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.
57
+ # @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.
58
+
59
+ def initialize(document:, index:, node_path: nil, load_encoding: nil, password: nil, encrypted_password: nil)
60
+ self.document = document
61
+ self.index = index
62
+ self.node_path = node_path
63
+ self.load_encoding = load_encoding
64
+ self.password = password
65
+ self.encrypted_password = encrypted_password
66
+ end
67
+
68
+ # Creating batch part from request
69
+ def to_batch_part(api_client, requestId, parentRequestId = nil)
70
+ # verify the required parameter 'document' is set
71
+ raise ArgumentError, 'Missing the required parameter document when calling WordsApi.get_structured_document_tag_online' if api_client.config.client_side_validation && self.document.nil?
72
+ # verify the required parameter 'index' is set
73
+ raise ArgumentError, 'Missing the required parameter index when calling WordsApi.get_structured_document_tag_online' if api_client.config.client_side_validation && self.index.nil?
74
+
75
+ # resource path
76
+ local_var_path = '/words/online/get/{nodePath}/sdt/{index}'[7..-1]
77
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('Index') + '}', self.index.nil? ? '' : self.index.to_s)
78
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('NodePath') + '}', self.node_path.nil? ? '' : self.node_path.to_s)
79
+ local_var_path = local_var_path.sub('//', '/')
80
+
81
+ # query parameters
82
+ query_params = {}
83
+ query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
84
+ query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
85
+ query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
86
+
87
+ if query_params
88
+ query_params.each { |key, value| local_var_path = api_client.add_param_to_query(local_var_path, key, value) }
89
+ end
90
+
91
+ header_params = {}
92
+ # header parameters
93
+ # HTTP header 'Content-Type'
94
+ header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
95
+ header_params['RequestId'] = requestId
96
+
97
+ if parentRequestId != nil
98
+ header_params['DependsOn'] = parentRequestId
99
+ end
100
+
101
+ # form parameters
102
+ form_params = []
103
+ files_content = []
104
+ if self.document.nil?
105
+ raise "Parameter Document is required."
106
+ end
107
+ unless self.document.nil?
108
+ form_params.push({:'Name' => 'document', :'Data' => self.document, :'MimeType' =>'application/octet-stream'})
109
+ end
110
+
111
+
112
+ # http body (model)
113
+ body = api_client.build_request_body_batch(header_params, form_params, files_content)
114
+ part = ""
115
+ part.concat("PUT".force_encoding('UTF-8'))
116
+ part.concat(" ".force_encoding('UTF-8'))
117
+ part.concat(local_var_path.force_encoding('UTF-8'))
118
+ part.concat(" \r\n".force_encoding('UTF-8'))
119
+
120
+ 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')) }
121
+ part.concat("\r\n".force_encoding('UTF-8'))
122
+ if body
123
+ if body.is_a?(Hash)
124
+ body.each do |key, value|
125
+ part.concat(value, "\r\n")
126
+ end
127
+ else
128
+ part.concat(body)
129
+ end
130
+ end
131
+ part
132
+ end
133
+
134
+ def create_http_request(api_client)
135
+ # verify the required parameter 'document' is set
136
+ raise ArgumentError, 'Missing the required parameter document when calling WordsApi.get_structured_document_tag_online' if api_client.config.client_side_validation && self.document.nil?
137
+ # verify the required parameter 'index' is set
138
+ raise ArgumentError, 'Missing the required parameter index when calling WordsApi.get_structured_document_tag_online' if api_client.config.client_side_validation && self.index.nil?
139
+
140
+ # resource path
141
+ local_var_path = '/words/online/get/{nodePath}/sdt/{index}'[1..-1]
142
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('Index') + '}', self.index.nil? ? '' : self.index.to_s)
143
+ local_var_path = local_var_path.sub('{' + downcase_first_letter('NodePath') + '}', self.node_path.nil? ? '' : self.node_path.to_s)
144
+ local_var_path = local_var_path.sub('//', '/')
145
+
146
+ # query parameters
147
+ query_params = {}
148
+ query_params[downcase_first_letter('LoadEncoding')] = self.load_encoding unless self.load_encoding.nil?
149
+ query_params[downcase_first_letter('Password')] = self.password unless self.password.nil?
150
+ query_params[downcase_first_letter('EncryptedPassword')] = self.encrypted_password unless self.encrypted_password.nil?
151
+
152
+ # header parameters
153
+ header_params = {}
154
+ # HTTP header 'Content-Type'
155
+ header_params['Content-Type'] = api_client.select_header_content_type(['multipart/form-data'])
156
+
157
+ # form parameters
158
+ form_params = []
159
+ files_content = []
160
+ if self.document.nil?
161
+ raise "Parameter Document is required."
162
+ end
163
+ unless self.document.nil?
164
+ form_params.push({:'Name' => 'document', :'Data' => self.document, :'MimeType' =>'application/octet-stream'})
165
+ end
166
+
167
+ body = api_client.build_request_body(header_params, form_params, files_content)
168
+ {
169
+ 'method': :PUT,
170
+ 'path': local_var_path,
171
+ 'header_params': header_params,
172
+ 'query_params': query_params,
173
+ 'body': body,
174
+ 'auth_names': ['JWT']
175
+ }
176
+ end
177
+
178
+ #
179
+ # Helper method to convert first letter to downcase
180
+ #
181
+ def downcase_first_letter(str)
182
+ str[0].downcase + str[1..-1]
183
+ end
184
+
185
+ # Get response type
186
+ def get_response_type
187
+ 'StructuredDocumentTagResponse'
188
+ end
189
+ end
190
+ end