« Request/PutWorksheetCustomFilterRequest.pm
↑ Summary
Request/DeleteWorksheetDateFilterRequest.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::SplitTableRequest; | ||
| 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 | # SplitTableRequest.Spreadsheet : Upload spreadsheet file. , | ||
| 64 | # SplitTableRequest.worksheet : Worksheet containing the table. , | ||
| 65 | # SplitTableRequest.tableName : Data table that needs to be split. , | ||
| 66 | # SplitTableRequest.splitColumnName : Column name to split by. , | ||
| 67 | # SplitTableRequest.saveSplitColumn : Whether to keep the data in the split column. , | ||
| 68 | # SplitTableRequest.splitRowNumber : , | ||
| 69 | # SplitTableRequest.toNewWorkbook : Export destination control: true - Creates new workbook files containing the split data; false - Adds a new worksheet to the current workbook. , | ||
| 70 | # SplitTableRequest.toMultipleFiles : true - Exports table data as **multiple separate files** (returned as ZIP archive);false - Stores all data in a **single file** with multiple sheets. Default: false. , | ||
| 71 | # SplitTableRequest.outPath : (Optional) The folder path where the workbook is stored. The default is null. , | ||
| 72 | # SplitTableRequest.outStorageName : Output file Storage Name. , | ||
| 73 | # SplitTableRequest.fontsLocation : Use Custom fonts. , | ||
| 74 | # SplitTableRequest.region : The spreadsheet region setting. , | ||
| 75 | # SplitTableRequest.password : The password for opening spreadsheet file. | ||
| 76 | |||
| 77 | { | ||
| 78 | my $params = { | ||
| 79 | 'client' =>{ | ||
| 80 | data_type => 'ApiClient', | ||
| 81 | description => 'API Client.', | ||
| 82 | required => '0', | ||
| 83 | } | ||
| 84 | }; | ||
| 85 | __PACKAGE__->method_documentation->{ 'split_table' } = { | ||
| 86 | summary => 'Split an Excel worksheet tale into multiple sheets by column value.', | ||
| 87 | params => $params, | ||
| 88 | returns => 'string', | ||
| 89 | }; | ||
| 90 | } | ||
| 91 | |||
| 92 | sub run_http_request { | ||
| 93 | my ($self, %args) = @_; | ||
| 94 | |||
| 95 | my $client = $args{'client'}; | ||
| 96 | |||
| 97 | # parse inputs | ||
| 98 | my $_resource_path = 'v4.0/cells/split/table'; | ||
| 99 | |||
| 100 | my $_method = 'PUT'; | ||
| 101 | my $query_params = {}; | ||
| 102 | my $header_params = {}; | ||
| 103 | my $form_params = {}; | ||
| 104 | |||
| 105 | |||
| 106 | my $_header_accept = $client->select_header_accept('application/json'); | ||
| 107 | if ($_header_accept) { | ||
| 108 | $header_params->{'Accept'} = $_header_accept; | ||
| 109 | } | ||
| 110 | $header_params->{'Content-Type'} = $client->select_header_content_type('multipart/form-data'); | ||
| 111 | |||
| 112 | if(defined $self->worksheet){ | ||
| 113 | $query_params->{'worksheet'} = $client->to_query_value($self->worksheet); | ||
| 114 | } | ||
| 115 | |||
| 116 | if(defined $self->table_name){ | ||
| 117 | $query_params->{'tableName'} = $client->to_query_value($self->table_name); | ||
| 118 | } | ||
| 119 | |||
| 120 | if(defined $self->split_column_name){ | ||
| 121 | $query_params->{'splitColumnName'} = $client->to_query_value($self->split_column_name); | ||
| 122 | } | ||
| 123 | |||
| 124 | if(defined $self->save_split_column){ | ||
| 125 | $query_params->{'saveSplitColumn'} = $client->to_query_value($self->save_split_column); | ||
| 126 | } | ||
| 127 | |||
| 128 | if(defined $self->split_row_number){ | ||
| 129 | $query_params->{'splitRowNumber'} = $client->to_query_value($self->split_row_number); | ||
| 130 | } | ||
| 131 | |||
| 132 | if(defined $self->to_new_workbook){ | ||
| 133 | $query_params->{'toNewWorkbook'} = $client->to_query_value($self->to_new_workbook); | ||
| 134 | } | ||
| 135 | |||
| 136 | if(defined $self->to_multiple_files){ | ||
| 137 | $query_params->{'toMultipleFiles'} = $client->to_query_value($self->to_multiple_files); | ||
| 138 | } | ||
| 139 | |||
| 140 | if(defined $self->out_path){ | ||
| 141 | $query_params->{'outPath'} = $client->to_query_value($self->out_path); | ||
| 142 | } | ||
| 143 | |||
| 144 | if(defined $self->out_storage_name){ | ||
| 145 | $query_params->{'outStorageName'} = $client->to_query_value($self->out_storage_name); | ||
| 146 | } | ||
| 147 | |||
| 148 | if(defined $self->fonts_location){ | ||
| 149 | $query_params->{'fontsLocation'} = $client->to_query_value($self->fonts_location); | ||
| 150 | } | ||
| 151 | |||
| 152 | if(defined $self->region){ | ||
| 153 | $query_params->{'region'} = $client->to_query_value($self->region); | ||
| 154 | } | ||
| 155 | |||
| 156 | if(defined $self->password){ | ||
| 157 | $query_params->{'password'} = $client->to_query_value($self->password); | ||
| 158 | } | ||
| 159 | my $_body_data; | ||
| 160 | |||
| 161 | |||
| 162 | if (defined $self->spreadsheet) { | ||
| 163 | $form_params->{basename($self->spreadsheet)} = [$self->spreadsheet ,basename($self->spreadsheet),'application/octet-stream']; | ||
| 164 | } | ||
| 165 | |||
| 166 | |||
| 167 | # authentication setting, if any | ||
| 168 | my $auth_settings = [qw()]; | ||
| 169 | |||
| 170 | # make the API Call | ||
| 171 | my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); | ||
| 172 | return $response; | ||
| 173 | } | ||
| 174 | |||
| 175 | |||
| 176 | __PACKAGE__->method_documentation({ | ||
| 177 | 'spreadsheet' => { | ||
| 178 | datatype => 'string', | ||
| 179 | base_name => 'Spreadsheet', | ||
| 180 | description => 'Upload spreadsheet file.', | ||
| 181 | format => '', | ||
| 182 | read_only => '', | ||
| 183 | }, | ||
| 184 | 'worksheet' => { | ||
| 185 | datatype => 'string', | ||
| 186 | base_name => 'worksheet', | ||
| 187 | description => 'Worksheet containing the table.', | ||
| 188 | format => '', | ||
| 189 | read_only => '', | ||
| 190 | }, | ||
| 191 | 'table_name' => { | ||
| 192 | datatype => 'string', | ||
| 193 | base_name => 'tableName', | ||
| 194 | description => 'Data table that needs to be split.', | ||
| 195 | format => '', | ||
| 196 | read_only => '', | ||
| 197 | }, | ||
| 198 | 'split_column_name' => { | ||
| 199 | datatype => 'string', | ||
| 200 | base_name => 'splitColumnName', | ||
| 201 | description => 'Column name to split by.', | ||
| 202 | format => '', | ||
| 203 | read_only => '', | ||
| 204 | }, | ||
| 205 | 'save_split_column' => { | ||
| 206 | datatype => 'string', | ||
| 207 | base_name => 'saveSplitColumn', | ||
| 208 | description => 'Whether to keep the data in the split column.', | ||
| 209 | format => '', | ||
| 210 | read_only => '', | ||
| 211 | }, | ||
| 212 | 'split_row_number' => { | ||
| 213 | datatype => 'int', | ||
| 214 | base_name => 'splitRowNumber', | ||
| 215 | description => '', | ||
| 216 | format => '', | ||
| 217 | read_only => '', | ||
| 218 | }, | ||
| 219 | 'to_new_workbook' => { | ||
| 220 | datatype => 'string', | ||
| 221 | base_name => 'toNewWorkbook', | ||
| 222 | description => 'Export destination control: true - Creates new workbook files containing the split data; false - Adds a new worksheet to the current workbook.', | ||
| 223 | format => '', | ||
| 224 | read_only => '', | ||
| 225 | }, | ||
| 226 | 'to_multiple_files' => { | ||
| 227 | datatype => 'string', | ||
| 228 | base_name => 'toMultipleFiles', | ||
| 229 | description => 'true - Exports table data as **multiple separate files** (returned as ZIP archive);false - Stores all data in a **single file** with multiple sheets. Default: false.', | ||
| 230 | format => '', | ||
| 231 | read_only => '', | ||
| 232 | }, | ||
| 233 | 'out_path' => { | ||
| 234 | datatype => 'string', | ||
| 235 | base_name => 'outPath', | ||
| 236 | description => '(Optional) The folder path where the workbook is stored. The default is null.', | ||
| 237 | format => '', | ||
| 238 | read_only => '', | ||
| 239 | }, | ||
| 240 | 'out_storage_name' => { | ||
| 241 | datatype => 'string', | ||
| 242 | base_name => 'outStorageName', | ||
| 243 | description => 'Output file Storage Name.', | ||
| 244 | format => '', | ||
| 245 | read_only => '', | ||
| 246 | }, | ||
| 247 | 'fonts_location' => { | ||
| 248 | datatype => 'string', | ||
| 249 | base_name => 'fontsLocation', | ||
| 250 | description => 'Use Custom fonts.', | ||
| 251 | format => '', | ||
| 252 | read_only => '', | ||
| 253 | }, | ||
| 254 | 'region' => { | ||
| 255 | datatype => 'string', | ||
| 256 | base_name => 'region', | ||
| 257 | description => 'The spreadsheet region setting.', | ||
| 258 | format => '', | ||
| 259 | read_only => '', | ||
| 260 | }, | ||
| 261 | 'password' => { | ||
| 262 | datatype => 'string', | ||
| 263 | base_name => 'password', | ||
| 264 | description => 'The password for opening spreadsheet file.', | ||
| 265 | format => '', | ||
| 266 | read_only => '', | ||
| 267 | }, | ||
| 268 | }); | ||
| 269 | |||
| 270 | |||
| 271 | __PACKAGE__->attribute_map( { | ||
| 272 | 'spreadsheet' => 'Spreadsheet', | ||
| 273 | 'worksheet' => 'worksheet', | ||
| 274 | 'table_name' => 'tableName', | ||
| 275 | 'split_column_name' => 'splitColumnName', | ||
| 276 | 'save_split_column' => 'saveSplitColumn', | ||
| 277 | 'split_row_number' => 'splitRowNumber', | ||
| 278 | 'to_new_workbook' => 'toNewWorkbook', | ||
| 279 | 'to_multiple_files' => 'toMultipleFiles', | ||
| 280 | 'out_path' => 'outPath', | ||
| 281 | 'out_storage_name' => 'outStorageName', | ||
| 282 | 'fonts_location' => 'fontsLocation', | ||
| 283 | 'region' => 'region', | ||
| 284 | 'password' => 'password' | ||
| 285 | } ); | ||
| 286 | |||
| 287 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 288 | |||
| 289 | |||
| 290 | 1; |