Object/PdfSaveOption.pm untested

filter: Statementstmt 0.0% 0 / 99 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 20 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 134 CC 6 SCAR 15.5
CC
6
Cov
0%
from_hash
12.0
_deserialize
12.0
TO_JSON
6.0
CRAP 4.7
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::PdfSaveOption;
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 AsposeThreeDCloud::Object::PdfLightingScheme;
34 use AsposeThreeDCloud::Object::PdfRenderMode;
35 use AsposeThreeDCloud::Object::SaveFormat;
36 use AsposeThreeDCloud::Object::SaveOptions;
37
38 use base ("Class::Accessor", "Class::Data::Inheritable");
39
40
41 #
42 #
43 #
44 # NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
45 # REF: https://github.com/swagger-api/swagger-codegen
46 #
47
48 =begin comment
49
50 Aspose.3D Cloud API Reference
51
52 No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
53
54 OpenAPI spec version: 3.0
55
56 Generated by: https://github.com/swagger-api/swagger-codegen.git
57
58 =end comment
59
60 =cut
61
62 #
63 # NOTE: This class is auto generated by the swagger code generator program.
64 # Do not edit the class manually.
65 # Ref: https://github.com/swagger-api/swagger-codegen
66 #
67 __PACKAGE__->mk_classdata('attribute_map' => {});
68 __PACKAGE__->mk_classdata('swagger_types' => {});
69 __PACKAGE__->mk_classdata('method_documentation' => {});
70 __PACKAGE__->mk_classdata('class_documentation' => {});
71
72 # new object
73 sub new {
74 my ($class, %args) = @_;
75
76 my $self = bless {}, $class;
77
78 foreach my $attribute (keys %{$class->attribute_map}) {
79 my $args_key = $class->attribute_map->{$attribute};
80 $self->$attribute( $args{ $args_key } );
81 }
82
83 return $self;
84 }
85
86 # return perl hash
87 sub to_hash {
88 return decode_json(JSON->new->convert_blessed->encode( shift ));
89 }
90
91 # used by JSON for serialization
92 sub TO_JSON {
93 my $self = shift;
94 my $_data = {};
95 foreach my $_key (keys %{$self->attribute_map}) {
96 if (defined $self->{$_key}) {
97 $_data->{$self->attribute_map->{$_key}} = $self->{$_key};
98 }
99 }
100 return $_data;
101 }
102
103 # from Perl hashref
104 sub from_hash {
105 my ($self, $hash) = @_;
106
107 # loop through attributes and use swagger_types to deserialize the data
108 while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
109 my $_json_attribute = $self->attribute_map->{$_key};
110 if ($_type =~ /^array\[/i) { # array
111 my $_subclass = substr($_type, 6, -1);
112 my @_array = ();
113 foreach my $_element (@{$hash->{$_json_attribute}}) {
114 push @_array, $self->_deserialize($_subclass, $_element);
115 }
116 $self->{$_key} = \@_array;
117 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
118 $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
119 } else {
120 $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
121 }
122 }
123
124 return $self;
125 }
126
127 # deserialize non-array data
128 sub _deserialize {
129 my ($self, $type, $data) = @_;
130 $log->debugf("deserializing %s with %s",Dumper($data), $type);
131
132 if ($type eq 'DateTime') {
133 return DateTime->from_epoch(epoch => str2time($data));
134 } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
135 return $data;
136 } else { # hash(model)
137 my $_instance = eval "AsposeThreeDCloud::Object::$type->new()";
138 return $_instance->from_hash($data);
139 }
140 }
141
142
143
144 __PACKAGE__->class_documentation({description => '',
145 class => 'PdfSaveOption',
146 required => [], # TODO
147 } );
148
149 __PACKAGE__->method_documentation({
150 'save_format' => {
151 datatype => 'SaveFormat',
152 base_name => 'SaveFormat',
153 description => 'Gets or sets of the SaveFormat.',
154 format => '',
155 read_only => '',
156 },
157 'lookup_paths' => {
158 datatype => 'ARRAY[string]',
159 base_name => 'LookupPaths',
160 description => 'Some files like OBJ depends on external file, the lookup paths will allows Aspose.3D to look for external file to load',
161 format => '',
162 read_only => '',
163 },
164 'file_name' => {
165 datatype => 'string',
166 base_name => 'FileName',
167 description => 'The file name of the exporting/importing scene. This is optional, but useful when serialize external assets like OBJ's material.',
168 format => '',
169 read_only => '',
170 },
171 'file_format' => {
172 datatype => 'string',
173 base_name => 'FileFormat',
174 description => 'The file format like FBX,U3D,PDF ....',
175 format => '',
176 read_only => '',
177 },
178 'flip_coordinate_system' => {
179 datatype => 'boolean',
180 base_name => 'FlipCoordinateSystem',
181 description => 'Gets or sets to flip the coordinate system of the scene during exporting.',
182 format => '',
183 read_only => '',
184 },
185 'render_mode' => {
186 datatype => 'PdfRenderMode',
187 base_name => 'RenderMode',
188 description => 'Render mode specifies the style in which the 3D artwork is rendered.',
189 format => '',
190 read_only => '',
191 },
192 'lighting_scheme' => {
193 datatype => 'PdfLightingScheme',
194 base_name => 'LightingScheme',
195 description => 'LightingScheme specifies the lighting to apply to 3D artwork.',
196 format => '',
197 read_only => '',
198 },
199 });
200
201 __PACKAGE__->swagger_types( {
202 'save_format' => 'SaveFormat',
203 'lookup_paths' => 'ARRAY[string]',
204 'file_name' => 'string',
205 'file_format' => 'string',
206 'flip_coordinate_system' => 'boolean',
207 'render_mode' => 'PdfRenderMode',
208 'lighting_scheme' => 'PdfLightingScheme'
209 } );
210
211 __PACKAGE__->attribute_map( {
212 'save_format' => 'SaveFormat',
213 'lookup_paths' => 'LookupPaths',
214 'file_name' => 'FileName',
215 'file_format' => 'FileFormat',
216 'flip_coordinate_system' => 'FlipCoordinateSystem',
217 'render_mode' => 'RenderMode',
218 'lighting_scheme' => 'LightingScheme'
219 } );
220
221 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
222
223
224 1;