Object/PlySaveOption.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.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::PlySaveOption;
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::FileContentType;
34 use AsposeThreeDCloud::Object::SaveFormat;
35 use AsposeThreeDCloud::Object::SaveOptions;
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.3D 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 "AsposeThreeDCloud::Object::$type->new()";
137 return $_instance->from_hash($data);
138 }
139 }
140
141
142
143 __PACKAGE__->class_documentation({description => '',
144 class => 'PlySaveOption',
145 required => [], # TODO
146 } );
147
148 __PACKAGE__->method_documentation({
149 'save_format' => {
150 datatype => 'SaveFormat',
151 base_name => 'SaveFormat',
152 description => 'Gets or sets of the SaveFormat.',
153 format => '',
154 read_only => '',
155 },
156 'lookup_paths' => {
157 datatype => 'ARRAY[string]',
158 base_name => 'LookupPaths',
159 description => 'Some files like OBJ depends on external file, the lookup paths will allows Aspose.3D to look for external file to load',
160 format => '',
161 read_only => '',
162 },
163 'file_name' => {
164 datatype => 'string',
165 base_name => 'FileName',
166 description => 'The file name of the exporting/importing scene. This is optional, but useful when serialize external assets like OBJ's material.',
167 format => '',
168 read_only => '',
169 },
170 'file_format' => {
171 datatype => 'string',
172 base_name => 'FileFormat',
173 description => 'The file format like FBX,U3D,PDF ....',
174 format => '',
175 read_only => '',
176 },
177 'flip_coordinate' => {
178 datatype => 'boolean',
179 base_name => 'FlipCoordinate',
180 description => 'Flip the coordinate while saving the scene, default value is true.',
181 format => '',
182 read_only => '',
183 },
184 'vertex_element' => {
185 datatype => 'string',
186 base_name => 'VertexElement',
187 description => 'The element name for the vertex data, default value is \"vertex\".',
188 format => '',
189 read_only => '',
190 },
191 'position_components' => {
192 datatype => 'ARRAY[string]',
193 base_name => 'PositionComponents',
194 description => 'The component names for position data, default value is (\"x\", \"y\", \"z\")',
195 format => '',
196 read_only => '',
197 },
198 'face_element' => {
199 datatype => 'string',
200 base_name => 'FaceElement',
201 description => 'The element name for the face data, default value is face.',
202 format => '',
203 read_only => '',
204 },
205 'face_property' => {
206 datatype => 'string',
207 base_name => 'FaceProperty',
208 description => 'The property name for the face data, default value is vertex_index.',
209 format => '',
210 read_only => '',
211 },
212 'file_content_type' => {
213 datatype => 'FileContentType',
214 base_name => 'FileContentType',
215 description => 'Gets or sets of the FileContent Style.',
216 format => '',
217 read_only => '',
218 },
219 });
220
221 __PACKAGE__->swagger_types( {
222 'save_format' => 'SaveFormat',
223 'lookup_paths' => 'ARRAY[string]',
224 'file_name' => 'string',
225 'file_format' => 'string',
226 'flip_coordinate' => 'boolean',
227 'vertex_element' => 'string',
228 'position_components' => 'ARRAY[string]',
229 'face_element' => 'string',
230 'face_property' => 'string',
231 'file_content_type' => 'FileContentType'
232 } );
233
234 __PACKAGE__->attribute_map( {
235 'save_format' => 'SaveFormat',
236 'lookup_paths' => 'LookupPaths',
237 'file_name' => 'FileName',
238 'file_format' => 'FileFormat',
239 'flip_coordinate' => 'FlipCoordinate',
240 'vertex_element' => 'VertexElement',
241 'position_components' => 'PositionComponents',
242 'face_element' => 'FaceElement',
243 'face_property' => 'FaceProperty',
244 'file_content_type' => 'FileContentType'
245 } );
246
247 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
248
249
250 1;