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