Object/PdfRenderMode.pm untested

filter: Statementstmt 0.0% 0 / 85 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 16 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 116 CC 6 SCAR 16.6
CC
6
Cov
0%
from_hash
12.0
_deserialize
12.0
TO_JSON
6.0
CRAP 5.2
1 =begin comment
2
3 Aspose.3D 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 AsposeThreeDCloud::Object::PdfRenderMode;
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
34 use base ("Class::Accessor", "Class::Data::Inheritable");
35
36
37 #
38 #Render mode specifies the style in which the 3D artwork is rendered.
39 #
40 # NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
41 # REF: https://github.com/swagger-api/swagger-codegen
42 #
43
44 =begin comment
45
46 Aspose.3D Cloud API Reference
47
48 No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
49
50 OpenAPI spec version: 3.0
51
52 Generated by: https://github.com/swagger-api/swagger-codegen.git
53
54 =end comment
55
56 =cut
57
58 #
59 # NOTE: This class is auto generated by the swagger code generator program.
60 # Do not edit the class manually.
61 # Ref: https://github.com/swagger-api/swagger-codegen
62 #
63 __PACKAGE__->mk_classdata('attribute_map' => {});
64 __PACKAGE__->mk_classdata('swagger_types' => {});
65 __PACKAGE__->mk_classdata('method_documentation' => {});
66 __PACKAGE__->mk_classdata('class_documentation' => {});
67
68 # new object
69 sub new {
70 my ($class, %args) = @_;
71
72 my $self = bless {}, $class;
73
74 foreach my $attribute (keys %{$class->attribute_map}) {
75 my $args_key = $class->attribute_map->{$attribute};
76 $self->$attribute( $args{ $args_key } );
77 }
78 ##########Added manual##########
79 my $self = {
80 Solid => 0,
81 SolidWireframe => 1,
82 Transparent => 2,
83 TransparentWireframe => 3,
84 BoundingBox => 4,
85 TransparentBoundingBox => 5,
86 TransparentBoundingBoxOutline => 6,
87 Wireframe => 7,
88 ShadedWireframe => 8,
89 HiddenWireframe => 9,
90 Vertices => 10,
91 ShadedVertices => 11,
92 Illustration => 12,
93 SolidOutline => 13,
94 ShadedIllustration => 14
95 };
96 ####################
97 return $self;
98 }
99
100 # return perl hash
101 sub to_hash {
102 return decode_json(JSON->new->convert_blessed->encode( shift ));
103 }
104
105 # used by JSON for serialization
106 sub TO_JSON {
107 my $self = shift;
108 my $_data = {};
109 foreach my $_key (keys %{$self->attribute_map}) {
110 if (defined $self->{$_key}) {
111 $_data->{$self->attribute_map->{$_key}} = $self->{$_key};
112 }
113 }
114 return $_data;
115 }
116
117 # from Perl hashref
118 sub from_hash {
119 my ($self, $hash) = @_;
120
121 # loop through attributes and use swagger_types to deserialize the data
122 while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
123 my $_json_attribute = $self->attribute_map->{$_key};
124 if ($_type =~ /^array\[/i) { # array
125 my $_subclass = substr($_type, 6, -1);
126 my @_array = ();
127 foreach my $_element (@{$hash->{$_json_attribute}}) {
128 push @_array, $self->_deserialize($_subclass, $_element);
129 }
130 $self->{$_key} = \@_array;
131 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
132 $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
133 } else {
134 $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
135 }
136 }
137
138 return $self;
139 }
140
141 # deserialize non-array data
142 sub _deserialize {
143 my ($self, $type, $data) = @_;
144 $log->debugf("deserializing %s with %s",Dumper($data), $type);
145
146 if ($type eq 'DateTime') {
147 return DateTime->from_epoch(epoch => str2time($data));
148 } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
149 return $data;
150 } else { # hash(model)
151 my $_instance = eval "AsposeThreeDCloud::Object::$type->new()";
152 return $_instance->from_hash($data);
153 }
154 }
155
156
157
158 __PACKAGE__->class_documentation({description => 'Render mode specifies the style in which the 3D artwork is rendered.',
159 class => 'PdfRenderMode',
160 required => [], # TODO
161 } );
162
163 __PACKAGE__->method_documentation({
164 });
165
166 __PACKAGE__->swagger_types( {
167
168 } );
169
170 __PACKAGE__->attribute_map( {
171
172 } );
173
174 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
175
176
177 1;