Request/PostWorkbookSaveAsRequest.pm untested

filter: Statementstmt 0.0% 0 / 104 Branchbran 0.0% 0 / 30 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 150 CC 16 SCAR 50.2
CC
16
Cov
0%
run_http_request
272.0
new
2.0
BEGIN
2.0
CRAP 151.0
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::PostWorkbookSaveAsRequest;
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 # PostWorkbookSaveAsRequest.name : The workbook name. ,
64 # PostWorkbookSaveAsRequest.newfilename : newfilename to save the result.The `newfilename` should encompass both the filename and extension. ,
65 # PostWorkbookSaveAsRequest.saveOptions : ,
66 # PostWorkbookSaveAsRequest.isAutoFitRows : Indicates if Autofit rows in workbook. ,
67 # PostWorkbookSaveAsRequest.isAutoFitColumns : Indicates if Autofit columns in workbook. ,
68 # PostWorkbookSaveAsRequest.folder : The folder where the file is situated. ,
69 # PostWorkbookSaveAsRequest.storageName : The storage name where the file is situated. ,
70 # PostWorkbookSaveAsRequest.outStorageName : The storage name where the output file is situated. ,
71 # PostWorkbookSaveAsRequest.checkExcelRestriction : Whether check restriction of excel file when user modify cells related objects. ,
72 # PostWorkbookSaveAsRequest.region : The regional settings for workbook. ,
73 # PostWorkbookSaveAsRequest.pageWideFitOnPerSheet : The page wide fit on worksheet. ,
74 # PostWorkbookSaveAsRequest.pageTallFitOnPerSheet : The page tall fit on worksheet. ,
75 # PostWorkbookSaveAsRequest.onePagePerSheet : ,
76 # PostWorkbookSaveAsRequest.FontsLocation : Use Custom fonts.
77
78 {
79 my $params = {
80 'client' =>{
81 data_type => 'ApiClient',
82 description => 'API Client.',
83 required => '0',
84 }
85 };
86 __PACKAGE__->method_documentation->{ 'post_workbook_save_as' } = {
87 summary => 'Save an Excel file in various formats.',
88 params => $params,
89 returns => 'SaveResponse',
90 };
91 }
92
93 sub run_http_request {
94 my ($self, %args) = @_;
95
96 my $client = $args{'client'};
97
98 # parse inputs
99 my $_resource_path = 'v3.0/cells/{name}/SaveAs';
100
101 my $_method = 'POST';
102 my $query_params = {};
103 my $header_params = {};
104 my $form_params = {};
105
106
107 my $_header_accept = $client->select_header_accept('application/json');
108 if ($_header_accept) {
109 $header_params->{'Accept'} = $_header_accept;
110 }
111 $header_params->{'Content-Type'} = $client->select_header_content_type('application/json');
112 if(defined $self->name){
113 my $_base_variable = "{" . "name" . "}";
114 my $_base_value = $client->to_path_value($self->name);
115 $_resource_path =~ s/$_base_variable/$_base_value/g;
116 }
117 if(defined $self->newfilename){
118 $query_params->{'newfilename'} = $client->to_query_value($self->newfilename);
119 }
120
121 if(defined $self->is_auto_fit_rows){
122 $query_params->{'isAutoFitRows'} = $client->to_query_value($self->is_auto_fit_rows);
123 }
124
125 if(defined $self->is_auto_fit_columns){
126 $query_params->{'isAutoFitColumns'} = $client->to_query_value($self->is_auto_fit_columns);
127 }
128
129 if(defined $self->folder){
130 $query_params->{'folder'} = $client->to_query_value($self->folder);
131 }
132
133 if(defined $self->storage_name){
134 $query_params->{'storageName'} = $client->to_query_value($self->storage_name);
135 }
136
137 if(defined $self->out_storage_name){
138 $query_params->{'outStorageName'} = $client->to_query_value($self->out_storage_name);
139 }
140
141 if(defined $self->check_excel_restriction){
142 $query_params->{'checkExcelRestriction'} = $client->to_query_value($self->check_excel_restriction);
143 }
144
145 if(defined $self->region){
146 $query_params->{'region'} = $client->to_query_value($self->region);
147 }
148
149 if(defined $self->page_wide_fit_on_per_sheet){
150 $query_params->{'pageWideFitOnPerSheet'} = $client->to_query_value($self->page_wide_fit_on_per_sheet);
151 }
152
153 if(defined $self->page_tall_fit_on_per_sheet){
154 $query_params->{'pageTallFitOnPerSheet'} = $client->to_query_value($self->page_tall_fit_on_per_sheet);
155 }
156
157 if(defined $self->one_page_per_sheet){
158 $query_params->{'onePagePerSheet'} = $client->to_query_value($self->one_page_per_sheet);
159 }
160
161 if(defined $self->fonts_location){
162 $query_params->{'FontsLocation'} = $client->to_query_value($self->fonts_location);
163 }
164 my $_body_data;
165
166
167 # body params
168 if (defined $self->save_options) {
169 $_body_data = JSON->new->convert_blessed->encode( $self->save_options);
170 }
171
172
173
174 # authentication setting, if any
175 my $auth_settings = [qw()];
176
177 # make the API Call
178 my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings);
179 return $response;
180 }
181
182
183 __PACKAGE__->method_documentation({
184 'name' => {
185 datatype => 'string',
186 base_name => 'name',
187 description => 'The workbook name.',
188 format => '',
189 read_only => '',
190 },
191 'newfilename' => {
192 datatype => 'string',
193 base_name => 'newfilename',
194 description => 'newfilename to save the result.The `newfilename` should encompass both the filename and extension.',
195 format => '',
196 read_only => '',
197 },
198 'save_options' => {
199 datatype => 'SaveOptions',
200 base_name => 'saveOptions',
201 description => '',
202 format => '',
203 read_only => '',
204 },
205 'is_auto_fit_rows' => {
206 datatype => 'string',
207 base_name => 'isAutoFitRows',
208 description => 'Indicates if Autofit rows in workbook.',
209 format => '',
210 read_only => '',
211 },
212 'is_auto_fit_columns' => {
213 datatype => 'string',
214 base_name => 'isAutoFitColumns',
215 description => 'Indicates if Autofit columns in workbook.',
216 format => '',
217 read_only => '',
218 },
219 'folder' => {
220 datatype => 'string',
221 base_name => 'folder',
222 description => 'The folder where the file is situated.',
223 format => '',
224 read_only => '',
225 },
226 'storage_name' => {
227 datatype => 'string',
228 base_name => 'storageName',
229 description => 'The storage name where the file is situated.',
230 format => '',
231 read_only => '',
232 },
233 'out_storage_name' => {
234 datatype => 'string',
235 base_name => 'outStorageName',
236 description => 'The storage name where the output file is situated.',
237 format => '',
238 read_only => '',
239 },
240 'check_excel_restriction' => {
241 datatype => 'string',
242 base_name => 'checkExcelRestriction',
243 description => 'Whether check restriction of excel file when user modify cells related objects.',
244 format => '',
245 read_only => '',
246 },
247 'region' => {
248 datatype => 'string',
249 base_name => 'region',
250 description => 'The regional settings for workbook.',
251 format => '',
252 read_only => '',
253 },
254 'page_wide_fit_on_per_sheet' => {
255 datatype => 'string',
256 base_name => 'pageWideFitOnPerSheet',
257 description => 'The page wide fit on worksheet.',
258 format => '',
259 read_only => '',
260 },
261 'page_tall_fit_on_per_sheet' => {
262 datatype => 'string',
263 base_name => 'pageTallFitOnPerSheet',
264 description => 'The page tall fit on worksheet.',
265 format => '',
266 read_only => '',
267 },
268 'one_page_per_sheet' => {
269 datatype => 'string',
270 base_name => 'onePagePerSheet',
271 description => '',
272 format => '',
273 read_only => '',
274 },
275 'fonts_location' => {
276 datatype => 'string',
277 base_name => 'FontsLocation',
278 description => 'Use Custom fonts.',
279 format => '',
280 read_only => '',
281 },
282 });
283
284
285 __PACKAGE__->attribute_map( {
286 'name' => 'name',
287 'newfilename' => 'newfilename',
288 'save_options' => 'saveOptions',
289 'is_auto_fit_rows' => 'isAutoFitRows',
290 'is_auto_fit_columns' => 'isAutoFitColumns',
291 'folder' => 'folder',
292 'storage_name' => 'storageName',
293 'out_storage_name' => 'outStorageName',
294 'check_excel_restriction' => 'checkExcelRestriction',
295 'region' => 'region',
296 'page_wide_fit_on_per_sheet' => 'pageWideFitOnPerSheet',
297 'page_tall_fit_on_per_sheet' => 'pageTallFitOnPerSheet',
298 'one_page_per_sheet' => 'onePagePerSheet',
299 'fonts_location' => 'FontsLocation'
300 } );
301
302 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
303
304
305 1;