| 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::PostCopyCellIntoCellRequest; | ||
| 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 | # PostCopyCellIntoCellRequest.name : The file name. , | ||
| 64 | # PostCopyCellIntoCellRequest.destCellName : The destination cell name. , | ||
| 65 | # PostCopyCellIntoCellRequest.sheetName : The destination worksheet name. , | ||
| 66 | # PostCopyCellIntoCellRequest.worksheet : The source worksheet name. , | ||
| 67 | # PostCopyCellIntoCellRequest.cellname : The source cell name. , | ||
| 68 | # PostCopyCellIntoCellRequest.row : The source row index. , | ||
| 69 | # PostCopyCellIntoCellRequest.column : The source column index. , | ||
| 70 | # PostCopyCellIntoCellRequest.folder : The folder where the file is situated. , | ||
| 71 | # PostCopyCellIntoCellRequest.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_copy_cell_into_cell' } = { | ||
| 82 | summary => 'Copy data from a source cell to a destination cell 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/{destCellName}/copy'; | ||
| 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->dest_cell_name){ | ||
| 114 | my $_base_variable = "{" . "destCellName" . "}"; | ||
| 115 | my $_base_value = $client->to_path_value($self->dest_cell_name); | ||
| 116 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 117 | } | ||
| 118 | |||
| 119 | if(defined $self->sheet_name){ | ||
| 120 | my $_base_variable = "{" . "sheetName" . "}"; | ||
| 121 | my $_base_value = $client->to_path_value($self->sheet_name); | ||
| 122 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 123 | } | ||
| 124 | if(defined $self->worksheet){ | ||
| 125 | $query_params->{'worksheet'} = $client->to_query_value($self->worksheet); | ||
| 126 | } | ||
| 127 | |||
| 128 | if(defined $self->cellname){ | ||
| 129 | $query_params->{'cellname'} = $client->to_query_value($self->cellname); | ||
| 130 | } | ||
| 131 | |||
| 132 | if(defined $self->row){ | ||
| 133 | $query_params->{'row'} = $client->to_query_value($self->row); | ||
| 134 | } | ||
| 135 | |||
| 136 | if(defined $self->column){ | ||
| 137 | $query_params->{'column'} = $client->to_query_value($self->column); | ||
| 138 | } | ||
| 139 | |||
| 140 | if(defined $self->folder){ | ||
| 141 | $query_params->{'folder'} = $client->to_query_value($self->folder); | ||
| 142 | } | ||
| 143 | |||
| 144 | if(defined $self->storage_name){ | ||
| 145 | $query_params->{'storageName'} = $client->to_query_value($self->storage_name); | ||
| 146 | } | ||
| 147 | my $_body_data; | ||
| 148 | |||
| 149 | |||
| 150 | |||
| 151 | # authentication setting, if any | ||
| 152 | my $auth_settings = [qw()]; | ||
| 153 | |||
| 154 | # make the API Call | ||
| 155 | my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); | ||
| 156 | return $response; | ||
| 157 | } | ||
| 158 | |||
| 159 | |||
| 160 | __PACKAGE__->method_documentation({ | ||
| 161 | 'name' => { | ||
| 162 | datatype => 'string', | ||
| 163 | base_name => 'name', | ||
| 164 | description => 'The file name.', | ||
| 165 | format => '', | ||
| 166 | read_only => '', | ||
| 167 | }, | ||
| 168 | 'dest_cell_name' => { | ||
| 169 | datatype => 'string', | ||
| 170 | base_name => 'destCellName', | ||
| 171 | description => 'The destination cell name.', | ||
| 172 | format => '', | ||
| 173 | read_only => '', | ||
| 174 | }, | ||
| 175 | 'sheet_name' => { | ||
| 176 | datatype => 'string', | ||
| 177 | base_name => 'sheetName', | ||
| 178 | description => 'The destination worksheet name.', | ||
| 179 | format => '', | ||
| 180 | read_only => '', | ||
| 181 | }, | ||
| 182 | 'worksheet' => { | ||
| 183 | datatype => 'string', | ||
| 184 | base_name => 'worksheet', | ||
| 185 | description => 'The source worksheet name.', | ||
| 186 | format => '', | ||
| 187 | read_only => '', | ||
| 188 | }, | ||
| 189 | 'cellname' => { | ||
| 190 | datatype => 'string', | ||
| 191 | base_name => 'cellname', | ||
| 192 | description => 'The source cell name.', | ||
| 193 | format => '', | ||
| 194 | read_only => '', | ||
| 195 | }, | ||
| 196 | 'row' => { | ||
| 197 | datatype => 'int', | ||
| 198 | base_name => 'row', | ||
| 199 | description => 'The source row index.', | ||
| 200 | format => '', | ||
| 201 | read_only => '', | ||
| 202 | }, | ||
| 203 | 'column' => { | ||
| 204 | datatype => 'int', | ||
| 205 | base_name => 'column', | ||
| 206 | description => 'The source column index.', | ||
| 207 | format => '', | ||
| 208 | read_only => '', | ||
| 209 | }, | ||
| 210 | 'folder' => { | ||
| 211 | datatype => 'string', | ||
| 212 | base_name => 'folder', | ||
| 213 | description => 'The folder where the file is situated.', | ||
| 214 | format => '', | ||
| 215 | read_only => '', | ||
| 216 | }, | ||
| 217 | 'storage_name' => { | ||
| 218 | datatype => 'string', | ||
| 219 | base_name => 'storageName', | ||
| 220 | description => 'The storage name where the file is situated.', | ||
| 221 | format => '', | ||
| 222 | read_only => '', | ||
| 223 | }, | ||
| 224 | }); | ||
| 225 | |||
| 226 | |||
| 227 | __PACKAGE__->attribute_map( { | ||
| 228 | 'name' => 'name', | ||
| 229 | 'dest_cell_name' => 'destCellName', | ||
| 230 | 'sheet_name' => 'sheetName', | ||
| 231 | 'worksheet' => 'worksheet', | ||
| 232 | 'cellname' => 'cellname', | ||
| 233 | 'row' => 'row', | ||
| 234 | 'column' => 'column', | ||
| 235 | 'folder' => 'folder', | ||
| 236 | 'storage_name' => 'storageName' | ||
| 237 | } ); | ||
| 238 | |||
| 239 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 240 | |||
| 241 | |||
| 242 | 1; |