aspose_html 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +12 -0
  3. data/Gemfile.lock +92 -0
  4. data/LICENSE +21 -0
  5. data/README.md +181 -0
  6. data/Rakefile +8 -0
  7. data/aspose_html.gemspec +58 -0
  8. data/docs/ConversionApi.md +837 -0
  9. data/docs/DocumentApi.md +386 -0
  10. data/docs/OcrApi.md +128 -0
  11. data/docs/SummarizationApi.md +111 -0
  12. data/docs/TranslationApi.md +126 -0
  13. data/docs/storage/DiscUsage.md +9 -0
  14. data/docs/storage/DiscUsageResponse.md +10 -0
  15. data/docs/storage/FileApi.md +240 -0
  16. data/docs/storage/FileDetail.md +13 -0
  17. data/docs/storage/FileDetailsResponse.md +10 -0
  18. data/docs/storage/FileExist.md +9 -0
  19. data/docs/storage/FileExistResponse.md +10 -0
  20. data/docs/storage/FileVersion.md +15 -0
  21. data/docs/storage/FileVersionsResponse.md +10 -0
  22. data/docs/storage/FolderApi.md +229 -0
  23. data/docs/storage/MessageResponse.md +9 -0
  24. data/docs/storage/MoveFileResponse.md +9 -0
  25. data/docs/storage/MoveFolderResponse.md +9 -0
  26. data/docs/storage/RemoveFileResponse.md +9 -0
  27. data/docs/storage/RemoveFolderResponse.md +9 -0
  28. data/docs/storage/StorageApi.md +217 -0
  29. data/docs/storage/StorageExistResponse.md +10 -0
  30. data/lib/aspose_html.rb +68 -0
  31. data/lib/aspose_html/api/html_api.rb +1900 -0
  32. data/lib/aspose_html/api/storage_api.rb +774 -0
  33. data/lib/aspose_html/api_client.rb +386 -0
  34. data/lib/aspose_html/api_error.rb +54 -0
  35. data/lib/aspose_html/configuration.rb +175 -0
  36. data/lib/aspose_html/models/disc_usage.rb +223 -0
  37. data/lib/aspose_html/models/disc_usage_response.rb +260 -0
  38. data/lib/aspose_html/models/file_detail.rb +254 -0
  39. data/lib/aspose_html/models/file_details_response.rb +262 -0
  40. data/lib/aspose_html/models/file_exist.rb +223 -0
  41. data/lib/aspose_html/models/file_exist_response.rb +274 -0
  42. data/lib/aspose_html/models/file_version.rb +273 -0
  43. data/lib/aspose_html/models/file_versions_response.rb +262 -0
  44. data/lib/aspose_html/models/message_response.rb +251 -0
  45. data/lib/aspose_html/models/move_file_response.rb +251 -0
  46. data/lib/aspose_html/models/move_folder_response.rb +251 -0
  47. data/lib/aspose_html/models/remove_file_response.rb +251 -0
  48. data/lib/aspose_html/models/remove_folder_response.rb +251 -0
  49. data/lib/aspose_html/models/storage_exist_response.rb +260 -0
  50. data/lib/aspose_html/version.rb +31 -0
  51. data/spec/api/html_api_spec.rb +971 -0
  52. data/spec/api/model_spec.rb +622 -0
  53. data/spec/api/storage_api_spec.rb +596 -0
  54. data/spec/spec_helper.rb +169 -0
  55. data/testdata/test.txt +1 -0
  56. data/testdata/test1.html +19 -0
  57. data/testdata/test1.html.zip +0 -0
  58. data/testdata/test2.html +46 -0
  59. data/testdata/test2.html.zip +0 -0
  60. data/testdata/test3.html.zip +0 -0
  61. data/testdata/test4.html.zip +0 -0
  62. data/testdata/test_download.jpg +0 -0
  63. data/testdata/test_en.html +46 -0
  64. data/testdata/test_for_delete.html +46 -0
  65. data/testdata/test_for_move.html +46 -0
  66. data/testdata/test_get_doc.zip +0 -0
  67. data/testdata/test_ocr.jpg +0 -0
  68. data/testdata/test_ocr.png +0 -0
  69. data/testdata/test_put_create.html +19 -0
  70. data/testdata/test_put_create.jpg +0 -0
  71. data/testresult/Convert_html.bmp +0 -0
  72. data/testresult/Convert_html.pdf +0 -0
  73. data/testresult/Convert_html.xps +0 -0
  74. data/testresult/Convert_url.pdf +0 -0
  75. data/testresult/Convert_url.png +0 -0
  76. data/testresult/Convert_url.xps +0 -0
  77. data/testresult/Get_document.zip +0 -0
  78. data/testresult/Get_fragment_css_by_url.html +447 -0
  79. data/testresult/Get_fragment_doc.html +9 -0
  80. data/testresult/Get_fragment_doc_css.html +9 -0
  81. data/testresult/Get_fragment_xpath_by_url.html +38 -0
  82. data/testresult/Get_images_doc.zip +0 -0
  83. data/testresult/Get_images_from_url.zip +0 -0
  84. data/testresult/Keyword_by_doc.json +1 -0
  85. data/testresult/Keyword_by_url.json +1 -0
  86. data/testresult/Recognize_en_png.html +10 -0
  87. data/testresult/Translate_url_en_fr.zip +0 -0
  88. data/testresult/putTest.pdf +0 -0
  89. data/testresult/putTest.png +0 -0
  90. data/testresult/putTest.xps +0 -0
  91. data/testresult/putTestDoc.pdf +0 -0
  92. data/testresult/putTestDoc.tiff +0 -0
  93. data/testresult/putTestDoc.xps +0 -0
  94. data/testresult/test_download.jpg +0 -0
  95. metadata +320 -0
@@ -0,0 +1,10 @@
1
+ # AsposeStorage::StorageExistResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **code** | **String** | |
7
+ **status** | **String** | | [optional]
8
+ **is_exist** | **BOOLEAN** | | [optional]
9
+
10
+
@@ -0,0 +1,68 @@
1
+ # -*- coding: utf-8 -*-
2
+ =begin
3
+ --------------------------------------------------------------------------------------------------------------------
4
+ <copyright company="Aspose" file="aspose_html.rb">
5
+ </copyright>
6
+ Copyright (c) 2018 Aspose.HTML for Cloud
7
+ <summary>
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
25
+ </summary>
26
+ --------------------------------------------------------------------------------------------------------------------
27
+ =end
28
+
29
+ # Common files
30
+ require 'aspose_html/api_client'
31
+ require 'aspose_html/api_error'
32
+ require 'aspose_html/version'
33
+ require 'aspose_html/configuration'
34
+
35
+ # APIs HTML
36
+ require 'aspose_html/api/html_api'
37
+
38
+ # APIs Storage
39
+ require 'aspose_html/api/storage_api'
40
+
41
+ # Models Storage
42
+ require 'aspose_html/models/disc_usage'
43
+ require 'aspose_html/models/file_detail'
44
+ require 'aspose_html/models/file_exist'
45
+ require 'aspose_html/models/message_response'
46
+ require 'aspose_html/models/disc_usage_response'
47
+ require 'aspose_html/models/file_exist_response'
48
+ require 'aspose_html/models/file_version'
49
+ require 'aspose_html/models/file_versions_response'
50
+ require 'aspose_html/models/file_details_response'
51
+ require 'aspose_html/models/move_file_response'
52
+ require 'aspose_html/models/move_folder_response'
53
+ require 'aspose_html/models/remove_file_response'
54
+ require 'aspose_html/models/remove_folder_response'
55
+ require 'aspose_html/models/storage_exist_response'
56
+
57
+
58
+ module AsposeHtml
59
+ class << self
60
+ def configure(args)
61
+ if block_given?
62
+ yield(Configuration.default(args))
63
+ else
64
+ Configuration.default(args)
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,1900 @@
1
+ # -*- coding: utf-8 -*-
2
+ =begin
3
+ --------------------------------------------------------------------------------------------------------------------
4
+ <copyright company="Aspose" file="html_api.rb">
5
+ </copyright>
6
+ Copyright (c) 2018 Aspose.HTML for Cloud
7
+ <summary>
8
+ Permission is hereby granted, free of charge, to any person obtaining a copy
9
+ of this software and associated documentation files (the "Software"), to deal
10
+ in the Software without restriction, including without limitation the rights
11
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
+ copies of the Software, and to permit persons to whom the Software is
13
+ furnished to do so, subject to the following conditions:
14
+
15
+ The above copyright notice and this permission notice shall be included in all
16
+ copies or substantial portions of the Software.
17
+
18
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
+ SOFTWARE.
25
+ </summary>
26
+ --------------------------------------------------------------------------------------------------------------------
27
+ =end
28
+
29
+ require "uri"
30
+
31
+
32
+ module AsposeHtml
33
+ class HtmlApi
34
+ attr_accessor :api_client
35
+
36
+ def initialize(args)
37
+ @api_client = AsposeHtml::ApiClient.default(args)
38
+ end
39
+
40
+
41
+ ################################################################################
42
+ # Conversion Api
43
+ ################################################################################
44
+
45
+
46
+ # Convert the HTML document from the storage by its name to the specified image format.
47
+ #
48
+ # @param name Document name.
49
+ # @param out_format Resulting image format.
50
+ # @param [Hash] opts the optional parameters
51
+ # @option opts [Integer] :width Resulting image width.
52
+ # @option opts [Integer] :height Resulting image height.
53
+ # @option opts [Integer] :left_margin Left resulting image margin.
54
+ # @option opts [Integer] :right_margin Right resulting image margin.
55
+ # @option opts [Integer] :top_margin Top resulting image margin.
56
+ # @option opts [Integer] :bottom_margin Bottom resulting image margin.
57
+ # @option opts [Integer] :x_resolution Horizontal resolution of resulting image.
58
+ # @option opts [Integer] :y_resolution Vertical resolution of resulting image.
59
+ # @option opts [String] :folder The source document folder.
60
+ # @option opts [String] :storage The source document storage.
61
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
62
+ def get_convert_document_to_image(name, out_format, opts = {})
63
+ data, _status_code, _headers = get_convert_document_to_image_with_http_info(name, out_format, opts)
64
+ return {file: data, status: _status_code, headers: _headers}
65
+ end
66
+
67
+ # Convert the HTML document from the storage by its name to the specified image format.
68
+ #
69
+ # @param name Document name.
70
+ # @param out_format Resulting image format.
71
+ # @param [Hash] opts the optional parameters
72
+ # @option opts [Integer] :width Resulting image width.
73
+ # @option opts [Integer] :height Resulting image height.
74
+ # @option opts [Integer] :left_margin Left resulting image margin.
75
+ # @option opts [Integer] :right_margin Right resulting image margin.
76
+ # @option opts [Integer] :top_margin Top resulting image margin.
77
+ # @option opts [Integer] :bottom_margin Bottom resulting image margin.
78
+ # @option opts [Integer] :x_resolution Horizontal resolution of resulting image.
79
+ # @option opts [Integer] :y_resolution Vertical resolution of resulting image.
80
+ # @option opts [String] :folder The source document folder.
81
+ # @option opts [String] :storage The source document storage.
82
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
83
+ def get_convert_document_to_image_with_http_info(name, out_format, opts = {})
84
+ if @api_client.config.debug
85
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_image ..."
86
+ end
87
+ # verify the required parameter 'name' is set
88
+ if @api_client.config.client_side_validation && name.nil?
89
+ fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_convert_document_to_image"
90
+ end
91
+ # verify the required parameter 'out_format' is set
92
+ if @api_client.config.client_side_validation && out_format.nil?
93
+ fail ArgumentError, "Missing the required parameter 'out_format' when calling HtmlApi.get_convert_document_to_image"
94
+ end
95
+ # resource path
96
+ local_var_path = "/html/{name}/convert/image/{outFormat}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'outFormat' + '}', out_format.to_s)
97
+
98
+ # query parameters
99
+ query_params = {}
100
+ query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
101
+ query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
102
+ query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
103
+ query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
104
+ query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
105
+ query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
106
+ query_params[:'xResolution'] = opts[:'x_resolution'] if !opts[:'x_resolution'].nil?
107
+ query_params[:'yResolution'] = opts[:'y_resolution'] if !opts[:'y_resolution'].nil?
108
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
109
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
110
+
111
+ # header parameters
112
+ header_params = {}
113
+ # HTTP header 'Accept' (if needed)
114
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
115
+ # HTTP header 'Content-Type'
116
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
117
+
118
+ # form parameters
119
+ form_params = {}
120
+
121
+ # http body (model)
122
+ post_body = nil
123
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
124
+ :header_params => header_params,
125
+ :query_params => query_params,
126
+ :form_params => form_params,
127
+ :body => post_body,
128
+ :return_type => 'File')
129
+ if @api_client.config.debug
130
+ @api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
131
+ end
132
+ return data, status_code, headers
133
+ end
134
+
135
+ # Convert the HTML page from the web by its URL to the specified image format.
136
+ #
137
+ # @param source_url Source page URL.
138
+ # @param out_format Resulting image format.
139
+ # @param [Hash] opts the optional parameters
140
+ # @option opts [Integer] :width Resulting image width.
141
+ # @option opts [Integer] :height Resulting image height.
142
+ # @option opts [Integer] :left_margin Left resulting image margin.
143
+ # @option opts [Integer] :right_margin Right resulting image margin.
144
+ # @option opts [Integer] :top_margin Top resulting image margin.
145
+ # @option opts [Integer] :bottom_margin Bottom resulting image margin.
146
+ # @option opts [Integer] :x_resolution Horizontal resolution of resulting image.
147
+ # @option opts [Integer] :y_resolution Vertical resolution of resulting image.
148
+ # @option opts [String] :folder The document folder.
149
+ # @option opts [String] :storage The document storage.
150
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
151
+ def get_convert_document_to_image_by_url(source_url, out_format, opts = {})
152
+ data, _status_code, _headers = get_convert_document_to_image_by_url_with_http_info(source_url, out_format, opts)
153
+ return {file: data, status: _status_code, headers: _headers}
154
+ end
155
+
156
+ # Convert the HTML page from the web by its URL to the specified image format.
157
+ #
158
+ # @param source_url Source page URL.
159
+ # @param out_format Resulting image format.
160
+ # @param [Hash] opts the optional parameters
161
+ # @option opts [Integer] :width Resulting image width.
162
+ # @option opts [Integer] :height Resulting image height.
163
+ # @option opts [Integer] :left_margin Left resulting image margin.
164
+ # @option opts [Integer] :right_margin Right resulting image margin.
165
+ # @option opts [Integer] :top_margin Top resulting image margin.
166
+ # @option opts [Integer] :bottom_margin Bottom resulting image margin.
167
+ # @option opts [Integer] :x_resolution Horizontal resolution of resulting image.
168
+ # @option opts [Integer] :y_resolution Vertical resolution of resulting image.
169
+ # @option opts [String] :folder The document folder.
170
+ # @option opts [String] :storage The document storage.
171
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
172
+ def get_convert_document_to_image_by_url_with_http_info(source_url, out_format, opts = {})
173
+ if @api_client.config.debug
174
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_image_by_url ..."
175
+ end
176
+ # verify the required parameter 'source_url' is set
177
+ if @api_client.config.client_side_validation && source_url.nil?
178
+ fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_convert_document_to_image_by_url"
179
+ end
180
+ # verify the required parameter 'out_format' is set
181
+ if @api_client.config.client_side_validation && out_format.nil?
182
+ fail ArgumentError, "Missing the required parameter 'out_format' when calling HtmlApi.get_convert_document_to_image_by_url"
183
+ end
184
+ # resource path
185
+ local_var_path = "/html/convert/image/{outFormat}".sub('{' + 'outFormat' + '}', out_format.to_s)
186
+
187
+ # query parameters
188
+ query_params = {}
189
+ query_params[:'sourceUrl'] = source_url
190
+ query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
191
+ query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
192
+ query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
193
+ query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
194
+ query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
195
+ query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
196
+ query_params[:'xResolution'] = opts[:'x_resolution'] if !opts[:'x_resolution'].nil?
197
+ query_params[:'yResolution'] = opts[:'y_resolution'] if !opts[:'y_resolution'].nil?
198
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
199
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
200
+
201
+ # header parameters
202
+ header_params = {}
203
+ # HTTP header 'Accept' (if needed)
204
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
205
+ # HTTP header 'Content-Type'
206
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
207
+
208
+ # form parameters
209
+ form_params = {}
210
+
211
+ # http body (model)
212
+ post_body = nil
213
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
214
+ :header_params => header_params,
215
+ :query_params => query_params,
216
+ :form_params => form_params,
217
+ :body => post_body,
218
+ :return_type => 'File')
219
+ if @api_client.config.debug
220
+ @api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_image_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
221
+ end
222
+ return data, status_code, headers
223
+ end
224
+
225
+ # Convert the HTML document from the storage by its name to PDF.
226
+ #
227
+ # @param name Document name.
228
+ # @param [Hash] opts the optional parameters
229
+ # @option opts [Integer] :width Resulting image width.
230
+ # @option opts [Integer] :height Resulting image height.
231
+ # @option opts [Integer] :left_margin Left resulting image margin.
232
+ # @option opts [Integer] :right_margin Right resulting image margin.
233
+ # @option opts [Integer] :top_margin Top resulting image margin.
234
+ # @option opts [Integer] :bottom_margin Bottom resulting image margin.
235
+ # @option opts [String] :folder The document folder.
236
+ # @option opts [String] :storage The document storage.
237
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
238
+ def get_convert_document_to_pdf(name, opts = {})
239
+ data, _status_code, _headers = get_convert_document_to_pdf_with_http_info(name, opts)
240
+ return {file: data, status: _status_code, headers: _headers}
241
+ end
242
+
243
+ # Convert the HTML document from the storage by its name to PDF.
244
+ #
245
+ # @param name Document name.
246
+ # @param [Hash] opts the optional parameters
247
+ # @option opts [Integer] :width Resulting image width.
248
+ # @option opts [Integer] :height Resulting image height.
249
+ # @option opts [Integer] :left_margin Left resulting image margin.
250
+ # @option opts [Integer] :right_margin Right resulting image margin.
251
+ # @option opts [Integer] :top_margin Top resulting image margin.
252
+ # @option opts [Integer] :bottom_margin Bottom resulting image margin.
253
+ # @option opts [String] :folder The document folder.
254
+ # @option opts [String] :storage The document storage.
255
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
256
+ def get_convert_document_to_pdf_with_http_info(name, opts = {})
257
+ if @api_client.config.debug
258
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_pdf ..."
259
+ end
260
+ # verify the required parameter 'name' is set
261
+ if @api_client.config.client_side_validation && name.nil?
262
+ fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_convert_document_to_pdf"
263
+ end
264
+ # resource path
265
+ local_var_path = "/html/{name}/convert/pdf".sub('{' + 'name' + '}', name.to_s)
266
+
267
+ # query parameters
268
+ query_params = {}
269
+ query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
270
+ query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
271
+ query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
272
+ query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
273
+ query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
274
+ query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
275
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
276
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
277
+
278
+ # header parameters
279
+ header_params = {}
280
+ # HTTP header 'Accept' (if needed)
281
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
282
+ # HTTP header 'Content-Type'
283
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
284
+
285
+ # form parameters
286
+ form_params = {}
287
+
288
+ # http body (model)
289
+ post_body = nil
290
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
291
+ :header_params => header_params,
292
+ :query_params => query_params,
293
+ :form_params => form_params,
294
+ :body => post_body,
295
+ :return_type => 'File')
296
+ if @api_client.config.debug
297
+ @api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
298
+ end
299
+ return data, status_code, headers
300
+ end
301
+
302
+ # Convert the HTML page from the web by its URL to PDF.
303
+ #
304
+ # @param source_url Source page URL.
305
+ # @param [Hash] opts the optional parameters
306
+ # @option opts [Integer] :width Resulting image width.
307
+ # @option opts [Integer] :height Resulting image height.
308
+ # @option opts [Integer] :left_margin Left resulting image margin.
309
+ # @option opts [Integer] :right_margin Right resulting image margin.
310
+ # @option opts [Integer] :top_margin Top resulting image margin.
311
+ # @option opts [Integer] :bottom_margin Bottom resulting image margin.
312
+ # @option opts [String] :folder The document folder.
313
+ # @option opts [String] :storage The document storage.
314
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
315
+ def get_convert_document_to_pdf_by_url(source_url, opts = {})
316
+ data, _status_code, _headers = get_convert_document_to_pdf_by_url_with_http_info(source_url, opts)
317
+ return {file: data, status: _status_code, headers: _headers}
318
+ end
319
+
320
+ # Convert the HTML page from the web by its URL to PDF.
321
+ #
322
+ # @param source_url Source page URL.
323
+ # @param [Hash] opts the optional parameters
324
+ # @option opts [Integer] :width Resulting image width.
325
+ # @option opts [Integer] :height Resulting image height.
326
+ # @option opts [Integer] :left_margin Left resulting image margin.
327
+ # @option opts [Integer] :right_margin Right resulting image margin.
328
+ # @option opts [Integer] :top_margin Top resulting image margin.
329
+ # @option opts [Integer] :bottom_margin Bottom resulting image margin.
330
+ # @option opts [String] :folder The document folder.
331
+ # @option opts [String] :storage The document storage.
332
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
333
+ def get_convert_document_to_pdf_by_url_with_http_info(source_url, opts = {})
334
+ if @api_client.config.debug
335
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_pdf_by_url ..."
336
+ end
337
+ # verify the required parameter 'source_url' is set
338
+ if @api_client.config.client_side_validation && source_url.nil?
339
+ fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_convert_document_to_pdf_by_url"
340
+ end
341
+ # resource path
342
+ local_var_path = "/html/convert/pdf"
343
+
344
+ # query parameters
345
+ query_params = {}
346
+ query_params[:'sourceUrl'] = source_url
347
+ query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
348
+ query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
349
+ query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
350
+ query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
351
+ query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
352
+ query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
353
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
354
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
355
+
356
+ # header parameters
357
+ header_params = {}
358
+ # HTTP header 'Accept' (if needed)
359
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
360
+ # HTTP header 'Content-Type'
361
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
362
+
363
+ # form parameters
364
+ form_params = {}
365
+
366
+ # http body (model)
367
+ post_body = nil
368
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
369
+ :header_params => header_params,
370
+ :query_params => query_params,
371
+ :form_params => form_params,
372
+ :body => post_body,
373
+ :return_type => 'File')
374
+ if @api_client.config.debug
375
+ @api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_pdf_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
376
+ end
377
+ return data, status_code, headers
378
+ end
379
+
380
+ # Convert the HTML document from the storage by its name to XPS.
381
+ #
382
+ # @param name Document name.
383
+ # @param [Hash] opts the optional parameters
384
+ # @option opts [Integer] :width Resulting image width.
385
+ # @option opts [Integer] :height Resulting image height.
386
+ # @option opts [Integer] :left_margin Left resulting image margin.
387
+ # @option opts [Integer] :right_margin Right resulting image margin.
388
+ # @option opts [Integer] :top_margin Top resulting image margin.
389
+ # @option opts [Integer] :bottom_margin Bottom resulting image margin.
390
+ # @option opts [String] :folder The document folder.
391
+ # @option opts [String] :storage The document storage.
392
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
393
+ def get_convert_document_to_xps(name, opts = {})
394
+ data, _status_code, _headers = get_convert_document_to_xps_with_http_info(name, opts)
395
+ return {file: data, status: _status_code, headers: _headers}
396
+ end
397
+
398
+ # Convert the HTML document from the storage by its name to XPS.
399
+ #
400
+ # @param name Document name.
401
+ # @param [Hash] opts the optional parameters
402
+ # @option opts [Integer] :width Resulting image width.
403
+ # @option opts [Integer] :height Resulting image height.
404
+ # @option opts [Integer] :left_margin Left resulting image margin.
405
+ # @option opts [Integer] :right_margin Right resulting image margin.
406
+ # @option opts [Integer] :top_margin Top resulting image margin.
407
+ # @option opts [Integer] :bottom_margin Bottom resulting image margin.
408
+ # @option opts [String] :folder The document folder.
409
+ # @option opts [String] :storage The document storage.
410
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
411
+ def get_convert_document_to_xps_with_http_info(name, opts = {})
412
+ if @api_client.config.debug
413
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_xps ..."
414
+ end
415
+ # verify the required parameter 'name' is set
416
+ if @api_client.config.client_side_validation && name.nil?
417
+ fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_convert_document_to_xps"
418
+ end
419
+ # resource path
420
+ local_var_path = "/html/{name}/convert/xps".sub('{' + 'name' + '}', name.to_s)
421
+
422
+ # query parameters
423
+ query_params = {}
424
+ query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
425
+ query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
426
+ query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
427
+ query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
428
+ query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
429
+ query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
430
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
431
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
432
+
433
+ # header parameters
434
+ header_params = {}
435
+ # HTTP header 'Accept' (if needed)
436
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
437
+ # HTTP header 'Content-Type'
438
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
439
+
440
+ # form parameters
441
+ form_params = {}
442
+
443
+ # http body (model)
444
+ post_body = nil
445
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
446
+ :header_params => header_params,
447
+ :query_params => query_params,
448
+ :form_params => form_params,
449
+ :body => post_body,
450
+ :return_type => 'File')
451
+ if @api_client.config.debug
452
+ @api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_xps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
453
+ end
454
+ return data, status_code, headers
455
+ end
456
+
457
+ # Convert the HTML page from the web by its URL to XPS.
458
+ #
459
+ # @param source_url Source page URL.
460
+ # @param [Hash] opts the optional parameters
461
+ # @option opts [Integer] :width Resulting image width.
462
+ # @option opts [Integer] :height Resulting image height.
463
+ # @option opts [Integer] :left_margin Left resulting image margin.
464
+ # @option opts [Integer] :right_margin Right resulting image margin.
465
+ # @option opts [Integer] :top_margin Top resulting image margin.
466
+ # @option opts [Integer] :bottom_margin Bottom resulting image margin.
467
+ # @option opts [String] :folder The document folder.
468
+ # @option opts [String] :storage The document storage.
469
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
470
+ def get_convert_document_to_xps_by_url(source_url, opts = {})
471
+ data, _status_code, _headers = get_convert_document_to_xps_by_url_with_http_info(source_url, opts)
472
+ return {file: data, status: _status_code, headers: _headers}
473
+ end
474
+
475
+ # Convert the HTML page from the web by its URL to XPS.
476
+ #
477
+ # @param source_url Source page URL.
478
+ # @param [Hash] opts the optional parameters
479
+ # @option opts [Integer] :width Resulting image width.
480
+ # @option opts [Integer] :height Resulting image height.
481
+ # @option opts [Integer] :left_margin Left resulting image margin.
482
+ # @option opts [Integer] :right_margin Right resulting image margin.
483
+ # @option opts [Integer] :top_margin Top resulting image margin.
484
+ # @option opts [Integer] :bottom_margin Bottom resulting image margin.
485
+ # @option opts [String] :folder The document folder.
486
+ # @option opts [String] :storage The document storage.
487
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
488
+ def get_convert_document_to_xps_by_url_with_http_info(source_url, opts = {})
489
+ if @api_client.config.debug
490
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_xps_by_url ..."
491
+ end
492
+ # verify the required parameter 'source_url' is set
493
+ if @api_client.config.client_side_validation && source_url.nil?
494
+ fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_convert_document_to_xps_by_url"
495
+ end
496
+ # resource path
497
+ local_var_path = "/html/convert/xps"
498
+
499
+ # query parameters
500
+ query_params = {}
501
+ query_params[:'sourceUrl'] = source_url
502
+ query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
503
+ query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
504
+ query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
505
+ query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
506
+ query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
507
+ query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
508
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
509
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
510
+
511
+ # header parameters
512
+ header_params = {}
513
+ # HTTP header 'Accept' (if needed)
514
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
515
+ # HTTP header 'Content-Type'
516
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
517
+
518
+ # form parameters
519
+ form_params = {}
520
+
521
+ # http body (model)
522
+ post_body = nil
523
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
524
+ :header_params => header_params,
525
+ :query_params => query_params,
526
+ :form_params => form_params,
527
+ :body => post_body,
528
+ :return_type => 'File')
529
+ if @api_client.config.debug
530
+ @api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_xps_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
531
+ end
532
+ return data, status_code, headers
533
+ end
534
+
535
+
536
+ # Converts the HTML document (in request content) to the specified image format and uploads resulting file to storage.
537
+ #
538
+ # @param out_path Full resulting filename (ex. /folder1/folder2/result.jpg)
539
+ # @param out_format
540
+ # @param file A file to be converted.
541
+ # @param [Hash] opts the optional parameters
542
+ # @option opts [Integer] :width Resulting document page width in points (1/96 inch).
543
+ # @option opts [Integer] :height Resulting document page height in points (1/96 inch).
544
+ # @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
545
+ # @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
546
+ # @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
547
+ # @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
548
+ # @option opts [Integer] :resolution Resolution of resulting image. Default is 96 dpi.
549
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
550
+ def put_convert_document_in_request_to_image(out_path, out_format, file, opts = {})
551
+ data, _status_code, _headers = put_convert_document_in_request_to_image_with_http_info(out_path, out_format, file, opts)
552
+ return {file: data, status: _status_code, headers: _headers}
553
+ end
554
+
555
+ # Converts the HTML document (in request content) to the specified image format and uploads resulting file to storage.
556
+ #
557
+ # @param out_path Full resulting filename (ex. /folder1/folder2/result.jpg)
558
+ # @param out_format
559
+ # @param file A file to be converted.
560
+ # @param [Hash] opts the optional parameters
561
+ # @option opts [Integer] :width Resulting document page width in points (1/96 inch).
562
+ # @option opts [Integer] :height Resulting document page height in points (1/96 inch).
563
+ # @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
564
+ # @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
565
+ # @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
566
+ # @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
567
+ # @option opts [Integer] :resolution Resolution of resulting image. Default is 96 dpi.
568
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
569
+ def put_convert_document_in_request_to_image_with_http_info(out_path, out_format, file, opts = {})
570
+ if @api_client.config.debug
571
+ @api_client.config.logger.debug "Calling API: ConversionApi.put_convert_document_in_request_to_image ..."
572
+ end
573
+ # verify the required parameter 'out_path' is set
574
+ if @api_client.config.client_side_validation && out_path.nil?
575
+ fail ArgumentError, "Missing the required parameter 'out_path' when calling ConversionApi.put_convert_document_in_request_to_image"
576
+ end
577
+ # verify the required parameter 'out_format' is set
578
+ if @api_client.config.client_side_validation && out_format.nil?
579
+ fail ArgumentError, "Missing the required parameter 'out_format' when calling ConversionApi.put_convert_document_in_request_to_image"
580
+ end
581
+ # verify the required parameter 'file' is set
582
+ if @api_client.config.client_side_validation && file.nil?
583
+ fail ArgumentError, "Missing the required parameter 'file' when calling ConversionApi.put_convert_document_in_request_to_image"
584
+ end
585
+ # resource path
586
+ local_var_path = "/html/convert/image/{outFormat}".sub('{' + 'outFormat' + '}', out_format.to_s)
587
+
588
+ # query parameters
589
+ query_params = {}
590
+ query_params[:'outPath'] = out_path
591
+ query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
592
+ query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
593
+ query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
594
+ query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
595
+ query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
596
+ query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
597
+ query_params[:'resolution'] = opts[:'resolution'] if !opts[:'resolution'].nil?
598
+
599
+ # header parameters
600
+ header_params = {}
601
+ # HTTP header 'Accept' (if needed)
602
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
603
+ # HTTP header 'Content-Type'
604
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])
605
+
606
+ # form parameters
607
+ form_params = {}
608
+
609
+ # http body (model)
610
+ post_body = ::File.open(file,"rb").read
611
+
612
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
613
+ :header_params => header_params,
614
+ :query_params => query_params,
615
+ :form_params => form_params,
616
+ :body => post_body,
617
+ :return_type => 'File')
618
+ if @api_client.config.debug
619
+ @api_client.config.logger.debug "API called: ConversionApi#put_convert_document_in_request_to_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
620
+ end
621
+ return data, status_code, headers
622
+ end
623
+
624
+ # Converts the HTML document (in request content) to PDF and uploads resulting file to storage.
625
+ #
626
+ # @param out_path Full resulting filename (ex. /folder1/folder2/result.pdf)
627
+ # @param file A file to be converted.
628
+ # @param [Hash] opts the optional parameters
629
+ # @option opts [Integer] :width Resulting document page width in points (1/96 inch).
630
+ # @option opts [Integer] :height Resulting document page height in points (1/96 inch).
631
+ # @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
632
+ # @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
633
+ # @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
634
+ # @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
635
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
636
+ def put_convert_document_in_request_to_pdf(out_path, file, opts = {})
637
+ data, _status_code, _headers = put_convert_document_in_request_to_pdf_with_http_info(out_path, file, opts)
638
+ return {file: data, status: _status_code, headers: _headers}
639
+ end
640
+
641
+ # Converts the HTML document (in request content) to PDF and uploads resulting file to storage.
642
+ #
643
+ # @param out_path Full resulting filename (ex. /folder1/folder2/result.pdf)
644
+ # @param file A file to be converted.
645
+ # @param [Hash] opts the optional parameters
646
+ # @option opts [Integer] :width Resulting document page width in points (1/96 inch).
647
+ # @option opts [Integer] :height Resulting document page height in points (1/96 inch).
648
+ # @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
649
+ # @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
650
+ # @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
651
+ # @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
652
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
653
+ def put_convert_document_in_request_to_pdf_with_http_info(out_path, file, opts = {})
654
+ if @api_client.config.debug
655
+ @api_client.config.logger.debug "Calling API: ConversionApi.put_convert_document_in_request_to_pdf ..."
656
+ end
657
+ # verify the required parameter 'out_path' is set
658
+ if @api_client.config.client_side_validation && out_path.nil?
659
+ fail ArgumentError, "Missing the required parameter 'out_path' when calling ConversionApi.put_convert_document_in_request_to_pdf"
660
+ end
661
+ # verify the required parameter 'file' is set
662
+ if @api_client.config.client_side_validation && file.nil?
663
+ fail ArgumentError, "Missing the required parameter 'file' when calling ConversionApi.put_convert_document_in_request_to_pdf"
664
+ end
665
+ # resource path
666
+ local_var_path = "/html/convert/pdf"
667
+
668
+ # query parameters
669
+ query_params = {}
670
+ query_params[:'outPath'] = out_path
671
+ query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
672
+ query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
673
+ query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
674
+ query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
675
+ query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
676
+ query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
677
+
678
+ # header parameters
679
+ header_params = {}
680
+ # HTTP header 'Accept' (if needed)
681
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
682
+ # HTTP header 'Content-Type'
683
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])
684
+
685
+ # form parameters
686
+ form_params = {}
687
+
688
+ # http body (model)
689
+ post_body = ::File.open(file,"rb").read
690
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
691
+ :header_params => header_params,
692
+ :query_params => query_params,
693
+ :form_params => form_params,
694
+ :body => post_body,
695
+ :return_type => 'File')
696
+ if @api_client.config.debug
697
+ @api_client.config.logger.debug "API called: ConversionApi#put_convert_document_in_request_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
698
+ end
699
+ return data, status_code, headers
700
+ end
701
+
702
+ # Converts the HTML document (in request content) to XPS and uploads resulting file to storage.
703
+ #
704
+ # @param out_path Full resulting filename (ex. /folder1/folder2/result.xps)
705
+ # @param file A file to be converted.
706
+ # @param [Hash] opts the optional parameters
707
+ # @option opts [Integer] :width Resulting document page width in points (1/96 inch).
708
+ # @option opts [Integer] :height Resulting document page height in points (1/96 inch).
709
+ # @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
710
+ # @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
711
+ # @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
712
+ # @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
713
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
714
+ def put_convert_document_in_request_to_xps(out_path, file, opts = {})
715
+ data, _status_code, _headers = put_convert_document_in_request_to_xps_with_http_info(out_path, file, opts)
716
+ return {file: data, status: _status_code, headers: _headers}
717
+ end
718
+
719
+ # Converts the HTML document (in request content) to XPS and uploads resulting file to storage.
720
+ #
721
+ # @param out_path Full resulting filename (ex. /folder1/folder2/result.xps)
722
+ # @param file A file to be converted.
723
+ # @param [Hash] opts the optional parameters
724
+ # @option opts [Integer] :width Resulting document page width in points (1/96 inch).
725
+ # @option opts [Integer] :height Resulting document page height in points (1/96 inch).
726
+ # @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
727
+ # @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
728
+ # @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
729
+ # @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
730
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
731
+ def put_convert_document_in_request_to_xps_with_http_info(out_path, file, opts = {})
732
+ if @api_client.config.debug
733
+ @api_client.config.logger.debug "Calling API: ConversionApi.put_convert_document_in_request_to_xps ..."
734
+ end
735
+ # verify the required parameter 'out_path' is set
736
+ if @api_client.config.client_side_validation && out_path.nil?
737
+ fail ArgumentError, "Missing the required parameter 'out_path' when calling ConversionApi.put_convert_document_in_request_to_xps"
738
+ end
739
+ # verify the required parameter 'file' is set
740
+ if @api_client.config.client_side_validation && file.nil?
741
+ fail ArgumentError, "Missing the required parameter 'file' when calling ConversionApi.put_convert_document_in_request_to_xps"
742
+ end
743
+ # resource path
744
+ local_var_path = "/html/convert/xps"
745
+
746
+ # query parameters
747
+ query_params = {}
748
+ query_params[:'outPath'] = out_path
749
+ query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
750
+ query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
751
+ query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
752
+ query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
753
+ query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
754
+ query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
755
+
756
+ # header parameters
757
+ header_params = {}
758
+ # HTTP header 'Accept' (if needed)
759
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
760
+ # HTTP header 'Content-Type'
761
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream'])
762
+
763
+ # form parameters
764
+ form_params = {}
765
+
766
+ # http body (model)
767
+ post_body = ::File.open(file,"rb").read
768
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
769
+ :header_params => header_params,
770
+ :query_params => query_params,
771
+ :form_params => form_params,
772
+ :body => post_body,
773
+ :return_type => 'File')
774
+ if @api_client.config.debug
775
+ @api_client.config.logger.debug "API called: ConversionApi#put_convert_document_in_request_to_xps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
776
+ end
777
+ return data, status_code, headers
778
+ end
779
+
780
+ # Converts the HTML document (located on storage) to the specified image format and uploads resulting file to storage.
781
+ #
782
+ # @param name Document name.
783
+ # @param out_path Full resulting filename (ex. /folder1/folder2/result.jpg)
784
+ # @param out_format
785
+ # @param [Hash] opts the optional parameters
786
+ # @option opts [Integer] :width Resulting document page width in points (1/96 inch).
787
+ # @option opts [Integer] :height Resulting document page height in points (1/96 inch).
788
+ # @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
789
+ # @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
790
+ # @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
791
+ # @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
792
+ # @option opts [Integer] :resolution Resolution of resulting image. Default is 96 dpi.
793
+ # @option opts [String] :folder The source document folder.
794
+ # @option opts [String] :storage The source and resulting document storage.
795
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
796
+ def put_convert_document_to_image(name, out_path, out_format, opts = {})
797
+ data, _status_code, _headers = put_convert_document_to_image_with_http_info(name, out_path, out_format, opts)
798
+ return {file: data, status: _status_code, headers: _headers}
799
+ end
800
+
801
+ # Converts the HTML document (located on storage) to the specified image format and uploads resulting file to storage.
802
+ #
803
+ # @param name Document name.
804
+ # @param out_path Full resulting filename (ex. /folder1/folder2/result.jpg)
805
+ # @param out_format
806
+ # @param [Hash] opts the optional parameters
807
+ # @option opts [Integer] :width Resulting document page width in points (1/96 inch).
808
+ # @option opts [Integer] :height Resulting document page height in points (1/96 inch).
809
+ # @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
810
+ # @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
811
+ # @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
812
+ # @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
813
+ # @option opts [Integer] :resolution Resolution of resulting image. Default is 96 dpi.
814
+ # @option opts [String] :folder The source document folder.
815
+ # @option opts [String] :storage The source and resulting document storage.
816
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
817
+ def put_convert_document_to_image_with_http_info(name, out_path, out_format, opts = {})
818
+ if @api_client.config.debug
819
+ @api_client.config.logger.debug "Calling API: ConversionApi.put_convert_document_to_image ..."
820
+ end
821
+ # verify the required parameter 'name' is set
822
+ if @api_client.config.client_side_validation && name.nil?
823
+ fail ArgumentError, "Missing the required parameter 'name' when calling ConversionApi.put_convert_document_to_image"
824
+ end
825
+ # verify the required parameter 'out_path' is set
826
+ if @api_client.config.client_side_validation && out_path.nil?
827
+ fail ArgumentError, "Missing the required parameter 'out_path' when calling ConversionApi.put_convert_document_to_image"
828
+ end
829
+ # verify the required parameter 'out_format' is set
830
+ if @api_client.config.client_side_validation && out_format.nil?
831
+ fail ArgumentError, "Missing the required parameter 'out_format' when calling ConversionApi.put_convert_document_to_image"
832
+ end
833
+ # resource path
834
+ local_var_path = "/html/{name}/convert/image/{outFormat}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'outFormat' + '}', out_format.to_s)
835
+
836
+ # query parameters
837
+ query_params = {}
838
+ query_params[:'outPath'] = out_path
839
+ query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
840
+ query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
841
+ query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
842
+ query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
843
+ query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
844
+ query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
845
+ query_params[:'resolution'] = opts[:'resolution'] if !opts[:'resolution'].nil?
846
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
847
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
848
+
849
+ # header parameters
850
+ header_params = {}
851
+ # HTTP header 'Accept' (if needed)
852
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
853
+ # HTTP header 'Content-Type'
854
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
855
+
856
+ # form parameters
857
+ form_params = {}
858
+
859
+ # http body (model)
860
+ post_body = nil
861
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
862
+ :header_params => header_params,
863
+ :query_params => query_params,
864
+ :form_params => form_params,
865
+ :body => post_body,
866
+ :return_type => 'File')
867
+ if @api_client.config.debug
868
+ @api_client.config.logger.debug "API called: ConversionApi#put_convert_document_to_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
869
+ end
870
+ return data, status_code, headers
871
+ end
872
+
873
+ # Converts the HTML document (located on storage) to PDF and uploads resulting file to storage.
874
+ #
875
+ # @param name Document name.
876
+ # @param out_path Full resulting filename (ex. /folder1/folder2/result.pdf)
877
+ # @param [Hash] opts the optional parameters
878
+ # @option opts [Integer] :width Resulting document page width in points (1/96 inch).
879
+ # @option opts [Integer] :height Resulting document page height in points (1/96 inch).
880
+ # @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
881
+ # @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
882
+ # @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
883
+ # @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
884
+ # @option opts [String] :folder The source document folder.
885
+ # @option opts [String] :storage The source and resulting document storage.
886
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
887
+ def put_convert_document_to_pdf(name, out_path, opts = {})
888
+ data, _status_code, _headers = put_convert_document_to_pdf_with_http_info(name, out_path, opts)
889
+ return {file: data, status: _status_code, headers: _headers}
890
+ end
891
+
892
+ # Converts the HTML document (located on storage) to PDF and uploads resulting file to storage.
893
+ #
894
+ # @param name Document name.
895
+ # @param out_path Full resulting filename (ex. /folder1/folder2/result.pdf)
896
+ # @param [Hash] opts the optional parameters
897
+ # @option opts [Integer] :width Resulting document page width in points (1/96 inch).
898
+ # @option opts [Integer] :height Resulting document page height in points (1/96 inch).
899
+ # @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
900
+ # @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
901
+ # @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
902
+ # @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
903
+ # @option opts [String] :folder The source document folder.
904
+ # @option opts [String] :storage The source and resulting document storage.
905
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
906
+ def put_convert_document_to_pdf_with_http_info(name, out_path, opts = {})
907
+ if @api_client.config.debug
908
+ @api_client.config.logger.debug "Calling API: ConversionApi.put_convert_document_to_pdf ..."
909
+ end
910
+ # verify the required parameter 'name' is set
911
+ if @api_client.config.client_side_validation && name.nil?
912
+ fail ArgumentError, "Missing the required parameter 'name' when calling ConversionApi.put_convert_document_to_pdf"
913
+ end
914
+ # verify the required parameter 'out_path' is set
915
+ if @api_client.config.client_side_validation && out_path.nil?
916
+ fail ArgumentError, "Missing the required parameter 'out_path' when calling ConversionApi.put_convert_document_to_pdf"
917
+ end
918
+ # resource path
919
+ local_var_path = "/html/{name}/convert/pdf".sub('{' + 'name' + '}', name.to_s)
920
+
921
+ # query parameters
922
+ query_params = {}
923
+ query_params[:'outPath'] = out_path
924
+ query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
925
+ query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
926
+ query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
927
+ query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
928
+ query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
929
+ query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
930
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
931
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
932
+
933
+ # header parameters
934
+ header_params = {}
935
+ # HTTP header 'Accept' (if needed)
936
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
937
+ # HTTP header 'Content-Type'
938
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
939
+
940
+ # form parameters
941
+ form_params = {}
942
+
943
+ # http body (model)
944
+ post_body = nil
945
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
946
+ :header_params => header_params,
947
+ :query_params => query_params,
948
+ :form_params => form_params,
949
+ :body => post_body,
950
+ :return_type => 'File')
951
+ if @api_client.config.debug
952
+ @api_client.config.logger.debug "API called: ConversionApi#put_convert_document_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
953
+ end
954
+ return data, status_code, headers
955
+ end
956
+
957
+ # Converts the HTML document (located on storage) to XPS and uploads resulting file to storage.
958
+ #
959
+ # @param name Document name.
960
+ # @param out_path Full resulting filename (ex. /folder1/folder2/result.xps)
961
+ # @param [Hash] opts the optional parameters
962
+ # @option opts [Integer] :width Resulting document page width in points (1/96 inch).
963
+ # @option opts [Integer] :height Resulting document page height in points (1/96 inch).
964
+ # @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
965
+ # @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
966
+ # @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
967
+ # @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
968
+ # @option opts [String] :folder The source document folder.
969
+ # @option opts [String] :storage The source and resulting document storage.
970
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
971
+ def put_convert_document_to_xps(name, out_path, opts = {})
972
+ data, _status_code, _headers = put_convert_document_to_xps_with_http_info(name, out_path, opts)
973
+ return {file: data, status: _status_code, headers: _headers}
974
+ end
975
+
976
+ # Converts the HTML document (located on storage) to XPS and uploads resulting file to storage.
977
+ #
978
+ # @param name Document name.
979
+ # @param out_path Full resulting filename (ex. /folder1/folder2/result.xps)
980
+ # @param [Hash] opts the optional parameters
981
+ # @option opts [Integer] :width Resulting document page width in points (1/96 inch).
982
+ # @option opts [Integer] :height Resulting document page height in points (1/96 inch).
983
+ # @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
984
+ # @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
985
+ # @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
986
+ # @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
987
+ # @option opts [String] :folder The source document folder.
988
+ # @option opts [String] :storage The source and resulting document storage.
989
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
990
+ def put_convert_document_to_xps_with_http_info(name, out_path, opts = {})
991
+ if @api_client.config.debug
992
+ @api_client.config.logger.debug "Calling API: ConversionApi.put_convert_document_to_xps ..."
993
+ end
994
+ # verify the required parameter 'name' is set
995
+ if @api_client.config.client_side_validation && name.nil?
996
+ fail ArgumentError, "Missing the required parameter 'name' when calling ConversionApi.put_convert_document_to_xps"
997
+ end
998
+ # verify the required parameter 'out_path' is set
999
+ if @api_client.config.client_side_validation && out_path.nil?
1000
+ fail ArgumentError, "Missing the required parameter 'out_path' when calling ConversionApi.put_convert_document_to_xps"
1001
+ end
1002
+ # resource path
1003
+ local_var_path = "/html/{name}/convert/xps".sub('{' + 'name' + '}', name.to_s)
1004
+
1005
+ # query parameters
1006
+ query_params = {}
1007
+ query_params[:'outPath'] = out_path
1008
+ query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
1009
+ query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
1010
+ query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
1011
+ query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
1012
+ query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
1013
+ query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
1014
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
1015
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
1016
+
1017
+ # header parameters
1018
+ header_params = {}
1019
+ # HTTP header 'Accept' (if needed)
1020
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1021
+ # HTTP header 'Content-Type'
1022
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1023
+
1024
+ # form parameters
1025
+ form_params = {}
1026
+
1027
+ # http body (model)
1028
+ post_body = nil
1029
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
1030
+ :header_params => header_params,
1031
+ :query_params => query_params,
1032
+ :form_params => form_params,
1033
+ :body => post_body,
1034
+ :return_type => 'File')
1035
+ if @api_client.config.debug
1036
+ @api_client.config.logger.debug "API called: ConversionApi#put_convert_document_to_xps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1037
+ end
1038
+ return data, status_code, headers
1039
+ end
1040
+
1041
+
1042
+ ################################################################################
1043
+ # Document Api
1044
+ ################################################################################
1045
+
1046
+
1047
+ # Return the HTML document by the name from default or specified storage.
1048
+ #
1049
+ # @param name The document name.
1050
+ # @param [Hash] opts the optional parameters
1051
+ # @option opts [String] :storage The document folder
1052
+ # @option opts [String] :folder The document folder.
1053
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1054
+ def get_document(name, opts = {})
1055
+ data, _status_code, _headers = get_document_with_http_info(name, opts)
1056
+ return {file: data, status: _status_code, headers: _headers}
1057
+ end
1058
+
1059
+ # Return the HTML document by the name from default or specified storage.
1060
+ #
1061
+ # @param name The document name.
1062
+ # @param [Hash] opts the optional parameters
1063
+ # @option opts [String] :storage The document folder
1064
+ # @option opts [String] :folder The document folder.
1065
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1066
+ def get_document_with_http_info(name, opts = {})
1067
+ if @api_client.config.debug
1068
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_document ..."
1069
+ end
1070
+ # verify the required parameter 'name' is set
1071
+ if @api_client.config.client_side_validation && name.nil?
1072
+ fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_document"
1073
+ end
1074
+ # resource path
1075
+ local_var_path = "/html/{name}".sub('{' + 'name' + '}', name.to_s)
1076
+
1077
+ # query parameters
1078
+ query_params = {}
1079
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
1080
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
1081
+
1082
+ # header parameters
1083
+ header_params = {}
1084
+ # HTTP header 'Accept' (if needed)
1085
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data', 'application/zip'])
1086
+ # HTTP header 'Content-Type'
1087
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1088
+
1089
+ # form parameters
1090
+ form_params = {}
1091
+
1092
+ # http body (model)
1093
+ post_body = nil
1094
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1095
+ :header_params => header_params,
1096
+ :query_params => query_params,
1097
+ :form_params => form_params,
1098
+ :body => post_body,
1099
+ :return_type => 'File')
1100
+ if @api_client.config.debug
1101
+ @api_client.config.logger.debug "API called: HtmlApi#get_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1102
+ end
1103
+ return data, status_code, headers
1104
+ end
1105
+
1106
+ # Return list of HTML fragments matching the specified XPath query.
1107
+ #
1108
+ # @param name The document name.
1109
+ # @param x_path XPath query string.
1110
+ # @param out_format Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.
1111
+ # @param [Hash] opts the optional parameters
1112
+ # @option opts [String] :storage The document storage.
1113
+ # @option opts [String] :folder The document folder.
1114
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1115
+ def get_document_fragment_by_x_path(name, x_path, out_format, opts = {})
1116
+ data, _status_code, _headers = get_document_fragment_by_x_path_with_http_info(name, x_path, out_format, opts)
1117
+ return {file: data, status: _status_code, headers: _headers}
1118
+ end
1119
+
1120
+ # Return list of HTML fragments matching the specified XPath query.
1121
+ #
1122
+ # @param name The document name.
1123
+ # @param x_path XPath query string.
1124
+ # @param out_format Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.
1125
+ # @param [Hash] opts the optional parameters
1126
+ # @option opts [String] :storage The document storage.
1127
+ # @option opts [String] :folder The document folder.
1128
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1129
+ def get_document_fragment_by_x_path_with_http_info(name, x_path, out_format, opts = {})
1130
+ if @api_client.config.debug
1131
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_document_fragment_by_x_path ..."
1132
+ end
1133
+ # verify the required parameter 'name' is set
1134
+ if @api_client.config.client_side_validation && name.nil?
1135
+ fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_document_fragment_by_x_path"
1136
+ end
1137
+ # verify the required parameter 'x_path' is set
1138
+ if @api_client.config.client_side_validation && x_path.nil?
1139
+ fail ArgumentError, "Missing the required parameter 'x_path' when calling HtmlApi.get_document_fragment_by_x_path"
1140
+ end
1141
+ # verify the required parameter 'out_format' is set
1142
+ if @api_client.config.client_side_validation && out_format.nil?
1143
+ fail ArgumentError, "Missing the required parameter 'out_format' when calling HtmlApi.get_document_fragment_by_x_path"
1144
+ end
1145
+ # resource path
1146
+ local_var_path = "/html/{name}/fragments/{outFormat}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'outFormat' + '}', out_format.to_s)
1147
+
1148
+ # query parameters
1149
+ query_params = {}
1150
+ query_params[:'xPath'] = x_path
1151
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
1152
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
1153
+
1154
+ # header parameters
1155
+ header_params = {}
1156
+ # HTTP header 'Accept' (if needed)
1157
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
1158
+ # HTTP header 'Content-Type'
1159
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1160
+
1161
+ # form parameters
1162
+ form_params = {}
1163
+
1164
+ # http body (model)
1165
+ post_body = nil
1166
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1167
+ :header_params => header_params,
1168
+ :query_params => query_params,
1169
+ :form_params => form_params,
1170
+ :body => post_body,
1171
+ :return_type => 'File')
1172
+ if @api_client.config.debug
1173
+ @api_client.config.logger.debug "API called: HtmlApi#get_document_fragment_by_x_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1174
+ end
1175
+ return data, status_code, headers
1176
+ end
1177
+
1178
+ # Return list of HTML fragments matching the specified XPath query by the source page URL.
1179
+ #
1180
+ # @param source_url Source page URL.
1181
+ # @param x_path XPath query string.
1182
+ # @param out_format Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.
1183
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1184
+ def get_document_fragment_by_x_path_by_url(source_url, x_path, out_format)
1185
+ data, _status_code, _headers = get_document_fragment_by_x_path_by_url_with_http_info(source_url, x_path, out_format)
1186
+ return {file: data, status: _status_code, headers: _headers}
1187
+ end
1188
+
1189
+ # Return list of HTML fragments matching the specified XPath query by the source page URL.
1190
+ #
1191
+ # @param source_url Source page URL.
1192
+ # @param x_path XPath query string.
1193
+ # @param out_format Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.
1194
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1195
+ def get_document_fragment_by_x_path_by_url_with_http_info(source_url, x_path, out_format)
1196
+ if @api_client.config.debug
1197
+ @api_client.config.logger.debug "Calling API: DocumentApi.get_document_fragment_by_x_path_by_url ..."
1198
+ end
1199
+ # verify the required parameter 'source_url' is set
1200
+ if @api_client.config.client_side_validation && source_url.nil?
1201
+ fail ArgumentError, "Missing the required parameter 'source_url' when calling DocumentApi.get_document_fragment_by_x_path_by_url"
1202
+ end
1203
+ # verify the required parameter 'x_path' is set
1204
+ if @api_client.config.client_side_validation && x_path.nil?
1205
+ fail ArgumentError, "Missing the required parameter 'x_path' when calling DocumentApi.get_document_fragment_by_x_path_by_url"
1206
+ end
1207
+ # verify the required parameter 'out_format' is set
1208
+ if @api_client.config.client_side_validation && out_format.nil?
1209
+ fail ArgumentError, "Missing the required parameter 'out_format' when calling DocumentApi.get_document_fragment_by_x_path_by_url"
1210
+ end
1211
+ # resource path
1212
+ local_var_path = "/html/fragments/{outFormat}".sub('{' + 'outFormat' + '}', out_format.to_s)
1213
+
1214
+ # query parameters
1215
+ query_params = {}
1216
+ query_params[:'sourceUrl'] = source_url
1217
+ query_params[:'xPath'] = x_path
1218
+
1219
+ # header parameters
1220
+ header_params = {}
1221
+ # HTTP header 'Accept' (if needed)
1222
+ header_params['Accept'] = @api_client.select_header_accept(['application/zip'])
1223
+ # HTTP header 'Content-Type'
1224
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1225
+
1226
+ # form parameters
1227
+ form_params = {}
1228
+
1229
+ # http body (model)
1230
+ post_body = nil
1231
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1232
+ :header_params => header_params,
1233
+ :query_params => query_params,
1234
+ :form_params => form_params,
1235
+ :body => post_body,
1236
+ :return_type => 'File')
1237
+ if @api_client.config.debug
1238
+ @api_client.config.logger.debug "API called: DocumentApi#get_document_fragment_by_x_path_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1239
+ end
1240
+ return data, status_code, headers
1241
+ end
1242
+
1243
+ # Return list of HTML fragments matching the specified CSS selector.
1244
+ #
1245
+ # @param name The document name.
1246
+ # @param selector CSS selector string.
1247
+ # @param out_format Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.
1248
+ # @param [Hash] opts the optional parameters
1249
+ # @option opts [String] :folder The document folder.
1250
+ # @option opts [String] :storage The document storage.
1251
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1252
+ def get_document_fragments_by_css_selector(name, selector, out_format, opts = {})
1253
+ data, _status_code, _headers = get_document_fragments_by_css_selector_with_http_info(name, selector, out_format, opts)
1254
+ return {file: data, status: _status_code, headers: _headers}
1255
+ end
1256
+
1257
+ # Return list of HTML fragments matching the specified CSS selector.
1258
+ #
1259
+ # @param name The document name.
1260
+ # @param selector CSS selector string.
1261
+ # @param out_format Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.
1262
+ # @param [Hash] opts the optional parameters
1263
+ # @option opts [String] :folder The document folder.
1264
+ # @option opts [String] :storage The document storage.
1265
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1266
+ def get_document_fragments_by_css_selector_with_http_info(name, selector, out_format, opts = {})
1267
+ if @api_client.config.debug
1268
+ @api_client.config.logger.debug "Calling API: DocumentApi.get_document_fragments_by_css_selector ..."
1269
+ end
1270
+ # verify the required parameter 'name' is set
1271
+ if @api_client.config.client_side_validation && name.nil?
1272
+ fail ArgumentError, "Missing the required parameter 'name' when calling DocumentApi.get_document_fragments_by_css_selector"
1273
+ end
1274
+ # verify the required parameter 'selector' is set
1275
+ if @api_client.config.client_side_validation && selector.nil?
1276
+ fail ArgumentError, "Missing the required parameter 'selector' when calling DocumentApi.get_document_fragments_by_css_selector"
1277
+ end
1278
+ # verify the required parameter 'out_format' is set
1279
+ if @api_client.config.client_side_validation && out_format.nil?
1280
+ fail ArgumentError, "Missing the required parameter 'out_format' when calling DocumentApi.get_document_fragments_by_css_selector"
1281
+ end
1282
+ # resource path
1283
+ local_var_path = "/html/{name}/fragments/css/{outFormat}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'outFormat' + '}', out_format.to_s)
1284
+
1285
+ # query parameters
1286
+ query_params = {}
1287
+ query_params[:'selector'] = selector
1288
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
1289
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
1290
+
1291
+ # header parameters
1292
+ header_params = {}
1293
+ # HTTP header 'Accept' (if needed)
1294
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
1295
+ # HTTP header 'Content-Type'
1296
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1297
+
1298
+ # form parameters
1299
+ form_params = {}
1300
+
1301
+ # http body (model)
1302
+ post_body = nil
1303
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1304
+ :header_params => header_params,
1305
+ :query_params => query_params,
1306
+ :form_params => form_params,
1307
+ :body => post_body,
1308
+ :return_type => 'File')
1309
+ if @api_client.config.debug
1310
+ @api_client.config.logger.debug "API called: DocumentApi#get_document_fragments_by_css_selector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1311
+ end
1312
+ return data, status_code, headers
1313
+ end
1314
+
1315
+ # Return list of HTML fragments matching the specified CSS selector by the source page URL.
1316
+ #
1317
+ # @param source_url Source page URL.
1318
+ # @param selector CSS selector string.
1319
+ # @param out_format Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.
1320
+ # @param [Hash] opts the optional parameters
1321
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1322
+ def get_document_fragments_by_css_selector_by_url(source_url, selector, out_format, opts = {})
1323
+ data, _status_code, _headers = get_document_fragments_by_css_selector_by_url_with_http_info(source_url, selector, out_format, opts)
1324
+ return {file: data, status: _status_code, headers: _headers}
1325
+ end
1326
+
1327
+ # Return list of HTML fragments matching the specified CSS selector by the source page URL.
1328
+ #
1329
+ # @param source_url Source page URL.
1330
+ # @param selector CSS selector string.
1331
+ # @param out_format Output format. Possible values: &#39;plain&#39; and &#39;json&#39;.
1332
+ # @param [Hash] opts the optional parameters
1333
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1334
+ def get_document_fragments_by_css_selector_by_url_with_http_info(source_url, selector, out_format, opts = {})
1335
+ if @api_client.config.debug
1336
+ @api_client.config.logger.debug "Calling API: DocumentApi.get_document_fragments_by_css_selector_by_url ..."
1337
+ end
1338
+ # verify the required parameter 'source_url' is set
1339
+ if @api_client.config.client_side_validation && source_url.nil?
1340
+ fail ArgumentError, "Missing the required parameter 'source_url' when calling DocumentApi.get_document_fragments_by_css_selector_by_url"
1341
+ end
1342
+ # verify the required parameter 'selector' is set
1343
+ if @api_client.config.client_side_validation && selector.nil?
1344
+ fail ArgumentError, "Missing the required parameter 'selector' when calling DocumentApi.get_document_fragments_by_css_selector_by_url"
1345
+ end
1346
+ # verify the required parameter 'out_format' is set
1347
+ if @api_client.config.client_side_validation && out_format.nil?
1348
+ fail ArgumentError, "Missing the required parameter 'out_format' when calling DocumentApi.get_document_fragments_by_css_selector_by_url"
1349
+ end
1350
+ # resource path
1351
+ local_var_path = "/html/fragments/css/{outFormat}".sub('{' + 'outFormat' + '}', out_format.to_s)
1352
+
1353
+ # query parameters
1354
+ query_params = {}
1355
+ query_params[:'sourceUrl'] = source_url
1356
+ query_params[:'selector'] = selector
1357
+
1358
+ # header parameters
1359
+ header_params = {}
1360
+ # HTTP header 'Accept' (if needed)
1361
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
1362
+ # HTTP header 'Content-Type'
1363
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1364
+
1365
+ # form parameters
1366
+ form_params = {}
1367
+
1368
+ # http body (model)
1369
+ post_body = nil
1370
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1371
+ :header_params => header_params,
1372
+ :query_params => query_params,
1373
+ :form_params => form_params,
1374
+ :body => post_body,
1375
+ :return_type => 'File')
1376
+ if @api_client.config.debug
1377
+ @api_client.config.logger.debug "API called: DocumentApi#get_document_fragments_by_css_selector_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1378
+ end
1379
+ return data, status_code, headers
1380
+ end
1381
+
1382
+ # Return all HTML document images packaged as a ZIP archive.
1383
+ #
1384
+ # @param name The document name.
1385
+ # @param [Hash] opts the optional parameters
1386
+ # @option opts [String] :folder The document folder.
1387
+ # @option opts [String] :storage The document storage.
1388
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1389
+ def get_document_images(name, opts = {})
1390
+ data, _status_code, _headers = get_document_images_with_http_info(name, opts)
1391
+ return {file: data, status: _status_code, headers: _headers}
1392
+ end
1393
+
1394
+ # Return all HTML document images packaged as a ZIP archive.
1395
+ #
1396
+ # @param name The document name.
1397
+ # @param [Hash] opts the optional parameters
1398
+ # @option opts [String] :folder The document folder.
1399
+ # @option opts [String] :storage The document storage.
1400
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1401
+ def get_document_images_with_http_info(name, opts = {})
1402
+ if @api_client.config.debug
1403
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_document_images ..."
1404
+ end
1405
+ # verify the required parameter 'name' is set
1406
+ if @api_client.config.client_side_validation && name.nil?
1407
+ fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_document_images"
1408
+ end
1409
+ # resource path
1410
+ local_var_path = "/html/{name}/images/all".sub('{' + 'name' + '}', name.to_s)
1411
+
1412
+ # query parameters
1413
+ query_params = {}
1414
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
1415
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
1416
+
1417
+ # header parameters
1418
+ header_params = {}
1419
+ # HTTP header 'Accept' (if needed)
1420
+ header_params['Accept'] = @api_client.select_header_accept(['application/zip'])
1421
+ # HTTP header 'Content-Type'
1422
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1423
+
1424
+ # form parameters
1425
+ form_params = {}
1426
+
1427
+ # http body (model)
1428
+ post_body = nil
1429
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1430
+ :header_params => header_params,
1431
+ :query_params => query_params,
1432
+ :form_params => form_params,
1433
+ :body => post_body,
1434
+ :return_type => 'File')
1435
+ if @api_client.config.debug
1436
+ @api_client.config.logger.debug "API called: HtmlApi#get_document_images\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1437
+ end
1438
+ return data, status_code, headers
1439
+ end
1440
+
1441
+
1442
+ # Return all HTML page images packaged as a ZIP archive by the source page URL.
1443
+ #
1444
+ # @param source_url Source page URL.
1445
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1446
+ def get_document_images_by_url(source_url)
1447
+ data, _status_code, _headers = get_document_images_by_url_with_http_info(source_url)
1448
+ return {file: data, status: _status_code, headers: _headers}
1449
+ end
1450
+
1451
+ # Return all HTML page images packaged as a ZIP archive by the source page URL.
1452
+ #
1453
+ # @param source_url Source page URL.
1454
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1455
+ def get_document_images_by_url_with_http_info(source_url)
1456
+ if @api_client.config.debug
1457
+ @api_client.config.logger.debug "Calling API: DocumentApi.get_document_images_by_url ..."
1458
+ end
1459
+ # verify the required parameter 'source_url' is set
1460
+ if @api_client.config.client_side_validation && source_url.nil?
1461
+ fail ArgumentError, "Missing the required parameter 'source_url' when calling DocumentApi.get_document_images_by_url"
1462
+ end
1463
+ # resource path
1464
+ local_var_path = "/html/images/all"
1465
+
1466
+ # query parameters
1467
+ query_params = {}
1468
+ query_params[:'sourceUrl'] = source_url
1469
+
1470
+ # header parameters
1471
+ header_params = {}
1472
+ # HTTP header 'Accept' (if needed)
1473
+ header_params['Accept'] = @api_client.select_header_accept(['application/zip'])
1474
+ # HTTP header 'Content-Type'
1475
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1476
+
1477
+ # form parameters
1478
+ form_params = {}
1479
+
1480
+ # http body (model)
1481
+ post_body = nil
1482
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1483
+ :header_params => header_params,
1484
+ :query_params => query_params,
1485
+ :form_params => form_params,
1486
+ :body => post_body,
1487
+ :return_type => 'File')
1488
+ if @api_client.config.debug
1489
+ @api_client.config.logger.debug "API called: DocumentApi#get_document_images_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1490
+ end
1491
+ return data, status_code, headers
1492
+ end
1493
+
1494
+ ################################################################################
1495
+ # OCR Api
1496
+ ################################################################################
1497
+
1498
+
1499
+ # Recognize text from the image file in the storage and import it to HTML format.
1500
+ #
1501
+ # @param name The image file name.
1502
+ # @param [Hash] opts the optional parameters
1503
+ # @option opts [String] :ocr_engine_lang OCR engine language - language (default to en)
1504
+ # @option opts [String] :folder The source image folder.
1505
+ # @option opts [String] :storage The source image storage.
1506
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1507
+ def get_recognize_and_import_to_html(name, opts = {})
1508
+ data, _status_code, _headers = get_recognize_and_import_to_html_with_http_info(name, opts)
1509
+ return {file: data, status: _status_code, headers: _headers}
1510
+ end
1511
+
1512
+ # Recognize text from the image file in the storage and import it to HTML format.
1513
+ #
1514
+ # @param name The image file name.
1515
+ # @param [Hash] opts the optional parameters
1516
+ # @option opts [String] :ocr_engine_lang OCR engine language - language default "en"
1517
+ # @option opts [String] :folder The source image folder.
1518
+ # @option opts [String] :storage The source image storage.
1519
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1520
+ def get_recognize_and_import_to_html_with_http_info(name, opts = {})
1521
+ if @api_client.config.debug
1522
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_recognize_and_import_to_html ..."
1523
+ end
1524
+ # verify the required parameter 'name' is set
1525
+ if @api_client.config.client_side_validation && name.nil?
1526
+ fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_recognize_and_import_to_html"
1527
+ end
1528
+ # resource path
1529
+ local_var_path = "/html/{name}/ocr/import".sub('{' + 'name' + '}', name.to_s)
1530
+
1531
+ # query parameters
1532
+ query_params = {}
1533
+ if opts[:'ocr_engine_lang'].nil?
1534
+ query_params[:'ocrEngineLang'] = "en"
1535
+ else
1536
+ query_params[:'ocrEngineLang'] = opts[:'ocr_engine_lang']
1537
+ end
1538
+
1539
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
1540
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
1541
+
1542
+ # header parameters
1543
+ header_params = {}
1544
+ # HTTP header 'Accept' (if needed)
1545
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
1546
+ # HTTP header 'Content-Type'
1547
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1548
+
1549
+ # form parameters
1550
+ form_params = {}
1551
+
1552
+ # http body (model)
1553
+ post_body = nil
1554
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1555
+ :header_params => header_params,
1556
+ :query_params => query_params,
1557
+ :form_params => form_params,
1558
+ :body => post_body,
1559
+ :return_type => 'File')
1560
+ if @api_client.config.debug
1561
+ @api_client.config.logger.debug "API called: HtmlApi#get_recognize_and_import_to_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1562
+ end
1563
+ return data, status_code, headers
1564
+ end
1565
+
1566
+ # Recognize text from the image file in the storage, import it to HTML format and translate to specified language.
1567
+ #
1568
+ # @param name The image file name.
1569
+ # @param src_lang Source language - also supposed as the OCR engine language.
1570
+ # @param res_lang Result language.
1571
+ # @param [Hash] opts the optional parameters
1572
+ # @option opts [String] :folder The source image folder.
1573
+ # @option opts [String] :storage The source image storage.
1574
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1575
+ def get_recognize_and_translate_to_html(name, src_lang, res_lang, opts = {})
1576
+ data, _status_code, _headers = get_recognize_and_translate_to_html_with_http_info(name, src_lang, res_lang, opts)
1577
+ return {file: data, status: _status_code, headers: _headers}
1578
+ end
1579
+
1580
+ # Recognize text from the image file in the storage, import it to HTML format and translate to specified language.
1581
+ #
1582
+ # @param name The image file name.
1583
+ # @param src_lang Source language - also supposed as the OCR engine language.
1584
+ # @param res_lang Result language.
1585
+ # @param [Hash] opts the optional parameters
1586
+ # @option opts [String] :folder The source image folder.
1587
+ # @option opts [String] :storage The source image storage.
1588
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1589
+ def get_recognize_and_translate_to_html_with_http_info(name, src_lang, res_lang, opts = {})
1590
+ if @api_client.config.debug
1591
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_recognize_and_translate_to_html ..."
1592
+ end
1593
+ # verify the required parameter 'name' is set
1594
+ if @api_client.config.client_side_validation && name.nil?
1595
+ fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_recognize_and_translate_to_html"
1596
+ end
1597
+ # verify the required parameter 'src_lang' is set
1598
+ if @api_client.config.client_side_validation && src_lang.nil?
1599
+ fail ArgumentError, "Missing the required parameter 'src_lang' when calling HtmlApi.get_recognize_and_translate_to_html"
1600
+ end
1601
+ # verify the required parameter 'res_lang' is set
1602
+ if @api_client.config.client_side_validation && res_lang.nil?
1603
+ fail ArgumentError, "Missing the required parameter 'res_lang' when calling HtmlApi.get_recognize_and_translate_to_html"
1604
+ end
1605
+ # resource path
1606
+ local_var_path = "/html/{name}/ocr/translate/{srcLang}/{resLang}"
1607
+ .sub('{' + 'name' + '}', name.to_s)
1608
+ .sub('{' + 'srcLang' + '}', src_lang.to_s)
1609
+ .sub('{' + 'resLang' + '}', res_lang.to_s)
1610
+
1611
+ # query parameters
1612
+ query_params = {}
1613
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
1614
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
1615
+
1616
+ # header parameters
1617
+ header_params = {}
1618
+ # HTTP header 'Accept' (if needed)
1619
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
1620
+ # HTTP header 'Content-Type'
1621
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1622
+
1623
+ # form parameters
1624
+ form_params = {}
1625
+
1626
+ # http body (model)
1627
+ post_body = nil
1628
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1629
+ :header_params => header_params,
1630
+ :query_params => query_params,
1631
+ :form_params => form_params,
1632
+ :body => post_body,
1633
+ :return_type => 'File')
1634
+ if @api_client.config.debug
1635
+ @api_client.config.logger.debug "API called: HtmlApi#get_recognize_and_translate_to_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1636
+ end
1637
+ return data, status_code, headers
1638
+ end
1639
+
1640
+
1641
+ ################################################################################
1642
+ # Translation Api
1643
+ ################################################################################
1644
+
1645
+
1646
+ # Translate the HTML document specified by the name from default or specified storage.
1647
+ #
1648
+ # @param name Document name.
1649
+ # @param src_lang Source language.
1650
+ # @param res_lang Result language.
1651
+ # @param [Hash] opts the optional parameters
1652
+ # @option opts [String] :storage The source document storage.
1653
+ # @option opts [String] :folder The source document folder.
1654
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1655
+ def get_translate_document(name, src_lang, res_lang, opts = {})
1656
+ data, _status_code, _headers = get_translate_document_with_http_info(name, src_lang, res_lang, opts)
1657
+ return {file: data, status: _status_code, headers: _headers}
1658
+ end
1659
+
1660
+ # Translate the HTML document specified by the name from default or specified storage.
1661
+ #
1662
+ # @param name Document name.
1663
+ # @param src_lang Source language.
1664
+ # @param res_lang Result language.
1665
+ # @param [Hash] opts the optional parameters
1666
+ # @option opts [String] :storage The source document storage.
1667
+ # @option opts [String] :folder The source document folder.
1668
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1669
+ def get_translate_document_with_http_info(name, src_lang, res_lang, opts = {})
1670
+ if @api_client.config.debug
1671
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_translate_document ..."
1672
+ end
1673
+ # verify the required parameter 'name' is set
1674
+ if @api_client.config.client_side_validation && name.nil?
1675
+ fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_translate_document"
1676
+ end
1677
+ # verify the required parameter 'src_lang' is set
1678
+ if @api_client.config.client_side_validation && src_lang.nil?
1679
+ fail ArgumentError, "Missing the required parameter 'src_lang' when calling HtmlApi.get_translate_document"
1680
+ end
1681
+ # verify the required parameter 'res_lang' is set
1682
+ if @api_client.config.client_side_validation && res_lang.nil?
1683
+ fail ArgumentError, "Missing the required parameter 'res_lang' when calling HtmlApi.get_translate_document"
1684
+ end
1685
+ # resource path
1686
+ local_var_path = "/html/{name}/translate/{srcLang}/{resLang}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'srcLang' + '}', src_lang.to_s).sub('{' + 'resLang' + '}', res_lang.to_s)
1687
+
1688
+ # query parameters
1689
+ query_params = {}
1690
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
1691
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
1692
+
1693
+ # header parameters
1694
+ header_params = {}
1695
+ # HTTP header 'Accept' (if needed)
1696
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
1697
+ # HTTP header 'Content-Type'
1698
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1699
+
1700
+ # form parameters
1701
+ form_params = {}
1702
+
1703
+ # http body (model)
1704
+ post_body = nil
1705
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1706
+ :header_params => header_params,
1707
+ :query_params => query_params,
1708
+ :form_params => form_params,
1709
+ :body => post_body,
1710
+ :return_type => 'File')
1711
+ if @api_client.config.debug
1712
+ @api_client.config.logger.debug "API called: HtmlApi#get_translate_document\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1713
+ end
1714
+ return data, status_code, headers
1715
+ end
1716
+
1717
+ # Translate the HTML document from Web specified by its URL.
1718
+ #
1719
+ # @param source_url Source document URL.
1720
+ # @param src_lang Source language.
1721
+ # @param res_lang Result language.
1722
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1723
+ def get_translate_document_by_url(source_url, src_lang, res_lang)
1724
+ data, _status_code, _headers = get_translate_document_by_url_with_http_info(source_url, src_lang, res_lang)
1725
+ return {file: data, status: _status_code, headers: _headers}
1726
+ end
1727
+
1728
+ # Translate the HTML document from Web specified by its URL.
1729
+ #
1730
+ # @param source_url Source document URL.
1731
+ # @param src_lang Source language.
1732
+ # @param res_lang Result language.
1733
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1734
+ def get_translate_document_by_url_with_http_info(source_url, src_lang, res_lang)
1735
+ if @api_client.config.debug
1736
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_translate_document_by_url ..."
1737
+ end
1738
+ # verify the required parameter 'source_url' is set
1739
+ if @api_client.config.client_side_validation && source_url.nil?
1740
+ fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_translate_document_by_url"
1741
+ end
1742
+ # verify the required parameter 'src_lang' is set
1743
+ if @api_client.config.client_side_validation && src_lang.nil?
1744
+ fail ArgumentError, "Missing the required parameter 'src_lang' when calling HtmlApi.get_translate_document_by_url"
1745
+ end
1746
+ # verify the required parameter 'res_lang' is set
1747
+ if @api_client.config.client_side_validation && res_lang.nil?
1748
+ fail ArgumentError, "Missing the required parameter 'res_lang' when calling HtmlApi.get_translate_document_by_url"
1749
+ end
1750
+ # resource path
1751
+ local_var_path = "/html/translate/{srcLang}/{resLang}".sub('{' + 'srcLang' + '}', src_lang.to_s).sub('{' + 'resLang' + '}', res_lang.to_s)
1752
+
1753
+ # query parameters
1754
+ query_params = {}
1755
+ query_params[:'sourceUrl'] = source_url
1756
+
1757
+ # header parameters
1758
+ header_params = {}
1759
+ # HTTP header 'Accept' (if needed)
1760
+ header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
1761
+ # HTTP header 'Content-Type'
1762
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1763
+
1764
+ # form parameters
1765
+ form_params = {}
1766
+
1767
+ # http body (model)
1768
+ post_body = nil
1769
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1770
+ :header_params => header_params,
1771
+ :query_params => query_params,
1772
+ :form_params => form_params,
1773
+ :body => post_body,
1774
+ :return_type => 'File')
1775
+ if @api_client.config.debug
1776
+ @api_client.config.logger.debug "API called: HtmlApi#get_translate_document_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1777
+ end
1778
+ return data, status_code, headers
1779
+ end
1780
+
1781
+
1782
+ ################################################################################
1783
+ # Summarization Api
1784
+ ################################################################################
1785
+
1786
+
1787
+ # Get the HTML document keywords using the keyword detection service.
1788
+ #
1789
+ # @param name Document name.
1790
+ # @param [Hash] opts the optional parameters
1791
+ # @option opts [String] :folder Document folder.
1792
+ # @option opts [String] :storage Document storage.
1793
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1794
+ def get_detect_html_keywords(name, opts = {})
1795
+ data, _status_code, _headers = get_detect_html_keywords_with_http_info(name, opts)
1796
+ return {file: data, status: _status_code, headers: _headers}
1797
+ end
1798
+
1799
+ # Get the HTML document keywords using the keyword detection service.
1800
+ #
1801
+ # @param name Document name.
1802
+ # @param [Hash] opts the optional parameters
1803
+ # @option opts [String] :folder Document folder.
1804
+ # @option opts [String] :storage Document storage.
1805
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1806
+ def get_detect_html_keywords_with_http_info(name, opts = {})
1807
+ if @api_client.config.debug
1808
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_detect_html_keywords ..."
1809
+ end
1810
+ # verify the required parameter 'name' is set
1811
+ if @api_client.config.client_side_validation && name.nil?
1812
+ fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_detect_html_keywords"
1813
+ end
1814
+ # resource path
1815
+ local_var_path = "/html/{name}/summ/keywords".sub('{' + 'name' + '}', name.to_s)
1816
+
1817
+ # query parameters
1818
+ query_params = {}
1819
+ query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
1820
+ query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
1821
+
1822
+ # header parameters
1823
+ header_params = {}
1824
+ # HTTP header 'Accept' (if needed)
1825
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1826
+ # HTTP header 'Content-Type'
1827
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1828
+
1829
+ # form parameters
1830
+ form_params = {}
1831
+
1832
+ # http body (model)
1833
+ post_body = nil
1834
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1835
+ :header_params => header_params,
1836
+ :query_params => query_params,
1837
+ :form_params => form_params,
1838
+ :body => post_body,
1839
+ :return_type => 'File')
1840
+ if @api_client.config.debug
1841
+ @api_client.config.logger.debug "API called: HtmlApi#get_detect_html_keywords\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1842
+ end
1843
+ return data, status_code, headers
1844
+ end
1845
+
1846
+ # Get the keywords from HTML document from Web specified by its URL using the keyword detection service
1847
+ #
1848
+ # @param source_url Source document URL.
1849
+ # @param [Hash] opts the optional parameters
1850
+ # @return [Hash] {file: data, status: _status_code, headers: _headers}
1851
+ def get_detect_html_keywords_by_url(source_url, opts = {})
1852
+ data, _status_code, _headers = get_detect_html_keywords_by_url_with_http_info(source_url, opts)
1853
+ return {file: data, status: _status_code, headers: _headers}
1854
+ end
1855
+
1856
+ # Get the keywords from HTML document from Web specified by its URL using the keyword detection service
1857
+ #
1858
+ # @param source_url Source document URL.
1859
+ # @param [Hash] opts the optional parameters
1860
+ # @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
1861
+ def get_detect_html_keywords_by_url_with_http_info(source_url, opts = {})
1862
+ if @api_client.config.debug
1863
+ @api_client.config.logger.debug "Calling API: HtmlApi.get_detect_html_keywords_by_url ..."
1864
+ end
1865
+ # verify the required parameter 'source_url' is set
1866
+ if @api_client.config.client_side_validation && source_url.nil?
1867
+ fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_detect_html_keywords_by_url"
1868
+ end
1869
+ # resource path
1870
+ local_var_path = "/html/summ/keywords"
1871
+
1872
+ # query parameters
1873
+ query_params = {}
1874
+ query_params[:'sourceUrl'] = source_url
1875
+
1876
+ # header parameters
1877
+ header_params = {}
1878
+ # HTTP header 'Accept' (if needed)
1879
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1880
+ # HTTP header 'Content-Type'
1881
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1882
+
1883
+ # form parameters
1884
+ form_params = {}
1885
+
1886
+ # http body (model)
1887
+ post_body = nil
1888
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
1889
+ :header_params => header_params,
1890
+ :query_params => query_params,
1891
+ :form_params => form_params,
1892
+ :body => post_body,
1893
+ :return_type => 'File')
1894
+ if @api_client.config.debug
1895
+ @api_client.config.logger.debug "API called: HtmlApi#get_detect_html_keywords_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1896
+ end
1897
+ return data, status_code, headers
1898
+ end
1899
+ end
1900
+ end