Request/PutConvertWorkbookRequest.pm untested

filter: Statementstmt 0.0% 0 / 107 Branchbran 0.0% 0 / 34 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 157 CC 18 SCAR 53.0
CC
18
Cov
0%
run_http_request
342.0
new
2.0
BEGIN
2.0
CRAP 199.4
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::PutConvertWorkbookRequest;
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 # PutConvertWorkbookRequest.File : File to upload ,
64 # PutConvertWorkbookRequest.format : The format to convert(CSV/XLS/HTML/MHTML/ODS/PDF/XML/TXT/TIFF/XLSB/XLSM/XLSX/XLTM/XLTX/XPS/PNG/JPG/JPEG/GIF/EMF/BMP/MD[Markdown]/Numbers). ,
65 # PutConvertWorkbookRequest.password : The password needed to open an Excel file. ,
66 # PutConvertWorkbookRequest.outPath : Path to save the result. If it`s a single file, the `outPath` should encompass both the filename and extension. In the case of multiple files, the `outPath` should only include the folder. ,
67 # PutConvertWorkbookRequest.storageName : The storage name where the file is situated. ,
68 # PutConvertWorkbookRequest.checkExcelRestriction : Whether check restriction of excel file when user modify cells related objects. ,
69 # PutConvertWorkbookRequest.streamFormat : The format of the input file stream. ,
70 # PutConvertWorkbookRequest.region : The regional settings for workbook. ,
71 # PutConvertWorkbookRequest.pageWideFitOnPerSheet : The page wide fit on worksheet. ,
72 # PutConvertWorkbookRequest.pageTallFitOnPerSheet : The page tall fit on worksheet. ,
73 # PutConvertWorkbookRequest.sheetName : Convert the specified worksheet. ,
74 # PutConvertWorkbookRequest.pageIndex : Convert the specified page of worksheet, sheetName is required. ,
75 # PutConvertWorkbookRequest.onePagePerSheet : When converting to PDF format, one page per sheet. ,
76 # PutConvertWorkbookRequest.AutoRowsFit : Auto-fits all rows in this workbook. ,
77 # PutConvertWorkbookRequest.AutoColumnsFit : Auto-fits the columns width in this workbook. ,
78 # PutConvertWorkbookRequest.FontsLocation : Use Custom fonts.
79
80 {
81 my $params = {
82 'client' =>{
83 data_type => 'ApiClient',
84 description => 'API Client.',
85 required => '0',
86 }
87 };
88 __PACKAGE__->method_documentation->{ 'put_convert_workbook' } = {
89 summary => 'Convert the workbook from the requested content into files in different formats.',
90 params => $params,
91 returns => 'string',
92 };
93 }
94
95 sub run_http_request {
96 my ($self, %args) = @_;
97
98 my $client = $args{'client'};
99
100 # parse inputs
101 my $_resource_path = 'v3.0/cells/convert';
102
103 my $_method = 'PUT';
104 my $query_params = {};
105 my $header_params = {};
106 my $form_params = {};
107
108
109 my $_header_accept = $client->select_header_accept('application/json');
110 if ($_header_accept) {
111 $header_params->{'Accept'} = $_header_accept;
112 }
113 $header_params->{'Content-Type'} = $client->select_header_content_type('multipart/form-data');
114
115 if(defined $self->format){
116 $query_params->{'format'} = $client->to_query_value($self->format);
117 }
118
119 if(defined $self->password){
120 $query_params->{'password'} = $client->to_query_value($self->password);
121 }
122
123 if(defined $self->out_path){
124 $query_params->{'outPath'} = $client->to_query_value($self->out_path);
125 }
126
127 if(defined $self->storage_name){
128 $query_params->{'storageName'} = $client->to_query_value($self->storage_name);
129 }
130
131 if(defined $self->check_excel_restriction){
132 $query_params->{'checkExcelRestriction'} = $client->to_query_value($self->check_excel_restriction);
133 }
134
135 if(defined $self->stream_format){
136 $query_params->{'streamFormat'} = $client->to_query_value($self->stream_format);
137 }
138
139 if(defined $self->region){
140 $query_params->{'region'} = $client->to_query_value($self->region);
141 }
142
143 if(defined $self->page_wide_fit_on_per_sheet){
144 $query_params->{'pageWideFitOnPerSheet'} = $client->to_query_value($self->page_wide_fit_on_per_sheet);
145 }
146
147 if(defined $self->page_tall_fit_on_per_sheet){
148 $query_params->{'pageTallFitOnPerSheet'} = $client->to_query_value($self->page_tall_fit_on_per_sheet);
149 }
150
151 if(defined $self->sheet_name){
152 $query_params->{'sheetName'} = $client->to_query_value($self->sheet_name);
153 }
154
155 if(defined $self->page_index){
156 $query_params->{'pageIndex'} = $client->to_query_value($self->page_index);
157 }
158
159 if(defined $self->one_page_per_sheet){
160 $query_params->{'onePagePerSheet'} = $client->to_query_value($self->one_page_per_sheet);
161 }
162
163 if(defined $self->auto_rows_fit){
164 $query_params->{'AutoRowsFit'} = $client->to_query_value($self->auto_rows_fit);
165 }
166
167 if(defined $self->auto_columns_fit){
168 $query_params->{'AutoColumnsFit'} = $client->to_query_value($self->auto_columns_fit);
169 }
170
171 if(defined $self->fonts_location){
172 $query_params->{'FontsLocation'} = $client->to_query_value($self->fonts_location);
173 }
174 my $_body_data;
175
176
177 if (defined $self->file) {
178 $form_params->{basename($self->file)} = [$self->file ,basename($self->file),'application/octet-stream'];
179 }
180
181
182 # authentication setting, if any
183 my $auth_settings = [qw()];
184
185 # make the API Call
186 my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings);
187 return $response;
188 }
189
190
191 __PACKAGE__->method_documentation({
192 'file' => {
193 datatype => 'string',
194 base_name => 'File',
195 description => 'File to upload',
196 format => '',
197 read_only => '',
198 },
199 'format' => {
200 datatype => 'string',
201 base_name => 'format',
202 description => 'The format to convert(CSV/XLS/HTML/MHTML/ODS/PDF/XML/TXT/TIFF/XLSB/XLSM/XLSX/XLTM/XLTX/XPS/PNG/JPG/JPEG/GIF/EMF/BMP/MD[Markdown]/Numbers).',
203 format => '',
204 read_only => '',
205 },
206 'password' => {
207 datatype => 'string',
208 base_name => 'password',
209 description => 'The password needed to open an Excel file.',
210 format => '',
211 read_only => '',
212 },
213 'out_path' => {
214 datatype => 'string',
215 base_name => 'outPath',
216 description => 'Path to save the result. If it`s a single file, the `outPath` should encompass both the filename and extension. In the case of multiple files, the `outPath` should only include the folder.',
217 format => '',
218 read_only => '',
219 },
220 'storage_name' => {
221 datatype => 'string',
222 base_name => 'storageName',
223 description => 'The storage name where the file is situated.',
224 format => '',
225 read_only => '',
226 },
227 'check_excel_restriction' => {
228 datatype => 'string',
229 base_name => 'checkExcelRestriction',
230 description => 'Whether check restriction of excel file when user modify cells related objects.',
231 format => '',
232 read_only => '',
233 },
234 'stream_format' => {
235 datatype => 'string',
236 base_name => 'streamFormat',
237 description => 'The format of the input file stream. ',
238 format => '',
239 read_only => '',
240 },
241 'region' => {
242 datatype => 'string',
243 base_name => 'region',
244 description => 'The regional settings for workbook.',
245 format => '',
246 read_only => '',
247 },
248 'page_wide_fit_on_per_sheet' => {
249 datatype => 'string',
250 base_name => 'pageWideFitOnPerSheet',
251 description => 'The page wide fit on worksheet.',
252 format => '',
253 read_only => '',
254 },
255 'page_tall_fit_on_per_sheet' => {
256 datatype => 'string',
257 base_name => 'pageTallFitOnPerSheet',
258 description => 'The page tall fit on worksheet.',
259 format => '',
260 read_only => '',
261 },
262 'sheet_name' => {
263 datatype => 'string',
264 base_name => 'sheetName',
265 description => 'Convert the specified worksheet. ',
266 format => '',
267 read_only => '',
268 },
269 'page_index' => {
270 datatype => 'int',
271 base_name => 'pageIndex',
272 description => 'Convert the specified page of worksheet, sheetName is required. ',
273 format => '',
274 read_only => '',
275 },
276 'one_page_per_sheet' => {
277 datatype => 'string',
278 base_name => 'onePagePerSheet',
279 description => 'When converting to PDF format, one page per sheet. ',
280 format => '',
281 read_only => '',
282 },
283 'auto_rows_fit' => {
284 datatype => 'string',
285 base_name => 'AutoRowsFit',
286 description => 'Auto-fits all rows in this workbook.',
287 format => '',
288 read_only => '',
289 },
290 'auto_columns_fit' => {
291 datatype => 'string',
292 base_name => 'AutoColumnsFit',
293 description => 'Auto-fits the columns width in this workbook.',
294 format => '',
295 read_only => '',
296 },
297 'fonts_location' => {
298 datatype => 'string',
299 base_name => 'FontsLocation',
300 description => 'Use Custom fonts.',
301 format => '',
302 read_only => '',
303 },
304 });
305
306
307 __PACKAGE__->attribute_map( {
308 'file' => 'File',
309 'format' => 'format',
310 'password' => 'password',
311 'out_path' => 'outPath',
312 'storage_name' => 'storageName',
313 'check_excel_restriction' => 'checkExcelRestriction',
314 'stream_format' => 'streamFormat',
315 'region' => 'region',
316 'page_wide_fit_on_per_sheet' => 'pageWideFitOnPerSheet',
317 'page_tall_fit_on_per_sheet' => 'pageTallFitOnPerSheet',
318 'sheet_name' => 'sheetName',
319 'page_index' => 'pageIndex',
320 'one_page_per_sheet' => 'onePagePerSheet',
321 'auto_rows_fit' => 'AutoRowsFit',
322 'auto_columns_fit' => 'AutoColumnsFit',
323 'fonts_location' => 'FontsLocation'
324 } );
325
326 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
327
328
329 1;