Object/EllipseData.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 Aspose.Diagram Cloud API Reference
4
5 No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
6
7 OpenAPI spec version: 3.0
8
9 Generated by: https://github.com/swagger-api/swagger-codegen.git
10
11 =end comment
12
13 =cut
14
15 #
16 # NOTE: This class is auto generated by the swagger code generator program.
17 # Do not edit the class manually.
18 # Ref: https://github.com/swagger-api/swagger-codegen
19 #
20 package AsposeDiagramCloud::Object::EllipseData;
21
22 require 5.6.0;
23 use strict;
24 use warnings;
25 use utf8;
26 use JSON qw(decode_json);
27 use Data::Dumper;
28 use Module::Runtime qw(use_module);
29 use Log::Any qw($log);
30 use Date::Parse;
31 use DateTime;
32
33 use AsposeDiagramCloud::Object::DrawShapeData;
34 use AsposeDiagramCloud::Object::ShapeStyleData;
35 use AsposeDiagramCloud::Object::TextStyleData;
36
37 use base ("Class::Accessor", "Class::Data::Inheritable");
38
39
40 #
41 #
42 #
43 # NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
44 # REF: https://github.com/swagger-api/swagger-codegen
45 #
46
47 =begin comment
48
49 Aspose.Diagram Cloud API Reference
50
51 No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
52
53 OpenAPI spec version: 3.0
54
55 Generated by: https://github.com/swagger-api/swagger-codegen.git
56
57 =end comment
58
59 =cut
60
61 #
62 # NOTE: This class is auto generated by the swagger code generator program.
63 # Do not edit the class manually.
64 # Ref: https://github.com/swagger-api/swagger-codegen
65 #
66 __PACKAGE__->mk_classdata('attribute_map' => {});
67 __PACKAGE__->mk_classdata('swagger_types' => {});
68 __PACKAGE__->mk_classdata('method_documentation' => {});
69 __PACKAGE__->mk_classdata('class_documentation' => {});
70
71 # new object
72 sub new {
73 my ($class, %args) = @_;
74
75 my $self = bless {}, $class;
76
77 foreach my $attribute (keys %{$class->attribute_map}) {
78 my $args_key = $class->attribute_map->{$attribute};
79 $self->$attribute( $args{ $args_key } );
80 }
81
82 return $self;
83 }
84
85 # return perl hash
86 sub to_hash {
87 return decode_json(JSON->new->convert_blessed->encode( shift ));
88 }
89
90 # used by JSON for serialization
91 sub TO_JSON {
92 my $self = shift;
93 my $_data = {};
94 foreach my $_key (keys %{$self->attribute_map}) {
95 if (defined $self->{$_key}) {
96 $_data->{$self->attribute_map->{$_key}} = $self->{$_key};
97 }
98 }
99 return $_data;
100 }
101
102 # from Perl hashref
103 sub from_hash {
104 my ($self, $hash) = @_;
105
106 # loop through attributes and use swagger_types to deserialize the data
107 while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
108 my $_json_attribute = $self->attribute_map->{$_key};
109 if ($_type =~ /^array\[/i) { # array
110 my $_subclass = substr($_type, 6, -1);
111 my @_array = ();
112 foreach my $_element (@{$hash->{$_json_attribute}}) {
113 push @_array, $self->_deserialize($_subclass, $_element);
114 }
115 $self->{$_key} = \@_array;
116 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
117 $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
118 } else {
119 $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
120 }
121 }
122
123 return $self;
124 }
125
126 # deserialize non-array data
127 sub _deserialize {
128 my ($self, $type, $data) = @_;
129 $log->debugf("deserializing %s with %s",Dumper($data), $type);
130
131 if ($type eq 'DateTime') {
132 return DateTime->from_epoch(epoch => str2time($data));
133 } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
134 return $data;
135 } else { # hash(model)
136 my $_instance = eval "AsposeDiagramCloud::Object::$type->new()";
137 return $_instance->from_hash($data);
138 }
139 }
140
141
142
143 __PACKAGE__->class_documentation({description => '',
144 class => 'EllipseData',
145 required => [], # TODO
146 } );
147
148 __PACKAGE__->method_documentation({
149 'pin_x' => {
150 datatype => 'double',
151 base_name => 'PinX',
152 description => '',
153 format => '',
154 read_only => '',
155 },
156 'pin_y' => {
157 datatype => 'double',
158 base_name => 'PinY',
159 description => '',
160 format => '',
161 read_only => '',
162 },
163 'width' => {
164 datatype => 'double',
165 base_name => 'Width',
166 description => '',
167 format => '',
168 read_only => '',
169 },
170 'height' => {
171 datatype => 'double',
172 base_name => 'Height',
173 description => '',
174 format => '',
175 read_only => '',
176 },
177 'shape_style_data' => {
178 datatype => 'ShapeStyleData',
179 base_name => 'ShapeStyleData',
180 description => '',
181 format => '',
182 read_only => '',
183 },
184 'text' => {
185 datatype => 'string',
186 base_name => 'Text',
187 description => '',
188 format => '',
189 read_only => '',
190 },
191 'text_style_data' => {
192 datatype => 'TextStyleData',
193 base_name => 'TextStyleData',
194 description => '',
195 format => '',
196 read_only => '',
197 },
198 });
199
200 __PACKAGE__->swagger_types( {
201 'pin_x' => 'double',
202 'pin_y' => 'double',
203 'width' => 'double',
204 'height' => 'double',
205 'shape_style_data' => 'ShapeStyleData',
206 'text' => 'string',
207 'text_style_data' => 'TextStyleData'
208 } );
209
210 __PACKAGE__->attribute_map( {
211 'pin_x' => 'PinX',
212 'pin_y' => 'PinY',
213 'width' => 'Width',
214 'height' => 'Height',
215 'shape_style_data' => 'ShapeStyleData',
216 'text' => 'Text',
217 'text_style_data' => 'TextStyleData'
218 } );
219
220 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
221
222
223 1;