Object/PaginatedSaveOptions.pm untested

filter: Statementstmt 0.0% 0 / 90 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 17 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 122 CC 6 SCAR 16.3
CC
6
Cov
0%
from_hash
12.0
_deserialize
12.0
TO_JSON
6.0
CRAP 5.1
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::PaginatedSaveOptions;
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::SaveOptions;
39
40
41 use base ("Class::Accessor", "Class::Data::Inheritable");
42
43
44
45 __PACKAGE__->mk_classdata('attribute_map' => {});
46 __PACKAGE__->mk_classdata('swagger_types' => {});
47 __PACKAGE__->mk_classdata('method_documentation' => {});
48 __PACKAGE__->mk_classdata('class_documentation' => {});
49
50 # new object
51 sub new {
52 my ($class, %args) = @_;
53
54 my $self = bless {}, $class;
55
56 foreach my $attribute (keys %{$class->attribute_map}) {
57 my $args_key = $class->attribute_map->{$attribute};
58 $self->$attribute( $args{ $args_key } );
59 }
60
61 return $self;
62 }
63
64 # return perl hash
65 sub to_hash {
66 return decode_json(JSON->new->convert_blessed->encode( shift ));
67 }
68
69 # used by JSON for serialization
70 sub TO_JSON {
71 my $self = shift;
72 my $_data = {};
73 foreach my $_key (keys %{$self->attribute_map}) {
74 if (defined $self->{$_key}) {
75 $_data->{$self->attribute_map->{$_key}} = $self->{$_key};
76 }
77 }
78 return $_data;
79 }
80
81 # from Perl hashref
82 sub from_hash {
83 my ($self, $hash) = @_;
84
85 # loop through attributes and use swagger_types to deserialize the data
86 while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
87 my $_json_attribute = $self->attribute_map->{$_key};
88 if ($_type =~ /^array\[/i) { # array
89 my $_subclass = substr($_type, 6, -1);
90 my @_array = ();
91 foreach my $_element (@{$hash->{$_json_attribute}}) {
92 push @_array, $self->_deserialize($_subclass, $_element);
93 }
94 $self->{$_key} = \@_array;
95 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
96 $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
97 } else {
98 $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
99 }
100 }
101
102 return $self;
103 }
104
105 # deserialize non-array data
106 sub _deserialize {
107 my ($self, $type, $data) = @_;
108 $log->debugf("deserializing %s with %s",Dumper($data), $type);
109
110 if ($type eq 'DateTime') {
111 return DateTime->from_epoch(epoch => str2time($data));
112 } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
113 return $data;
114 } else { # hash(model)
115 my $_instance = eval "AsposeCellsCloud::Object::$type->new()";
116 return $_instance->from_hash($data);
117 }
118 }
119
120
121 __PACKAGE__->class_documentation({description => '',
122 class => 'PaginatedSaveOptions',
123 required => [], # TODO
124 } );
125
126
127 __PACKAGE__->method_documentation({
128 'default_font' => {
129 datatype => 'string',
130 base_name => 'DefaultFont',
131 description => '',
132 format => '',
133 read_only => '',
134 },
135 'check_workbook_default_font' => {
136 datatype => 'boolean',
137 base_name => 'CheckWorkbookDefaultFont',
138 description => '',
139 format => '',
140 read_only => '',
141 },
142 'check_font_compatibility' => {
143 datatype => 'boolean',
144 base_name => 'CheckFontCompatibility',
145 description => '',
146 format => '',
147 read_only => '',
148 },
149 'is_font_substitution_char_granularity' => {
150 datatype => 'boolean',
151 base_name => 'IsFontSubstitutionCharGranularity',
152 description => '',
153 format => '',
154 read_only => '',
155 },
156 'one_page_per_sheet' => {
157 datatype => 'boolean',
158 base_name => 'OnePagePerSheet',
159 description => '',
160 format => '',
161 read_only => '',
162 },
163 'all_columns_in_one_page_per_sheet' => {
164 datatype => 'boolean',
165 base_name => 'AllColumnsInOnePagePerSheet',
166 description => '',
167 format => '',
168 read_only => '',
169 },
170 'ignore_error' => {
171 datatype => 'boolean',
172 base_name => 'IgnoreError',
173 description => '',
174 format => '',
175 read_only => '',
176 },
177 'output_blank_page_when_nothing_to_print' => {
178 datatype => 'boolean',
179 base_name => 'OutputBlankPageWhenNothingToPrint',
180 description => '',
181 format => '',
182 read_only => '',
183 },
184 'page_index' => {
185 datatype => 'int',
186 base_name => 'PageIndex',
187 description => '',
188 format => '',
189 read_only => '',
190 },
191 'page_count' => {
192 datatype => 'int',
193 base_name => 'PageCount',
194 description => '',
195 format => '',
196 read_only => '',
197 },
198 'printing_page_type' => {
199 datatype => 'string',
200 base_name => 'PrintingPageType',
201 description => '',
202 format => '',
203 read_only => '',
204 },
205 'gridline_type' => {
206 datatype => 'string',
207 base_name => 'GridlineType',
208 description => '',
209 format => '',
210 read_only => '',
211 },
212 'text_cross_type' => {
213 datatype => 'string',
214 base_name => 'TextCrossType',
215 description => '',
216 format => '',
217 read_only => '',
218 },
219 'default_edit_language' => {
220 datatype => 'string',
221 base_name => 'DefaultEditLanguage',
222 description => '',
223 format => '',
224 read_only => '',
225 },
226 'emf_render_setting' => {
227 datatype => 'string',
228 base_name => 'EmfRenderSetting',
229 description => '',
230 format => '',
231 read_only => '',
232 },
233 'merge_areas' => {
234 datatype => 'boolean',
235 base_name => 'MergeAreas',
236 description => '',
237 format => '',
238 read_only => '',
239 },
240 'sort_external_names' => {
241 datatype => 'boolean',
242 base_name => 'SortExternalNames',
243 description => '',
244 format => '',
245 read_only => '',
246 },
247 'update_smart_art' => {
248 datatype => 'boolean',
249 base_name => 'UpdateSmartArt',
250 description => '',
251 format => '',
252 read_only => '',
253 },
254 'save_format' => {
255 datatype => 'string',
256 base_name => 'SaveFormat',
257 description => '',
258 format => '',
259 read_only => '',
260 },
261 'cached_file_folder' => {
262 datatype => 'string',
263 base_name => 'CachedFileFolder',
264 description => '',
265 format => '',
266 read_only => '',
267 },
268 'clear_data' => {
269 datatype => 'boolean',
270 base_name => 'ClearData',
271 description => '',
272 format => '',
273 read_only => '',
274 },
275 'create_directory' => {
276 datatype => 'boolean',
277 base_name => 'CreateDirectory',
278 description => '',
279 format => '',
280 read_only => '',
281 },
282 'enable_http_compression' => {
283 datatype => 'boolean',
284 base_name => 'EnableHTTPCompression',
285 description => '',
286 format => '',
287 read_only => '',
288 },
289 'refresh_chart_cache' => {
290 datatype => 'boolean',
291 base_name => 'RefreshChartCache',
292 description => '',
293 format => '',
294 read_only => '',
295 },
296 'sort_names' => {
297 datatype => 'boolean',
298 base_name => 'SortNames',
299 description => '',
300 format => '',
301 read_only => '',
302 },
303 'validate_merged_areas' => {
304 datatype => 'boolean',
305 base_name => 'ValidateMergedAreas',
306 description => '',
307 format => '',
308 read_only => '',
309 },
310 'check_excel_restriction' => {
311 datatype => 'boolean',
312 base_name => 'CheckExcelRestriction',
313 description => '',
314 format => '',
315 read_only => '',
316 },
317 'encrypt_document_properties' => {
318 datatype => 'boolean',
319 base_name => 'EncryptDocumentProperties',
320 description => '',
321 format => '',
322 read_only => '',
323 },
324 });
325
326 __PACKAGE__->swagger_types( {
327 'default_font' => 'string',
328 'check_workbook_default_font' => 'boolean',
329 'check_font_compatibility' => 'boolean',
330 'is_font_substitution_char_granularity' => 'boolean',
331 'one_page_per_sheet' => 'boolean',
332 'all_columns_in_one_page_per_sheet' => 'boolean',
333 'ignore_error' => 'boolean',
334 'output_blank_page_when_nothing_to_print' => 'boolean',
335 'page_index' => 'int',
336 'page_count' => 'int',
337 'printing_page_type' => 'string',
338 'gridline_type' => 'string',
339 'text_cross_type' => 'string',
340 'default_edit_language' => 'string',
341 'emf_render_setting' => 'string',
342 'merge_areas' => 'boolean',
343 'sort_external_names' => 'boolean',
344 'update_smart_art' => 'boolean',
345 'save_format' => 'string',
346 'cached_file_folder' => 'string',
347 'clear_data' => 'boolean',
348 'create_directory' => 'boolean',
349 'enable_http_compression' => 'boolean',
350 'refresh_chart_cache' => 'boolean',
351 'sort_names' => 'boolean',
352 'validate_merged_areas' => 'boolean',
353 'check_excel_restriction' => 'boolean',
354 'encrypt_document_properties' => 'boolean'
355 } );
356
357 __PACKAGE__->attribute_map( {
358 'default_font' => 'DefaultFont',
359 'check_workbook_default_font' => 'CheckWorkbookDefaultFont',
360 'check_font_compatibility' => 'CheckFontCompatibility',
361 'is_font_substitution_char_granularity' => 'IsFontSubstitutionCharGranularity',
362 'one_page_per_sheet' => 'OnePagePerSheet',
363 'all_columns_in_one_page_per_sheet' => 'AllColumnsInOnePagePerSheet',
364 'ignore_error' => 'IgnoreError',
365 'output_blank_page_when_nothing_to_print' => 'OutputBlankPageWhenNothingToPrint',
366 'page_index' => 'PageIndex',
367 'page_count' => 'PageCount',
368 'printing_page_type' => 'PrintingPageType',
369 'gridline_type' => 'GridlineType',
370 'text_cross_type' => 'TextCrossType',
371 'default_edit_language' => 'DefaultEditLanguage',
372 'emf_render_setting' => 'EmfRenderSetting',
373 'merge_areas' => 'MergeAreas',
374 'sort_external_names' => 'SortExternalNames',
375 'update_smart_art' => 'UpdateSmartArt',
376 'save_format' => 'SaveFormat',
377 'cached_file_folder' => 'CachedFileFolder',
378 'clear_data' => 'ClearData',
379 'create_directory' => 'CreateDirectory',
380 'enable_http_compression' => 'EnableHTTPCompression',
381 'refresh_chart_cache' => 'RefreshChartCache',
382 'sort_names' => 'SortNames',
383 'validate_merged_areas' => 'ValidateMergedAreas',
384 'check_excel_restriction' => 'CheckExcelRestriction',
385 'encrypt_document_properties' => 'EncryptDocumentProperties'
386 } );
387
388 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
389
390
391 1;