| 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::MergeRemoteSpreadsheetRequest; | ||
| 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 | # MergeRemoteSpreadsheetRequest.name : The name of the workbook file to be split. , | ||
| 64 | # MergeRemoteSpreadsheetRequest.mergedSpreadsheet : , | ||
| 65 | # MergeRemoteSpreadsheetRequest.folder : The folder path where the workbook is stored. , | ||
| 66 | # MergeRemoteSpreadsheetRequest.outFormat : The out file format. , | ||
| 67 | # MergeRemoteSpreadsheetRequest.mergeInOneSheet : Whether to combine all data into a single worksheet. , | ||
| 68 | # MergeRemoteSpreadsheetRequest.storageName : (Optional) The name of the storage if using custom cloud storage. Use default storage if omitted. , | ||
| 69 | # MergeRemoteSpreadsheetRequest.outPath : (Optional) The folder path where the workbook is stored. The default is null. , | ||
| 70 | # MergeRemoteSpreadsheetRequest.outStorageName : Output file Storage Name. , | ||
| 71 | # MergeRemoteSpreadsheetRequest.fontsLocation : Use Custom fonts. , | ||
| 72 | # MergeRemoteSpreadsheetRequest.region : The spreadsheet region setting. , | ||
| 73 | # MergeRemoteSpreadsheetRequest.password : The password for opening spreadsheet file. | ||
| 74 | |||
| 75 | { | ||
| 76 | my $params = { | ||
| 77 | 'client' =>{ | ||
| 78 | data_type => 'ApiClient', | ||
| 79 | description => 'API Client.', | ||
| 80 | required => '0', | ||
| 81 | } | ||
| 82 | }; | ||
| 83 | __PACKAGE__->method_documentation->{ 'merge_remote_spreadsheet' } = { | ||
| 84 | summary => 'Merge a spreadsheet file into other spreadsheet in cloud storage, and output a specified format file.', | ||
| 85 | params => $params, | ||
| 86 | returns => 'string', | ||
| 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 = 'v4.0/cells/{name}/merge/spreadsheet'; | ||
| 97 | |||
| 98 | my $_method = 'PUT'; | ||
| 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->merged_spreadsheet){ | ||
| 115 | $query_params->{'mergedSpreadsheet'} = $client->to_query_value($self->merged_spreadsheet); | ||
| 116 | } | ||
| 117 | |||
| 118 | if(defined $self->folder){ | ||
| 119 | $query_params->{'folder'} = $client->to_query_value($self->folder); | ||
| 120 | } | ||
| 121 | |||
| 122 | if(defined $self->out_format){ | ||
| 123 | $query_params->{'outFormat'} = $client->to_query_value($self->out_format); | ||
| 124 | } | ||
| 125 | |||
| 126 | if(defined $self->merge_in_one_sheet){ | ||
| 127 | $query_params->{'mergeInOneSheet'} = $client->to_query_value($self->merge_in_one_sheet); | ||
| 128 | } | ||
| 129 | |||
| 130 | if(defined $self->storage_name){ | ||
| 131 | $query_params->{'storageName'} = $client->to_query_value($self->storage_name); | ||
| 132 | } | ||
| 133 | |||
| 134 | if(defined $self->out_path){ | ||
| 135 | $query_params->{'outPath'} = $client->to_query_value($self->out_path); | ||
| 136 | } | ||
| 137 | |||
| 138 | if(defined $self->out_storage_name){ | ||
| 139 | $query_params->{'outStorageName'} = $client->to_query_value($self->out_storage_name); | ||
| 140 | } | ||
| 141 | |||
| 142 | if(defined $self->fonts_location){ | ||
| 143 | $query_params->{'fontsLocation'} = $client->to_query_value($self->fonts_location); | ||
| 144 | } | ||
| 145 | |||
| 146 | if(defined $self->region){ | ||
| 147 | $query_params->{'region'} = $client->to_query_value($self->region); | ||
| 148 | } | ||
| 149 | |||
| 150 | if(defined $self->password){ | ||
| 151 | $query_params->{'password'} = $client->to_query_value($self->password); | ||
| 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 name of the workbook file to be split.', | ||
| 171 | format => '', | ||
| 172 | read_only => '', | ||
| 173 | }, | ||
| 174 | 'merged_spreadsheet' => { | ||
| 175 | datatype => 'string', | ||
| 176 | base_name => 'mergedSpreadsheet', | ||
| 177 | description => '', | ||
| 178 | format => '', | ||
| 179 | read_only => '', | ||
| 180 | }, | ||
| 181 | 'folder' => { | ||
| 182 | datatype => 'string', | ||
| 183 | base_name => 'folder', | ||
| 184 | description => 'The folder path where the workbook is stored.', | ||
| 185 | format => '', | ||
| 186 | read_only => '', | ||
| 187 | }, | ||
| 188 | 'out_format' => { | ||
| 189 | datatype => 'string', | ||
| 190 | base_name => 'outFormat', | ||
| 191 | description => 'The out file format.', | ||
| 192 | format => '', | ||
| 193 | read_only => '', | ||
| 194 | }, | ||
| 195 | 'merge_in_one_sheet' => { | ||
| 196 | datatype => 'string', | ||
| 197 | base_name => 'mergeInOneSheet', | ||
| 198 | description => 'Whether to combine all data into a single worksheet.', | ||
| 199 | format => '', | ||
| 200 | read_only => '', | ||
| 201 | }, | ||
| 202 | 'storage_name' => { | ||
| 203 | datatype => 'string', | ||
| 204 | base_name => 'storageName', | ||
| 205 | description => '(Optional) The name of the storage if using custom cloud storage. Use default storage if omitted.', | ||
| 206 | format => '', | ||
| 207 | read_only => '', | ||
| 208 | }, | ||
| 209 | 'out_path' => { | ||
| 210 | datatype => 'string', | ||
| 211 | base_name => 'outPath', | ||
| 212 | description => '(Optional) The folder path where the workbook is stored. The default is null.', | ||
| 213 | format => '', | ||
| 214 | read_only => '', | ||
| 215 | }, | ||
| 216 | 'out_storage_name' => { | ||
| 217 | datatype => 'string', | ||
| 218 | base_name => 'outStorageName', | ||
| 219 | description => 'Output file Storage Name.', | ||
| 220 | format => '', | ||
| 221 | read_only => '', | ||
| 222 | }, | ||
| 223 | 'fonts_location' => { | ||
| 224 | datatype => 'string', | ||
| 225 | base_name => 'fontsLocation', | ||
| 226 | description => 'Use Custom fonts.', | ||
| 227 | format => '', | ||
| 228 | read_only => '', | ||
| 229 | }, | ||
| 230 | 'region' => { | ||
| 231 | datatype => 'string', | ||
| 232 | base_name => 'region', | ||
| 233 | description => 'The spreadsheet region setting.', | ||
| 234 | format => '', | ||
| 235 | read_only => '', | ||
| 236 | }, | ||
| 237 | 'password' => { | ||
| 238 | datatype => 'string', | ||
| 239 | base_name => 'password', | ||
| 240 | description => 'The password for opening spreadsheet file.', | ||
| 241 | format => '', | ||
| 242 | read_only => '', | ||
| 243 | }, | ||
| 244 | }); | ||
| 245 | |||
| 246 | |||
| 247 | __PACKAGE__->attribute_map( { | ||
| 248 | 'name' => 'name', | ||
| 249 | 'merged_spreadsheet' => 'mergedSpreadsheet', | ||
| 250 | 'folder' => 'folder', | ||
| 251 | 'out_format' => 'outFormat', | ||
| 252 | 'merge_in_one_sheet' => 'mergeInOneSheet', | ||
| 253 | 'storage_name' => 'storageName', | ||
| 254 | 'out_path' => 'outPath', | ||
| 255 | 'out_storage_name' => 'outStorageName', | ||
| 256 | 'fonts_location' => 'fontsLocation', | ||
| 257 | 'region' => 'region', | ||
| 258 | 'password' => 'password' | ||
| 259 | } ); | ||
| 260 | |||
| 261 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 262 | |||
| 263 | |||
| 264 | 1; |