Request/ExportChartAsFormatRequest.pm untested

filter: Statementstmt 0.0% 0 / 102 Branchbran 0.0% 0 / 24 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 142 CC 13 SCAR 45.2
CC
13
Cov
0%
run_http_request
182.0
new
2.0
BEGIN
2.0
CRAP 92.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::ExportChartAsFormatRequest;
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 # ExportChartAsFormatRequest.name : (Required) The name of the workbook file to be retrieved. ,
64 # ExportChartAsFormatRequest.worksheet : worksheet name ,
65 # ExportChartAsFormatRequest.chartIndex : chart index ,
66 # ExportChartAsFormatRequest.format : (Required) The desired pdf or image format (e.g., "png", "Pdf", "svg"). ,
67 # ExportChartAsFormatRequest.folder : (Optional) The folder path where the workbook is stored. The default is null. ,
68 # ExportChartAsFormatRequest.storageName : (Optional) The name of the storage if using custom cloud storage. Use default storage if omitted. ,
69 # ExportChartAsFormatRequest.outPath : (Optional) The folder path where the workbook is stored. The default is null. ,
70 # ExportChartAsFormatRequest.outStorageName : Output file Storage Name. ,
71 # ExportChartAsFormatRequest.fontsLocation : Use Custom fonts. ,
72 # ExportChartAsFormatRequest.region : The spreadsheet region setting. ,
73 # ExportChartAsFormatRequest.password : The password for opening spreadsheet file.
74
75 {
76 my $params = {
77 'client' =>{
78 data_type => 'ApiClient',
79 description => 'API Client.',
80 required => '0',
81 }
82 };
83 __PACKAGE__->method_documentation->{ 'export_chart_as_format' } = {
84 summary => 'Converts a chart of spreadsheet in cloud storage to the specified format.',
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 = 'v4.0/cells/{name}/worksheets/{worksheet}/charts/{chartIndex}';
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->worksheet){
116 my $_base_variable = "{" . "worksheet" . "}";
117 my $_base_value = $client->to_path_value($self->worksheet);
118 $_resource_path =~ s/$_base_variable/$_base_value/g;
119 }
120
121 if(defined $self->chart_index){
122 my $_base_variable = "{" . "chartIndex" . "}";
123 my $_base_value = $client->to_path_value($self->chart_index);
124 $_resource_path =~ s/$_base_variable/$_base_value/g;
125 }
126 if(defined $self->format){
127 $query_params->{'format'} = $client->to_query_value($self->format);
128 }
129
130 if(defined $self->folder){
131 $query_params->{'folder'} = $client->to_query_value($self->folder);
132 }
133
134 if(defined $self->storage_name){
135 $query_params->{'storageName'} = $client->to_query_value($self->storage_name);
136 }
137
138 if(defined $self->out_path){
139 $query_params->{'outPath'} = $client->to_query_value($self->out_path);
140 }
141
142 if(defined $self->out_storage_name){
143 $query_params->{'outStorageName'} = $client->to_query_value($self->out_storage_name);
144 }
145
146 if(defined $self->fonts_location){
147 $query_params->{'fontsLocation'} = $client->to_query_value($self->fonts_location);
148 }
149
150 if(defined $self->region){
151 $query_params->{'region'} = $client->to_query_value($self->region);
152 }
153
154 if(defined $self->password){
155 $query_params->{'password'} = $client->to_query_value($self->password);
156 }
157 my $_body_data;
158
159
160
161 # authentication setting, if any
162 my $auth_settings = [qw()];
163
164 # make the API Call
165 my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings);
166 return $response;
167 }
168
169
170 __PACKAGE__->method_documentation({
171 'name' => {
172 datatype => 'string',
173 base_name => 'name',
174 description => '(Required) The name of the workbook file to be retrieved.',
175 format => '',
176 read_only => '',
177 },
178 'worksheet' => {
179 datatype => 'string',
180 base_name => 'worksheet',
181 description => 'worksheet name',
182 format => '',
183 read_only => '',
184 },
185 'chart_index' => {
186 datatype => 'int',
187 base_name => 'chartIndex',
188 description => 'chart index',
189 format => '',
190 read_only => '',
191 },
192 'format' => {
193 datatype => 'string',
194 base_name => 'format',
195 description => '(Required) The desired pdf or image format (e.g., "png", "Pdf", "svg").',
196 format => '',
197 read_only => '',
198 },
199 'folder' => {
200 datatype => 'string',
201 base_name => 'folder',
202 description => '(Optional) The folder path where the workbook is stored. The default is null.',
203 format => '',
204 read_only => '',
205 },
206 'storage_name' => {
207 datatype => 'string',
208 base_name => 'storageName',
209 description => '(Optional) The name of the storage if using custom cloud storage. Use default storage if omitted.',
210 format => '',
211 read_only => '',
212 },
213 'out_path' => {
214 datatype => 'string',
215 base_name => 'outPath',
216 description => '(Optional) The folder path where the workbook is stored. The default is null.',
217 format => '',
218 read_only => '',
219 },
220 'out_storage_name' => {
221 datatype => 'string',
222 base_name => 'outStorageName',
223 description => 'Output file Storage Name.',
224 format => '',
225 read_only => '',
226 },
227 'fonts_location' => {
228 datatype => 'string',
229 base_name => 'fontsLocation',
230 description => 'Use Custom fonts.',
231 format => '',
232 read_only => '',
233 },
234 'region' => {
235 datatype => 'string',
236 base_name => 'region',
237 description => 'The spreadsheet region setting.',
238 format => '',
239 read_only => '',
240 },
241 'password' => {
242 datatype => 'string',
243 base_name => 'password',
244 description => 'The password for opening spreadsheet file.',
245 format => '',
246 read_only => '',
247 },
248 });
249
250
251 __PACKAGE__->attribute_map( {
252 'name' => 'name',
253 'worksheet' => 'worksheet',
254 'chart_index' => 'chartIndex',
255 'format' => 'format',
256 'folder' => 'folder',
257 'storage_name' => 'storageName',
258 'out_path' => 'outPath',
259 'out_storage_name' => 'outStorageName',
260 'fonts_location' => 'fontsLocation',
261 'region' => 'region',
262 'password' => 'password'
263 } );
264
265 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
266
267
268 1;