Object/PdfLightingScheme.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::PdfLightingScheme;
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
79 ##########Added manual##########
80 my $self = {
81 Artwork => 0,
82 None => 1,
83 White => 2,
84 Day => 3,
85 Night => 4,
86 Hard => 5,
87 Primary => 6,
88 Blue => 7,
89 Red => 8,
90 Cube => 9,
91 CAD => 10,
92 Headlamp => 11
93 };
94 ####################
95 return $self;
96 }
97
98 # return perl hash
99 sub to_hash {
100 return decode_json(JSON->new->convert_blessed->encode( shift ));
101 }
102
103 # used by JSON for serialization
104 sub TO_JSON {
105 my $self = shift;
106 my $_data = {};
107 foreach my $_key (keys %{$self->attribute_map}) {
108 if (defined $self->{$_key}) {
109 $_data->{$self->attribute_map->{$_key}} = $self->{$_key};
110 }
111 }
112 return $_data;
113 }
114
115 # from Perl hashref
116 sub from_hash {
117 my ($self, $hash) = @_;
118
119 # loop through attributes and use swagger_types to deserialize the data
120 while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
121 my $_json_attribute = $self->attribute_map->{$_key};
122 if ($_type =~ /^array\[/i) { # array
123 my $_subclass = substr($_type, 6, -1);
124 my @_array = ();
125 foreach my $_element (@{$hash->{$_json_attribute}}) {
126 push @_array, $self->_deserialize($_subclass, $_element);
127 }
128 $self->{$_key} = \@_array;
129 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
130 $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
131 } else {
132 $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
133 }
134 }
135
136 return $self;
137 }
138
139 # deserialize non-array data
140 sub _deserialize {
141 my ($self, $type, $data) = @_;
142 $log->debugf("deserializing %s with %s",Dumper($data), $type);
143
144 if ($type eq 'DateTime') {
145 return DateTime->from_epoch(epoch => str2time($data));
146 } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
147 return $data;
148 } else { # hash(model)
149 my $_instance = eval "AsposeThreeDCloud::Object::$type->new()";
150 return $_instance->from_hash($data);
151 }
152 }
153
154
155
156 __PACKAGE__->class_documentation({description => 'Render mode specifies the style in which the 3D artwork is rendered.',
157 class => 'PdfLightingScheme',
158 required => [], # TODO
159 } );
160
161 __PACKAGE__->method_documentation({
162 });
163
164 __PACKAGE__->swagger_types( {
165
166 } );
167
168 __PACKAGE__->attribute_map( {
169
170 } );
171
172 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
173
174
175 1;