| 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::PostWorkbookSplitRequest; | ||
| 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 | # PostWorkbookSplitRequest.name : The file name. , | ||
| 64 | # PostWorkbookSplitRequest.format : Split format. , | ||
| 65 | # PostWorkbookSplitRequest.outFolder : , | ||
| 66 | # PostWorkbookSplitRequest.from : Start worksheet index. , | ||
| 67 | # PostWorkbookSplitRequest.to : End worksheet index. , | ||
| 68 | # PostWorkbookSplitRequest.horizontalResolution : Image horizontal resolution. , | ||
| 69 | # PostWorkbookSplitRequest.verticalResolution : Image vertical resolution. , | ||
| 70 | # PostWorkbookSplitRequest.splitNameRule : rule name : sheetname newguid , | ||
| 71 | # PostWorkbookSplitRequest.folder : The folder where the file is situated. , | ||
| 72 | # PostWorkbookSplitRequest.storageName : The storage name where the file is situated. , | ||
| 73 | # PostWorkbookSplitRequest.outStorageName : | ||
| 74 | |||
| 75 | { | ||
| 76 | my $params = { | ||
| 77 | 'client' =>{ | ||
| 78 | data_type => 'ApiClient', | ||
| 79 | description => 'API Client.', | ||
| 80 | required => '0', | ||
| 81 | } | ||
| 82 | }; | ||
| 83 | __PACKAGE__->method_documentation->{ 'post_workbook_split' } = { | ||
| 84 | summary => 'Split the workbook with a specific format.', | ||
| 85 | params => $params, | ||
| 86 | returns => 'SplitResultResponse', | ||
| 87 | }; | ||
| 88 | } | ||
| 89 | |||
| 90 | sub run_http_request { | ||
| 91 | my ($self, %args) = @_; | ||
| 92 | |||
| 93 | my $client = $args{'client'}; | ||
| 94 | |||
| 95 | # parse inputs | ||
| 96 | my $_resource_path = 'v3.0/cells/{name}/split'; | ||
| 97 | |||
| 98 | my $_method = 'POST'; | ||
| 99 | my $query_params = {}; | ||
| 100 | my $header_params = {}; | ||
| 101 | my $form_params = {}; | ||
| 102 | |||
| 103 | |||
| 104 | my $_header_accept = $client->select_header_accept('application/json'); | ||
| 105 | if ($_header_accept) { | ||
| 106 | $header_params->{'Accept'} = $_header_accept; | ||
| 107 | } | ||
| 108 | $header_params->{'Content-Type'} = $client->select_header_content_type('application/json'); | ||
| 109 | if(defined $self->name){ | ||
| 110 | my $_base_variable = "{" . "name" . "}"; | ||
| 111 | my $_base_value = $client->to_path_value($self->name); | ||
| 112 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 113 | } | ||
| 114 | if(defined $self->format){ | ||
| 115 | $query_params->{'format'} = $client->to_query_value($self->format); | ||
| 116 | } | ||
| 117 | |||
| 118 | if(defined $self->out_folder){ | ||
| 119 | $query_params->{'outFolder'} = $client->to_query_value($self->out_folder); | ||
| 120 | } | ||
| 121 | |||
| 122 | if(defined $self->from){ | ||
| 123 | $query_params->{'from'} = $client->to_query_value($self->from); | ||
| 124 | } | ||
| 125 | |||
| 126 | if(defined $self->to){ | ||
| 127 | $query_params->{'to'} = $client->to_query_value($self->to); | ||
| 128 | } | ||
| 129 | |||
| 130 | if(defined $self->horizontal_resolution){ | ||
| 131 | $query_params->{'horizontalResolution'} = $client->to_query_value($self->horizontal_resolution); | ||
| 132 | } | ||
| 133 | |||
| 134 | if(defined $self->vertical_resolution){ | ||
| 135 | $query_params->{'verticalResolution'} = $client->to_query_value($self->vertical_resolution); | ||
| 136 | } | ||
| 137 | |||
| 138 | if(defined $self->split_name_rule){ | ||
| 139 | $query_params->{'splitNameRule'} = $client->to_query_value($self->split_name_rule); | ||
| 140 | } | ||
| 141 | |||
| 142 | if(defined $self->folder){ | ||
| 143 | $query_params->{'folder'} = $client->to_query_value($self->folder); | ||
| 144 | } | ||
| 145 | |||
| 146 | if(defined $self->storage_name){ | ||
| 147 | $query_params->{'storageName'} = $client->to_query_value($self->storage_name); | ||
| 148 | } | ||
| 149 | |||
| 150 | if(defined $self->out_storage_name){ | ||
| 151 | $query_params->{'outStorageName'} = $client->to_query_value($self->out_storage_name); | ||
| 152 | } | ||
| 153 | my $_body_data; | ||
| 154 | |||
| 155 | |||
| 156 | |||
| 157 | # authentication setting, if any | ||
| 158 | my $auth_settings = [qw()]; | ||
| 159 | |||
| 160 | # make the API Call | ||
| 161 | my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); | ||
| 162 | return $response; | ||
| 163 | } | ||
| 164 | |||
| 165 | |||
| 166 | __PACKAGE__->method_documentation({ | ||
| 167 | 'name' => { | ||
| 168 | datatype => 'string', | ||
| 169 | base_name => 'name', | ||
| 170 | description => 'The file name.', | ||
| 171 | format => '', | ||
| 172 | read_only => '', | ||
| 173 | }, | ||
| 174 | 'format' => { | ||
| 175 | datatype => 'string', | ||
| 176 | base_name => 'format', | ||
| 177 | description => 'Split format.', | ||
| 178 | format => '', | ||
| 179 | read_only => '', | ||
| 180 | }, | ||
| 181 | 'out_folder' => { | ||
| 182 | datatype => 'string', | ||
| 183 | base_name => 'outFolder', | ||
| 184 | description => '', | ||
| 185 | format => '', | ||
| 186 | read_only => '', | ||
| 187 | }, | ||
| 188 | 'from' => { | ||
| 189 | datatype => 'int', | ||
| 190 | base_name => 'from', | ||
| 191 | description => 'Start worksheet index.', | ||
| 192 | format => '', | ||
| 193 | read_only => '', | ||
| 194 | }, | ||
| 195 | 'to' => { | ||
| 196 | datatype => 'int', | ||
| 197 | base_name => 'to', | ||
| 198 | description => 'End worksheet index.', | ||
| 199 | format => '', | ||
| 200 | read_only => '', | ||
| 201 | }, | ||
| 202 | 'horizontal_resolution' => { | ||
| 203 | datatype => 'int', | ||
| 204 | base_name => 'horizontalResolution', | ||
| 205 | description => 'Image horizontal resolution.', | ||
| 206 | format => '', | ||
| 207 | read_only => '', | ||
| 208 | }, | ||
| 209 | 'vertical_resolution' => { | ||
| 210 | datatype => 'int', | ||
| 211 | base_name => 'verticalResolution', | ||
| 212 | description => 'Image vertical resolution.', | ||
| 213 | format => '', | ||
| 214 | read_only => '', | ||
| 215 | }, | ||
| 216 | 'split_name_rule' => { | ||
| 217 | datatype => 'string', | ||
| 218 | base_name => 'splitNameRule', | ||
| 219 | description => 'rule name : sheetname newguid ', | ||
| 220 | format => '', | ||
| 221 | read_only => '', | ||
| 222 | }, | ||
| 223 | 'folder' => { | ||
| 224 | datatype => 'string', | ||
| 225 | base_name => 'folder', | ||
| 226 | description => 'The folder where the file is situated.', | ||
| 227 | format => '', | ||
| 228 | read_only => '', | ||
| 229 | }, | ||
| 230 | 'storage_name' => { | ||
| 231 | datatype => 'string', | ||
| 232 | base_name => 'storageName', | ||
| 233 | description => 'The storage name where the file is situated.', | ||
| 234 | format => '', | ||
| 235 | read_only => '', | ||
| 236 | }, | ||
| 237 | 'out_storage_name' => { | ||
| 238 | datatype => 'string', | ||
| 239 | base_name => 'outStorageName', | ||
| 240 | description => '', | ||
| 241 | format => '', | ||
| 242 | read_only => '', | ||
| 243 | }, | ||
| 244 | }); | ||
| 245 | |||
| 246 | |||
| 247 | __PACKAGE__->attribute_map( { | ||
| 248 | 'name' => 'name', | ||
| 249 | 'format' => 'format', | ||
| 250 | 'out_folder' => 'outFolder', | ||
| 251 | 'from' => 'from', | ||
| 252 | 'to' => 'to', | ||
| 253 | 'horizontal_resolution' => 'horizontalResolution', | ||
| 254 | 'vertical_resolution' => 'verticalResolution', | ||
| 255 | 'split_name_rule' => 'splitNameRule', | ||
| 256 | 'folder' => 'folder', | ||
| 257 | 'storage_name' => 'storageName', | ||
| 258 | 'out_storage_name' => 'outStorageName' | ||
| 259 | } ); | ||
| 260 | |||
| 261 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 262 | |||
| 263 | |||
| 264 | 1; |