Object/LineShape.pm untested

filter: Statementstmt 0.0% 0 / 96 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 19 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 130 CC 6 SCAR 15.8
CC
6
Cov
0%
from_hash
12.0
_deserialize
12.0
TO_JSON
6.0
CRAP 4.8
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::LineShape;
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::Font;
39 use AsposeCellsCloud::Object::Link;
40 use AsposeCellsCloud::Object::Shape;
41
42
43 use base ("Class::Accessor", "Class::Data::Inheritable");
44
45
46
47 __PACKAGE__->mk_classdata('attribute_map' => {});
48 __PACKAGE__->mk_classdata('swagger_types' => {});
49 __PACKAGE__->mk_classdata('method_documentation' => {});
50 __PACKAGE__->mk_classdata('class_documentation' => {});
51
52 # new object
53 sub new {
54 my ($class, %args) = @_;
55
56 my $self = bless {}, $class;
57
58 foreach my $attribute (keys %{$class->attribute_map}) {
59 my $args_key = $class->attribute_map->{$attribute};
60 $self->$attribute( $args{ $args_key } );
61 }
62
63 return $self;
64 }
65
66 # return perl hash
67 sub to_hash {
68 return decode_json(JSON->new->convert_blessed->encode( shift ));
69 }
70
71 # used by JSON for serialization
72 sub TO_JSON {
73 my $self = shift;
74 my $_data = {};
75 foreach my $_key (keys %{$self->attribute_map}) {
76 if (defined $self->{$_key}) {
77 $_data->{$self->attribute_map->{$_key}} = $self->{$_key};
78 }
79 }
80 return $_data;
81 }
82
83 # from Perl hashref
84 sub from_hash {
85 my ($self, $hash) = @_;
86
87 # loop through attributes and use swagger_types to deserialize the data
88 while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
89 my $_json_attribute = $self->attribute_map->{$_key};
90 if ($_type =~ /^array\[/i) { # array
91 my $_subclass = substr($_type, 6, -1);
92 my @_array = ();
93 foreach my $_element (@{$hash->{$_json_attribute}}) {
94 push @_array, $self->_deserialize($_subclass, $_element);
95 }
96 $self->{$_key} = \@_array;
97 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
98 $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
99 } else {
100 $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
101 }
102 }
103
104 return $self;
105 }
106
107 # deserialize non-array data
108 sub _deserialize {
109 my ($self, $type, $data) = @_;
110 $log->debugf("deserializing %s with %s",Dumper($data), $type);
111
112 if ($type eq 'DateTime') {
113 return DateTime->from_epoch(epoch => str2time($data));
114 } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
115 return $data;
116 } else { # hash(model)
117 my $_instance = eval "AsposeCellsCloud::Object::$type->new()";
118 return $_instance->from_hash($data);
119 }
120 }
121
122
123 __PACKAGE__->class_documentation({description => 'Represents the line shape.',
124 class => 'LineShape',
125 required => [], # TODO
126 } );
127
128
129 __PACKAGE__->method_documentation({
130 'begin_arrowhead_length' => {
131 datatype => 'string',
132 base_name => 'BeginArrowheadLength',
133 description => 'Gets and sets the begin arrow head length of the line.',
134 format => '',
135 read_only => '',
136 },
137 'begin_arrowhead_style' => {
138 datatype => 'string',
139 base_name => 'BeginArrowheadStyle',
140 description => 'Gets and sets the begin arrow head style of the line.',
141 format => '',
142 read_only => '',
143 },
144 'begin_arrowhead_width' => {
145 datatype => 'string',
146 base_name => 'BeginArrowheadWidth',
147 description => 'Gets and sets the begin arrow head width of the line.',
148 format => '',
149 read_only => '',
150 },
151 'end_arrowhead_length' => {
152 datatype => 'string',
153 base_name => 'EndArrowheadLength',
154 description => 'Gets and sets the end arrow head length of the line.',
155 format => '',
156 read_only => '',
157 },
158 'end_arrowhead_style' => {
159 datatype => 'string',
160 base_name => 'EndArrowheadStyle',
161 description => 'Gets and sets the end arrow head style of the line.',
162 format => '',
163 read_only => '',
164 },
165 'end_arrowhead_width' => {
166 datatype => 'string',
167 base_name => 'EndArrowheadWidth',
168 description => 'Gets and sets the end arrow head width of the line.',
169 format => '',
170 read_only => '',
171 },
172 'name' => {
173 datatype => 'string',
174 base_name => 'Name',
175 description => '',
176 format => '',
177 read_only => '',
178 },
179 'mso_drawing_type' => {
180 datatype => 'string',
181 base_name => 'MsoDrawingType',
182 description => '',
183 format => '',
184 read_only => '',
185 },
186 'auto_shape_type' => {
187 datatype => 'string',
188 base_name => 'AutoShapeType',
189 description => '',
190 format => '',
191 read_only => '',
192 },
193 'placement' => {
194 datatype => 'string',
195 base_name => 'Placement',
196 description => '',
197 format => '',
198 read_only => '',
199 },
200 'upper_left_row' => {
201 datatype => 'int',
202 base_name => 'UpperLeftRow',
203 description => '',
204 format => '',
205 read_only => '',
206 },
207 'top' => {
208 datatype => 'int',
209 base_name => 'Top',
210 description => '',
211 format => '',
212 read_only => '',
213 },
214 'upper_left_column' => {
215 datatype => 'int',
216 base_name => 'UpperLeftColumn',
217 description => '',
218 format => '',
219 read_only => '',
220 },
221 'left' => {
222 datatype => 'int',
223 base_name => 'Left',
224 description => '',
225 format => '',
226 read_only => '',
227 },
228 'lower_right_row' => {
229 datatype => 'int',
230 base_name => 'LowerRightRow',
231 description => '',
232 format => '',
233 read_only => '',
234 },
235 'bottom' => {
236 datatype => 'int',
237 base_name => 'Bottom',
238 description => '',
239 format => '',
240 read_only => '',
241 },
242 'lower_right_column' => {
243 datatype => 'int',
244 base_name => 'LowerRightColumn',
245 description => '',
246 format => '',
247 read_only => '',
248 },
249 'right' => {
250 datatype => 'int',
251 base_name => 'Right',
252 description => '',
253 format => '',
254 read_only => '',
255 },
256 'width' => {
257 datatype => 'int',
258 base_name => 'Width',
259 description => '',
260 format => '',
261 read_only => '',
262 },
263 'height' => {
264 datatype => 'int',
265 base_name => 'Height',
266 description => '',
267 format => '',
268 read_only => '',
269 },
270 'x' => {
271 datatype => 'int',
272 base_name => 'X',
273 description => '',
274 format => '',
275 read_only => '',
276 },
277 'y' => {
278 datatype => 'int',
279 base_name => 'Y',
280 description => '',
281 format => '',
282 read_only => '',
283 },
284 'rotation_angle' => {
285 datatype => 'double',
286 base_name => 'RotationAngle',
287 description => '',
288 format => '',
289 read_only => '',
290 },
291 'html_text' => {
292 datatype => 'string',
293 base_name => 'HtmlText',
294 description => '',
295 format => '',
296 read_only => '',
297 },
298 'text' => {
299 datatype => 'string',
300 base_name => 'Text',
301 description => '',
302 format => '',
303 read_only => '',
304 },
305 'alternative_text' => {
306 datatype => 'string',
307 base_name => 'AlternativeText',
308 description => '',
309 format => '',
310 read_only => '',
311 },
312 'text_horizontal_alignment' => {
313 datatype => 'string',
314 base_name => 'TextHorizontalAlignment',
315 description => '',
316 format => '',
317 read_only => '',
318 },
319 'text_horizontal_overflow' => {
320 datatype => 'string',
321 base_name => 'TextHorizontalOverflow',
322 description => '',
323 format => '',
324 read_only => '',
325 },
326 'text_orientation_type' => {
327 datatype => 'string',
328 base_name => 'TextOrientationType',
329 description => '',
330 format => '',
331 read_only => '',
332 },
333 'text_vertical_alignment' => {
334 datatype => 'string',
335 base_name => 'TextVerticalAlignment',
336 description => '',
337 format => '',
338 read_only => '',
339 },
340 'text_vertical_overflow' => {
341 datatype => 'string',
342 base_name => 'TextVerticalOverflow',
343 description => '',
344 format => '',
345 read_only => '',
346 },
347 'is_group' => {
348 datatype => 'boolean',
349 base_name => 'IsGroup',
350 description => '',
351 format => '',
352 read_only => '',
353 },
354 'is_hidden' => {
355 datatype => 'boolean',
356 base_name => 'IsHidden',
357 description => '',
358 format => '',
359 read_only => '',
360 },
361 'is_lock_aspect_ratio' => {
362 datatype => 'boolean',
363 base_name => 'IsLockAspectRatio',
364 description => '',
365 format => '',
366 read_only => '',
367 },
368 'is_locked' => {
369 datatype => 'boolean',
370 base_name => 'IsLocked',
371 description => '',
372 format => '',
373 read_only => '',
374 },
375 'is_printable' => {
376 datatype => 'boolean',
377 base_name => 'IsPrintable',
378 description => '',
379 format => '',
380 read_only => '',
381 },
382 'is_text_wrapped' => {
383 datatype => 'boolean',
384 base_name => 'IsTextWrapped',
385 description => '',
386 format => '',
387 read_only => '',
388 },
389 'is_word_art' => {
390 datatype => 'boolean',
391 base_name => 'IsWordArt',
392 description => '',
393 format => '',
394 read_only => '',
395 },
396 'linked_cell' => {
397 datatype => 'string',
398 base_name => 'LinkedCell',
399 description => '',
400 format => '',
401 read_only => '',
402 },
403 'z_order_position' => {
404 datatype => 'int',
405 base_name => 'ZOrderPosition',
406 description => '',
407 format => '',
408 read_only => '',
409 },
410 'font' => {
411 datatype => 'Font',
412 base_name => 'Font',
413 description => '',
414 format => '',
415 read_only => '',
416 },
417 'hyperlink' => {
418 datatype => 'string',
419 base_name => 'Hyperlink',
420 description => '',
421 format => '',
422 read_only => '',
423 },
424 'link' => {
425 datatype => 'Link',
426 base_name => 'link',
427 description => '',
428 format => '',
429 read_only => '',
430 },
431 });
432
433 __PACKAGE__->swagger_types( {
434 'begin_arrowhead_length' => 'string',
435 'begin_arrowhead_style' => 'string',
436 'begin_arrowhead_width' => 'string',
437 'end_arrowhead_length' => 'string',
438 'end_arrowhead_style' => 'string',
439 'end_arrowhead_width' => 'string',
440 'name' => 'string',
441 'mso_drawing_type' => 'string',
442 'auto_shape_type' => 'string',
443 'placement' => 'string',
444 'upper_left_row' => 'int',
445 'top' => 'int',
446 'upper_left_column' => 'int',
447 'left' => 'int',
448 'lower_right_row' => 'int',
449 'bottom' => 'int',
450 'lower_right_column' => 'int',
451 'right' => 'int',
452 'width' => 'int',
453 'height' => 'int',
454 'x' => 'int',
455 'y' => 'int',
456 'rotation_angle' => 'double',
457 'html_text' => 'string',
458 'text' => 'string',
459 'alternative_text' => 'string',
460 'text_horizontal_alignment' => 'string',
461 'text_horizontal_overflow' => 'string',
462 'text_orientation_type' => 'string',
463 'text_vertical_alignment' => 'string',
464 'text_vertical_overflow' => 'string',
465 'is_group' => 'boolean',
466 'is_hidden' => 'boolean',
467 'is_lock_aspect_ratio' => 'boolean',
468 'is_locked' => 'boolean',
469 'is_printable' => 'boolean',
470 'is_text_wrapped' => 'boolean',
471 'is_word_art' => 'boolean',
472 'linked_cell' => 'string',
473 'z_order_position' => 'int',
474 'font' => 'Font',
475 'hyperlink' => 'string',
476 'link' => 'Link'
477 } );
478
479 __PACKAGE__->attribute_map( {
480 'begin_arrowhead_length' => 'BeginArrowheadLength',
481 'begin_arrowhead_style' => 'BeginArrowheadStyle',
482 'begin_arrowhead_width' => 'BeginArrowheadWidth',
483 'end_arrowhead_length' => 'EndArrowheadLength',
484 'end_arrowhead_style' => 'EndArrowheadStyle',
485 'end_arrowhead_width' => 'EndArrowheadWidth',
486 'name' => 'Name',
487 'mso_drawing_type' => 'MsoDrawingType',
488 'auto_shape_type' => 'AutoShapeType',
489 'placement' => 'Placement',
490 'upper_left_row' => 'UpperLeftRow',
491 'top' => 'Top',
492 'upper_left_column' => 'UpperLeftColumn',
493 'left' => 'Left',
494 'lower_right_row' => 'LowerRightRow',
495 'bottom' => 'Bottom',
496 'lower_right_column' => 'LowerRightColumn',
497 'right' => 'Right',
498 'width' => 'Width',
499 'height' => 'Height',
500 'x' => 'X',
501 'y' => 'Y',
502 'rotation_angle' => 'RotationAngle',
503 'html_text' => 'HtmlText',
504 'text' => 'Text',
505 'alternative_text' => 'AlternativeText',
506 'text_horizontal_alignment' => 'TextHorizontalAlignment',
507 'text_horizontal_overflow' => 'TextHorizontalOverflow',
508 'text_orientation_type' => 'TextOrientationType',
509 'text_vertical_alignment' => 'TextVerticalAlignment',
510 'text_vertical_overflow' => 'TextVerticalOverflow',
511 'is_group' => 'IsGroup',
512 'is_hidden' => 'IsHidden',
513 'is_lock_aspect_ratio' => 'IsLockAspectRatio',
514 'is_locked' => 'IsLocked',
515 'is_printable' => 'IsPrintable',
516 'is_text_wrapped' => 'IsTextWrapped',
517 'is_word_art' => 'IsWordArt',
518 'linked_cell' => 'LinkedCell',
519 'z_order_position' => 'ZOrderPosition',
520 'font' => 'Font',
521 'hyperlink' => 'Hyperlink',
522 'link' => 'link'
523 } );
524
525 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
526
527
528 1;