| 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::PostClearContentsRequest; | ||
| 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 | # PostClearContentsRequest.name : The file name. , | ||
| 64 | # PostClearContentsRequest.sheetName : The worksheet name. , | ||
| 65 | # PostClearContentsRequest.range : Represents the range to which the specified cells applies. , | ||
| 66 | # PostClearContentsRequest.startRow : The start row index. , | ||
| 67 | # PostClearContentsRequest.startColumn : The start column index. , | ||
| 68 | # PostClearContentsRequest.endRow : The end row index. , | ||
| 69 | # PostClearContentsRequest.endColumn : The end column index. , | ||
| 70 | # PostClearContentsRequest.folder : The folder where the file is situated. , | ||
| 71 | # PostClearContentsRequest.storageName : The storage name where the file is situated. | ||
| 72 | |||
| 73 | { | ||
| 74 | my $params = { | ||
| 75 | 'client' =>{ | ||
| 76 | data_type => 'ApiClient', | ||
| 77 | description => 'API Client.', | ||
| 78 | required => '0', | ||
| 79 | } | ||
| 80 | }; | ||
| 81 | __PACKAGE__->method_documentation->{ 'post_clear_contents' } = { | ||
| 82 | summary => 'Clear cell area contents in the worksheet.', | ||
| 83 | params => $params, | ||
| 84 | returns => 'CellsCloudResponse', | ||
| 85 | }; | ||
| 86 | } | ||
| 87 | |||
| 88 | sub run_http_request { | ||
| 89 | my ($self, %args) = @_; | ||
| 90 | |||
| 91 | my $client = $args{'client'}; | ||
| 92 | |||
| 93 | # parse inputs | ||
| 94 | my $_resource_path = 'v3.0/cells/{name}/worksheets/{sheetName}/cells/clearcontents'; | ||
| 95 | |||
| 96 | my $_method = 'POST'; | ||
| 97 | my $query_params = {}; | ||
| 98 | my $header_params = {}; | ||
| 99 | my $form_params = {}; | ||
| 100 | |||
| 101 | |||
| 102 | my $_header_accept = $client->select_header_accept('application/json'); | ||
| 103 | if ($_header_accept) { | ||
| 104 | $header_params->{'Accept'} = $_header_accept; | ||
| 105 | } | ||
| 106 | $header_params->{'Content-Type'} = $client->select_header_content_type('application/json'); | ||
| 107 | if(defined $self->name){ | ||
| 108 | my $_base_variable = "{" . "name" . "}"; | ||
| 109 | my $_base_value = $client->to_path_value($self->name); | ||
| 110 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 111 | } | ||
| 112 | |||
| 113 | if(defined $self->sheet_name){ | ||
| 114 | my $_base_variable = "{" . "sheetName" . "}"; | ||
| 115 | my $_base_value = $client->to_path_value($self->sheet_name); | ||
| 116 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 117 | } | ||
| 118 | if(defined $self->range){ | ||
| 119 | $query_params->{'range'} = $client->to_query_value($self->range); | ||
| 120 | } | ||
| 121 | |||
| 122 | if(defined $self->start_row){ | ||
| 123 | $query_params->{'startRow'} = $client->to_query_value($self->start_row); | ||
| 124 | } | ||
| 125 | |||
| 126 | if(defined $self->start_column){ | ||
| 127 | $query_params->{'startColumn'} = $client->to_query_value($self->start_column); | ||
| 128 | } | ||
| 129 | |||
| 130 | if(defined $self->end_row){ | ||
| 131 | $query_params->{'endRow'} = $client->to_query_value($self->end_row); | ||
| 132 | } | ||
| 133 | |||
| 134 | if(defined $self->end_column){ | ||
| 135 | $query_params->{'endColumn'} = $client->to_query_value($self->end_column); | ||
| 136 | } | ||
| 137 | |||
| 138 | if(defined $self->folder){ | ||
| 139 | $query_params->{'folder'} = $client->to_query_value($self->folder); | ||
| 140 | } | ||
| 141 | |||
| 142 | if(defined $self->storage_name){ | ||
| 143 | $query_params->{'storageName'} = $client->to_query_value($self->storage_name); | ||
| 144 | } | ||
| 145 | my $_body_data; | ||
| 146 | |||
| 147 | |||
| 148 | |||
| 149 | # authentication setting, if any | ||
| 150 | my $auth_settings = [qw()]; | ||
| 151 | |||
| 152 | # make the API Call | ||
| 153 | my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); | ||
| 154 | return $response; | ||
| 155 | } | ||
| 156 | |||
| 157 | |||
| 158 | __PACKAGE__->method_documentation({ | ||
| 159 | 'name' => { | ||
| 160 | datatype => 'string', | ||
| 161 | base_name => 'name', | ||
| 162 | description => 'The file name.', | ||
| 163 | format => '', | ||
| 164 | read_only => '', | ||
| 165 | }, | ||
| 166 | 'sheet_name' => { | ||
| 167 | datatype => 'string', | ||
| 168 | base_name => 'sheetName', | ||
| 169 | description => 'The worksheet name.', | ||
| 170 | format => '', | ||
| 171 | read_only => '', | ||
| 172 | }, | ||
| 173 | 'range' => { | ||
| 174 | datatype => 'string', | ||
| 175 | base_name => 'range', | ||
| 176 | description => 'Represents the range to which the specified cells applies.', | ||
| 177 | format => '', | ||
| 178 | read_only => '', | ||
| 179 | }, | ||
| 180 | 'start_row' => { | ||
| 181 | datatype => 'int', | ||
| 182 | base_name => 'startRow', | ||
| 183 | description => 'The start row index.', | ||
| 184 | format => '', | ||
| 185 | read_only => '', | ||
| 186 | }, | ||
| 187 | 'start_column' => { | ||
| 188 | datatype => 'int', | ||
| 189 | base_name => 'startColumn', | ||
| 190 | description => 'The start column index.', | ||
| 191 | format => '', | ||
| 192 | read_only => '', | ||
| 193 | }, | ||
| 194 | 'end_row' => { | ||
| 195 | datatype => 'int', | ||
| 196 | base_name => 'endRow', | ||
| 197 | description => 'The end row index.', | ||
| 198 | format => '', | ||
| 199 | read_only => '', | ||
| 200 | }, | ||
| 201 | 'end_column' => { | ||
| 202 | datatype => 'int', | ||
| 203 | base_name => 'endColumn', | ||
| 204 | description => 'The end column index.', | ||
| 205 | format => '', | ||
| 206 | read_only => '', | ||
| 207 | }, | ||
| 208 | 'folder' => { | ||
| 209 | datatype => 'string', | ||
| 210 | base_name => 'folder', | ||
| 211 | description => 'The folder where the file is situated.', | ||
| 212 | format => '', | ||
| 213 | read_only => '', | ||
| 214 | }, | ||
| 215 | 'storage_name' => { | ||
| 216 | datatype => 'string', | ||
| 217 | base_name => 'storageName', | ||
| 218 | description => 'The storage name where the file is situated.', | ||
| 219 | format => '', | ||
| 220 | read_only => '', | ||
| 221 | }, | ||
| 222 | }); | ||
| 223 | |||
| 224 | |||
| 225 | __PACKAGE__->attribute_map( { | ||
| 226 | 'name' => 'name', | ||
| 227 | 'sheet_name' => 'sheetName', | ||
| 228 | 'range' => 'range', | ||
| 229 | 'start_row' => 'startRow', | ||
| 230 | 'start_column' => 'startColumn', | ||
| 231 | 'end_row' => 'endRow', | ||
| 232 | 'end_column' => 'endColumn', | ||
| 233 | 'folder' => 'folder', | ||
| 234 | 'storage_name' => 'storageName' | ||
| 235 | } ); | ||
| 236 | |||
| 237 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 238 | |||
| 239 | |||
| 240 | 1; |