Object/Discreet3DSSaveOption.pm untested

filter: Statementstmt 0.0% 0 / 93 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 18 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 126 CC 6 SCAR 16.0
CC
6
Cov
0%
from_hash
12.0
_deserialize
12.0
TO_JSON
6.0
CRAP 5.0
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::Discreet3DSSaveOption;
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::SaveFormat;
34 use AsposeThreeDCloud::Object::SaveOptions;
35
36 use base ("Class::Accessor", "Class::Data::Inheritable");
37
38
39 #
40 #
41 #
42 # NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
43 # REF: https://github.com/swagger-api/swagger-codegen
44 #
45
46 =begin comment
47
48 Aspose.3D Cloud API Reference
49
50 No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
51
52 OpenAPI spec version: 3.0
53
54 Generated by: https://github.com/swagger-api/swagger-codegen.git
55
56 =end comment
57
58 =cut
59
60 #
61 # NOTE: This class is auto generated by the swagger code generator program.
62 # Do not edit the class manually.
63 # Ref: https://github.com/swagger-api/swagger-codegen
64 #
65 __PACKAGE__->mk_classdata('attribute_map' => {});
66 __PACKAGE__->mk_classdata('swagger_types' => {});
67 __PACKAGE__->mk_classdata('method_documentation' => {});
68 __PACKAGE__->mk_classdata('class_documentation' => {});
69
70 # new object
71 sub new {
72 my ($class, %args) = @_;
73
74 my $self = bless {}, $class;
75
76 foreach my $attribute (keys %{$class->attribute_map}) {
77 my $args_key = $class->attribute_map->{$attribute};
78 $self->$attribute( $args{ $args_key } );
79 }
80
81 return $self;
82 }
83
84 # return perl hash
85 sub to_hash {
86 return decode_json(JSON->new->convert_blessed->encode( shift ));
87 }
88
89 # used by JSON for serialization
90 sub TO_JSON {
91 my $self = shift;
92 my $_data = {};
93 foreach my $_key (keys %{$self->attribute_map}) {
94 if (defined $self->{$_key}) {
95 $_data->{$self->attribute_map->{$_key}} = $self->{$_key};
96 }
97 }
98 return $_data;
99 }
100
101 # from Perl hashref
102 sub from_hash {
103 my ($self, $hash) = @_;
104
105 # loop through attributes and use swagger_types to deserialize the data
106 while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
107 my $_json_attribute = $self->attribute_map->{$_key};
108 if ($_type =~ /^array\[/i) { # array
109 my $_subclass = substr($_type, 6, -1);
110 my @_array = ();
111 foreach my $_element (@{$hash->{$_json_attribute}}) {
112 push @_array, $self->_deserialize($_subclass, $_element);
113 }
114 $self->{$_key} = \@_array;
115 } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
116 $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
117 } else {
118 $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
119 }
120 }
121
122 return $self;
123 }
124
125 # deserialize non-array data
126 sub _deserialize {
127 my ($self, $type, $data) = @_;
128 $log->debugf("deserializing %s with %s",Dumper($data), $type);
129
130 if ($type eq 'DateTime') {
131 return DateTime->from_epoch(epoch => str2time($data));
132 } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
133 return $data;
134 } else { # hash(model)
135 my $_instance = eval "AsposeThreeDCloud::Object::$type->new()";
136 return $_instance->from_hash($data);
137 }
138 }
139
140
141
142 __PACKAGE__->class_documentation({description => '',
143 class => 'Discreet3DSSaveOption',
144 required => [], # TODO
145 } );
146
147 __PACKAGE__->method_documentation({
148 'save_format' => {
149 datatype => 'SaveFormat',
150 base_name => 'SaveFormat',
151 description => 'Gets or sets of the SaveFormat.',
152 format => '',
153 read_only => '',
154 },
155 'lookup_paths' => {
156 datatype => 'ARRAY[string]',
157 base_name => 'LookupPaths',
158 description => 'Some files like OBJ depends on external file, the lookup paths will allows Aspose.3D to look for external file to load',
159 format => '',
160 read_only => '',
161 },
162 'file_name' => {
163 datatype => 'string',
164 base_name => 'FileName',
165 description => 'The file name of the exporting/importing scene. This is optional, but useful when serialize external assets like OBJ's material.',
166 format => '',
167 read_only => '',
168 },
169 'file_format' => {
170 datatype => 'string',
171 base_name => 'FileFormat',
172 description => 'The file format like FBX,U3D,PDF ....',
173 format => '',
174 read_only => '',
175 },
176 'export_light' => {
177 datatype => 'boolean',
178 base_name => 'ExportLight',
179 description => 'Gets or sets whether export all lights in the scene.',
180 format => '',
181 read_only => '',
182 },
183 'export_camera' => {
184 datatype => 'boolean',
185 base_name => 'ExportCamera',
186 description => 'Gets or sets whether export all cameras in the scene',
187 format => '',
188 read_only => '',
189 },
190 'duplicated_name_separator' => {
191 datatype => 'string',
192 base_name => 'DuplicatedNameSeparator',
193 description => 'The separator between object's name and the duplicated counter, default value is \"_\". When scene contains objects that use the same name, Aspose.3D 3DS exporter will generate a different name for the object. For example there's two nodes named \"Box\", the first node will have a name \"Box\", and the second node will get a new name \"Box_2\" using the default configuration',
194 format => '',
195 read_only => '',
196 },
197 'duplicated_name_counter_base' => {
198 datatype => 'int',
199 base_name => 'DuplicatedNameCounterBase',
200 description => 'The counter used by generating new name for duplicated names',
201 format => '',
202 read_only => '',
203 },
204 'duplicated_name_counter_format' => {
205 datatype => 'string',
206 base_name => 'DuplicatedNameCounterFormat',
207 description => 'The format of the duplicated counter, default value is empty string.',
208 format => '',
209 read_only => '',
210 },
211 'master_scale' => {
212 datatype => 'double',
213 base_name => 'MasterScale',
214 description => 'Gets or sets the master scale used in exporting.',
215 format => '',
216 read_only => '',
217 },
218 'gamma_corrected_color' => {
219 datatype => 'boolean',
220 base_name => 'GammaCorrectedColor',
221 description => 'Gets or sets the GammaCorrectedColor.',
222 format => '',
223 read_only => '',
224 },
225 'flip_coordinate_system' => {
226 datatype => 'boolean',
227 base_name => 'FlipCoordinateSystem',
228 description => 'Gets or sets flip coordinate system of control points/normal during importing/exporting..',
229 format => '',
230 read_only => '',
231 },
232 'high_precise_color' => {
233 datatype => 'boolean',
234 base_name => 'HighPreciseColor',
235 description => 'Gets or sets the HighPreciseColor.',
236 format => '',
237 read_only => '',
238 },
239 });
240
241 __PACKAGE__->swagger_types( {
242 'save_format' => 'SaveFormat',
243 'lookup_paths' => 'ARRAY[string]',
244 'file_name' => 'string',
245 'file_format' => 'string',
246 'export_light' => 'boolean',
247 'export_camera' => 'boolean',
248 'duplicated_name_separator' => 'string',
249 'duplicated_name_counter_base' => 'int',
250 'duplicated_name_counter_format' => 'string',
251 'master_scale' => 'double',
252 'gamma_corrected_color' => 'boolean',
253 'flip_coordinate_system' => 'boolean',
254 'high_precise_color' => 'boolean'
255 } );
256
257 __PACKAGE__->attribute_map( {
258 'save_format' => 'SaveFormat',
259 'lookup_paths' => 'LookupPaths',
260 'file_name' => 'FileName',
261 'file_format' => 'FileFormat',
262 'export_light' => 'ExportLight',
263 'export_camera' => 'ExportCamera',
264 'duplicated_name_separator' => 'DuplicatedNameSeparator',
265 'duplicated_name_counter_base' => 'DuplicatedNameCounterBase',
266 'duplicated_name_counter_format' => 'DuplicatedNameCounterFormat',
267 'master_scale' => 'MasterScale',
268 'gamma_corrected_color' => 'GammaCorrectedColor',
269 'flip_coordinate_system' => 'FlipCoordinateSystem',
270 'high_precise_color' => 'HighPreciseColor'
271 } );
272
273 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
274
275
276 1;