| 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::GetWorksheetWithFormatRequest; | ||
| 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 | # GetWorksheetWithFormatRequest.name : The file name. , | ||
| 64 | # GetWorksheetWithFormatRequest.sheetName : The worksheet name. , | ||
| 65 | # GetWorksheetWithFormatRequest.format : Export format(CSV/XLS/HTML/MHTML/ODS/PDF/XML/TXT/TIFF/XLSB/XLSM/XLSX/XLTM/XLTX/XPS/PNG/JPG/JPEG/GIF/EMF/BMP/MD[Markdown]/Numbers). , | ||
| 66 | # GetWorksheetWithFormatRequest.verticalResolution : Image vertical resolution. , | ||
| 67 | # GetWorksheetWithFormatRequest.horizontalResolution : Image horizontal resolution. , | ||
| 68 | # GetWorksheetWithFormatRequest.area : Represents the range to be printed. , | ||
| 69 | # GetWorksheetWithFormatRequest.pageIndex : Represents the page to be printed , | ||
| 70 | # GetWorksheetWithFormatRequest.onePagePerSheet : , | ||
| 71 | # GetWorksheetWithFormatRequest.printHeadings : , | ||
| 72 | # GetWorksheetWithFormatRequest.folder : The folder where the file is situated. , | ||
| 73 | # GetWorksheetWithFormatRequest.storageName : The storage name where the file is situated. | ||
| 74 | |||
| 75 | { | ||
| 76 | my $params = { | ||
| 77 | 'client' =>{ | ||
| 78 | data_type => 'ApiClient', | ||
| 79 | description => 'API Client.', | ||
| 80 | required => '0', | ||
| 81 | } | ||
| 82 | }; | ||
| 83 | __PACKAGE__->method_documentation->{ 'get_worksheet_with_format' } = { | ||
| 84 | summary => 'Retrieve the worksheet in a specified format from the workbook.', | ||
| 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 = 'v3.0/cells/{name}/worksheets/{sheetName}'; | ||
| 97 | |||
| 98 | my $_method = 'GET'; | ||
| 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 | |||
| 115 | if(defined $self->sheet_name){ | ||
| 116 | my $_base_variable = "{" . "sheetName" . "}"; | ||
| 117 | my $_base_value = $client->to_path_value($self->sheet_name); | ||
| 118 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 119 | } | ||
| 120 | if(defined $self->format){ | ||
| 121 | $query_params->{'format'} = $client->to_query_value($self->format); | ||
| 122 | } | ||
| 123 | |||
| 124 | if(defined $self->vertical_resolution){ | ||
| 125 | $query_params->{'verticalResolution'} = $client->to_query_value($self->vertical_resolution); | ||
| 126 | } | ||
| 127 | |||
| 128 | if(defined $self->horizontal_resolution){ | ||
| 129 | $query_params->{'horizontalResolution'} = $client->to_query_value($self->horizontal_resolution); | ||
| 130 | } | ||
| 131 | |||
| 132 | if(defined $self->area){ | ||
| 133 | $query_params->{'area'} = $client->to_query_value($self->area); | ||
| 134 | } | ||
| 135 | |||
| 136 | if(defined $self->page_index){ | ||
| 137 | $query_params->{'pageIndex'} = $client->to_query_value($self->page_index); | ||
| 138 | } | ||
| 139 | |||
| 140 | if(defined $self->one_page_per_sheet){ | ||
| 141 | $query_params->{'onePagePerSheet'} = $client->to_query_value($self->one_page_per_sheet); | ||
| 142 | } | ||
| 143 | |||
| 144 | if(defined $self->print_headings){ | ||
| 145 | $query_params->{'printHeadings'} = $client->to_query_value($self->print_headings); | ||
| 146 | } | ||
| 147 | |||
| 148 | if(defined $self->folder){ | ||
| 149 | $query_params->{'folder'} = $client->to_query_value($self->folder); | ||
| 150 | } | ||
| 151 | |||
| 152 | if(defined $self->storage_name){ | ||
| 153 | $query_params->{'storageName'} = $client->to_query_value($self->storage_name); | ||
| 154 | } | ||
| 155 | my $_body_data; | ||
| 156 | |||
| 157 | |||
| 158 | |||
| 159 | # authentication setting, if any | ||
| 160 | my $auth_settings = [qw()]; | ||
| 161 | |||
| 162 | # make the API Call | ||
| 163 | my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); | ||
| 164 | return $response; | ||
| 165 | } | ||
| 166 | |||
| 167 | |||
| 168 | __PACKAGE__->method_documentation({ | ||
| 169 | 'name' => { | ||
| 170 | datatype => 'string', | ||
| 171 | base_name => 'name', | ||
| 172 | description => 'The file name.', | ||
| 173 | format => '', | ||
| 174 | read_only => '', | ||
| 175 | }, | ||
| 176 | 'sheet_name' => { | ||
| 177 | datatype => 'string', | ||
| 178 | base_name => 'sheetName', | ||
| 179 | description => 'The worksheet name.', | ||
| 180 | format => '', | ||
| 181 | read_only => '', | ||
| 182 | }, | ||
| 183 | 'format' => { | ||
| 184 | datatype => 'string', | ||
| 185 | base_name => 'format', | ||
| 186 | description => 'Export format(CSV/XLS/HTML/MHTML/ODS/PDF/XML/TXT/TIFF/XLSB/XLSM/XLSX/XLTM/XLTX/XPS/PNG/JPG/JPEG/GIF/EMF/BMP/MD[Markdown]/Numbers).', | ||
| 187 | format => '', | ||
| 188 | read_only => '', | ||
| 189 | }, | ||
| 190 | 'vertical_resolution' => { | ||
| 191 | datatype => 'int', | ||
| 192 | base_name => 'verticalResolution', | ||
| 193 | description => 'Image vertical resolution.', | ||
| 194 | format => '', | ||
| 195 | read_only => '', | ||
| 196 | }, | ||
| 197 | 'horizontal_resolution' => { | ||
| 198 | datatype => 'int', | ||
| 199 | base_name => 'horizontalResolution', | ||
| 200 | description => 'Image horizontal resolution.', | ||
| 201 | format => '', | ||
| 202 | read_only => '', | ||
| 203 | }, | ||
| 204 | 'area' => { | ||
| 205 | datatype => 'string', | ||
| 206 | base_name => 'area', | ||
| 207 | description => 'Represents the range to be printed.', | ||
| 208 | format => '', | ||
| 209 | read_only => '', | ||
| 210 | }, | ||
| 211 | 'page_index' => { | ||
| 212 | datatype => 'int', | ||
| 213 | base_name => 'pageIndex', | ||
| 214 | description => 'Represents the page to be printed', | ||
| 215 | format => '', | ||
| 216 | read_only => '', | ||
| 217 | }, | ||
| 218 | 'one_page_per_sheet' => { | ||
| 219 | datatype => 'string', | ||
| 220 | base_name => 'onePagePerSheet', | ||
| 221 | description => '', | ||
| 222 | format => '', | ||
| 223 | read_only => '', | ||
| 224 | }, | ||
| 225 | 'print_headings' => { | ||
| 226 | datatype => 'string', | ||
| 227 | base_name => 'printHeadings', | ||
| 228 | description => '', | ||
| 229 | format => '', | ||
| 230 | read_only => '', | ||
| 231 | }, | ||
| 232 | 'folder' => { | ||
| 233 | datatype => 'string', | ||
| 234 | base_name => 'folder', | ||
| 235 | description => 'The folder where the file is situated.', | ||
| 236 | format => '', | ||
| 237 | read_only => '', | ||
| 238 | }, | ||
| 239 | 'storage_name' => { | ||
| 240 | datatype => 'string', | ||
| 241 | base_name => 'storageName', | ||
| 242 | description => 'The storage name where the file is situated.', | ||
| 243 | format => '', | ||
| 244 | read_only => '', | ||
| 245 | }, | ||
| 246 | }); | ||
| 247 | |||
| 248 | |||
| 249 | __PACKAGE__->attribute_map( { | ||
| 250 | 'name' => 'name', | ||
| 251 | 'sheet_name' => 'sheetName', | ||
| 252 | 'format' => 'format', | ||
| 253 | 'vertical_resolution' => 'verticalResolution', | ||
| 254 | 'horizontal_resolution' => 'horizontalResolution', | ||
| 255 | 'area' => 'area', | ||
| 256 | 'page_index' => 'pageIndex', | ||
| 257 | 'one_page_per_sheet' => 'onePagePerSheet', | ||
| 258 | 'print_headings' => 'printHeadings', | ||
| 259 | 'folder' => 'folder', | ||
| 260 | 'storage_name' => 'storageName' | ||
| 261 | } ); | ||
| 262 | |||
| 263 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 264 | |||
| 265 | |||
| 266 | 1; |