Object/MHtmlSaveOptions.pm untested

filter: Statementstmt 0.0% 0 / 93 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 18 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 126 CC 6 SCAR 16.0
CC
6
Cov
0%
from_hash
12.0
_deserialize
12.0
TO_JSON
6.0
CRAP 5.0
1 =begin comment
2
3 Copyright (c) 2026 Aspose.Cells Cloud
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 SOFTWARE.
21
22 =end comment
23
24 =cut
25
26 package AsposeCellsCloud::Object::MHtmlSaveOptions;
27
28 require 5.6.0;
29 use strict;
30 use warnings;
31 use utf8;
32 use JSON qw(decode_json);
33 use Data::Dumper;
34 use Module::Runtime qw(use_module);
35 use Log::Any qw($log);
36 use Date::Parse;
37 use DateTime;
38 use AsposeCellsCloud::Object::ImageOrPrintOptions;
39 use AsposeCellsCloud::Object::SaveOptions;
40
41
42 use base ("Class::Accessor", "Class::Data::Inheritable");
43
44
45
46 __PACKAGE__->mk_classdata('attribute_map' => {});
47 __PACKAGE__->mk_classdata('swagger_types' => {});
48 __PACKAGE__->mk_classdata('method_documentation' => {});
49 __PACKAGE__->mk_classdata('class_documentation' => {});
50
51 # new object
52 sub new {
53 my ($class, %args) = @_;
54
55 my $self = bless {}, $class;
56
57 foreach my $attribute (keys %{$class->attribute_map}) {
58 my $args_key = $class->attribute_map->{$attribute};
59 $self->$attribute( $args{ $args_key } );
60 }
61
62 return $self;
63 }
64
65 # return perl hash
66 sub to_hash {
67 return decode_json(JSON->new->convert_blessed->encode( shift ));
68 }
69
70 # used by JSON for serialization
71 sub TO_JSON {
72 my $self = shift;
73 my $_data = {};
74 foreach my $_key (keys %{$self->attribute_map}) {
75 if (defined $self->{$_key}) {
76 $_data->{$self->attribute_map->{$_key}} = $self->{$_key};
77 }
78 }
79 return $_data;
80 }
81
82 # from Perl hashref
83 sub from_hash {
84 my ($self, $hash) = @_;
85
86 # loop through attributes and use swagger_types to deserialize the data
87 while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
88 my $_json_attribute = $self->attribute_map->{$_key};
89 if ($_type =~ /^array\[/i) { # array
90 my $_subclass = substr($_type, 6, -1);
91 my @_array = ();
92 foreach my $_element (@{$hash->{$_json_attribute}}) {
93 push @_array, $self->_deserialize($_subclass, $_element);
94 }
95 $self->{$_key} = \@_array;
96 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
97 $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
98 } else {
99 $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
100 }
101 }
102
103 return $self;
104 }
105
106 # deserialize non-array data
107 sub _deserialize {
108 my ($self, $type, $data) = @_;
109 $log->debugf("deserializing %s with %s",Dumper($data), $type);
110
111 if ($type eq 'DateTime') {
112 return DateTime->from_epoch(epoch => str2time($data));
113 } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
114 return $data;
115 } else { # hash(model)
116 my $_instance = eval "AsposeCellsCloud::Object::$type->new()";
117 return $_instance->from_hash($data);
118 }
119 }
120
121
122 __PACKAGE__->class_documentation({description => '',
123 class => 'MHtmlSaveOptions',
124 required => [], # TODO
125 } );
126
127
128 __PACKAGE__->method_documentation({
129 'export_page_headers' => {
130 datatype => 'boolean',
131 base_name => 'ExportPageHeaders',
132 description => '',
133 format => '',
134 read_only => '',
135 },
136 'export_page_footers' => {
137 datatype => 'boolean',
138 base_name => 'ExportPageFooters',
139 description => '',
140 format => '',
141 read_only => '',
142 },
143 'export_row_column_headings' => {
144 datatype => 'boolean',
145 base_name => 'ExportRowColumnHeadings',
146 description => '',
147 format => '',
148 read_only => '',
149 },
150 'show_all_sheets' => {
151 datatype => 'boolean',
152 base_name => 'ShowAllSheets',
153 description => '',
154 format => '',
155 read_only => '',
156 },
157 'image_options' => {
158 datatype => 'ImageOrPrintOptions',
159 base_name => 'ImageOptions',
160 description => '',
161 format => '',
162 read_only => '',
163 },
164 'save_as_single_file' => {
165 datatype => 'boolean',
166 base_name => 'SaveAsSingleFile',
167 description => '',
168 format => '',
169 read_only => '',
170 },
171 'export_hidden_worksheet' => {
172 datatype => 'boolean',
173 base_name => 'ExportHiddenWorksheet',
174 description => '',
175 format => '',
176 read_only => '',
177 },
178 'export_grid_lines' => {
179 datatype => 'boolean',
180 base_name => 'ExportGridLines',
181 description => '',
182 format => '',
183 read_only => '',
184 },
185 'presentation_preference' => {
186 datatype => 'boolean',
187 base_name => 'PresentationPreference',
188 description => '',
189 format => '',
190 read_only => '',
191 },
192 'cell_css_prefix' => {
193 datatype => 'string',
194 base_name => 'CellCssPrefix',
195 description => '',
196 format => '',
197 read_only => '',
198 },
199 'table_css_id' => {
200 datatype => 'string',
201 base_name => 'TableCssId',
202 description => '',
203 format => '',
204 read_only => '',
205 },
206 'is_full_path_link' => {
207 datatype => 'boolean',
208 base_name => 'IsFullPathLink',
209 description => '',
210 format => '',
211 read_only => '',
212 },
213 'export_worksheet_css_separately' => {
214 datatype => 'boolean',
215 base_name => 'ExportWorksheetCSSSeparately',
216 description => '',
217 format => '',
218 read_only => '',
219 },
220 'export_similar_border_style' => {
221 datatype => 'boolean',
222 base_name => 'ExportSimilarBorderStyle',
223 description => '',
224 format => '',
225 read_only => '',
226 },
227 'merge_empty_td_forcely' => {
228 datatype => 'boolean',
229 base_name => 'MergeEmptyTdForcely',
230 description => '',
231 format => '',
232 read_only => '',
233 },
234 'export_cell_coordinate' => {
235 datatype => 'boolean',
236 base_name => 'ExportCellCoordinate',
237 description => '',
238 format => '',
239 read_only => '',
240 },
241 'export_extra_headings' => {
242 datatype => 'boolean',
243 base_name => 'ExportExtraHeadings',
244 description => '',
245 format => '',
246 read_only => '',
247 },
248 'export_headings' => {
249 datatype => 'boolean',
250 base_name => 'ExportHeadings',
251 description => '',
252 format => '',
253 read_only => '',
254 },
255 'export_formula' => {
256 datatype => 'boolean',
257 base_name => 'ExportFormula',
258 description => '',
259 format => '',
260 read_only => '',
261 },
262 'add_tooltip_text' => {
263 datatype => 'boolean',
264 base_name => 'AddTooltipText',
265 description => '',
266 format => '',
267 read_only => '',
268 },
269 'export_bogus_row_data' => {
270 datatype => 'boolean',
271 base_name => 'ExportBogusRowData',
272 description => '',
273 format => '',
274 read_only => '',
275 },
276 'exclude_unused_styles' => {
277 datatype => 'boolean',
278 base_name => 'ExcludeUnusedStyles',
279 description => '',
280 format => '',
281 read_only => '',
282 },
283 'export_document_properties' => {
284 datatype => 'boolean',
285 base_name => 'ExportDocumentProperties',
286 description => '',
287 format => '',
288 read_only => '',
289 },
290 'export_worksheet_properties' => {
291 datatype => 'boolean',
292 base_name => 'ExportWorksheetProperties',
293 description => '',
294 format => '',
295 read_only => '',
296 },
297 'export_workbook_properties' => {
298 datatype => 'boolean',
299 base_name => 'ExportWorkbookProperties',
300 description => '',
301 format => '',
302 read_only => '',
303 },
304 'export_frame_scripts_and_properties' => {
305 datatype => 'boolean',
306 base_name => 'ExportFrameScriptsAndProperties',
307 description => '',
308 format => '',
309 read_only => '',
310 },
311 'attached_files_directory' => {
312 datatype => 'string',
313 base_name => 'AttachedFilesDirectory',
314 description => '',
315 format => '',
316 read_only => '',
317 },
318 'attached_files_url_prefix' => {
319 datatype => 'string',
320 base_name => 'AttachedFilesUrlPrefix',
321 description => '',
322 format => '',
323 read_only => '',
324 },
325 'encoding' => {
326 datatype => 'string',
327 base_name => 'Encoding',
328 description => '',
329 format => '',
330 read_only => '',
331 },
332 'export_active_worksheet_only' => {
333 datatype => 'boolean',
334 base_name => 'ExportActiveWorksheetOnly',
335 description => '',
336 format => '',
337 read_only => '',
338 },
339 'export_chart_image_format' => {
340 datatype => 'string',
341 base_name => 'ExportChartImageFormat',
342 description => '',
343 format => '',
344 read_only => '',
345 },
346 'export_images_as_base64' => {
347 datatype => 'boolean',
348 base_name => 'ExportImagesAsBase64',
349 description => '',
350 format => '',
351 read_only => '',
352 },
353 'hidden_col_display_type' => {
354 datatype => 'string',
355 base_name => 'HiddenColDisplayType',
356 description => '',
357 format => '',
358 read_only => '',
359 },
360 'hidden_row_display_type' => {
361 datatype => 'string',
362 base_name => 'HiddenRowDisplayType',
363 description => '',
364 format => '',
365 read_only => '',
366 },
367 'html_cross_string_type' => {
368 datatype => 'string',
369 base_name => 'HtmlCrossStringType',
370 description => '',
371 format => '',
372 read_only => '',
373 },
374 'is_exp_image_to_temp_dir' => {
375 datatype => 'boolean',
376 base_name => 'IsExpImageToTempDir',
377 description => '',
378 format => '',
379 read_only => '',
380 },
381 'page_title' => {
382 datatype => 'string',
383 base_name => 'PageTitle',
384 description => '',
385 format => '',
386 read_only => '',
387 },
388 'parse_html_tag_in_cell' => {
389 datatype => 'boolean',
390 base_name => 'ParseHtmlTagInCell',
391 description => '',
392 format => '',
393 read_only => '',
394 },
395 'cell_name_attribute' => {
396 datatype => 'string',
397 base_name => 'CellNameAttribute',
398 description => '',
399 format => '',
400 read_only => '',
401 },
402 'save_format' => {
403 datatype => 'string',
404 base_name => 'SaveFormat',
405 description => '',
406 format => '',
407 read_only => '',
408 },
409 'cached_file_folder' => {
410 datatype => 'string',
411 base_name => 'CachedFileFolder',
412 description => '',
413 format => '',
414 read_only => '',
415 },
416 'clear_data' => {
417 datatype => 'boolean',
418 base_name => 'ClearData',
419 description => '',
420 format => '',
421 read_only => '',
422 },
423 'create_directory' => {
424 datatype => 'boolean',
425 base_name => 'CreateDirectory',
426 description => '',
427 format => '',
428 read_only => '',
429 },
430 'enable_http_compression' => {
431 datatype => 'boolean',
432 base_name => 'EnableHTTPCompression',
433 description => '',
434 format => '',
435 read_only => '',
436 },
437 'refresh_chart_cache' => {
438 datatype => 'boolean',
439 base_name => 'RefreshChartCache',
440 description => '',
441 format => '',
442 read_only => '',
443 },
444 'sort_names' => {
445 datatype => 'boolean',
446 base_name => 'SortNames',
447 description => '',
448 format => '',
449 read_only => '',
450 },
451 'validate_merged_areas' => {
452 datatype => 'boolean',
453 base_name => 'ValidateMergedAreas',
454 description => '',
455 format => '',
456 read_only => '',
457 },
458 'merge_areas' => {
459 datatype => 'boolean',
460 base_name => 'MergeAreas',
461 description => '',
462 format => '',
463 read_only => '',
464 },
465 'sort_external_names' => {
466 datatype => 'boolean',
467 base_name => 'SortExternalNames',
468 description => '',
469 format => '',
470 read_only => '',
471 },
472 'check_excel_restriction' => {
473 datatype => 'boolean',
474 base_name => 'CheckExcelRestriction',
475 description => '',
476 format => '',
477 read_only => '',
478 },
479 'update_smart_art' => {
480 datatype => 'boolean',
481 base_name => 'UpdateSmartArt',
482 description => '',
483 format => '',
484 read_only => '',
485 },
486 'encrypt_document_properties' => {
487 datatype => 'boolean',
488 base_name => 'EncryptDocumentProperties',
489 description => '',
490 format => '',
491 read_only => '',
492 },
493 });
494
495 __PACKAGE__->swagger_types( {
496 'export_page_headers' => 'boolean',
497 'export_page_footers' => 'boolean',
498 'export_row_column_headings' => 'boolean',
499 'show_all_sheets' => 'boolean',
500 'image_options' => 'ImageOrPrintOptions',
501 'save_as_single_file' => 'boolean',
502 'export_hidden_worksheet' => 'boolean',
503 'export_grid_lines' => 'boolean',
504 'presentation_preference' => 'boolean',
505 'cell_css_prefix' => 'string',
506 'table_css_id' => 'string',
507 'is_full_path_link' => 'boolean',
508 'export_worksheet_css_separately' => 'boolean',
509 'export_similar_border_style' => 'boolean',
510 'merge_empty_td_forcely' => 'boolean',
511 'export_cell_coordinate' => 'boolean',
512 'export_extra_headings' => 'boolean',
513 'export_headings' => 'boolean',
514 'export_formula' => 'boolean',
515 'add_tooltip_text' => 'boolean',
516 'export_bogus_row_data' => 'boolean',
517 'exclude_unused_styles' => 'boolean',
518 'export_document_properties' => 'boolean',
519 'export_worksheet_properties' => 'boolean',
520 'export_workbook_properties' => 'boolean',
521 'export_frame_scripts_and_properties' => 'boolean',
522 'attached_files_directory' => 'string',
523 'attached_files_url_prefix' => 'string',
524 'encoding' => 'string',
525 'export_active_worksheet_only' => 'boolean',
526 'export_chart_image_format' => 'string',
527 'export_images_as_base64' => 'boolean',
528 'hidden_col_display_type' => 'string',
529 'hidden_row_display_type' => 'string',
530 'html_cross_string_type' => 'string',
531 'is_exp_image_to_temp_dir' => 'boolean',
532 'page_title' => 'string',
533 'parse_html_tag_in_cell' => 'boolean',
534 'cell_name_attribute' => 'string',
535 'save_format' => 'string',
536 'cached_file_folder' => 'string',
537 'clear_data' => 'boolean',
538 'create_directory' => 'boolean',
539 'enable_http_compression' => 'boolean',
540 'refresh_chart_cache' => 'boolean',
541 'sort_names' => 'boolean',
542 'validate_merged_areas' => 'boolean',
543 'merge_areas' => 'boolean',
544 'sort_external_names' => 'boolean',
545 'check_excel_restriction' => 'boolean',
546 'update_smart_art' => 'boolean',
547 'encrypt_document_properties' => 'boolean'
548 } );
549
550 __PACKAGE__->attribute_map( {
551 'export_page_headers' => 'ExportPageHeaders',
552 'export_page_footers' => 'ExportPageFooters',
553 'export_row_column_headings' => 'ExportRowColumnHeadings',
554 'show_all_sheets' => 'ShowAllSheets',
555 'image_options' => 'ImageOptions',
556 'save_as_single_file' => 'SaveAsSingleFile',
557 'export_hidden_worksheet' => 'ExportHiddenWorksheet',
558 'export_grid_lines' => 'ExportGridLines',
559 'presentation_preference' => 'PresentationPreference',
560 'cell_css_prefix' => 'CellCssPrefix',
561 'table_css_id' => 'TableCssId',
562 'is_full_path_link' => 'IsFullPathLink',
563 'export_worksheet_css_separately' => 'ExportWorksheetCSSSeparately',
564 'export_similar_border_style' => 'ExportSimilarBorderStyle',
565 'merge_empty_td_forcely' => 'MergeEmptyTdForcely',
566 'export_cell_coordinate' => 'ExportCellCoordinate',
567 'export_extra_headings' => 'ExportExtraHeadings',
568 'export_headings' => 'ExportHeadings',
569 'export_formula' => 'ExportFormula',
570 'add_tooltip_text' => 'AddTooltipText',
571 'export_bogus_row_data' => 'ExportBogusRowData',
572 'exclude_unused_styles' => 'ExcludeUnusedStyles',
573 'export_document_properties' => 'ExportDocumentProperties',
574 'export_worksheet_properties' => 'ExportWorksheetProperties',
575 'export_workbook_properties' => 'ExportWorkbookProperties',
576 'export_frame_scripts_and_properties' => 'ExportFrameScriptsAndProperties',
577 'attached_files_directory' => 'AttachedFilesDirectory',
578 'attached_files_url_prefix' => 'AttachedFilesUrlPrefix',
579 'encoding' => 'Encoding',
580 'export_active_worksheet_only' => 'ExportActiveWorksheetOnly',
581 'export_chart_image_format' => 'ExportChartImageFormat',
582 'export_images_as_base64' => 'ExportImagesAsBase64',
583 'hidden_col_display_type' => 'HiddenColDisplayType',
584 'hidden_row_display_type' => 'HiddenRowDisplayType',
585 'html_cross_string_type' => 'HtmlCrossStringType',
586 'is_exp_image_to_temp_dir' => 'IsExpImageToTempDir',
587 'page_title' => 'PageTitle',
588 'parse_html_tag_in_cell' => 'ParseHtmlTagInCell',
589 'cell_name_attribute' => 'CellNameAttribute',
590 'save_format' => 'SaveFormat',
591 'cached_file_folder' => 'CachedFileFolder',
592 'clear_data' => 'ClearData',
593 'create_directory' => 'CreateDirectory',
594 'enable_http_compression' => 'EnableHTTPCompression',
595 'refresh_chart_cache' => 'RefreshChartCache',
596 'sort_names' => 'SortNames',
597 'validate_merged_areas' => 'ValidateMergedAreas',
598 'merge_areas' => 'MergeAreas',
599 'sort_external_names' => 'SortExternalNames',
600 'check_excel_restriction' => 'CheckExcelRestriction',
601 'update_smart_art' => 'UpdateSmartArt',
602 'encrypt_document_properties' => 'EncryptDocumentProperties'
603 } );
604
605 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
606
607
608 1;