| 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::GetWorkbookRequest; | ||
| 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 | # GetWorkbookRequest.name : The file name. , | ||
| 64 | # GetWorkbookRequest.format : The conversion format(CSV/XLS/HTML/MHTML/ODS/PDF/XML/TXT/TIFF/XLSB/XLSM/XLSX/XLTM/XLTX/XPS/PNG/JPG/JPEG/GIF/EMF/BMP/MD[Markdown]/Numbers). , | ||
| 65 | # GetWorkbookRequest.password : The password needed to open an Excel file. , | ||
| 66 | # GetWorkbookRequest.isAutoFit : Specifies whether set workbook rows to be autofit. , | ||
| 67 | # GetWorkbookRequest.onlySaveTable : Specifies whether only save table data.Only use pdf to excel. , | ||
| 68 | # GetWorkbookRequest.folder : The folder where the file is situated. , | ||
| 69 | # GetWorkbookRequest.outPath : Path to save the result. If it`s a single file, the `outPath` should encompass both the filename and extension. In the case of multiple files, the `outPath` should only include the folder. , | ||
| 70 | # GetWorkbookRequest.storageName : The storage name where the file is situated. , | ||
| 71 | # GetWorkbookRequest.outStorageName : The storage name where the output file is situated. , | ||
| 72 | # GetWorkbookRequest.checkExcelRestriction : Whether check restriction of excel file when user modify cells related objects. , | ||
| 73 | # GetWorkbookRequest.region : The regional settings for workbook. , | ||
| 74 | # GetWorkbookRequest.pageWideFitOnPerSheet : The page wide fit on worksheet. , | ||
| 75 | # GetWorkbookRequest.pageTallFitOnPerSheet : The page tall fit on worksheet. , | ||
| 76 | # GetWorkbookRequest.onePagePerSheet : When converting to PDF format, one page per sheet. , | ||
| 77 | # GetWorkbookRequest.onlyAutofitTable : , | ||
| 78 | # GetWorkbookRequest.FontsLocation : Use Custom fonts. | ||
| 79 | |||
| 80 | { | ||
| 81 | my $params = { | ||
| 82 | 'client' =>{ | ||
| 83 | data_type => 'ApiClient', | ||
| 84 | description => 'API Client.', | ||
| 85 | required => '0', | ||
| 86 | } | ||
| 87 | }; | ||
| 88 | __PACKAGE__->method_documentation->{ 'get_workbook' } = { | ||
| 89 | summary => 'Retrieve workbooks in various formats.', | ||
| 90 | params => $params, | ||
| 91 | returns => 'string', | ||
| 92 | }; | ||
| 93 | } | ||
| 94 | |||
| 95 | sub run_http_request { | ||
| 96 | my ($self, %args) = @_; | ||
| 97 | |||
| 98 | my $client = $args{'client'}; | ||
| 99 | |||
| 100 | # parse inputs | ||
| 101 | my $_resource_path = 'v3.0/cells/{name}'; | ||
| 102 | |||
| 103 | my $_method = 'GET'; | ||
| 104 | my $query_params = {}; | ||
| 105 | my $header_params = {}; | ||
| 106 | my $form_params = {}; | ||
| 107 | |||
| 108 | |||
| 109 | my $_header_accept = $client->select_header_accept('application/json'); | ||
| 110 | if ($_header_accept) { | ||
| 111 | $header_params->{'Accept'} = $_header_accept; | ||
| 112 | } | ||
| 113 | $header_params->{'Content-Type'} = $client->select_header_content_type('application/json'); | ||
| 114 | if(defined $self->name){ | ||
| 115 | my $_base_variable = "{" . "name" . "}"; | ||
| 116 | my $_base_value = $client->to_path_value($self->name); | ||
| 117 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 118 | } | ||
| 119 | if(defined $self->format){ | ||
| 120 | $query_params->{'format'} = $client->to_query_value($self->format); | ||
| 121 | } | ||
| 122 | |||
| 123 | if(defined $self->password){ | ||
| 124 | $query_params->{'password'} = $client->to_query_value($self->password); | ||
| 125 | } | ||
| 126 | |||
| 127 | if(defined $self->is_auto_fit){ | ||
| 128 | $query_params->{'isAutoFit'} = $client->to_query_value($self->is_auto_fit); | ||
| 129 | } | ||
| 130 | |||
| 131 | if(defined $self->only_save_table){ | ||
| 132 | $query_params->{'onlySaveTable'} = $client->to_query_value($self->only_save_table); | ||
| 133 | } | ||
| 134 | |||
| 135 | if(defined $self->folder){ | ||
| 136 | $query_params->{'folder'} = $client->to_query_value($self->folder); | ||
| 137 | } | ||
| 138 | |||
| 139 | if(defined $self->out_path){ | ||
| 140 | $query_params->{'outPath'} = $client->to_query_value($self->out_path); | ||
| 141 | } | ||
| 142 | |||
| 143 | if(defined $self->storage_name){ | ||
| 144 | $query_params->{'storageName'} = $client->to_query_value($self->storage_name); | ||
| 145 | } | ||
| 146 | |||
| 147 | if(defined $self->out_storage_name){ | ||
| 148 | $query_params->{'outStorageName'} = $client->to_query_value($self->out_storage_name); | ||
| 149 | } | ||
| 150 | |||
| 151 | if(defined $self->check_excel_restriction){ | ||
| 152 | $query_params->{'checkExcelRestriction'} = $client->to_query_value($self->check_excel_restriction); | ||
| 153 | } | ||
| 154 | |||
| 155 | if(defined $self->region){ | ||
| 156 | $query_params->{'region'} = $client->to_query_value($self->region); | ||
| 157 | } | ||
| 158 | |||
| 159 | if(defined $self->page_wide_fit_on_per_sheet){ | ||
| 160 | $query_params->{'pageWideFitOnPerSheet'} = $client->to_query_value($self->page_wide_fit_on_per_sheet); | ||
| 161 | } | ||
| 162 | |||
| 163 | if(defined $self->page_tall_fit_on_per_sheet){ | ||
| 164 | $query_params->{'pageTallFitOnPerSheet'} = $client->to_query_value($self->page_tall_fit_on_per_sheet); | ||
| 165 | } | ||
| 166 | |||
| 167 | if(defined $self->one_page_per_sheet){ | ||
| 168 | $query_params->{'onePagePerSheet'} = $client->to_query_value($self->one_page_per_sheet); | ||
| 169 | } | ||
| 170 | |||
| 171 | if(defined $self->only_autofit_table){ | ||
| 172 | $query_params->{'onlyAutofitTable'} = $client->to_query_value($self->only_autofit_table); | ||
| 173 | } | ||
| 174 | |||
| 175 | if(defined $self->fonts_location){ | ||
| 176 | $query_params->{'FontsLocation'} = $client->to_query_value($self->fonts_location); | ||
| 177 | } | ||
| 178 | my $_body_data; | ||
| 179 | |||
| 180 | |||
| 181 | |||
| 182 | # authentication setting, if any | ||
| 183 | my $auth_settings = [qw()]; | ||
| 184 | |||
| 185 | # make the API Call | ||
| 186 | my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); | ||
| 187 | return $response; | ||
| 188 | } | ||
| 189 | |||
| 190 | |||
| 191 | __PACKAGE__->method_documentation({ | ||
| 192 | 'name' => { | ||
| 193 | datatype => 'string', | ||
| 194 | base_name => 'name', | ||
| 195 | description => 'The file name.', | ||
| 196 | format => '', | ||
| 197 | read_only => '', | ||
| 198 | }, | ||
| 199 | 'format' => { | ||
| 200 | datatype => 'string', | ||
| 201 | base_name => 'format', | ||
| 202 | description => 'The conversion format(CSV/XLS/HTML/MHTML/ODS/PDF/XML/TXT/TIFF/XLSB/XLSM/XLSX/XLTM/XLTX/XPS/PNG/JPG/JPEG/GIF/EMF/BMP/MD[Markdown]/Numbers).', | ||
| 203 | format => '', | ||
| 204 | read_only => '', | ||
| 205 | }, | ||
| 206 | 'password' => { | ||
| 207 | datatype => 'string', | ||
| 208 | base_name => 'password', | ||
| 209 | description => 'The password needed to open an Excel file.', | ||
| 210 | format => '', | ||
| 211 | read_only => '', | ||
| 212 | }, | ||
| 213 | 'is_auto_fit' => { | ||
| 214 | datatype => 'string', | ||
| 215 | base_name => 'isAutoFit', | ||
| 216 | description => 'Specifies whether set workbook rows to be autofit.', | ||
| 217 | format => '', | ||
| 218 | read_only => '', | ||
| 219 | }, | ||
| 220 | 'only_save_table' => { | ||
| 221 | datatype => 'string', | ||
| 222 | base_name => 'onlySaveTable', | ||
| 223 | description => 'Specifies whether only save table data.Only use pdf to excel.', | ||
| 224 | format => '', | ||
| 225 | read_only => '', | ||
| 226 | }, | ||
| 227 | 'folder' => { | ||
| 228 | datatype => 'string', | ||
| 229 | base_name => 'folder', | ||
| 230 | description => 'The folder where the file is situated.', | ||
| 231 | format => '', | ||
| 232 | read_only => '', | ||
| 233 | }, | ||
| 234 | 'out_path' => { | ||
| 235 | datatype => 'string', | ||
| 236 | base_name => 'outPath', | ||
| 237 | description => 'Path to save the result. If it`s a single file, the `outPath` should encompass both the filename and extension. In the case of multiple files, the `outPath` should only include the folder.', | ||
| 238 | format => '', | ||
| 239 | read_only => '', | ||
| 240 | }, | ||
| 241 | 'storage_name' => { | ||
| 242 | datatype => 'string', | ||
| 243 | base_name => 'storageName', | ||
| 244 | description => 'The storage name where the file is situated.', | ||
| 245 | format => '', | ||
| 246 | read_only => '', | ||
| 247 | }, | ||
| 248 | 'out_storage_name' => { | ||
| 249 | datatype => 'string', | ||
| 250 | base_name => 'outStorageName', | ||
| 251 | description => 'The storage name where the output file is situated.', | ||
| 252 | format => '', | ||
| 253 | read_only => '', | ||
| 254 | }, | ||
| 255 | 'check_excel_restriction' => { | ||
| 256 | datatype => 'string', | ||
| 257 | base_name => 'checkExcelRestriction', | ||
| 258 | description => 'Whether check restriction of excel file when user modify cells related objects.', | ||
| 259 | format => '', | ||
| 260 | read_only => '', | ||
| 261 | }, | ||
| 262 | 'region' => { | ||
| 263 | datatype => 'string', | ||
| 264 | base_name => 'region', | ||
| 265 | description => 'The regional settings for workbook.', | ||
| 266 | format => '', | ||
| 267 | read_only => '', | ||
| 268 | }, | ||
| 269 | 'page_wide_fit_on_per_sheet' => { | ||
| 270 | datatype => 'string', | ||
| 271 | base_name => 'pageWideFitOnPerSheet', | ||
| 272 | description => 'The page wide fit on worksheet.', | ||
| 273 | format => '', | ||
| 274 | read_only => '', | ||
| 275 | }, | ||
| 276 | 'page_tall_fit_on_per_sheet' => { | ||
| 277 | datatype => 'string', | ||
| 278 | base_name => 'pageTallFitOnPerSheet', | ||
| 279 | description => 'The page tall fit on worksheet.', | ||
| 280 | format => '', | ||
| 281 | read_only => '', | ||
| 282 | }, | ||
| 283 | 'one_page_per_sheet' => { | ||
| 284 | datatype => 'string', | ||
| 285 | base_name => 'onePagePerSheet', | ||
| 286 | description => 'When converting to PDF format, one page per sheet.', | ||
| 287 | format => '', | ||
| 288 | read_only => '', | ||
| 289 | }, | ||
| 290 | 'only_autofit_table' => { | ||
| 291 | datatype => 'string', | ||
| 292 | base_name => 'onlyAutofitTable', | ||
| 293 | description => '', | ||
| 294 | format => '', | ||
| 295 | read_only => '', | ||
| 296 | }, | ||
| 297 | 'fonts_location' => { | ||
| 298 | datatype => 'string', | ||
| 299 | base_name => 'FontsLocation', | ||
| 300 | description => 'Use Custom fonts.', | ||
| 301 | format => '', | ||
| 302 | read_only => '', | ||
| 303 | }, | ||
| 304 | }); | ||
| 305 | |||
| 306 | |||
| 307 | __PACKAGE__->attribute_map( { | ||
| 308 | 'name' => 'name', | ||
| 309 | 'format' => 'format', | ||
| 310 | 'password' => 'password', | ||
| 311 | 'is_auto_fit' => 'isAutoFit', | ||
| 312 | 'only_save_table' => 'onlySaveTable', | ||
| 313 | 'folder' => 'folder', | ||
| 314 | 'out_path' => 'outPath', | ||
| 315 | 'storage_name' => 'storageName', | ||
| 316 | 'out_storage_name' => 'outStorageName', | ||
| 317 | 'check_excel_restriction' => 'checkExcelRestriction', | ||
| 318 | 'region' => 'region', | ||
| 319 | 'page_wide_fit_on_per_sheet' => 'pageWideFitOnPerSheet', | ||
| 320 | 'page_tall_fit_on_per_sheet' => 'pageTallFitOnPerSheet', | ||
| 321 | 'one_page_per_sheet' => 'onePagePerSheet', | ||
| 322 | 'only_autofit_table' => 'onlyAutofitTable', | ||
| 323 | 'fonts_location' => 'FontsLocation' | ||
| 324 | } ); | ||
| 325 | |||
| 326 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 327 | |||
| 328 | |||
| 329 | 1; |