« Request/ImportDataIntoSpreadsheetRequest.pm
↑ Summary
Request/RemoveCharactersByPositionRequest.pm »
| 1 | =begin comment | ||
| 2 | |||
| 3 | Copyright (c) 2026 Aspose.Cells Cloud | ||
| 4 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| 5 | of this software and associated documentation files (the "Software"), to deal | ||
| 6 | in the Software without restriction, including without limitation the rights | ||
| 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| 8 | copies of the Software, and to permit persons to whom the Software is | ||
| 9 | furnished to do so, subject to the following conditions: | ||
| 10 | |||
| 11 | The above copyright notice and this permission notice shall be included in all | ||
| 12 | copies or substantial portions of the Software. | ||
| 13 | |||
| 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| 20 | SOFTWARE. | ||
| 21 | |||
| 22 | =end comment | ||
| 23 | |||
| 24 | =cut | ||
| 25 | |||
| 26 | package AsposeCellsCloud::Request::PutWorksheetShapeRequest; | ||
| 27 | |||
| 28 | require 5.6.0; | ||
| 29 | use strict; | ||
| 30 | use warnings; | ||
| 31 | use utf8; | ||
| 32 | use JSON ; | ||
| 33 | use Data::Dumper; | ||
| 34 | use Module::Runtime qw(use_module); | ||
| 35 | use Log::Any qw($log); | ||
| 36 | use Date::Parse; | ||
| 37 | use DateTime; | ||
| 38 | use File::Basename; | ||
| 39 | |||
| 40 | use base ("Class::Accessor", "Class::Data::Inheritable"); | ||
| 41 | |||
| 42 | __PACKAGE__->mk_classdata('attribute_map' => {}); | ||
| 43 | __PACKAGE__->mk_classdata('method_documentation' => {}); | ||
| 44 | __PACKAGE__->mk_classdata('class_documentation' => {}); | ||
| 45 | |||
| 46 | |||
| 47 | # new object | ||
| 48 | sub new { | ||
| 49 | my ($class, %args) = @_; | ||
| 50 | |||
| 51 | my $self = bless {}, $class; | ||
| 52 | |||
| 53 | foreach my $attribute (keys %{$class->attribute_map}) { | ||
| 54 | my $args_key = $class->attribute_map->{$attribute}; | ||
| 55 | $self->$attribute( $args{ $args_key } ); | ||
| 56 | } | ||
| 57 | |||
| 58 | return $self; | ||
| 59 | } | ||
| 60 | |||
| 61 | |||
| 62 | # Run Operation Request | ||
| 63 | # PutWorksheetShapeRequest.name : The file name. , | ||
| 64 | # PutWorksheetShapeRequest.sheetName : The worksheet name. , | ||
| 65 | # PutWorksheetShapeRequest.shapeDTO : , | ||
| 66 | # PutWorksheetShapeRequest.DrawingType : Shape object type , | ||
| 67 | # PutWorksheetShapeRequest.upperLeftRow : Upper left row index. , | ||
| 68 | # PutWorksheetShapeRequest.upperLeftColumn : Upper left column index. , | ||
| 69 | # PutWorksheetShapeRequest.top : Represents the vertical offset of Spinner from its left row, in unit of pixel. , | ||
| 70 | # PutWorksheetShapeRequest.left : Represents the horizontal offset of Spinner from its left column, in unit of pixel. , | ||
| 71 | # PutWorksheetShapeRequest.width : Represents the height of Spinner, in unit of pixel. , | ||
| 72 | # PutWorksheetShapeRequest.height : Represents the width of Spinner, in unit of pixel. , | ||
| 73 | # PutWorksheetShapeRequest.folder : The folder where the file is situated. , | ||
| 74 | # PutWorksheetShapeRequest.storageName : The storage name where the file is situated. | ||
| 75 | |||
| 76 | { | ||
| 77 | my $params = { | ||
| 78 | 'client' =>{ | ||
| 79 | data_type => 'ApiClient', | ||
| 80 | description => 'API Client.', | ||
| 81 | required => '0', | ||
| 82 | } | ||
| 83 | }; | ||
| 84 | __PACKAGE__->method_documentation->{ 'put_worksheet_shape' } = { | ||
| 85 | summary => 'Add a shape in the worksheet.', | ||
| 86 | params => $params, | ||
| 87 | returns => 'CellsCloudResponse', | ||
| 88 | }; | ||
| 89 | } | ||
| 90 | |||
| 91 | sub run_http_request { | ||
| 92 | my ($self, %args) = @_; | ||
| 93 | |||
| 94 | my $client = $args{'client'}; | ||
| 95 | |||
| 96 | # parse inputs | ||
| 97 | my $_resource_path = 'v3.0/cells/{name}/worksheets/{sheetName}/shapes'; | ||
| 98 | |||
| 99 | my $_method = 'PUT'; | ||
| 100 | my $query_params = {}; | ||
| 101 | my $header_params = {}; | ||
| 102 | my $form_params = {}; | ||
| 103 | |||
| 104 | |||
| 105 | my $_header_accept = $client->select_header_accept('application/json'); | ||
| 106 | if ($_header_accept) { | ||
| 107 | $header_params->{'Accept'} = $_header_accept; | ||
| 108 | } | ||
| 109 | $header_params->{'Content-Type'} = $client->select_header_content_type('application/json'); | ||
| 110 | if(defined $self->name){ | ||
| 111 | my $_base_variable = "{" . "name" . "}"; | ||
| 112 | my $_base_value = $client->to_path_value($self->name); | ||
| 113 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 114 | } | ||
| 115 | |||
| 116 | if(defined $self->sheet_name){ | ||
| 117 | my $_base_variable = "{" . "sheetName" . "}"; | ||
| 118 | my $_base_value = $client->to_path_value($self->sheet_name); | ||
| 119 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 120 | } | ||
| 121 | if(defined $self->drawing_type){ | ||
| 122 | $query_params->{'DrawingType'} = $client->to_query_value($self->drawing_type); | ||
| 123 | } | ||
| 124 | |||
| 125 | if(defined $self->upper_left_row){ | ||
| 126 | $query_params->{'upperLeftRow'} = $client->to_query_value($self->upper_left_row); | ||
| 127 | } | ||
| 128 | |||
| 129 | if(defined $self->upper_left_column){ | ||
| 130 | $query_params->{'upperLeftColumn'} = $client->to_query_value($self->upper_left_column); | ||
| 131 | } | ||
| 132 | |||
| 133 | if(defined $self->top){ | ||
| 134 | $query_params->{'top'} = $client->to_query_value($self->top); | ||
| 135 | } | ||
| 136 | |||
| 137 | if(defined $self->left){ | ||
| 138 | $query_params->{'left'} = $client->to_query_value($self->left); | ||
| 139 | } | ||
| 140 | |||
| 141 | if(defined $self->width){ | ||
| 142 | $query_params->{'width'} = $client->to_query_value($self->width); | ||
| 143 | } | ||
| 144 | |||
| 145 | if(defined $self->height){ | ||
| 146 | $query_params->{'height'} = $client->to_query_value($self->height); | ||
| 147 | } | ||
| 148 | |||
| 149 | if(defined $self->folder){ | ||
| 150 | $query_params->{'folder'} = $client->to_query_value($self->folder); | ||
| 151 | } | ||
| 152 | |||
| 153 | if(defined $self->storage_name){ | ||
| 154 | $query_params->{'storageName'} = $client->to_query_value($self->storage_name); | ||
| 155 | } | ||
| 156 | my $_body_data; | ||
| 157 | |||
| 158 | |||
| 159 | # body params | ||
| 160 | if (defined $self->shape_dto) { | ||
| 161 | $_body_data = JSON->new->convert_blessed->encode( $self->shape_dto); | ||
| 162 | } | ||
| 163 | |||
| 164 | |||
| 165 | |||
| 166 | # authentication setting, if any | ||
| 167 | my $auth_settings = [qw()]; | ||
| 168 | |||
| 169 | # make the API Call | ||
| 170 | my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); | ||
| 171 | return $response; | ||
| 172 | } | ||
| 173 | |||
| 174 | |||
| 175 | __PACKAGE__->method_documentation({ | ||
| 176 | 'name' => { | ||
| 177 | datatype => 'string', | ||
| 178 | base_name => 'name', | ||
| 179 | description => 'The file name.', | ||
| 180 | format => '', | ||
| 181 | read_only => '', | ||
| 182 | }, | ||
| 183 | 'sheet_name' => { | ||
| 184 | datatype => 'string', | ||
| 185 | base_name => 'sheetName', | ||
| 186 | description => 'The worksheet name.', | ||
| 187 | format => '', | ||
| 188 | read_only => '', | ||
| 189 | }, | ||
| 190 | 'shape_dto' => { | ||
| 191 | datatype => 'Shape', | ||
| 192 | base_name => 'shapeDTO', | ||
| 193 | description => '', | ||
| 194 | format => '', | ||
| 195 | read_only => '', | ||
| 196 | }, | ||
| 197 | 'drawing_type' => { | ||
| 198 | datatype => 'string', | ||
| 199 | base_name => 'DrawingType', | ||
| 200 | description => 'Shape object type', | ||
| 201 | format => '', | ||
| 202 | read_only => '', | ||
| 203 | }, | ||
| 204 | 'upper_left_row' => { | ||
| 205 | datatype => 'int', | ||
| 206 | base_name => 'upperLeftRow', | ||
| 207 | description => 'Upper left row index.', | ||
| 208 | format => '', | ||
| 209 | read_only => '', | ||
| 210 | }, | ||
| 211 | 'upper_left_column' => { | ||
| 212 | datatype => 'int', | ||
| 213 | base_name => 'upperLeftColumn', | ||
| 214 | description => 'Upper left column index.', | ||
| 215 | format => '', | ||
| 216 | read_only => '', | ||
| 217 | }, | ||
| 218 | 'top' => { | ||
| 219 | datatype => 'int', | ||
| 220 | base_name => 'top', | ||
| 221 | description => 'Represents the vertical offset of Spinner from its left row, in unit of pixel.', | ||
| 222 | format => '', | ||
| 223 | read_only => '', | ||
| 224 | }, | ||
| 225 | 'left' => { | ||
| 226 | datatype => 'int', | ||
| 227 | base_name => 'left', | ||
| 228 | description => 'Represents the horizontal offset of Spinner from its left column, in unit of pixel.', | ||
| 229 | format => '', | ||
| 230 | read_only => '', | ||
| 231 | }, | ||
| 232 | 'width' => { | ||
| 233 | datatype => 'int', | ||
| 234 | base_name => 'width', | ||
| 235 | description => 'Represents the height of Spinner, in unit of pixel.', | ||
| 236 | format => '', | ||
| 237 | read_only => '', | ||
| 238 | }, | ||
| 239 | 'height' => { | ||
| 240 | datatype => 'int', | ||
| 241 | base_name => 'height', | ||
| 242 | description => 'Represents the width of Spinner, in unit of pixel.', | ||
| 243 | format => '', | ||
| 244 | read_only => '', | ||
| 245 | }, | ||
| 246 | 'folder' => { | ||
| 247 | datatype => 'string', | ||
| 248 | base_name => 'folder', | ||
| 249 | description => 'The folder where the file is situated.', | ||
| 250 | format => '', | ||
| 251 | read_only => '', | ||
| 252 | }, | ||
| 253 | 'storage_name' => { | ||
| 254 | datatype => 'string', | ||
| 255 | base_name => 'storageName', | ||
| 256 | description => 'The storage name where the file is situated.', | ||
| 257 | format => '', | ||
| 258 | read_only => '', | ||
| 259 | }, | ||
| 260 | }); | ||
| 261 | |||
| 262 | |||
| 263 | __PACKAGE__->attribute_map( { | ||
| 264 | 'name' => 'name', | ||
| 265 | 'sheet_name' => 'sheetName', | ||
| 266 | 'shape_dto' => 'shapeDTO', | ||
| 267 | 'drawing_type' => 'DrawingType', | ||
| 268 | 'upper_left_row' => 'upperLeftRow', | ||
| 269 | 'upper_left_column' => 'upperLeftColumn', | ||
| 270 | 'top' => 'top', | ||
| 271 | 'left' => 'left', | ||
| 272 | 'width' => 'width', | ||
| 273 | 'height' => 'height', | ||
| 274 | 'folder' => 'folder', | ||
| 275 | 'storage_name' => 'storageName' | ||
| 276 | } ); | ||
| 277 | |||
| 278 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 279 | |||
| 280 | |||
| 281 | 1; |