| 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::Cylinder; | ||
| 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 | # | ||
| 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 | return $self; | ||
| 80 | } | ||
| 81 | |||
| 82 | # return perl hash | ||
| 83 | sub to_hash { | ||
| 84 | return decode_json(JSON->new->convert_blessed->encode( shift )); | ||
| 85 | } | ||
| 86 | |||
| 87 | # used by JSON for serialization | ||
| 88 | sub TO_JSON { | ||
| 89 | my $self = shift; | ||
| 90 | my $_data = {}; | ||
| 91 | foreach my $_key (keys %{$self->attribute_map}) { | ||
| 92 | if (defined $self->{$_key}) { | ||
| 93 | $_data->{$self->attribute_map->{$_key}} = $self->{$_key}; | ||
| 94 | } | ||
| 95 | } | ||
| 96 | return $_data; | ||
| 97 | } | ||
| 98 | |||
| 99 | # from Perl hashref | ||
| 100 | sub from_hash { | ||
| 101 | my ($self, $hash) = @_; | ||
| 102 | |||
| 103 | # loop through attributes and use swagger_types to deserialize the data | ||
| 104 | while ( my ($_key, $_type) = each %{$self->swagger_types} ) { | ||
| 105 | my $_json_attribute = $self->attribute_map->{$_key}; | ||
| 106 | if ($_type =~ /^array\[/i) { # array | ||
| 107 | my $_subclass = substr($_type, 6, -1); | ||
| 108 | my @_array = (); | ||
| 109 | foreach my $_element (@{$hash->{$_json_attribute}}) { | ||
| 110 | push @_array, $self->_deserialize($_subclass, $_element); | ||
| 111 | } | ||
| 112 | $self->{$_key} = \@_array; | ||
| 113 | } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime | ||
| 114 | $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); | ||
| 115 | } else { | ||
| 116 | $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); | ||
| 117 | } | ||
| 118 | } | ||
| 119 | |||
| 120 | return $self; | ||
| 121 | } | ||
| 122 | |||
| 123 | # deserialize non-array data | ||
| 124 | sub _deserialize { | ||
| 125 | my ($self, $type, $data) = @_; | ||
| 126 | $log->debugf("deserializing %s with %s",Dumper($data), $type); | ||
| 127 | |||
| 128 | if ($type eq 'DateTime') { | ||
| 129 | return DateTime->from_epoch(epoch => str2time($data)); | ||
| 130 | } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) { | ||
| 131 | return $data; | ||
| 132 | } else { # hash(model) | ||
| 133 | my $_instance = eval "AsposeThreeDCloud::Object::$type->new()"; | ||
| 134 | return $_instance->from_hash($data); | ||
| 135 | } | ||
| 136 | } | ||
| 137 | |||
| 138 | |||
| 139 | |||
| 140 | __PACKAGE__->class_documentation({description => '', | ||
| 141 | class => 'Cylinder', | ||
| 142 | required => [], # TODO | ||
| 143 | } ); | ||
| 144 | |||
| 145 | __PACKAGE__->method_documentation({ | ||
| 146 | 'name' => { | ||
| 147 | datatype => 'string', | ||
| 148 | base_name => 'Name', | ||
| 149 | description => 'Gets or sets the name of the cylinder ', | ||
| 150 | format => '', | ||
| 151 | read_only => '', | ||
| 152 | }, | ||
| 153 | 'radius_top' => { | ||
| 154 | datatype => 'double', | ||
| 155 | base_name => 'RadiusTop', | ||
| 156 | description => 'Gets or sets the radius of cylinder's top cap.', | ||
| 157 | format => '', | ||
| 158 | read_only => '', | ||
| 159 | }, | ||
| 160 | 'radius_bottom' => { | ||
| 161 | datatype => 'double', | ||
| 162 | base_name => 'RadiusBottom', | ||
| 163 | description => 'Gets or sets the radius bottoof cylinder's bottom cap. ', | ||
| 164 | format => '', | ||
| 165 | read_only => '', | ||
| 166 | }, | ||
| 167 | 'height' => { | ||
| 168 | datatype => 'double', | ||
| 169 | base_name => 'Height', | ||
| 170 | description => 'Gets or sets the height of the cylinder.', | ||
| 171 | format => '', | ||
| 172 | read_only => '', | ||
| 173 | }, | ||
| 174 | 'radial_segments' => { | ||
| 175 | datatype => 'int', | ||
| 176 | base_name => 'RadialSegments', | ||
| 177 | description => 'Gets or sets the radial segments.', | ||
| 178 | format => '', | ||
| 179 | read_only => '', | ||
| 180 | }, | ||
| 181 | 'height_segments' => { | ||
| 182 | datatype => 'int', | ||
| 183 | base_name => 'HeightSegments', | ||
| 184 | description => 'Gets or sets the height segments.', | ||
| 185 | format => '', | ||
| 186 | read_only => '', | ||
| 187 | }, | ||
| 188 | 'open_ended' => { | ||
| 189 | datatype => 'boolean', | ||
| 190 | base_name => 'OpenEnded', | ||
| 191 | description => 'Gets or sets a value indicating whether this Aspose.ThreeD.Entities.Cylinder open ended. The default value is false.', | ||
| 192 | format => '', | ||
| 193 | read_only => '', | ||
| 194 | }, | ||
| 195 | 'theta_start' => { | ||
| 196 | datatype => 'double', | ||
| 197 | base_name => 'ThetaStart', | ||
| 198 | description => 'Gets or sets the theta start. The default value is 0. ', | ||
| 199 | format => '', | ||
| 200 | read_only => '', | ||
| 201 | }, | ||
| 202 | 'theta_length' => { | ||
| 203 | datatype => 'double', | ||
| 204 | base_name => 'ThetaLength', | ||
| 205 | description => 'Gets or sets the length of the theta. The default value is 2p', | ||
| 206 | format => '', | ||
| 207 | read_only => '', | ||
| 208 | }, | ||
| 209 | }); | ||
| 210 | |||
| 211 | __PACKAGE__->swagger_types( { | ||
| 212 | 'name' => 'string', | ||
| 213 | 'radius_top' => 'double', | ||
| 214 | 'radius_bottom' => 'double', | ||
| 215 | 'height' => 'double', | ||
| 216 | 'radial_segments' => 'int', | ||
| 217 | 'height_segments' => 'int', | ||
| 218 | 'open_ended' => 'boolean', | ||
| 219 | 'theta_start' => 'double', | ||
| 220 | 'theta_length' => 'double' | ||
| 221 | } ); | ||
| 222 | |||
| 223 | __PACKAGE__->attribute_map( { | ||
| 224 | 'name' => 'Name', | ||
| 225 | 'radius_top' => 'RadiusTop', | ||
| 226 | 'radius_bottom' => 'RadiusBottom', | ||
| 227 | 'height' => 'Height', | ||
| 228 | 'radial_segments' => 'RadialSegments', | ||
| 229 | 'height_segments' => 'HeightSegments', | ||
| 230 | 'open_ended' => 'OpenEnded', | ||
| 231 | 'theta_start' => 'ThetaStart', | ||
| 232 | 'theta_length' => 'ThetaLength' | ||
| 233 | } ); | ||
| 234 | |||
| 235 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 236 | |||
| 237 | |||
| 238 | 1; |