« Request/DeleteWorksheetFilterRequest.pm
↑ Summary
Request/DeleteWorksheetPivotTableFiltersRequest.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::DeleteWorksheetFromSpreadsheetRequest; | ||
| 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 | # DeleteWorksheetFromSpreadsheetRequest.Spreadsheet : Upload spreadsheet file. , | ||
| 64 | # DeleteWorksheetFromSpreadsheetRequest.sheetName : Specifies the name or identifier of the worksheet to be deleted. This parameter is required and must match the name of an existing worksheet in the workbook. , | ||
| 65 | # DeleteWorksheetFromSpreadsheetRequest.outPath : (Optional) The folder path where the workbook is stored. The default is null. , | ||
| 66 | # DeleteWorksheetFromSpreadsheetRequest.outStorageName : Output file Storage Name. , | ||
| 67 | # DeleteWorksheetFromSpreadsheetRequest.region : The spreadsheet region setting. , | ||
| 68 | # DeleteWorksheetFromSpreadsheetRequest.password : The password for opening spreadsheet file. | ||
| 69 | |||
| 70 | { | ||
| 71 | my $params = { | ||
| 72 | 'client' =>{ | ||
| 73 | data_type => 'ApiClient', | ||
| 74 | description => 'API Client.', | ||
| 75 | required => '0', | ||
| 76 | } | ||
| 77 | }; | ||
| 78 | __PACKAGE__->method_documentation->{ 'delete_worksheet_from_spreadsheet' } = { | ||
| 79 | summary => 'The Web API endpoint allows users to delete a specified worksheet from a workbook. This function provides a straightforward way to manage workbook structure by removing unnecessary or redundant worksheets.', | ||
| 80 | params => $params, | ||
| 81 | returns => 'string', | ||
| 82 | }; | ||
| 83 | } | ||
| 84 | |||
| 85 | sub run_http_request { | ||
| 86 | my ($self, %args) = @_; | ||
| 87 | |||
| 88 | my $client = $args{'client'}; | ||
| 89 | |||
| 90 | # parse inputs | ||
| 91 | my $_resource_path = 'v4.0/cells/spreadsheet/delete/worksheet'; | ||
| 92 | |||
| 93 | my $_method = 'PUT'; | ||
| 94 | my $query_params = {}; | ||
| 95 | my $header_params = {}; | ||
| 96 | my $form_params = {}; | ||
| 97 | |||
| 98 | |||
| 99 | my $_header_accept = $client->select_header_accept('application/json'); | ||
| 100 | if ($_header_accept) { | ||
| 101 | $header_params->{'Accept'} = $_header_accept; | ||
| 102 | } | ||
| 103 | $header_params->{'Content-Type'} = $client->select_header_content_type('multipart/form-data'); | ||
| 104 | |||
| 105 | if(defined $self->sheet_name){ | ||
| 106 | $query_params->{'sheetName'} = $client->to_query_value($self->sheet_name); | ||
| 107 | } | ||
| 108 | |||
| 109 | if(defined $self->out_path){ | ||
| 110 | $query_params->{'outPath'} = $client->to_query_value($self->out_path); | ||
| 111 | } | ||
| 112 | |||
| 113 | if(defined $self->out_storage_name){ | ||
| 114 | $query_params->{'outStorageName'} = $client->to_query_value($self->out_storage_name); | ||
| 115 | } | ||
| 116 | |||
| 117 | if(defined $self->region){ | ||
| 118 | $query_params->{'region'} = $client->to_query_value($self->region); | ||
| 119 | } | ||
| 120 | |||
| 121 | if(defined $self->password){ | ||
| 122 | $query_params->{'password'} = $client->to_query_value($self->password); | ||
| 123 | } | ||
| 124 | my $_body_data; | ||
| 125 | |||
| 126 | |||
| 127 | if (defined $self->spreadsheet) { | ||
| 128 | $form_params->{basename($self->spreadsheet)} = [$self->spreadsheet ,basename($self->spreadsheet),'application/octet-stream']; | ||
| 129 | } | ||
| 130 | |||
| 131 | |||
| 132 | # authentication setting, if any | ||
| 133 | my $auth_settings = [qw()]; | ||
| 134 | |||
| 135 | # make the API Call | ||
| 136 | my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); | ||
| 137 | return $response; | ||
| 138 | } | ||
| 139 | |||
| 140 | |||
| 141 | __PACKAGE__->method_documentation({ | ||
| 142 | 'spreadsheet' => { | ||
| 143 | datatype => 'string', | ||
| 144 | base_name => 'Spreadsheet', | ||
| 145 | description => 'Upload spreadsheet file.', | ||
| 146 | format => '', | ||
| 147 | read_only => '', | ||
| 148 | }, | ||
| 149 | 'sheet_name' => { | ||
| 150 | datatype => 'string', | ||
| 151 | base_name => 'sheetName', | ||
| 152 | description => 'Specifies the name or identifier of the worksheet to be deleted. This parameter is required and must match the name of an existing worksheet in the workbook.', | ||
| 153 | format => '', | ||
| 154 | read_only => '', | ||
| 155 | }, | ||
| 156 | 'out_path' => { | ||
| 157 | datatype => 'string', | ||
| 158 | base_name => 'outPath', | ||
| 159 | description => '(Optional) The folder path where the workbook is stored. The default is null.', | ||
| 160 | format => '', | ||
| 161 | read_only => '', | ||
| 162 | }, | ||
| 163 | 'out_storage_name' => { | ||
| 164 | datatype => 'string', | ||
| 165 | base_name => 'outStorageName', | ||
| 166 | description => 'Output file Storage Name.', | ||
| 167 | format => '', | ||
| 168 | read_only => '', | ||
| 169 | }, | ||
| 170 | 'region' => { | ||
| 171 | datatype => 'string', | ||
| 172 | base_name => 'region', | ||
| 173 | description => 'The spreadsheet region setting.', | ||
| 174 | format => '', | ||
| 175 | read_only => '', | ||
| 176 | }, | ||
| 177 | 'password' => { | ||
| 178 | datatype => 'string', | ||
| 179 | base_name => 'password', | ||
| 180 | description => 'The password for opening spreadsheet file.', | ||
| 181 | format => '', | ||
| 182 | read_only => '', | ||
| 183 | }, | ||
| 184 | }); | ||
| 185 | |||
| 186 | |||
| 187 | __PACKAGE__->attribute_map( { | ||
| 188 | 'spreadsheet' => 'Spreadsheet', | ||
| 189 | 'sheet_name' => 'sheetName', | ||
| 190 | 'out_path' => 'outPath', | ||
| 191 | 'out_storage_name' => 'outStorageName', | ||
| 192 | 'region' => 'region', | ||
| 193 | 'password' => 'password' | ||
| 194 | } ); | ||
| 195 | |||
| 196 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 197 | |||
| 198 | |||
| 199 | 1; |