aspose_html_cloud 20.8.0 → 22.9.1
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.
- checksums.yaml +4 -4
- data/lib/aspose_html_cloud/api/html_api.rb +210 -2096
- data/lib/aspose_html_cloud/api/storage_api.rb +32 -332
- data/lib/aspose_html_cloud/api_client.rb +3 -3
- data/lib/aspose_html_cloud/api_error.rb +1 -1
- data/lib/aspose_html_cloud/configuration.rb +1 -1
- data/lib/aspose_html_cloud/models/base_model.rb +1 -1
- data/lib/aspose_html_cloud/models/conversion_result.rb +140 -0
- data/lib/aspose_html_cloud/models/disc_usage.rb +1 -1
- data/lib/aspose_html_cloud/models/error.rb +1 -1
- data/lib/aspose_html_cloud/models/error_details.rb +1 -1
- data/lib/aspose_html_cloud/models/file_version.rb +1 -1
- data/lib/aspose_html_cloud/models/file_versions.rb +1 -1
- data/lib/aspose_html_cloud/models/files_list.rb +1 -1
- data/lib/aspose_html_cloud/models/files_upload_result.rb +1 -1
- data/lib/aspose_html_cloud/models/object_exist.rb +1 -1
- data/lib/aspose_html_cloud/models/storage_exist.rb +1 -1
- data/lib/aspose_html_cloud/models/storage_file.rb +1 -1
- data/lib/aspose_html_cloud/version.rb +1 -1
- data/lib/aspose_html_cloud.rb +2 -1
- data/spec/api/html_api_spec.rb +221 -2285
- data/spec/api/model_spec.rb +1 -1
- data/spec/api/storage_api_spec.rb +5 -233
- data/spec/spec_helper.rb +7 -8
- metadata +19 -18
@@ -3,7 +3,7 @@
|
|
3
3
|
--------------------------------------------------------------------------------------------------------------------
|
4
4
|
<copyright company="Aspose" file="html_api.rb">
|
5
5
|
</copyright>
|
6
|
-
Copyright (c)
|
6
|
+
Copyright (c) 2022 Aspose.HTML for Cloud
|
7
7
|
<summary>
|
8
8
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9
9
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -35,1926 +35,225 @@ module AsposeHtml
|
|
35
35
|
|
36
36
|
def initialize(args)
|
37
37
|
@api_client = AsposeHtml::ApiClient.default(args)
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
#
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
#
|
47
|
-
#
|
48
|
-
# @
|
49
|
-
# @
|
50
|
-
# @
|
51
|
-
# @option opts [Integer] :
|
52
|
-
# @option opts [Integer] :
|
53
|
-
# @option opts [Integer] :
|
54
|
-
# @
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
#
|
60
|
-
#
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
#
|
67
|
-
#
|
68
|
-
# @
|
69
|
-
# @
|
70
|
-
# @
|
71
|
-
# @option opts [Integer] :
|
72
|
-
# @
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
#
|
78
|
-
#
|
79
|
-
# @
|
80
|
-
# @
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
#
|
133
|
-
#
|
134
|
-
# @param
|
135
|
-
# @param
|
136
|
-
# @
|
137
|
-
# @option opts [Integer] :
|
138
|
-
# @option opts [Integer] :
|
139
|
-
# @option opts [Integer] :
|
140
|
-
# @option opts [Integer] :
|
141
|
-
# @option opts [Integer] :
|
142
|
-
# @option opts [Integer] :
|
143
|
-
# @
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
#
|
153
|
-
#
|
154
|
-
# @param
|
155
|
-
# @param
|
156
|
-
# @
|
157
|
-
# @option opts [Integer] :
|
158
|
-
# @option opts [Integer] :
|
159
|
-
# @option opts [Integer] :
|
160
|
-
# @option opts [Integer] :
|
161
|
-
# @option opts [Integer] :
|
162
|
-
# @option opts [Integer] :
|
163
|
-
# @
|
164
|
-
# @
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
end
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
:header_params => header_params,
|
209
|
-
:query_params => query_params,
|
210
|
-
:form_params => form_params,
|
211
|
-
:body => post_body,
|
212
|
-
:return_type => 'File')
|
213
|
-
if @api_client.config.debug
|
214
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_image_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
215
|
-
end
|
216
|
-
return data, status_code, headers
|
217
|
-
end
|
218
|
-
|
219
|
-
# Convert the HTML, EPUB, SVG document from the storage by its name to PDF.
|
220
|
-
#
|
221
|
-
# @param name Document name.
|
222
|
-
# @param [Hash] opts the optional parameters
|
223
|
-
# @option opts [Integer] :width Resulting image width.
|
224
|
-
# @option opts [Integer] :height Resulting image height.
|
225
|
-
# @option opts [Integer] :left_margin Left resulting image margin.
|
226
|
-
# @option opts [Integer] :right_margin Right resulting image margin.
|
227
|
-
# @option opts [Integer] :top_margin Top resulting image margin.
|
228
|
-
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
229
|
-
# @option opts [String] :folder The document folder.
|
230
|
-
# @option opts [String] :storage The document storage.
|
231
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
232
|
-
def get_convert_document_to_pdf(name, opts = {})
|
233
|
-
data, _status_code, _headers = get_convert_document_to_pdf_with_http_info(name, opts)
|
234
|
-
return {file: data, status: _status_code, headers: _headers}
|
235
|
-
end
|
236
|
-
|
237
|
-
# Convert the HTML, EPUB, SVG document from the storage by its name to PDF.
|
238
|
-
#
|
239
|
-
# @param name Document name.
|
240
|
-
# @param [Hash] opts the optional parameters
|
241
|
-
# @option opts [Integer] :width Resulting image width.
|
242
|
-
# @option opts [Integer] :height Resulting image height.
|
243
|
-
# @option opts [Integer] :left_margin Left resulting image margin.
|
244
|
-
# @option opts [Integer] :right_margin Right resulting image margin.
|
245
|
-
# @option opts [Integer] :top_margin Top resulting image margin.
|
246
|
-
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
247
|
-
# @option opts [String] :folder The document folder.
|
248
|
-
# @option opts [String] :storage The document storage.
|
249
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
250
|
-
def get_convert_document_to_pdf_with_http_info(name, opts = {})
|
251
|
-
if @api_client.config.debug
|
252
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_pdf ..."
|
253
|
-
end
|
254
|
-
# verify the required parameter 'name' is set
|
255
|
-
if @api_client.config.client_side_validation && name.nil?
|
256
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_convert_document_to_pdf"
|
257
|
-
end
|
258
|
-
# resource path
|
259
|
-
local_var_path = "/html/{name}/convert/pdf".sub('{' + 'name' + '}', name.to_s)
|
260
|
-
|
261
|
-
# query parameters
|
262
|
-
query_params = {}
|
263
|
-
query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
264
|
-
query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
265
|
-
query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
|
266
|
-
query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
|
267
|
-
query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
|
268
|
-
query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
|
269
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
270
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
271
|
-
|
272
|
-
# header parameters
|
273
|
-
header_params = {}
|
274
|
-
# HTTP header 'Accept' (if needed)
|
275
|
-
header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
|
276
|
-
# HTTP header 'Content-Type'
|
277
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
278
|
-
|
279
|
-
# form parameters
|
280
|
-
form_params = {}
|
281
|
-
|
282
|
-
# http body (model)
|
283
|
-
post_body = nil
|
284
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
285
|
-
:header_params => header_params,
|
286
|
-
:query_params => query_params,
|
287
|
-
:form_params => form_params,
|
288
|
-
:body => post_body,
|
289
|
-
:return_type => 'File')
|
290
|
-
if @api_client.config.debug
|
291
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
292
|
-
end
|
293
|
-
return data, status_code, headers
|
294
|
-
end
|
295
|
-
|
296
|
-
# Convert the HTML page from the web by its URL to PDF.
|
297
|
-
#
|
298
|
-
# @param source_url Source page URL.
|
299
|
-
# @param [Hash] opts the optional parameters
|
300
|
-
# @option opts [Integer] :width Resulting image width.
|
301
|
-
# @option opts [Integer] :height Resulting image height.
|
302
|
-
# @option opts [Integer] :left_margin Left resulting image margin.
|
303
|
-
# @option opts [Integer] :right_margin Right resulting image margin.
|
304
|
-
# @option opts [Integer] :top_margin Top resulting image margin.
|
305
|
-
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
306
|
-
# @option opts [String] :folder The document folder.
|
307
|
-
# @option opts [String] :storage The document storage.
|
308
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
309
|
-
def get_convert_document_to_pdf_by_url(source_url, opts = {})
|
310
|
-
data, _status_code, _headers = get_convert_document_to_pdf_by_url_with_http_info(source_url, opts)
|
311
|
-
return {file: data, status: _status_code, headers: _headers}
|
312
|
-
end
|
313
|
-
|
314
|
-
# Convert the HTML page from the web by its URL to PDF.
|
315
|
-
#
|
316
|
-
# @param source_url Source page URL.
|
317
|
-
# @param [Hash] opts the optional parameters
|
318
|
-
# @option opts [Integer] :width Resulting image width.
|
319
|
-
# @option opts [Integer] :height Resulting image height.
|
320
|
-
# @option opts [Integer] :left_margin Left resulting image margin.
|
321
|
-
# @option opts [Integer] :right_margin Right resulting image margin.
|
322
|
-
# @option opts [Integer] :top_margin Top resulting image margin.
|
323
|
-
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
324
|
-
# @option opts [String] :folder The document folder.
|
325
|
-
# @option opts [String] :storage The document storage.
|
326
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
327
|
-
def get_convert_document_to_pdf_by_url_with_http_info(source_url, opts = {})
|
328
|
-
if @api_client.config.debug
|
329
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_pdf_by_url ..."
|
330
|
-
end
|
331
|
-
# verify the required parameter 'source_url' is set
|
332
|
-
if @api_client.config.client_side_validation && source_url.nil?
|
333
|
-
fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_convert_document_to_pdf_by_url"
|
334
|
-
end
|
335
|
-
# resource path
|
336
|
-
local_var_path = "/html/convert/pdf"
|
337
|
-
|
338
|
-
# query parameters
|
339
|
-
query_params = {}
|
340
|
-
query_params[:'sourceUrl'] = source_url
|
341
|
-
query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
342
|
-
query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
343
|
-
query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
|
344
|
-
query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
|
345
|
-
query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
|
346
|
-
query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
|
347
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
348
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
349
|
-
|
350
|
-
# header parameters
|
351
|
-
header_params = {}
|
352
|
-
# HTTP header 'Accept' (if needed)
|
353
|
-
header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
|
354
|
-
# HTTP header 'Content-Type'
|
355
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
356
|
-
|
357
|
-
# form parameters
|
358
|
-
form_params = {}
|
359
|
-
|
360
|
-
# http body (model)
|
361
|
-
post_body = nil
|
362
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
363
|
-
:header_params => header_params,
|
364
|
-
:query_params => query_params,
|
365
|
-
:form_params => form_params,
|
366
|
-
:body => post_body,
|
367
|
-
:return_type => 'File')
|
368
|
-
if @api_client.config.debug
|
369
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_pdf_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
370
|
-
end
|
371
|
-
return data, status_code, headers
|
372
|
-
end
|
373
|
-
|
374
|
-
# Convert the HTML, EPUB, SVG document from the storage by its name to XPS.
|
375
|
-
#
|
376
|
-
# @param name Document name.
|
377
|
-
# @param [Hash] opts the optional parameters
|
378
|
-
# @option opts [Integer] :width Resulting image width.
|
379
|
-
# @option opts [Integer] :height Resulting image height.
|
380
|
-
# @option opts [Integer] :left_margin Left resulting image margin.
|
381
|
-
# @option opts [Integer] :right_margin Right resulting image margin.
|
382
|
-
# @option opts [Integer] :top_margin Top resulting image margin.
|
383
|
-
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
384
|
-
# @option opts [String] :folder The document folder.
|
385
|
-
# @option opts [String] :storage The document storage.
|
386
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
387
|
-
def get_convert_document_to_xps(name, opts = {})
|
388
|
-
data, _status_code, _headers = get_convert_document_to_xps_with_http_info(name, opts)
|
389
|
-
return {file: data, status: _status_code, headers: _headers}
|
390
|
-
end
|
391
|
-
|
392
|
-
# Convert the HTML, EPUB, SVG document from the storage by its name to XPS.
|
393
|
-
#
|
394
|
-
# @param name Document name.
|
395
|
-
# @param [Hash] opts the optional parameters
|
396
|
-
# @option opts [Integer] :width Resulting image width.
|
397
|
-
# @option opts [Integer] :height Resulting image height.
|
398
|
-
# @option opts [Integer] :left_margin Left resulting image margin.
|
399
|
-
# @option opts [Integer] :right_margin Right resulting image margin.
|
400
|
-
# @option opts [Integer] :top_margin Top resulting image margin.
|
401
|
-
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
402
|
-
# @option opts [String] :folder The document folder.
|
403
|
-
# @option opts [String] :storage The document storage.
|
404
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
405
|
-
def get_convert_document_to_xps_with_http_info(name, opts = {})
|
406
|
-
if @api_client.config.debug
|
407
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_xps ..."
|
408
|
-
end
|
409
|
-
# verify the required parameter 'name' is set
|
410
|
-
if @api_client.config.client_side_validation && name.nil?
|
411
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_convert_document_to_xps"
|
412
|
-
end
|
413
|
-
# resource path
|
414
|
-
local_var_path = "/html/{name}/convert/xps".sub('{' + 'name' + '}', name.to_s)
|
415
|
-
|
416
|
-
# query parameters
|
417
|
-
query_params = {}
|
418
|
-
query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
419
|
-
query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
420
|
-
query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
|
421
|
-
query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
|
422
|
-
query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
|
423
|
-
query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
|
424
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
425
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
426
|
-
|
427
|
-
# header parameters
|
428
|
-
header_params = {}
|
429
|
-
# HTTP header 'Accept' (if needed)
|
430
|
-
header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
|
431
|
-
# HTTP header 'Content-Type'
|
432
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
433
|
-
|
434
|
-
# form parameters
|
435
|
-
form_params = {}
|
436
|
-
|
437
|
-
# http body (model)
|
438
|
-
post_body = nil
|
439
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
440
|
-
:header_params => header_params,
|
441
|
-
:query_params => query_params,
|
442
|
-
:form_params => form_params,
|
443
|
-
:body => post_body,
|
444
|
-
:return_type => 'File')
|
445
|
-
if @api_client.config.debug
|
446
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_xps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
447
|
-
end
|
448
|
-
return data, status_code, headers
|
449
|
-
end
|
450
|
-
|
451
|
-
# Convert the HTML page from the web by its URL to XPS.
|
452
|
-
#
|
453
|
-
# @param source_url Source page URL.
|
454
|
-
# @param [Hash] opts the optional parameters
|
455
|
-
# @option opts [Integer] :width Resulting image width.
|
456
|
-
# @option opts [Integer] :height Resulting image height.
|
457
|
-
# @option opts [Integer] :left_margin Left resulting image margin.
|
458
|
-
# @option opts [Integer] :right_margin Right resulting image margin.
|
459
|
-
# @option opts [Integer] :top_margin Top resulting image margin.
|
460
|
-
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
461
|
-
# @option opts [String] :folder The document folder.
|
462
|
-
# @option opts [String] :storage The document storage.
|
463
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
464
|
-
def get_convert_document_to_xps_by_url(source_url, opts = {})
|
465
|
-
data, _status_code, _headers = get_convert_document_to_xps_by_url_with_http_info(source_url, opts)
|
466
|
-
return {file: data, status: _status_code, headers: _headers}
|
467
|
-
end
|
468
|
-
|
469
|
-
# Convert the HTML page from the web by its URL to XPS.
|
470
|
-
#
|
471
|
-
# @param source_url Source page URL.
|
472
|
-
# @param [Hash] opts the optional parameters
|
473
|
-
# @option opts [Integer] :width Resulting image width.
|
474
|
-
# @option opts [Integer] :height Resulting image height.
|
475
|
-
# @option opts [Integer] :left_margin Left resulting image margin.
|
476
|
-
# @option opts [Integer] :right_margin Right resulting image margin.
|
477
|
-
# @option opts [Integer] :top_margin Top resulting image margin.
|
478
|
-
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
479
|
-
# @option opts [String] :folder The document folder.
|
480
|
-
# @option opts [String] :storage The document storage.
|
481
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
482
|
-
def get_convert_document_to_xps_by_url_with_http_info(source_url, opts = {})
|
483
|
-
if @api_client.config.debug
|
484
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.get_convert_document_to_xps_by_url ..."
|
485
|
-
end
|
486
|
-
# verify the required parameter 'source_url' is set
|
487
|
-
if @api_client.config.client_side_validation && source_url.nil?
|
488
|
-
fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_convert_document_to_xps_by_url"
|
489
|
-
end
|
490
|
-
# resource path
|
491
|
-
local_var_path = "/html/convert/xps"
|
492
|
-
|
493
|
-
# query parameters
|
494
|
-
query_params = {}
|
495
|
-
query_params[:'sourceUrl'] = source_url
|
496
|
-
query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
497
|
-
query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
498
|
-
query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
|
499
|
-
query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
|
500
|
-
query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
|
501
|
-
query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
|
502
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
503
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
504
|
-
|
505
|
-
# header parameters
|
506
|
-
header_params = {}
|
507
|
-
# HTTP header 'Accept' (if needed)
|
508
|
-
header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
|
509
|
-
# HTTP header 'Content-Type'
|
510
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
511
|
-
|
512
|
-
# form parameters
|
513
|
-
form_params = {}
|
514
|
-
|
515
|
-
# http body (model)
|
516
|
-
post_body = nil
|
517
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
518
|
-
:header_params => header_params,
|
519
|
-
:query_params => query_params,
|
520
|
-
:form_params => form_params,
|
521
|
-
:body => post_body,
|
522
|
-
:return_type => 'File')
|
523
|
-
if @api_client.config.debug
|
524
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_xps_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
525
|
-
end
|
526
|
-
return data, status_code, headers
|
527
|
-
end
|
528
|
-
|
529
|
-
|
530
|
-
# Converts the HTML, EPUB, SVG document (in request content) to the specified image format and uploads resulting file to storage.
|
531
|
-
#
|
532
|
-
# @param out_path Full resulting filename (ex. /folder1/folder2/result.jpg)
|
533
|
-
# @param out_format (jpeg, png, bmp, tiff, gif)
|
534
|
-
# @param file A file to be converted.
|
535
|
-
# @param [Hash] opts the optional parameters
|
536
|
-
# @option opts [Integer] :width Resulting document page width in points (1/96 inch).
|
537
|
-
# @option opts [Integer] :height Resulting document page height in points (1/96 inch).
|
538
|
-
# @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
|
539
|
-
# @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
|
540
|
-
# @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
|
541
|
-
# @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
|
542
|
-
# @option opts [Integer] :resolution Resolution of resulting image. Default is 96 dpi.
|
543
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
544
|
-
def post_convert_document_in_request_to_image(out_path, out_format, file, opts = {})
|
545
|
-
data, _status_code, _headers = post_convert_document_in_request_to_image_with_http_info(out_path, out_format, file, opts)
|
546
|
-
return {file: data, status: _status_code, headers: _headers}
|
547
|
-
end
|
548
|
-
|
549
|
-
# Converts the HTML, EPUB, SVG document (in request content) to the specified image format and uploads resulting file to storage.
|
550
|
-
#
|
551
|
-
# @param out_path Full resulting filename (ex. /folder1/folder2/result.jpg)
|
552
|
-
# @param out_format (jpeg, png, bmp, tiff, gif)
|
553
|
-
# @param file A file to be converted.
|
554
|
-
# @param [Hash] opts the optional parameters
|
555
|
-
# @option opts [Integer] :width Resulting document page width in points (1/96 inch).
|
556
|
-
# @option opts [Integer] :height Resulting document page height in points (1/96 inch).
|
557
|
-
# @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
|
558
|
-
# @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
|
559
|
-
# @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
|
560
|
-
# @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
|
561
|
-
# @option opts [Integer] :resolution Resolution of resulting image. Default is 96 dpi.
|
562
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
563
|
-
def post_convert_document_in_request_to_image_with_http_info(out_path, out_format, file, opts = {})
|
564
|
-
if @api_client.config.debug
|
565
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.post_convert_document_in_request_to_image ..."
|
566
|
-
end
|
567
|
-
# verify the required parameter 'out_path' is set
|
568
|
-
if @api_client.config.client_side_validation && out_path.nil?
|
569
|
-
fail ArgumentError, "Missing the required parameter 'out_path' when calling HtmlApi.post_convert_document_in_request_to_image"
|
570
|
-
end
|
571
|
-
# verify the required parameter 'out_format' is set
|
572
|
-
if @api_client.config.client_side_validation && out_format.nil?
|
573
|
-
fail ArgumentError, "Missing the required parameter 'out_format' when calling HtmlApi.post_convert_document_in_request_to_image"
|
574
|
-
end
|
575
|
-
# verify the required parameter 'file' is set
|
576
|
-
if @api_client.config.client_side_validation && file.nil?
|
577
|
-
fail ArgumentError, "Missing the required parameter 'file' when calling HtmlApi.post_convert_document_in_request_to_image"
|
578
|
-
end
|
579
|
-
# resource path
|
580
|
-
local_var_path = "/html/convert/image/{outFormat}".sub('{' + 'outFormat' + '}', out_format.to_s)
|
581
|
-
|
582
|
-
# query parameters
|
583
|
-
query_params = {}
|
584
|
-
query_params[:'outPath'] = out_path
|
585
|
-
query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
586
|
-
query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
587
|
-
query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
|
588
|
-
query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
|
589
|
-
query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
|
590
|
-
query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
|
591
|
-
query_params[:'resolution'] = opts[:'resolution'] if !opts[:'resolution'].nil?
|
592
|
-
|
593
|
-
# header parameters
|
594
|
-
header_params = {}
|
595
|
-
# HTTP header 'Accept' (if needed)
|
596
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
597
|
-
# HTTP header 'Content-Type'
|
598
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
599
|
-
|
600
|
-
# form parameters
|
601
|
-
form_params = {
|
602
|
-
file: File::open(file,'rb')
|
603
|
-
}
|
604
|
-
post_body = nil
|
605
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
606
|
-
:header_params => header_params,
|
607
|
-
:query_params => query_params,
|
608
|
-
:form_params => form_params,
|
609
|
-
:body => post_body,
|
610
|
-
:return_type => 'File')
|
611
|
-
if @api_client.config.debug
|
612
|
-
@api_client.config.logger.debug "API called: HtmlApi#post_convert_document_in_request_to_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
613
|
-
end
|
614
|
-
return data, status_code, headers
|
615
|
-
end
|
616
|
-
|
617
|
-
# Converts the HTML, EPUB, SVG document (in request content) to PDF and uploads resulting file to storage.
|
618
|
-
#
|
619
|
-
# @param out_path Full resulting filename (ex. /folder1/folder2/result.pdf)
|
620
|
-
# @param file A file to be converted.
|
621
|
-
# @param [Hash] opts the optional parameters
|
622
|
-
# @option opts [Integer] :width Resulting document page width in points (1/96 inch).
|
623
|
-
# @option opts [Integer] :height Resulting document page height in points (1/96 inch).
|
624
|
-
# @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
|
625
|
-
# @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
|
626
|
-
# @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
|
627
|
-
# @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
|
628
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
629
|
-
def post_convert_document_in_request_to_pdf(out_path, file, opts = {})
|
630
|
-
data, _status_code, _headers = post_convert_document_in_request_to_pdf_with_http_info(out_path, file, opts)
|
631
|
-
return {file: data, status: _status_code, headers: _headers}
|
632
|
-
end
|
633
|
-
|
634
|
-
# Converts the HTML, EPUB, SVG document (in request content) to PDF and uploads resulting file to storage.
|
635
|
-
#
|
636
|
-
# @param out_path Full resulting filename (ex. /folder1/folder2/result.pdf)
|
637
|
-
# @param file A file to be converted.
|
638
|
-
# @param [Hash] opts the optional parameters
|
639
|
-
# @option opts [Integer] :width Resulting document page width in points (1/96 inch).
|
640
|
-
# @option opts [Integer] :height Resulting document page height in points (1/96 inch).
|
641
|
-
# @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
|
642
|
-
# @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
|
643
|
-
# @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
|
644
|
-
# @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
|
645
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
646
|
-
def post_convert_document_in_request_to_pdf_with_http_info(out_path, file, opts = {})
|
647
|
-
if @api_client.config.debug
|
648
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.post_convert_document_in_request_to_pdf ..."
|
649
|
-
end
|
650
|
-
# verify the required parameter 'out_path' is set
|
651
|
-
if @api_client.config.client_side_validation && out_path.nil?
|
652
|
-
fail ArgumentError, "Missing the required parameter 'out_path' when calling HtmlApi.post_convert_document_in_request_to_pdf"
|
653
|
-
end
|
654
|
-
# verify the required parameter 'file' is set
|
655
|
-
if @api_client.config.client_side_validation && file.nil?
|
656
|
-
fail ArgumentError, "Missing the required parameter 'file' when calling HtmlApi.post_convert_document_in_request_to_pdf"
|
657
|
-
end
|
658
|
-
# resource path
|
659
|
-
local_var_path = "/html/convert/pdf"
|
660
|
-
|
661
|
-
# query parameters
|
662
|
-
query_params = {}
|
663
|
-
query_params[:'outPath'] = out_path
|
664
|
-
query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
665
|
-
query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
666
|
-
query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
|
667
|
-
query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
|
668
|
-
query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
|
669
|
-
query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
|
670
|
-
|
671
|
-
# header parameters
|
672
|
-
header_params = {}
|
673
|
-
# HTTP header 'Accept' (if needed)
|
674
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
675
|
-
# HTTP header 'Content-Type'
|
676
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
677
|
-
|
678
|
-
# form parameters
|
679
|
-
form_params = {
|
680
|
-
file: File::open(file,'rb')
|
681
|
-
}
|
682
|
-
|
683
|
-
# http body (model)
|
684
|
-
post_body = nil
|
685
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
686
|
-
:header_params => header_params,
|
687
|
-
:query_params => query_params,
|
688
|
-
:form_params => form_params,
|
689
|
-
:body => post_body,
|
690
|
-
:return_type => 'File')
|
691
|
-
if @api_client.config.debug
|
692
|
-
@api_client.config.logger.debug "API called: HtmlApi#post_convert_document_in_request_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
693
|
-
end
|
694
|
-
return data, status_code, headers
|
695
|
-
end
|
696
|
-
|
697
|
-
# Converts the HTML, EPUB, SVG document (in request content) to XPS and uploads resulting file to storage.
|
698
|
-
#
|
699
|
-
# @param out_path Full resulting filename (ex. /folder1/folder2/result.xps)
|
700
|
-
# @param file A file to be converted.
|
701
|
-
# @param [Hash] opts the optional parameters
|
702
|
-
# @option opts [Integer] :width Resulting document page width in points (1/96 inch).
|
703
|
-
# @option opts [Integer] :height Resulting document page height in points (1/96 inch).
|
704
|
-
# @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
|
705
|
-
# @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
|
706
|
-
# @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
|
707
|
-
# @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
|
708
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
709
|
-
def post_convert_document_in_request_to_xps(out_path, file, opts = {})
|
710
|
-
data, _status_code, _headers = post_convert_document_in_request_to_xps_with_http_info(out_path, file, opts)
|
711
|
-
return {file: data, status: _status_code, headers: _headers}
|
712
|
-
end
|
713
|
-
|
714
|
-
# Converts the HTML, EPUB, SVG document (in request content) to XPS and uploads resulting file to storage.
|
715
|
-
#
|
716
|
-
# @param out_path Full resulting filename (ex. /folder1/folder2/result.xps)
|
717
|
-
# @param file A file to be converted.
|
718
|
-
# @param [Hash] opts the optional parameters
|
719
|
-
# @option opts [Integer] :width Resulting document page width in points (1/96 inch).
|
720
|
-
# @option opts [Integer] :height Resulting document page height in points (1/96 inch).
|
721
|
-
# @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
|
722
|
-
# @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
|
723
|
-
# @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
|
724
|
-
# @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
|
725
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
726
|
-
def post_convert_document_in_request_to_xps_with_http_info(out_path, file, opts = {})
|
727
|
-
if @api_client.config.debug
|
728
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.post_convert_document_in_request_to_xps ..."
|
729
|
-
end
|
730
|
-
# verify the required parameter 'out_path' is set
|
731
|
-
if @api_client.config.client_side_validation && out_path.nil?
|
732
|
-
fail ArgumentError, "Missing the required parameter 'out_path' when calling HtmlApi.post_convert_document_in_request_to_xps"
|
733
|
-
end
|
734
|
-
# verify the required parameter 'file' is set
|
735
|
-
if @api_client.config.client_side_validation && file.nil?
|
736
|
-
fail ArgumentError, "Missing the required parameter 'file' when calling HtmlApi.post_convert_document_in_request_to_xps"
|
737
|
-
end
|
738
|
-
# resource path
|
739
|
-
local_var_path = "/html/convert/xps"
|
740
|
-
|
741
|
-
# query parameters
|
742
|
-
query_params = {}
|
743
|
-
query_params[:'outPath'] = out_path
|
744
|
-
query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
745
|
-
query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
746
|
-
query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
|
747
|
-
query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
|
748
|
-
query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
|
749
|
-
query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
|
750
|
-
|
751
|
-
# header parameters
|
752
|
-
header_params = {}
|
753
|
-
# HTTP header 'Accept' (if needed)
|
754
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
755
|
-
# HTTP header 'Content-Type'
|
756
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
757
|
-
|
758
|
-
# form parameters
|
759
|
-
form_params = {
|
760
|
-
file: File::open(file,'rb')
|
761
|
-
}
|
762
|
-
|
763
|
-
# http body (model)
|
764
|
-
post_body = nil
|
765
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
766
|
-
:header_params => header_params,
|
767
|
-
:query_params => query_params,
|
768
|
-
:form_params => form_params,
|
769
|
-
:body => post_body,
|
770
|
-
:return_type => 'File')
|
771
|
-
if @api_client.config.debug
|
772
|
-
@api_client.config.logger.debug "API called: HtmlApi#post_convert_document_in_request_to_xps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
773
|
-
end
|
774
|
-
return data, status_code, headers
|
775
|
-
end
|
776
|
-
|
777
|
-
# Converts the HTML, EPUB, SVG document (located on storage) to the specified image format and uploads resulting file to storage.
|
778
|
-
#
|
779
|
-
# @param name Document name.
|
780
|
-
# @param out_path Full resulting filename (ex. /folder1/folder2/result.jpg)
|
781
|
-
# @param out_format(jpeg, png, bmp, tiff, gif)
|
782
|
-
# @param [Hash] opts the optional parameters
|
783
|
-
# @option opts [Integer] :width Resulting document page width in points (1/96 inch).
|
784
|
-
# @option opts [Integer] :height Resulting document page height in points (1/96 inch).
|
785
|
-
# @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
|
786
|
-
# @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
|
787
|
-
# @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
|
788
|
-
# @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
|
789
|
-
# @option opts [Integer] :resolution Resolution of resulting image. Default is 96 dpi.
|
790
|
-
# @option opts [String] :folder The source document folder.
|
791
|
-
# @option opts [String] :storage The source and resulting document storage.
|
792
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
793
|
-
def put_convert_document_to_image(name, out_path, out_format, opts = {})
|
794
|
-
data, _status_code, _headers = put_convert_document_to_image_with_http_info(name, out_path, out_format, opts)
|
795
|
-
return {file: data, status: _status_code, headers: _headers}
|
796
|
-
end
|
797
|
-
|
798
|
-
# Converts the HTML, EPUB, SVG document (located on storage) to the specified image format and uploads resulting file to storage.
|
799
|
-
#
|
800
|
-
# @param name Document name.
|
801
|
-
# @param out_path Full resulting filename (ex. /folder1/folder2/result.jpg)
|
802
|
-
# @param out_format(jpeg, png, bmp, tiff, gif)
|
803
|
-
# @param [Hash] opts the optional parameters
|
804
|
-
# @option opts [Integer] :width Resulting document page width in points (1/96 inch).
|
805
|
-
# @option opts [Integer] :height Resulting document page height in points (1/96 inch).
|
806
|
-
# @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
|
807
|
-
# @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
|
808
|
-
# @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
|
809
|
-
# @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
|
810
|
-
# @option opts [Integer] :resolution Resolution of resulting image. Default is 96 dpi.
|
811
|
-
# @option opts [String] :folder The source document folder.
|
812
|
-
# @option opts [String] :storage The source and resulting document storage.
|
813
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
814
|
-
def put_convert_document_to_image_with_http_info(name, out_path, out_format, opts = {})
|
815
|
-
if @api_client.config.debug
|
816
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.put_convert_document_to_image ..."
|
817
|
-
end
|
818
|
-
# verify the required parameter 'name' is set
|
819
|
-
if @api_client.config.client_side_validation && name.nil?
|
820
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.put_convert_document_to_image"
|
821
|
-
end
|
822
|
-
# verify the required parameter 'out_path' is set
|
823
|
-
if @api_client.config.client_side_validation && out_path.nil?
|
824
|
-
fail ArgumentError, "Missing the required parameter 'out_path' when calling HtmlApi.put_convert_document_to_image"
|
825
|
-
end
|
826
|
-
# verify the required parameter 'out_format' is set
|
827
|
-
if @api_client.config.client_side_validation && out_format.nil?
|
828
|
-
fail ArgumentError, "Missing the required parameter 'out_format' when calling HtmlApi.put_convert_document_to_image"
|
829
|
-
end
|
830
|
-
# resource path
|
831
|
-
local_var_path = "/html/{name}/convert/image/{outFormat}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'outFormat' + '}', out_format.to_s)
|
832
|
-
|
833
|
-
# query parameters
|
834
|
-
query_params = {}
|
835
|
-
query_params[:'outPath'] = out_path
|
836
|
-
query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
837
|
-
query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
838
|
-
query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
|
839
|
-
query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
|
840
|
-
query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
|
841
|
-
query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
|
842
|
-
query_params[:'resolution'] = opts[:'resolution'] if !opts[:'resolution'].nil?
|
843
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
844
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
845
|
-
|
846
|
-
# header parameters
|
847
|
-
header_params = {}
|
848
|
-
# HTTP header 'Accept' (if needed)
|
849
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
850
|
-
# HTTP header 'Content-Type'
|
851
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
852
|
-
|
853
|
-
# form parameters
|
854
|
-
form_params = {}
|
855
|
-
|
856
|
-
# http body (model)
|
857
|
-
post_body = nil
|
858
|
-
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
859
|
-
:header_params => header_params,
|
860
|
-
:query_params => query_params,
|
861
|
-
:form_params => form_params,
|
862
|
-
:body => post_body,
|
863
|
-
:return_type => 'File')
|
864
|
-
if @api_client.config.debug
|
865
|
-
@api_client.config.logger.debug "API called: HtmlApi#put_convert_document_to_image\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
866
|
-
end
|
867
|
-
return data, status_code, headers
|
868
|
-
end
|
869
|
-
|
870
|
-
# Converts the HTML, EPUB, SVG document (located on storage) to PDF and uploads resulting file to storage.
|
871
|
-
#
|
872
|
-
# @param name Document name.
|
873
|
-
# @param out_path Full resulting filename (ex. /folder1/folder2/result.pdf)
|
874
|
-
# @param [Hash] opts the optional parameters
|
875
|
-
# @option opts [Integer] :width Resulting document page width in points (1/96 inch).
|
876
|
-
# @option opts [Integer] :height Resulting document page height in points (1/96 inch).
|
877
|
-
# @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
|
878
|
-
# @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
|
879
|
-
# @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
|
880
|
-
# @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
|
881
|
-
# @option opts [String] :folder The source document folder.
|
882
|
-
# @option opts [String] :storage The source and resulting document storage.
|
883
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
884
|
-
def put_convert_document_to_pdf(name, out_path, opts = {})
|
885
|
-
data, _status_code, _headers = put_convert_document_to_pdf_with_http_info(name, out_path, opts)
|
886
|
-
return {file: data, status: _status_code, headers: _headers}
|
887
|
-
end
|
888
|
-
|
889
|
-
# Converts the HTML, EPUB, SVG document (located on storage) to PDF and uploads resulting file to storage.
|
890
|
-
#
|
891
|
-
# @param name Document name.
|
892
|
-
# @param out_path Full resulting filename (ex. /folder1/folder2/result.pdf)
|
893
|
-
# @param [Hash] opts the optional parameters
|
894
|
-
# @option opts [Integer] :width Resulting document page width in points (1/96 inch).
|
895
|
-
# @option opts [Integer] :height Resulting document page height in points (1/96 inch).
|
896
|
-
# @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
|
897
|
-
# @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
|
898
|
-
# @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
|
899
|
-
# @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
|
900
|
-
# @option opts [String] :folder The source document folder.
|
901
|
-
# @option opts [String] :storage The source and resulting document storage.
|
902
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
903
|
-
def put_convert_document_to_pdf_with_http_info(name, out_path, opts = {})
|
904
|
-
if @api_client.config.debug
|
905
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.put_convert_document_to_pdf ..."
|
906
|
-
end
|
907
|
-
# verify the required parameter 'name' is set
|
908
|
-
if @api_client.config.client_side_validation && name.nil?
|
909
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.put_convert_document_to_pdf"
|
910
|
-
end
|
911
|
-
# verify the required parameter 'out_path' is set
|
912
|
-
if @api_client.config.client_side_validation && out_path.nil?
|
913
|
-
fail ArgumentError, "Missing the required parameter 'out_path' when calling HtmlApi.put_convert_document_to_pdf"
|
914
|
-
end
|
915
|
-
# resource path
|
916
|
-
local_var_path = "/html/{name}/convert/pdf".sub('{' + 'name' + '}', name.to_s)
|
917
|
-
|
918
|
-
# query parameters
|
919
|
-
query_params = {}
|
920
|
-
query_params[:'outPath'] = out_path
|
921
|
-
query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
922
|
-
query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
923
|
-
query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
|
924
|
-
query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
|
925
|
-
query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
|
926
|
-
query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
|
927
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
928
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
929
|
-
|
930
|
-
# header parameters
|
931
|
-
header_params = {}
|
932
|
-
# HTTP header 'Accept' (if needed)
|
933
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
934
|
-
# HTTP header 'Content-Type'
|
935
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
936
|
-
|
937
|
-
# form parameters
|
938
|
-
form_params = {}
|
939
|
-
|
940
|
-
# http body (model)
|
941
|
-
post_body = nil
|
942
|
-
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
943
|
-
:header_params => header_params,
|
944
|
-
:query_params => query_params,
|
945
|
-
:form_params => form_params,
|
946
|
-
:body => post_body,
|
947
|
-
:return_type => 'File')
|
948
|
-
if @api_client.config.debug
|
949
|
-
@api_client.config.logger.debug "API called: HtmlApi#put_convert_document_to_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
950
|
-
end
|
951
|
-
return data, status_code, headers
|
952
|
-
end
|
953
|
-
|
954
|
-
# Converts the HTML, EPUB, SVG document (located on storage) to XPS and uploads resulting file to storage.
|
955
|
-
#
|
956
|
-
# @param name Document name.
|
957
|
-
# @param out_path Full resulting filename (ex. /folder1/folder2/result.xps)
|
958
|
-
# @param [Hash] opts the optional parameters
|
959
|
-
# @option opts [Integer] :width Resulting document page width in points (1/96 inch).
|
960
|
-
# @option opts [Integer] :height Resulting document page height in points (1/96 inch).
|
961
|
-
# @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
|
962
|
-
# @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
|
963
|
-
# @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
|
964
|
-
# @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
|
965
|
-
# @option opts [String] :folder The source document folder.
|
966
|
-
# @option opts [String] :storage The source and resulting document storage.
|
967
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
968
|
-
def put_convert_document_to_xps(name, out_path, opts = {})
|
969
|
-
data, _status_code, _headers = put_convert_document_to_xps_with_http_info(name, out_path, opts)
|
970
|
-
return {file: data, status: _status_code, headers: _headers}
|
971
|
-
end
|
972
|
-
|
973
|
-
# Converts the HTML, EPUB, SVG document (located on storage) to XPS and uploads resulting file to storage.
|
974
|
-
#
|
975
|
-
# @param name Document name.
|
976
|
-
# @param out_path Full resulting filename (ex. /folder1/folder2/result.xps)
|
977
|
-
# @param [Hash] opts the optional parameters
|
978
|
-
# @option opts [Integer] :width Resulting document page width in points (1/96 inch).
|
979
|
-
# @option opts [Integer] :height Resulting document page height in points (1/96 inch).
|
980
|
-
# @option opts [Integer] :left_margin Left resulting document page margin in points (1/96 inch).
|
981
|
-
# @option opts [Integer] :right_margin Right resulting document page margin in points (1/96 inch).
|
982
|
-
# @option opts [Integer] :top_margin Top resulting document page margin in points (1/96 inch).
|
983
|
-
# @option opts [Integer] :bottom_margin Bottom resulting document page margin in points (1/96 inch).
|
984
|
-
# @option opts [String] :folder The source document folder.
|
985
|
-
# @option opts [String] :storage The source and resulting document storage.
|
986
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
987
|
-
def put_convert_document_to_xps_with_http_info(name, out_path, opts = {})
|
988
|
-
if @api_client.config.debug
|
989
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.put_convert_document_to_xps ..."
|
990
|
-
end
|
991
|
-
# verify the required parameter 'name' is set
|
992
|
-
if @api_client.config.client_side_validation && name.nil?
|
993
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.put_convert_document_to_xps"
|
994
|
-
end
|
995
|
-
# verify the required parameter 'out_path' is set
|
996
|
-
if @api_client.config.client_side_validation && out_path.nil?
|
997
|
-
fail ArgumentError, "Missing the required parameter 'out_path' when calling HtmlApi.put_convert_document_to_xps"
|
998
|
-
end
|
999
|
-
# resource path
|
1000
|
-
local_var_path = "/html/{name}/convert/xps".sub('{' + 'name' + '}', name.to_s)
|
1001
|
-
|
1002
|
-
# query parameters
|
1003
|
-
query_params = {}
|
1004
|
-
query_params[:'outPath'] = out_path
|
1005
|
-
query_params[:'width'] = opts[:'width'] if !opts[:'width'].nil?
|
1006
|
-
query_params[:'height'] = opts[:'height'] if !opts[:'height'].nil?
|
1007
|
-
query_params[:'leftMargin'] = opts[:'left_margin'] if !opts[:'left_margin'].nil?
|
1008
|
-
query_params[:'rightMargin'] = opts[:'right_margin'] if !opts[:'right_margin'].nil?
|
1009
|
-
query_params[:'topMargin'] = opts[:'top_margin'] if !opts[:'top_margin'].nil?
|
1010
|
-
query_params[:'bottomMargin'] = opts[:'bottom_margin'] if !opts[:'bottom_margin'].nil?
|
1011
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
1012
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
1013
|
-
|
1014
|
-
# header parameters
|
1015
|
-
header_params = {}
|
1016
|
-
# HTTP header 'Accept' (if needed)
|
1017
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1018
|
-
# HTTP header 'Content-Type'
|
1019
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1020
|
-
|
1021
|
-
# form parameters
|
1022
|
-
form_params = {}
|
1023
|
-
|
1024
|
-
# http body (model)
|
1025
|
-
post_body = nil
|
1026
|
-
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
1027
|
-
:header_params => header_params,
|
1028
|
-
:query_params => query_params,
|
1029
|
-
:form_params => form_params,
|
1030
|
-
:body => post_body,
|
1031
|
-
:return_type => 'File')
|
1032
|
-
if @api_client.config.debug
|
1033
|
-
@api_client.config.logger.debug "API called: HtmlApi#put_convert_document_to_xps\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1034
|
-
end
|
1035
|
-
return data, status_code, headers
|
1036
|
-
end
|
1037
|
-
|
1038
|
-
# Converts the HTML page from Web by its URL to MHTML returns resulting file in response content.
|
1039
|
-
# @param source_url Source page URL.
|
1040
|
-
# @param [Hash] opts the optional parameters
|
1041
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1042
|
-
def get_convert_document_to_mhtml_by_url(source_url, opts = {})
|
1043
|
-
data, _status_code, _headers = get_convert_document_to_mhtml_by_url_with_http_info(source_url, opts)
|
1044
|
-
return {file: data, status: _status_code, headers: _headers}
|
1045
|
-
end
|
1046
|
-
|
1047
|
-
# Converts the HTML page from Web by its URL to MHTML returns resulting file in response content.
|
1048
|
-
# @param source_url Source page URL.
|
1049
|
-
# @param [Hash] opts the optional parameters
|
1050
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1051
|
-
def get_convert_document_to_mhtml_by_url_with_http_info(source_url, opts = {})
|
1052
|
-
if @api_client.config.debug
|
1053
|
-
@api_client.config.logger.debug 'Calling API: HtmlApi.get_convert_document_to_mhtml_by_url ...'
|
1054
|
-
end
|
1055
|
-
# verify the required parameter 'source_url' is set
|
1056
|
-
if @api_client.config.client_side_validation && source_url.nil?
|
1057
|
-
fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_convert_document_to_mhtml_by_url"
|
1058
|
-
end
|
1059
|
-
# resource path
|
1060
|
-
local_var_path = '/html/convert/mhtml'
|
1061
|
-
|
1062
|
-
# query parameters
|
1063
|
-
query_params = {}
|
1064
|
-
query_params[:'sourceUrl'] = source_url
|
1065
|
-
|
1066
|
-
# header parameters
|
1067
|
-
header_params = {}
|
1068
|
-
# HTTP header 'Accept' (if needed)
|
1069
|
-
header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
|
1070
|
-
# HTTP header 'Content-Type'
|
1071
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1072
|
-
|
1073
|
-
# form parameters
|
1074
|
-
form_params = {}
|
1075
|
-
|
1076
|
-
# http body (model)
|
1077
|
-
post_body = nil
|
1078
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
1079
|
-
:header_params => header_params,
|
1080
|
-
:query_params => query_params,
|
1081
|
-
:form_params => form_params,
|
1082
|
-
:body => post_body,
|
1083
|
-
:return_type => 'File')
|
1084
|
-
if @api_client.config.debug
|
1085
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_mhtml_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1086
|
-
end
|
1087
|
-
return data, status_code, headers
|
1088
|
-
end
|
1089
|
-
|
1090
|
-
# Converts the HTML document (located on storage) to Markdown and returns resulting file in response content.
|
1091
|
-
# @param name Document name.
|
1092
|
-
# @param [Hash] opts the optional parameters
|
1093
|
-
# @option opts [String] :use_git Use Git Markdown flavor to save ("true" or "false"). (default to "false")
|
1094
|
-
# @option opts [String] :folder Source document folder.
|
1095
|
-
# @option opts [String] :storage Source document storage.
|
1096
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1097
|
-
def get_convert_document_to_markdown(name, opts = {})
|
1098
|
-
data, _status_code, _headers = get_convert_document_to_markdown_with_http_info(name, opts)
|
1099
|
-
return {file: data, status: _status_code, headers: _headers}
|
1100
|
-
end
|
1101
|
-
|
1102
|
-
# Converts the HTML document (located on storage) to Markdown and returns resulting file in response content.
|
1103
|
-
# @param name Document name.
|
1104
|
-
# @param [Hash] opts the optional parameters
|
1105
|
-
# @option opts [String] :use_git Use Git Markdown flavor to save ("true" or "false"). (default to "false")
|
1106
|
-
# @option opts [String] :folder Source document folder.
|
1107
|
-
# @option opts [String] :storage Source document storage.
|
1108
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1109
|
-
def get_convert_document_to_markdown_with_http_info(name, opts = {})
|
1110
|
-
if @api_client.config.debug
|
1111
|
-
@api_client.config.logger.debug 'Calling API: HtmlApi.get_convert_document_to_markdown ...'
|
1112
|
-
end
|
1113
|
-
# verify the required parameter 'name' is set
|
1114
|
-
if @api_client.config.client_side_validation && name.nil?
|
1115
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_convert_document_to_markdown"
|
1116
|
-
end
|
1117
|
-
# resource path
|
1118
|
-
local_var_path = '/html/{name}/convert/md'.sub('{' + 'name' + '}', name.to_s)
|
1119
|
-
|
1120
|
-
# query parameters
|
1121
|
-
query_params = {}
|
1122
|
-
query_params[:'useGit'] = opts[:'use_git'] if !opts[:'use_git'].nil?
|
1123
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
1124
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
1125
|
-
|
1126
|
-
# header parameters
|
1127
|
-
header_params = {}
|
1128
|
-
# HTTP header 'Accept' (if needed)
|
1129
|
-
header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
|
1130
|
-
# HTTP header 'Content-Type'
|
1131
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1132
|
-
|
1133
|
-
# form parameters
|
1134
|
-
form_params = {}
|
1135
|
-
|
1136
|
-
# http body (model)
|
1137
|
-
post_body = nil
|
1138
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
1139
|
-
:header_params => header_params,
|
1140
|
-
:query_params => query_params,
|
1141
|
-
:form_params => form_params,
|
1142
|
-
:body => post_body,
|
1143
|
-
:return_type => 'File')
|
1144
|
-
if @api_client.config.debug
|
1145
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_convert_document_to_markdown\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1146
|
-
end
|
1147
|
-
return data, status_code, headers
|
1148
|
-
end
|
1149
|
-
|
1150
|
-
# Converts the HTML document (in request content) to Markdown and uploads resulting file to storage by specified path.
|
1151
|
-
# @param out_path Full resulting file path in the storage (ex. /folder1/folder2/result.md)
|
1152
|
-
# @param file A file to be converted.
|
1153
|
-
# @param [Hash] opts the optional parameters
|
1154
|
-
# @option opts [String] :use_git Use Git Markdown flavor to save ("true" or "false"). (default to "false")
|
1155
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1156
|
-
def post_convert_document_in_request_to_markdown(out_path, file, opts = {})
|
1157
|
-
data, _status_code, _headers = post_convert_document_in_request_to_markdown_with_http_info(out_path, file, opts)
|
1158
|
-
return {file: data, status: _status_code, headers: _headers}
|
1159
|
-
end
|
1160
|
-
|
1161
|
-
# Converts the HTML document (in request content) to Markdown and uploads resulting file to storage by specified path.
|
1162
|
-
# @param out_path Full resulting file path in the storage (ex. /folder1/folder2/result.md)
|
1163
|
-
# @param file A file to be converted.
|
1164
|
-
# @param [Hash] opts the optional parameters
|
1165
|
-
# @option opts [String] :use_git Use Git Markdown flavor to save ("true" or "false"). (default to "false")
|
1166
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1167
|
-
def post_convert_document_in_request_to_markdown_with_http_info(out_path, file, opts = {})
|
1168
|
-
if @api_client.config.debug
|
1169
|
-
@api_client.config.logger.debug 'Calling API: HtmlApi.post_convert_document_in_request_to_markdown ...'
|
1170
|
-
end
|
1171
|
-
# verify the required parameter 'out_path' is set
|
1172
|
-
if @api_client.config.client_side_validation && out_path.nil?
|
1173
|
-
fail ArgumentError, "Missing the required parameter 'out_path' when calling HtmlApi.post_convert_document_in_request_to_markdown"
|
1174
|
-
end
|
1175
|
-
# verify the required parameter 'file' is set
|
1176
|
-
if @api_client.config.client_side_validation && file.nil?
|
1177
|
-
fail ArgumentError, "Missing the required parameter 'file' when calling HtmlApi.post_convert_document_in_request_to_markdown"
|
1178
|
-
end
|
1179
|
-
# resource path
|
1180
|
-
local_var_path = '/html/convert/md'
|
1181
|
-
|
1182
|
-
# query parameters
|
1183
|
-
query_params = {}
|
1184
|
-
query_params[:'outPath'] = out_path
|
1185
|
-
query_params[:'useGit'] = opts[:'use_git'] if !opts[:'use_git'].nil?
|
1186
|
-
|
1187
|
-
# header parameters
|
1188
|
-
header_params = {}
|
1189
|
-
# HTTP header 'Accept' (if needed)
|
1190
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1191
|
-
# HTTP header 'Content-Type'
|
1192
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
1193
|
-
|
1194
|
-
# form parameters
|
1195
|
-
form_params = {
|
1196
|
-
file: File::open(file,'rb')
|
1197
|
-
}
|
1198
|
-
|
1199
|
-
# http body (model)
|
1200
|
-
post_body = nil
|
1201
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
1202
|
-
:header_params => header_params,
|
1203
|
-
:query_params => query_params,
|
1204
|
-
:form_params => form_params,
|
1205
|
-
:body => post_body,
|
1206
|
-
:return_type => 'File')
|
1207
|
-
if @api_client.config.debug
|
1208
|
-
@api_client.config.logger.debug "API called: HtmlApi#put_convert_document_in_request_to_markdown\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1209
|
-
end
|
1210
|
-
return data, status_code, headers
|
1211
|
-
end
|
1212
|
-
|
1213
|
-
# Converts the HTML document (located on storage) to Markdown and uploads resulting file to storage by specified path.
|
1214
|
-
# @param name Document name.
|
1215
|
-
# @param out_path Full resulting file path in the storage (ex. /folder1/folder2/result.md)
|
1216
|
-
# @param [Hash] opts the optional parameters
|
1217
|
-
# @option opts [String] :use_git Use Git Markdown flavor to save ("true" or "false"). (default to "false")
|
1218
|
-
# @option opts [String] :folder The source document folder.
|
1219
|
-
# @option opts [String] :storage The source and resulting document storage.
|
1220
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1221
|
-
def put_convert_document_to_markdown(name, out_path, opts = {})
|
1222
|
-
data, _status_code, _headers = put_convert_document_to_markdown_with_http_info(name, out_path, opts)
|
1223
|
-
return {file: data, status: _status_code, headers: _headers}
|
1224
|
-
end
|
1225
|
-
|
1226
|
-
# Converts the HTML document (located on storage) to Markdown and uploads resulting file to storage by specified path.
|
1227
|
-
# @param name Document name.
|
1228
|
-
# @param out_path Full resulting file path in the storage (ex. /folder1/folder2/result.md)
|
1229
|
-
# @param [Hash] opts the optional parameters
|
1230
|
-
# @option opts [String] :use_git Use Git Markdown flavor to save ("true" or "false"). (default to "false")
|
1231
|
-
# @option opts [String] :folder The source document folder.
|
1232
|
-
# @option opts [String] :storage The source and resulting document storage.
|
1233
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1234
|
-
def put_convert_document_to_markdown_with_http_info(name, out_path, opts = {})
|
1235
|
-
if @api_client.config.debug
|
1236
|
-
@api_client.config.logger.debug 'Calling API: HtmlApi.put_convert_document_to_markdown ...'
|
1237
|
-
end
|
1238
|
-
# verify the required parameter 'name' is set
|
1239
|
-
if @api_client.config.client_side_validation && name.nil?
|
1240
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.put_convert_document_to_markdown"
|
1241
|
-
end
|
1242
|
-
# verify the required parameter 'out_path' is set
|
1243
|
-
if @api_client.config.client_side_validation && out_path.nil?
|
1244
|
-
fail ArgumentError, "Missing the required parameter 'out_path' when calling HtmlApi.put_convert_document_to_markdown"
|
1245
|
-
end
|
1246
|
-
# resource path
|
1247
|
-
local_var_path = '/html/{name}/convert/md'.sub('{' + 'name' + '}', name.to_s)
|
1248
|
-
|
1249
|
-
# query parameters
|
1250
|
-
query_params = {}
|
1251
|
-
query_params[:'outPath'] = out_path
|
1252
|
-
query_params[:'useGit'] = opts[:'use_git'] if !opts[:'use_git'].nil?
|
1253
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
1254
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
1255
|
-
|
1256
|
-
# header parameters
|
1257
|
-
header_params = {}
|
1258
|
-
# HTTP header 'Accept' (if needed)
|
1259
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1260
|
-
# HTTP header 'Content-Type'
|
1261
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1262
|
-
|
1263
|
-
# form parameters
|
1264
|
-
form_params = {}
|
1265
|
-
|
1266
|
-
# http body (model)
|
1267
|
-
post_body = nil
|
1268
|
-
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
1269
|
-
:header_params => header_params,
|
1270
|
-
:query_params => query_params,
|
1271
|
-
:form_params => form_params,
|
1272
|
-
:body => post_body,
|
1273
|
-
:return_type => 'File')
|
1274
|
-
if @api_client.config.debug
|
1275
|
-
@api_client.config.logger.debug "API called: HtmlApi#put_convert_document_to_markdown\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1276
|
-
end
|
1277
|
-
return data, status_code, headers
|
1278
|
-
end
|
1279
|
-
|
1280
|
-
################################################################################
|
1281
|
-
# Import Api
|
1282
|
-
################################################################################
|
1283
|
-
|
1284
|
-
# Converts the Markdown document (located on storage) to HTML and returns resulting file in response content.
|
1285
|
-
# @param name Document name.
|
1286
|
-
# @param [Hash] opts the optional parameters
|
1287
|
-
# @option opts [String] :folder Source document folder.
|
1288
|
-
# @option opts [String] :storage Source document storage.
|
1289
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1290
|
-
def get_convert_markdown_to_html(name, opts = {})
|
1291
|
-
data, _status_code, _headers = get_convert_markdown_to_html_with_http_info(name, opts)
|
1292
|
-
return {file: data, status: _status_code, headers: _headers}
|
1293
|
-
end
|
1294
|
-
|
1295
|
-
# Converts the Markdown document (located on storage) to HTML and returns resulting file in response content.
|
1296
|
-
# @param name Document name.
|
1297
|
-
# @param [Hash] opts the optional parameters
|
1298
|
-
# @option opts [String] :folder Source document folder.
|
1299
|
-
# @option opts [String] :storage Source document storage.
|
1300
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1301
|
-
def get_convert_markdown_to_html_with_http_info(name, opts = {})
|
1302
|
-
if @api_client.config.debug
|
1303
|
-
@api_client.config.logger.debug 'Calling API: HtmlApi.get_convert_markdown_to_html ...'
|
1304
|
-
end
|
1305
|
-
# verify the required parameter 'name' is set
|
1306
|
-
if @api_client.config.client_side_validation && name.nil?
|
1307
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_convert_markdown_to_html"
|
1308
|
-
end
|
1309
|
-
# resource path
|
1310
|
-
local_var_path = '/html/{name}/import/md'.sub('{' + 'name' + '}', name.to_s)
|
1311
|
-
|
1312
|
-
# query parameters
|
1313
|
-
query_params = {}
|
1314
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
1315
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
1316
|
-
|
1317
|
-
# header parameters
|
1318
|
-
header_params = {}
|
1319
|
-
# HTTP header 'Accept' (if needed)
|
1320
|
-
header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
|
1321
|
-
# HTTP header 'Content-Type'
|
1322
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1323
|
-
|
1324
|
-
# form parameters
|
1325
|
-
form_params = {}
|
1326
|
-
|
1327
|
-
# http body (model)
|
1328
|
-
post_body = nil
|
1329
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
1330
|
-
:header_params => header_params,
|
1331
|
-
:query_params => query_params,
|
1332
|
-
:form_params => form_params,
|
1333
|
-
:body => post_body,
|
1334
|
-
:return_type => 'File')
|
1335
|
-
if @api_client.config.debug
|
1336
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_convert_markdown_to_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1337
|
-
end
|
1338
|
-
return data, status_code, headers
|
1339
|
-
end
|
1340
|
-
|
1341
|
-
# Converts the Markdown document (in request content) to HTML and uploads resulting file to storage by specified path.
|
1342
|
-
# @param out_path Full resulting file path in the storage (ex. /folder1/folder2/result.html)
|
1343
|
-
# @param file A file to be converted.
|
1344
|
-
# @param [Hash] opts the optional parameters
|
1345
|
-
# @option opts [String] :storage Source document storage.
|
1346
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1347
|
-
def post_convert_markdown_in_request_to_html(out_path, file, opts = {})
|
1348
|
-
data, _status_code, _headers = post_convert_markdown_in_request_to_html_with_http_info(out_path, file, opts)
|
1349
|
-
return {file: data, status: _status_code, headers: _headers}
|
1350
|
-
end
|
1351
|
-
|
1352
|
-
# Converts the Markdown document (in request content) to HTML and uploads resulting file to storage by specified path.
|
1353
|
-
# @param out_path Full resulting file path in the storage (ex. /folder1/folder2/result.html)
|
1354
|
-
# @param file A file to be converted.
|
1355
|
-
# @param [Hash] opts the optional parameters
|
1356
|
-
# @option opts [String] :storage Source document storage.
|
1357
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1358
|
-
def post_convert_markdown_in_request_to_html_with_http_info(out_path, file, opts = {})
|
1359
|
-
if @api_client.config.debug
|
1360
|
-
@api_client.config.logger.debug 'Calling API: HtmlApi.post_convert_markdown_in_request_to_html ...'
|
1361
|
-
end
|
1362
|
-
# verify the required parameter 'out_path' is set
|
1363
|
-
if @api_client.config.client_side_validation && out_path.nil?
|
1364
|
-
fail ArgumentError, "Missing the required parameter 'out_path' when calling HtmlApi.post_convert_markdown_in_request_to_html"
|
1365
|
-
end
|
1366
|
-
# verify the required parameter 'file' is set
|
1367
|
-
if @api_client.config.client_side_validation && file.nil?
|
1368
|
-
fail ArgumentError, "Missing the required parameter 'file' when calling HtmlApi.post_convert_markdown_in_request_to_html"
|
1369
|
-
end
|
1370
|
-
# resource path
|
1371
|
-
local_var_path = '/html/import/md'
|
1372
|
-
|
1373
|
-
# query parameters
|
1374
|
-
query_params = {}
|
1375
|
-
query_params[:'outPath'] = out_path
|
1376
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
1377
|
-
|
1378
|
-
# header parameters
|
1379
|
-
header_params = {}
|
1380
|
-
# HTTP header 'Accept' (if needed)
|
1381
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1382
|
-
# HTTP header 'Content-Type'
|
1383
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
1384
|
-
|
1385
|
-
# form parameters
|
1386
|
-
form_params = {
|
1387
|
-
file: File::open(file,'rb')
|
1388
|
-
}
|
1389
|
-
|
1390
|
-
# http body (model)
|
1391
|
-
post_body = nil
|
1392
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
1393
|
-
:header_params => header_params,
|
1394
|
-
:query_params => query_params,
|
1395
|
-
:form_params => form_params,
|
1396
|
-
:body => post_body,
|
1397
|
-
:return_type => 'File')
|
1398
|
-
if @api_client.config.debug
|
1399
|
-
@api_client.config.logger.debug "API called: HtmlApi#put_convert_markdown_in_request_to_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1400
|
-
end
|
1401
|
-
return data, status_code, headers
|
1402
|
-
end
|
1403
|
-
|
1404
|
-
# Converts the Markdown document (located on storage) to HTML and uploads resulting file to storage by specified path.
|
1405
|
-
# @param name Document name.
|
1406
|
-
# @param out_path Full resulting file path in the storage (ex. /folder1/folder2/result.html)
|
1407
|
-
# @param [Hash] opts the optional parameters
|
1408
|
-
# @option opts [String] :folder The source document folder.
|
1409
|
-
# @option opts [String] :storage The source and resulting document storage.
|
1410
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1411
|
-
def put_convert_markdown_to_html(name, out_path, opts = {})
|
1412
|
-
data, _status_code, _headers = put_convert_markdown_to_html_with_http_info(name, out_path, opts)
|
1413
|
-
return {file: data, status: _status_code, headers: _headers}
|
1414
|
-
end
|
1415
|
-
|
1416
|
-
# Converts the Markdown document (located on storage) to HTML and uploads resulting file to storage by specified path.
|
1417
|
-
# @param name Document name.
|
1418
|
-
# @param out_path Full resulting file path in the storage (ex. /folder1/folder2/result.html)
|
1419
|
-
# @param [Hash] opts the optional parameters
|
1420
|
-
# @option opts [String] :folder The source document folder.
|
1421
|
-
# @option opts [String] :storage The source and resulting document storage.
|
1422
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1423
|
-
def put_convert_markdown_to_html_with_http_info(name, out_path, opts = {})
|
1424
|
-
if @api_client.config.debug
|
1425
|
-
@api_client.config.logger.debug 'Calling API: HtmlApi.put_convert_markdown_to_html ...'
|
1426
|
-
end
|
1427
|
-
# verify the required parameter 'name' is set
|
1428
|
-
if @api_client.config.client_side_validation && name.nil?
|
1429
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.put_convert_markdown_to_html"
|
1430
|
-
end
|
1431
|
-
# verify the required parameter 'out_path' is set
|
1432
|
-
if @api_client.config.client_side_validation && out_path.nil?
|
1433
|
-
fail ArgumentError, "Missing the required parameter 'out_path' when calling HtmlApi.put_convert_markdown_to_html"
|
1434
|
-
end
|
1435
|
-
# resource path
|
1436
|
-
local_var_path = '/html/{name}/import/md'.sub('{' + 'name' + '}', name.to_s)
|
1437
|
-
|
1438
|
-
# query parameters
|
1439
|
-
query_params = {}
|
1440
|
-
query_params[:'outPath'] = out_path
|
1441
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
1442
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
1443
|
-
|
1444
|
-
# header parameters
|
1445
|
-
header_params = {}
|
1446
|
-
# HTTP header 'Accept' (if needed)
|
1447
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1448
|
-
# HTTP header 'Content-Type'
|
1449
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1450
|
-
|
1451
|
-
# form parameters
|
1452
|
-
form_params = {}
|
1453
|
-
|
1454
|
-
# http body (model)
|
1455
|
-
post_body = nil
|
1456
|
-
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
1457
|
-
:header_params => header_params,
|
1458
|
-
:query_params => query_params,
|
1459
|
-
:form_params => form_params,
|
1460
|
-
:body => post_body,
|
1461
|
-
:return_type => 'File')
|
1462
|
-
if @api_client.config.debug
|
1463
|
-
@api_client.config.logger.debug "API called: HtmlApi#put_convert_markdown_to_html\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1464
|
-
end
|
1465
|
-
return data, status_code, headers
|
1466
|
-
end
|
1467
|
-
|
1468
|
-
################################################################################
|
1469
|
-
# Document Api
|
1470
|
-
################################################################################
|
1471
|
-
|
1472
|
-
# Return all HTML page with linked resources packaged as a ZIP archive by the source page URL.
|
1473
|
-
#
|
1474
|
-
# @param source_url Source page URL.
|
1475
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1476
|
-
def get_document_by_url(source_url)
|
1477
|
-
data, _status_code, _headers = get_document_by_url_with_http_info(source_url)
|
1478
|
-
return {file: data, status: _status_code, headers: _headers}
|
1479
|
-
end
|
1480
|
-
|
1481
|
-
# Return all HTML page with linked resources packaged as a ZIP archive by the source page URL.
|
1482
|
-
#
|
1483
|
-
# @param source_url Source page URL.
|
1484
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1485
|
-
def get_document_by_url_with_http_info(source_url)
|
1486
|
-
if @api_client.config.debug
|
1487
|
-
@api_client.config.logger.debug 'Calling API: `HtmlApi.get_document_by_url ...'
|
1488
|
-
end
|
1489
|
-
# verify the required parameter 'source_url' is set
|
1490
|
-
if @api_client.config.client_side_validation && source_url.nil?
|
1491
|
-
fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_document_by_url"
|
1492
|
-
end
|
1493
|
-
# resource path
|
1494
|
-
local_var_path = '/html/download'
|
1495
|
-
|
1496
|
-
# query parameters
|
1497
|
-
query_params = {}
|
1498
|
-
query_params[:'sourceUrl'] = source_url
|
1499
|
-
|
1500
|
-
# header parameters
|
1501
|
-
header_params = {}
|
1502
|
-
# HTTP header 'Accept' (if needed)
|
1503
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/zip'])
|
1504
|
-
# HTTP header 'Content-Type'
|
1505
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1506
|
-
|
1507
|
-
# form parameters
|
1508
|
-
form_params = {}
|
1509
|
-
|
1510
|
-
# http body (model)
|
1511
|
-
post_body = nil
|
1512
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
1513
|
-
:header_params => header_params,
|
1514
|
-
:query_params => query_params,
|
1515
|
-
:form_params => form_params,
|
1516
|
-
:body => post_body,
|
1517
|
-
:return_type => 'File')
|
1518
|
-
if @api_client.config.debug
|
1519
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_document_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1520
|
-
end
|
1521
|
-
return data, status_code, headers
|
1522
|
-
end
|
1523
|
-
|
1524
|
-
# Return list of HTML fragments matching the specified XPath query.
|
1525
|
-
# @param name The document name.
|
1526
|
-
# @param x_path XPath query string.
|
1527
|
-
# @param out_format Output format. Possible values: 'plain' and 'json'.
|
1528
|
-
# @param [Hash] opts the optional parameters
|
1529
|
-
# @option opts [String] :storage The document storage.
|
1530
|
-
# @option opts [String] :folder The document folder.
|
1531
|
-
# @return [File]
|
1532
|
-
def document_get_document_fragment_by_x_path(name, x_path, out_format, opts = {})
|
1533
|
-
data, _status_code, _headers = document_get_document_fragment_by_x_path_with_http_info(name, x_path, out_format, opts)
|
1534
|
-
data
|
1535
|
-
end
|
1536
|
-
|
1537
|
-
|
1538
|
-
# Return list of HTML fragments matching the specified XPath query.
|
1539
|
-
#
|
1540
|
-
# @param name The document name.
|
1541
|
-
# @param x_path XPath query string.
|
1542
|
-
# @param out_format Output format. Possible values: 'plain' and 'json'.
|
1543
|
-
# @param [Hash] opts the optional parameters
|
1544
|
-
# @option opts [String] :storage The document storage.
|
1545
|
-
# @option opts [String] :folder The document folder.
|
1546
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1547
|
-
def get_document_fragment_by_x_path(name, x_path, out_format, opts = {})
|
1548
|
-
data, _status_code, _headers = get_document_fragment_by_x_path_with_http_info(name, x_path, out_format, opts)
|
1549
|
-
return {file: data, status: _status_code, headers: _headers}
|
1550
|
-
end
|
1551
|
-
|
1552
|
-
# Return list of HTML fragments matching the specified XPath query.
|
1553
|
-
#
|
1554
|
-
# @param name The document name.
|
1555
|
-
# @param x_path XPath query string.
|
1556
|
-
# @param out_format Output format. Possible values: 'plain' and 'json'.
|
1557
|
-
# @param [Hash] opts the optional parameters
|
1558
|
-
# @option opts [String] :storage The document storage.
|
1559
|
-
# @option opts [String] :folder The document folder.
|
1560
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1561
|
-
def get_document_fragment_by_x_path_with_http_info(name, x_path, out_format, opts = {})
|
1562
|
-
if @api_client.config.debug
|
1563
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.get_document_fragment_by_x_path ..."
|
1564
|
-
end
|
1565
|
-
# verify the required parameter 'name' is set
|
1566
|
-
if @api_client.config.client_side_validation && name.nil?
|
1567
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_document_fragment_by_x_path"
|
1568
|
-
end
|
1569
|
-
# verify the required parameter 'x_path' is set
|
1570
|
-
if @api_client.config.client_side_validation && x_path.nil?
|
1571
|
-
fail ArgumentError, "Missing the required parameter 'x_path' when calling HtmlApi.get_document_fragment_by_x_path"
|
1572
|
-
end
|
1573
|
-
# verify the required parameter 'out_format' is set
|
1574
|
-
if @api_client.config.client_side_validation && out_format.nil?
|
1575
|
-
fail ArgumentError, "Missing the required parameter 'out_format' when calling HtmlApi.get_document_fragment_by_x_path"
|
1576
|
-
end
|
1577
|
-
# resource path
|
1578
|
-
local_var_path = "/html/{name}/fragments/{outFormat}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'outFormat' + '}', out_format.to_s)
|
1579
|
-
|
1580
|
-
# query parameters
|
1581
|
-
query_params = {}
|
1582
|
-
query_params[:'xPath'] = x_path
|
1583
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
1584
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
1585
|
-
|
1586
|
-
# header parameters
|
1587
|
-
header_params = {}
|
1588
|
-
# HTTP header 'Accept' (if needed)
|
1589
|
-
header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
|
1590
|
-
# HTTP header 'Content-Type'
|
1591
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1592
|
-
|
1593
|
-
# form parameters
|
1594
|
-
form_params = {}
|
1595
|
-
|
1596
|
-
# http body (model)
|
1597
|
-
post_body = nil
|
1598
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
1599
|
-
:header_params => header_params,
|
1600
|
-
:query_params => query_params,
|
1601
|
-
:form_params => form_params,
|
1602
|
-
:body => post_body,
|
1603
|
-
:return_type => 'File')
|
1604
|
-
if @api_client.config.debug
|
1605
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_document_fragment_by_x_path\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1606
|
-
end
|
1607
|
-
return data, status_code, headers
|
1608
|
-
end
|
1609
|
-
|
1610
|
-
# Return list of HTML fragments matching the specified XPath query by the source page URL.
|
1611
|
-
#
|
1612
|
-
# @param source_url Source page URL.
|
1613
|
-
# @param x_path XPath query string.
|
1614
|
-
# @param out_format Output format. Possible values: 'plain' and 'json'.
|
1615
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1616
|
-
def get_document_fragment_by_x_path_by_url(source_url, x_path, out_format)
|
1617
|
-
data, _status_code, _headers = get_document_fragment_by_x_path_by_url_with_http_info(source_url, x_path, out_format)
|
1618
|
-
return {file: data, status: _status_code, headers: _headers}
|
1619
|
-
end
|
1620
|
-
|
1621
|
-
# Return list of HTML fragments matching the specified XPath query by the source page URL.
|
1622
|
-
#
|
1623
|
-
# @param source_url Source page URL.
|
1624
|
-
# @param x_path XPath query string.
|
1625
|
-
# @param out_format Output format. Possible values: 'plain' and 'json'.
|
1626
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1627
|
-
def get_document_fragment_by_x_path_by_url_with_http_info(source_url, x_path, out_format)
|
1628
|
-
if @api_client.config.debug
|
1629
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.get_document_fragment_by_x_path_by_url ..."
|
1630
|
-
end
|
1631
|
-
# verify the required parameter 'source_url' is set
|
1632
|
-
if @api_client.config.client_side_validation && source_url.nil?
|
1633
|
-
fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_document_fragment_by_x_path_by_url"
|
1634
|
-
end
|
1635
|
-
# verify the required parameter 'x_path' is set
|
1636
|
-
if @api_client.config.client_side_validation && x_path.nil?
|
1637
|
-
fail ArgumentError, "Missing the required parameter 'x_path' when calling HtmlApi.get_document_fragment_by_x_path_by_url"
|
1638
|
-
end
|
1639
|
-
# verify the required parameter 'out_format' is set
|
1640
|
-
if @api_client.config.client_side_validation && out_format.nil?
|
1641
|
-
fail ArgumentError, "Missing the required parameter 'out_format' when calling HtmlApi.get_document_fragment_by_x_path_by_url"
|
1642
|
-
end
|
1643
|
-
# resource path
|
1644
|
-
local_var_path = "/html/fragments/{outFormat}".sub('{' + 'outFormat' + '}', out_format.to_s)
|
1645
|
-
|
1646
|
-
# query parameters
|
1647
|
-
query_params = {}
|
1648
|
-
query_params[:'sourceUrl'] = source_url
|
1649
|
-
query_params[:'xPath'] = x_path
|
1650
|
-
|
1651
|
-
# header parameters
|
1652
|
-
header_params = {}
|
1653
|
-
# HTTP header 'Accept' (if needed)
|
1654
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/zip'])
|
1655
|
-
# HTTP header 'Content-Type'
|
1656
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1657
|
-
|
1658
|
-
# form parameters
|
1659
|
-
form_params = {}
|
1660
|
-
|
1661
|
-
# http body (model)
|
1662
|
-
post_body = nil
|
1663
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
1664
|
-
:header_params => header_params,
|
1665
|
-
:query_params => query_params,
|
1666
|
-
:form_params => form_params,
|
1667
|
-
:body => post_body,
|
1668
|
-
:return_type => 'File')
|
1669
|
-
if @api_client.config.debug
|
1670
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_document_fragment_by_x_path_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1671
|
-
end
|
1672
|
-
return data, status_code, headers
|
1673
|
-
end
|
1674
|
-
|
1675
|
-
# Return list of HTML fragments matching the specified CSS selector.
|
1676
|
-
#
|
1677
|
-
# @param name The document name.
|
1678
|
-
# @param selector CSS selector string.
|
1679
|
-
# @param out_format Output format. Possible values: 'plain' and 'json'.
|
1680
|
-
# @param [Hash] opts the optional parameters
|
1681
|
-
# @option opts [String] :folder The document folder.
|
1682
|
-
# @option opts [String] :storage The document storage.
|
1683
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1684
|
-
def get_document_fragments_by_css_selector(name, selector, out_format, opts = {})
|
1685
|
-
data, _status_code, _headers = get_document_fragments_by_css_selector_with_http_info(name, selector, out_format, opts)
|
1686
|
-
return {file: data, status: _status_code, headers: _headers}
|
1687
|
-
end
|
1688
|
-
|
1689
|
-
# Return list of HTML fragments matching the specified CSS selector.
|
1690
|
-
#
|
1691
|
-
# @param name The document name.
|
1692
|
-
# @param selector CSS selector string.
|
1693
|
-
# @param out_format Output format. Possible values: 'plain' and 'json'.
|
1694
|
-
# @param [Hash] opts the optional parameters
|
1695
|
-
# @option opts [String] :folder The document folder.
|
1696
|
-
# @option opts [String] :storage The document storage.
|
1697
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1698
|
-
def get_document_fragments_by_css_selector_with_http_info(name, selector, out_format, opts = {})
|
1699
|
-
if @api_client.config.debug
|
1700
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.get_document_fragments_by_css_selector ..."
|
1701
|
-
end
|
1702
|
-
# verify the required parameter 'name' is set
|
1703
|
-
if @api_client.config.client_side_validation && name.nil?
|
1704
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_document_fragments_by_css_selector"
|
1705
|
-
end
|
1706
|
-
# verify the required parameter 'selector' is set
|
1707
|
-
if @api_client.config.client_side_validation && selector.nil?
|
1708
|
-
fail ArgumentError, "Missing the required parameter 'selector' when calling HtmlApi.get_document_fragments_by_css_selector"
|
1709
|
-
end
|
1710
|
-
# verify the required parameter 'out_format' is set
|
1711
|
-
if @api_client.config.client_side_validation && out_format.nil?
|
1712
|
-
fail ArgumentError, "Missing the required parameter 'out_format' when calling HtmlApi.get_document_fragments_by_css_selector"
|
1713
|
-
end
|
1714
|
-
# resource path
|
1715
|
-
local_var_path = "/html/{name}/fragments/css/{outFormat}".sub('{' + 'name' + '}', name.to_s).sub('{' + 'outFormat' + '}', out_format.to_s)
|
1716
|
-
|
1717
|
-
# query parameters
|
1718
|
-
query_params = {}
|
1719
|
-
query_params[:'selector'] = selector
|
1720
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
1721
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
1722
|
-
|
1723
|
-
# header parameters
|
1724
|
-
header_params = {}
|
1725
|
-
# HTTP header 'Accept' (if needed)
|
1726
|
-
header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
|
1727
|
-
# HTTP header 'Content-Type'
|
1728
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1729
|
-
|
1730
|
-
# form parameters
|
1731
|
-
form_params = {}
|
1732
|
-
|
1733
|
-
# http body (model)
|
1734
|
-
post_body = nil
|
1735
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
1736
|
-
:header_params => header_params,
|
1737
|
-
:query_params => query_params,
|
1738
|
-
:form_params => form_params,
|
1739
|
-
:body => post_body,
|
1740
|
-
:return_type => 'File')
|
1741
|
-
if @api_client.config.debug
|
1742
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_document_fragments_by_css_selector\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1743
|
-
end
|
1744
|
-
return data, status_code, headers
|
1745
|
-
end
|
1746
|
-
|
1747
|
-
# Return list of HTML fragments matching the specified CSS selector by the source page URL.
|
1748
|
-
#
|
1749
|
-
# @param source_url Source page URL.
|
1750
|
-
# @param selector CSS selector string.
|
1751
|
-
# @param out_format Output format. Possible values: 'plain' and 'json'.
|
1752
|
-
# @param [Hash] opts the optional parameters
|
1753
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1754
|
-
def get_document_fragments_by_css_selector_by_url(source_url, selector, out_format, opts = {})
|
1755
|
-
data, _status_code, _headers = get_document_fragments_by_css_selector_by_url_with_http_info(source_url, selector, out_format, opts)
|
1756
|
-
return {file: data, status: _status_code, headers: _headers}
|
1757
|
-
end
|
1758
|
-
|
1759
|
-
# Return list of HTML fragments matching the specified CSS selector by the source page URL.
|
1760
|
-
#
|
1761
|
-
# @param source_url Source page URL.
|
1762
|
-
# @param selector CSS selector string.
|
1763
|
-
# @param out_format Output format. Possible values: 'plain' and 'json'.
|
1764
|
-
# @param [Hash] opts the optional parameters
|
1765
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1766
|
-
def get_document_fragments_by_css_selector_by_url_with_http_info(source_url, selector, out_format, opts = {})
|
1767
|
-
if @api_client.config.debug
|
1768
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.get_document_fragments_by_css_selector_by_url ..."
|
38
|
+
@storage_api = AsposeHtml::StorageApi.new args
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
# Converting the HTML, EPUB document from the local file and putting the result in the local file
|
43
|
+
#
|
44
|
+
# @param src Full path to source file.
|
45
|
+
# @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
|
46
|
+
# @param [Hash] options the optional parameters
|
47
|
+
# @option options [Integer] :width Resulting image width.
|
48
|
+
# @option opts [Integer] :height Resulting image height.
|
49
|
+
# @option opts [Integer] :left_margin Left resulting image margin.
|
50
|
+
# @option opts [Integer] :right_margin Right resulting image margin.
|
51
|
+
# @option opts [Integer] :top_margin Top resulting image margin.
|
52
|
+
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
53
|
+
# @option opts [Integer] :resolution Resolution of resulting image.
|
54
|
+
# @return [ConversionResult] Result of conversion. See ConversionResult object.
|
55
|
+
def convert_local_to_local(src, dst, options = nil)
|
56
|
+
return convert(src, dst, true, true, false, options)
|
57
|
+
end
|
58
|
+
|
59
|
+
# Converting the HTML, EPUB document from the local file and putting the result in the storage
|
60
|
+
#
|
61
|
+
# @param src Full path to source file.
|
62
|
+
# @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
|
63
|
+
# @param storage Storage name. Default storage is nil.
|
64
|
+
# @param [Hash] options the optional parameters
|
65
|
+
# @option options [Integer] :width Resulting image width.
|
66
|
+
# @option opts [Integer] :height Resulting image height.
|
67
|
+
# @option opts [Integer] :left_margin Left resulting image margin.
|
68
|
+
# @option opts [Integer] :right_margin Right resulting image margin.
|
69
|
+
# @option opts [Integer] :top_margin Top resulting image margin.
|
70
|
+
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
71
|
+
# @option opts [Integer] :resolution Resolution of resulting image.
|
72
|
+
# @return [ConversionResult] Result of conversion. See ConversionResult object.
|
73
|
+
def convert_local_to_storage(src, dst, storage, options=nil)
|
74
|
+
return convert(src, dst, true, false, false, options, storage)
|
75
|
+
end
|
76
|
+
|
77
|
+
# Converting the HTML, EPUB document from the storage and putting the result in the local file
|
78
|
+
#
|
79
|
+
# @param src Full path to source file.
|
80
|
+
# @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
|
81
|
+
# @param storage Storage name. Default storage is nil.
|
82
|
+
# @param [Hash] options the optional parameters
|
83
|
+
# @option options [Integer] :width Resulting image width.
|
84
|
+
# @option opts [Integer] :height Resulting image height.
|
85
|
+
# @option opts [Integer] :left_margin Left resulting image margin.
|
86
|
+
# @option opts [Integer] :right_margin Right resulting image margin.
|
87
|
+
# @option opts [Integer] :top_margin Top resulting image margin.
|
88
|
+
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
89
|
+
# @option opts [Integer] :resolution Resolution of resulting image.
|
90
|
+
# @return [ConversionResult] Result of conversion. See ConversionResult object.
|
91
|
+
def convert_storage_to_local(src, dst, storage, options=nil)
|
92
|
+
return convert(src, dst, false, true, false, options, storage)
|
93
|
+
end
|
94
|
+
|
95
|
+
# Converting the HTML, EPUB document from the storage and putting the result in the storage
|
96
|
+
#
|
97
|
+
# @param src Full path to source file.
|
98
|
+
# @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
|
99
|
+
# @param storage Storage name. Default storage is nil.
|
100
|
+
# @param [Hash] options the optional parameters
|
101
|
+
# @option options [Integer] :width Resulting image width.
|
102
|
+
# @option opts [Integer] :height Resulting image height.
|
103
|
+
# @option opts [Integer] :left_margin Left resulting image margin.
|
104
|
+
# @option opts [Integer] :right_margin Right resulting image margin.
|
105
|
+
# @option opts [Integer] :top_margin Top resulting image margin.
|
106
|
+
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
107
|
+
# @option opts [Integer] :resolution Resolution of resulting image.
|
108
|
+
# @return [ConversionResult] Result of conversion. See ConversionResult object.
|
109
|
+
def convert_storage_to_storage(src, dst, storage, options=nil)
|
110
|
+
return convert(src, dst, false, false, false, options, storage)
|
111
|
+
end
|
112
|
+
|
113
|
+
# Converting the HTML page from URL and putting the result in the local file
|
114
|
+
#
|
115
|
+
# @param src URI of the website.
|
116
|
+
# @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
|
117
|
+
# @param [Hash] options the optional parameters
|
118
|
+
# @option options [Integer] :width Resulting image width.
|
119
|
+
# @option opts [Integer] :height Resulting image height.
|
120
|
+
# @option opts [Integer] :left_margin Left resulting image margin.
|
121
|
+
# @option opts [Integer] :right_margin Right resulting image margin.
|
122
|
+
# @option opts [Integer] :top_margin Top resulting image margin.
|
123
|
+
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
124
|
+
# @option opts [Integer] :resolution Resolution of resulting image.
|
125
|
+
# @return [ConversionResult] Result of conversion. See ConversionResult object.
|
126
|
+
def convert_url_to_local(src, dst, options=nil)
|
127
|
+
return convert(src, dst, false, true, true, options)
|
128
|
+
end
|
129
|
+
|
130
|
+
# Converting the HTML page from URL and putting the result in the storage
|
131
|
+
#
|
132
|
+
# @param src URI of the website.
|
133
|
+
# @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
|
134
|
+
# @param storage Storage name. Default storage is nil.
|
135
|
+
# @param [Hash] options the optional parameters
|
136
|
+
# @option options [Integer] :width Resulting image width.
|
137
|
+
# @option opts [Integer] :height Resulting image height.
|
138
|
+
# @option opts [Integer] :left_margin Left resulting image margin.
|
139
|
+
# @option opts [Integer] :right_margin Right resulting image margin.
|
140
|
+
# @option opts [Integer] :top_margin Top resulting image margin.
|
141
|
+
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
142
|
+
# @option opts [Integer] :resolution Resolution of resulting image.
|
143
|
+
# @return [ConversionResult] Result of conversion. See ConversionResult object.
|
144
|
+
def convert_url_to_storage(src, dst, storage, options=nil)
|
145
|
+
return convert(src, dst, false, false, true, options, storage)
|
146
|
+
end
|
147
|
+
|
148
|
+
# Converting the HTML document to various formats
|
149
|
+
#
|
150
|
+
# @param src Source file or URL.
|
151
|
+
# @param dst Full path to a result file (pdf, xps, docx, md, mhtml, jpeg, png, bmp, tiff, gif).
|
152
|
+
# @param src_in_local Flag, true if source in the local file.
|
153
|
+
# @param dst_in_local Flag, true if result in the local file.
|
154
|
+
# @param is_url Flag, true if source is website.
|
155
|
+
# @param [Hash] options the optional parameters
|
156
|
+
# @option options [Integer] :width Resulting image width.
|
157
|
+
# @option opts [Integer] :height Resulting image height.
|
158
|
+
# @option opts [Integer] :left_margin Left resulting image margin.
|
159
|
+
# @option opts [Integer] :right_margin Right resulting image margin.
|
160
|
+
# @option opts [Integer] :top_margin Top resulting image margin.
|
161
|
+
# @option opts [Integer] :bottom_margin Bottom resulting image margin.
|
162
|
+
# @option opts [Integer] :resolution Resolution of resulting image.
|
163
|
+
# @param storage_name Storage name. Default storage is nil.
|
164
|
+
# @return [ConversionResult] Result of conversion. See ConversionResult object.
|
165
|
+
def convert(src, dst, src_in_local, dst_in_local, is_url, options=nil, storage_name=nil)
|
166
|
+
if src_in_local
|
167
|
+
res = @storage_api.upload_file("/", src)
|
168
|
+
if res.uploaded.length != 1 || res.errors.length != 0
|
169
|
+
fail ApiError.new('Unable to upload file')
|
170
|
+
end
|
171
|
+
file_in_storage = res.uploaded[0]
|
172
|
+
else
|
173
|
+
file_in_storage = src
|
174
|
+
end
|
175
|
+
|
176
|
+
out_file = File.basename(dst)
|
177
|
+
out_file = dst unless dst_in_local
|
178
|
+
|
179
|
+
input_format = 'html'
|
180
|
+
input_format = get_input_format(src) unless is_url
|
181
|
+
|
182
|
+
output_format = File.extname(dst).strip.downcase[1..-1]
|
183
|
+
|
184
|
+
if output_format == 'jpg'
|
185
|
+
output_format = 'jpeg'
|
186
|
+
elsif output_format == 'mht'
|
187
|
+
output_format = 'mhtml'
|
188
|
+
elsif output_format == 'tif'
|
189
|
+
output_format = 'tiff'
|
190
|
+
end
|
191
|
+
|
192
|
+
local_var_path = "/html/conversion/{from}-{to}".sub('{' + 'from' + '}', input_format.to_s).sub('{' + 'to' + '}', output_format.to_s)
|
193
|
+
|
194
|
+
post_body = {}
|
195
|
+
post_body[:'inputPath'] = file_in_storage.to_s
|
196
|
+
post_body[:'outputFile'] = out_file.to_s
|
197
|
+
post_body[:'storageName'] = storage_name.to_s
|
198
|
+
|
199
|
+
if !options.nil?
|
200
|
+
post_body[:'options'] = {}
|
201
|
+
post_body[:'options'][:'width'] = options[:'width'] if !options[:'width'].nil?
|
202
|
+
post_body[:'options'][:'height'] = options[:'height'] if !options[:'height'].nil?
|
203
|
+
post_body[:'options'][:'leftMargin'] = options[:'left_margin'] if !options[:'left_margin'].nil?
|
204
|
+
post_body[:'options'][:'rightMargin'] = options[:'right_margin'] if !options[:'right_margin'].nil?
|
205
|
+
post_body[:'options'][:'topMargin'] = options[:'top_margin'] if !options[:'top_margin'].nil?
|
206
|
+
post_body[:'options'][:'bottomMargin'] = options[:'bottom_margin'] if !options[:'bottom_margin'].nil?
|
207
|
+
post_body[:'options'][:'resolution'] = options[:'resolution'] if !options[:'resolution'].nil?
|
1769
208
|
end
|
1770
|
-
# verify the required parameter 'source_url' is set
|
1771
|
-
if @api_client.config.client_side_validation && source_url.nil?
|
1772
|
-
fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_document_fragments_by_css_selector_by_url"
|
1773
|
-
end
|
1774
|
-
# verify the required parameter 'selector' is set
|
1775
|
-
if @api_client.config.client_side_validation && selector.nil?
|
1776
|
-
fail ArgumentError, "Missing the required parameter 'selector' when calling HtmlApi.get_document_fragments_by_css_selector_by_url"
|
1777
|
-
end
|
1778
|
-
# verify the required parameter 'out_format' is set
|
1779
|
-
if @api_client.config.client_side_validation && out_format.nil?
|
1780
|
-
fail ArgumentError, "Missing the required parameter 'out_format' when calling HtmlApi.get_document_fragments_by_css_selector_by_url"
|
1781
|
-
end
|
1782
|
-
# resource path
|
1783
|
-
local_var_path = "/html/fragments/css/{outFormat}".sub('{' + 'outFormat' + '}', out_format.to_s)
|
1784
209
|
|
1785
|
-
# query parameters
|
1786
210
|
query_params = {}
|
1787
|
-
query_params[:'sourceUrl'] = source_url
|
1788
|
-
query_params[:'selector'] = selector
|
1789
211
|
|
1790
212
|
# header parameters
|
1791
213
|
header_params = {}
|
1792
214
|
# HTTP header 'Accept' (if needed)
|
1793
|
-
header_params['Accept'] = @api_client.select_header_accept(['
|
215
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1794
216
|
# HTTP header 'Content-Type'
|
1795
217
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1796
218
|
|
1797
219
|
# form parameters
|
1798
220
|
form_params = {}
|
1799
221
|
|
1800
|
-
|
1801
|
-
post_body = nil
|
1802
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
222
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
1803
223
|
:header_params => header_params,
|
1804
224
|
:query_params => query_params,
|
1805
225
|
:form_params => form_params,
|
1806
226
|
:body => post_body,
|
1807
|
-
:return_type => '
|
1808
|
-
if @api_client.config.debug
|
1809
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_document_fragments_by_css_selector_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1810
|
-
end
|
1811
|
-
return data, status_code, headers
|
1812
|
-
end
|
1813
|
-
|
1814
|
-
# Return all HTML document images packaged as a ZIP archive.
|
1815
|
-
#
|
1816
|
-
# @param name The document name.
|
1817
|
-
# @param [Hash] opts the optional parameters
|
1818
|
-
# @option opts [String] :folder The document folder.
|
1819
|
-
# @option opts [String] :storage The document storage.
|
1820
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1821
|
-
def get_document_images(name, opts = {})
|
1822
|
-
data, _status_code, _headers = get_document_images_with_http_info(name, opts)
|
1823
|
-
return {file: data, status: _status_code, headers: _headers}
|
1824
|
-
end
|
1825
|
-
|
1826
|
-
# Return all HTML document images packaged as a ZIP archive.
|
1827
|
-
#
|
1828
|
-
# @param name The document name.
|
1829
|
-
# @param [Hash] opts the optional parameters
|
1830
|
-
# @option opts [String] :folder The document folder.
|
1831
|
-
# @option opts [String] :storage The document storage.
|
1832
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1833
|
-
def get_document_images_with_http_info(name, opts = {})
|
227
|
+
:return_type => 'ConversionResult')
|
1834
228
|
if @api_client.config.debug
|
1835
|
-
@api_client.config.logger.debug "
|
1836
|
-
end
|
1837
|
-
# verify the required parameter 'name' is set
|
1838
|
-
if @api_client.config.client_side_validation && name.nil?
|
1839
|
-
fail ArgumentError, "Missing the required parameter 'name' when calling HtmlApi.get_document_images"
|
229
|
+
@api_client.config.logger.debug "API called: Create task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1840
230
|
end
|
1841
|
-
# resource path
|
1842
|
-
local_var_path = "/html/{name}/images/all".sub('{' + 'name' + '}', name.to_s)
|
1843
|
-
|
1844
|
-
# query parameters
|
1845
|
-
query_params = {}
|
1846
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
1847
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
1848
|
-
|
1849
|
-
# header parameters
|
1850
|
-
header_params = {}
|
1851
|
-
# HTTP header 'Accept' (if needed)
|
1852
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/zip'])
|
1853
|
-
# HTTP header 'Content-Type'
|
1854
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1855
|
-
|
1856
|
-
# form parameters
|
1857
|
-
form_params = {}
|
1858
231
|
|
1859
|
-
|
1860
|
-
|
1861
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
1862
|
-
:header_params => header_params,
|
1863
|
-
:query_params => query_params,
|
1864
|
-
:form_params => form_params,
|
1865
|
-
:body => post_body,
|
1866
|
-
:return_type => 'File')
|
1867
|
-
if @api_client.config.debug
|
1868
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_document_images\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
232
|
+
if status_code != 200
|
233
|
+
fail ApiError.new('Conversion failed')
|
1869
234
|
end
|
1870
|
-
return data, status_code, headers
|
1871
|
-
end
|
1872
|
-
|
1873
|
-
|
1874
|
-
# Return all HTML page images packaged as a ZIP archive by the source page URL.
|
1875
|
-
#
|
1876
|
-
# @param source_url Source page URL.
|
1877
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1878
|
-
def get_document_images_by_url(source_url)
|
1879
|
-
data, _status_code, _headers = get_document_images_by_url_with_http_info(source_url)
|
1880
|
-
return {file: data, status: _status_code, headers: _headers}
|
1881
|
-
end
|
1882
235
|
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
if @api_client.config.debug
|
1889
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.get_document_images_by_url ..."
|
1890
|
-
end
|
1891
|
-
# verify the required parameter 'source_url' is set
|
1892
|
-
if @api_client.config.client_side_validation && source_url.nil?
|
1893
|
-
fail ArgumentError, "Missing the required parameter 'source_url' when calling HtmlApi.get_document_images_by_url"
|
236
|
+
while true
|
237
|
+
data, status_code, headers = get_status(data.id)
|
238
|
+
fail ApiError.new('Conversion failed') if data.code != 200 or data.status == 'faulted' or data.status == 'canceled'
|
239
|
+
break if data.status == 'completed'
|
240
|
+
sleep 3
|
1894
241
|
end
|
1895
|
-
# resource path
|
1896
|
-
local_var_path = "/html/images/all"
|
1897
|
-
|
1898
|
-
# query parameters
|
1899
|
-
query_params = {}
|
1900
|
-
query_params[:'sourceUrl'] = source_url
|
1901
|
-
|
1902
|
-
# header parameters
|
1903
|
-
header_params = {}
|
1904
|
-
# HTTP header 'Accept' (if needed)
|
1905
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/zip'])
|
1906
|
-
# HTTP header 'Content-Type'
|
1907
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1908
|
-
|
1909
|
-
# form parameters
|
1910
|
-
form_params = {}
|
1911
242
|
|
1912
|
-
|
1913
|
-
|
1914
|
-
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
:body => post_body,
|
1919
|
-
:return_type => 'File')
|
1920
|
-
if @api_client.config.debug
|
1921
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_document_images_by_url\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
243
|
+
if dst_in_local
|
244
|
+
out_folder = File.dirname(dst)
|
245
|
+
d = @storage_api.download_file(data.file)
|
246
|
+
out_name = out_folder + '/' + File.basename(data.file)
|
247
|
+
File.rename(d, out_name)
|
248
|
+
data.file = out_name
|
1922
249
|
end
|
1923
|
-
return data, status_code, headers
|
1924
|
-
end
|
1925
|
-
|
1926
|
-
################################################################################
|
1927
|
-
# SEO Api
|
1928
|
-
################################################################################
|
1929
250
|
|
1930
|
-
|
1931
|
-
#
|
1932
|
-
# @param addr Source page URL.
|
1933
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1934
|
-
def get_seo_warning(addr)
|
1935
|
-
data, _status_code, _headers = get_seo_warning_with_http_info(addr)
|
1936
|
-
return {file: data, status: _status_code, headers: _headers}
|
251
|
+
data
|
1937
252
|
end
|
1938
253
|
|
1939
|
-
|
1940
|
-
#
|
1941
|
-
# @param addr Source page URL.
|
1942
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1943
|
-
def get_seo_warning_with_http_info(addr)
|
1944
|
-
if @api_client.config.debug
|
1945
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.get_seo_warning ..."
|
1946
|
-
end
|
1947
|
-
# verify the required parameter 'addr' is set
|
1948
|
-
if @api_client.config.client_side_validation && addr.nil?
|
1949
|
-
fail ArgumentError, "Missing the required parameter 'addr' when calling HtmlApi.get_seo_warning"
|
1950
|
-
end
|
1951
|
-
# resource path
|
1952
|
-
local_var_path = "/html/seo"
|
1953
|
-
|
1954
|
-
# query parameters
|
1955
|
-
query_params = {}
|
1956
|
-
query_params[:'addr'] = addr
|
254
|
+
def get_status(id)
|
1957
255
|
|
256
|
+
local_var_path = "/html/conversion/{id}".sub('{' + 'id' + '}', id.to_s)
|
1958
257
|
# header parameters
|
1959
258
|
header_params = {}
|
1960
259
|
# HTTP header 'Accept' (if needed)
|
@@ -1962,223 +261,38 @@ module AsposeHtml
|
|
1962
261
|
# HTTP header 'Content-Type'
|
1963
262
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1964
263
|
|
1965
|
-
# form parameters
|
1966
|
-
form_params = {}
|
1967
|
-
|
1968
|
-
# http body (model)
|
1969
|
-
post_body = nil
|
1970
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
1971
|
-
:header_params => header_params,
|
1972
|
-
:query_params => query_params,
|
1973
|
-
:form_params => form_params,
|
1974
|
-
:body => post_body,
|
1975
|
-
:return_type => 'File')
|
1976
|
-
if @api_client.config.debug
|
1977
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_seo_warning\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1978
|
-
end
|
1979
|
-
return data, status_code, headers
|
1980
|
-
end
|
1981
|
-
|
1982
|
-
# Checks the markup validity of Web documents in HTML, XHTML, etc., and return result in json format.
|
1983
|
-
#
|
1984
|
-
# @param url Source page URL.
|
1985
|
-
# @return [Hash] {file: data, status: _status_code, headers: _headers}
|
1986
|
-
def get_html_warning(url)
|
1987
|
-
data, _status_code, _headers = get_html_warning_with_http_info(url)
|
1988
|
-
return {file: data, status: _status_code, headers: _headers}
|
1989
|
-
end
|
1990
|
-
|
1991
|
-
# Checks the markup validity of Web documents in HTML, XHTML, etc., and return result in json format.
|
1992
|
-
#
|
1993
|
-
# @param url Source page URL.
|
1994
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
1995
|
-
def get_html_warning_with_http_info(url)
|
1996
|
-
if @api_client.config.debug
|
1997
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.get_html_warning ..."
|
1998
|
-
end
|
1999
|
-
# verify the required parameter 'url' is set
|
2000
|
-
if @api_client.config.client_side_validation && url.nil?
|
2001
|
-
fail ArgumentError, "Missing the required parameter 'url' when calling HtmlApi.get_html_warning"
|
2002
|
-
end
|
2003
|
-
# resource path
|
2004
|
-
local_var_path = "/html/validator"
|
2005
|
-
|
2006
|
-
# query parameters
|
2007
264
|
query_params = {}
|
2008
|
-
query_params[:'url'] = url
|
2009
|
-
|
2010
|
-
# header parameters
|
2011
|
-
header_params = {}
|
2012
|
-
# HTTP header 'Accept' (if needed)
|
2013
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2014
|
-
# HTTP header 'Content-Type'
|
2015
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
2016
|
-
|
2017
|
-
# form parameters
|
2018
265
|
form_params = {}
|
2019
|
-
|
2020
|
-
# http body (model)
|
2021
266
|
post_body = nil
|
2022
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
2023
|
-
:header_params => header_params,
|
2024
|
-
:query_params => query_params,
|
2025
|
-
:form_params => form_params,
|
2026
|
-
:body => post_body,
|
2027
|
-
:return_type => 'File')
|
2028
|
-
if @api_client.config.debug
|
2029
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_html_warning\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2030
|
-
end
|
2031
|
-
return data, status_code, headers
|
2032
|
-
end
|
2033
|
-
|
2034
|
-
################################################################################
|
2035
|
-
# TemplateMerge Api
|
2036
|
-
################################################################################
|
2037
|
-
|
2038
|
-
# Populate HTML document template with data located as a file in the storage.
|
2039
|
-
#
|
2040
|
-
# @param template_name Template document name. Template document is HTML or zipped HTML.
|
2041
|
-
# @param data_path Data source file path in the storage. Supported data format: XML
|
2042
|
-
# @param [Hash] opts the optional parameters
|
2043
|
-
# @option opts [String] :options Template merge options: reserved for further implementation.
|
2044
|
-
# @option opts [String] :folder The template document folder.
|
2045
|
-
# @option opts [String] :storage The template document and data source storage.
|
2046
|
-
# @return [File]
|
2047
|
-
def get_merge_html_template(template_name, data_path, opts = {})
|
2048
|
-
data, _status_code, _headers = get_merge_html_template_with_http_info(template_name, data_path, opts)
|
2049
|
-
return {file: data, status: _status_code, headers: _headers}
|
2050
|
-
end
|
2051
|
-
|
2052
|
-
# Populate HTML document template with data located as a file in the storage.
|
2053
|
-
#
|
2054
|
-
# @param template_name Template document name. Template document is HTML or zipped HTML.
|
2055
|
-
# @param data_path Data source file path in the storage. Supported data format: XML
|
2056
|
-
# @param [Hash] opts the optional parameters
|
2057
|
-
# @option opts [String] :options Template merge options: reserved for further implementation.
|
2058
|
-
# @option opts [String] :folder The template document folder.
|
2059
|
-
# @option opts [String] :storage The template document and data source storage.
|
2060
|
-
# @return [Array<(File, Fixnum, Hash)>] File data, response status code and response headers
|
2061
|
-
def get_merge_html_template_with_http_info(template_name, data_path, opts = {})
|
2062
|
-
if @api_client.config.debug
|
2063
|
-
@api_client.config.logger.debug "Calling API: HtmlApi.get_merge_html_template ..."
|
2064
|
-
end
|
2065
|
-
# verify the required parameter 'template_name' is set
|
2066
|
-
if @api_client.config.client_side_validation && template_name.nil?
|
2067
|
-
fail ArgumentError, "Missing the required parameter 'template_name' when calling HtmlApi.get_merge_html_template"
|
2068
|
-
end
|
2069
|
-
# verify the required parameter 'data_path' is set
|
2070
|
-
if @api_client.config.client_side_validation && data_path.nil?
|
2071
|
-
fail ArgumentError, "Missing the required parameter 'data_path' when calling HtmlApi.get_merge_html_template"
|
2072
|
-
end
|
2073
|
-
# resource path
|
2074
|
-
local_var_path = "/html/{templateName}/merge".sub('{' + 'templateName' + '}', template_name.to_s)
|
2075
|
-
|
2076
|
-
# query parameters
|
2077
|
-
query_params = {}
|
2078
|
-
query_params[:'dataPath'] = data_path
|
2079
|
-
query_params[:'options'] = opts[:'options'] if !opts[:'options'].nil?
|
2080
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
2081
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
2082
|
-
|
2083
|
-
# header parameters
|
2084
|
-
header_params = {}
|
2085
|
-
# HTTP header 'Accept' (if needed)
|
2086
|
-
header_params['Accept'] = @api_client.select_header_accept(['multipart/form-data'])
|
2087
|
-
# HTTP header 'Content-Type'
|
2088
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
2089
|
-
|
2090
|
-
# form parameters
|
2091
|
-
form_params = {}
|
2092
267
|
|
2093
|
-
# http body (model)
|
2094
|
-
post_body = nil
|
2095
268
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
2096
269
|
:header_params => header_params,
|
2097
270
|
:query_params => query_params,
|
2098
271
|
:form_params => form_params,
|
2099
272
|
:body => post_body,
|
2100
|
-
:return_type => '
|
2101
|
-
if @api_client.config.debug
|
2102
|
-
@api_client.config.logger.debug "API called: HtmlApi#get_merge_html_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2103
|
-
end
|
2104
|
-
return data, status_code, headers
|
2105
|
-
end
|
273
|
+
:return_type => 'ConversionResult')
|
2106
274
|
|
2107
|
-
# Populate HTML document template with data from the request body. Result document will be saved to storage.
|
2108
|
-
#
|
2109
|
-
# @param template_name Template document name. Template document is HTML or zipped HTML.
|
2110
|
-
# @param out_path Result document path.
|
2111
|
-
# @param file A data file to populate template.
|
2112
|
-
# @param [Hash] opts the optional parameters
|
2113
|
-
# @option opts [String] :options Template merge options: reserved for further implementation.
|
2114
|
-
# @option opts [String] :folder The template document folder.
|
2115
|
-
# @option opts [String] :storage The template document and data source storage.
|
2116
|
-
# @return [File]
|
2117
|
-
def post_merge_html_template(template_name, out_path, file, opts = {})
|
2118
|
-
data, _status_code, _headers = post_merge_html_template_with_http_info(template_name, out_path, file, opts)
|
2119
|
-
return {file: data, status: _status_code, headers: _headers}
|
2120
275
|
end
|
2121
276
|
|
2122
|
-
|
2123
|
-
|
2124
|
-
|
2125
|
-
|
2126
|
-
|
2127
|
-
|
2128
|
-
|
2129
|
-
|
2130
|
-
|
2131
|
-
|
2132
|
-
|
2133
|
-
|
2134
|
-
|
2135
|
-
|
2136
|
-
|
2137
|
-
|
2138
|
-
|
2139
|
-
end
|
2140
|
-
# verify the required parameter 'out_path' is set
|
2141
|
-
if @api_client.config.client_side_validation && out_path.nil?
|
2142
|
-
fail ArgumentError, "Missing the required parameter 'out_path' when calling HtmlApi.post_merge_html_template"
|
2143
|
-
end
|
2144
|
-
# verify the required parameter 'file' is set
|
2145
|
-
if @api_client.config.client_side_validation && file.nil?
|
2146
|
-
fail ArgumentError, "Missing the required parameter 'file' when calling HtmlApi.post_merge_html_template"
|
2147
|
-
end
|
2148
|
-
# resource path
|
2149
|
-
local_var_path = "/html/{templateName}/merge".sub('{' + 'templateName' + '}', template_name.to_s)
|
2150
|
-
|
2151
|
-
# query parameters
|
2152
|
-
query_params = {}
|
2153
|
-
query_params[:'outPath'] = out_path
|
2154
|
-
query_params[:'options'] = opts[:'options'] if !opts[:'options'].nil?
|
2155
|
-
query_params[:'folder'] = opts[:'folder'] if !opts[:'folder'].nil?
|
2156
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
2157
|
-
|
2158
|
-
# header parameters
|
2159
|
-
header_params = {}
|
2160
|
-
# HTTP header 'Accept' (if needed)
|
2161
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2162
|
-
# HTTP header 'Content-Type'
|
2163
|
-
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
2164
|
-
|
2165
|
-
# form parameters
|
2166
|
-
form_params = {
|
2167
|
-
file: File::open(file,'rb')
|
2168
|
-
}
|
2169
|
-
|
2170
|
-
# http body (model)
|
2171
|
-
post_body = nil
|
2172
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
2173
|
-
:header_params => header_params,
|
2174
|
-
:query_params => query_params,
|
2175
|
-
:form_params => form_params,
|
2176
|
-
:body => post_body,
|
2177
|
-
:return_type => 'File')
|
2178
|
-
if @api_client.config.debug
|
2179
|
-
@api_client.config.logger.debug "API called: HtmlApi#post_merge_html_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
277
|
+
def get_input_format(path)
|
278
|
+
ext = File.extname(path).upcase
|
279
|
+
case ext
|
280
|
+
when '.HTML', '.HTM'
|
281
|
+
return 'html'
|
282
|
+
when '.MHT', '.MHTML'
|
283
|
+
return 'mht'
|
284
|
+
when '.XHTML', '.XML'
|
285
|
+
return 'xhtml'
|
286
|
+
when '.EPUB'
|
287
|
+
return 'epub'
|
288
|
+
when '.SVG'
|
289
|
+
return 'svg'
|
290
|
+
when '.MD'
|
291
|
+
return 'md'
|
292
|
+
else
|
293
|
+
return nil
|
2180
294
|
end
|
2181
|
-
return data, status_code, headers
|
2182
295
|
end
|
296
|
+
|
2183
297
|
end
|
2184
298
|
end
|