Request/ConvertChartToImageRequest.pm untested

filter: Statementstmt 0.0% 0 / 93 Branchbran 0.0% 0 / 20 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 129 CC 11 SCAR 41.2
CC
11
Cov
0%
run_http_request
132.0
new
2.0
BEGIN
2.0
CRAP 61.6
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::ConvertChartToImageRequest;
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 # ConvertChartToImageRequest.Spreadsheet : Upload spreadsheet file. ,
64 # ConvertChartToImageRequest.worksheet : worksheet name of spreadsheet. ,
65 # ConvertChartToImageRequest.chartIndex : chart index of worksheet. ,
66 # ConvertChartToImageRequest.format : (Required) The desired image type (e.g., svg, png, jpg). ,
67 # ConvertChartToImageRequest.outPath : (Optional) The folder path where the workbook is stored. The default is null. ,
68 # ConvertChartToImageRequest.outStorageName : Output file Storage Name. ,
69 # ConvertChartToImageRequest.fontsLocation : Use Custom fonts. ,
70 # ConvertChartToImageRequest.region : The spreadsheet region setting. ,
71 # ConvertChartToImageRequest.password : The password for opening spreadsheet file.
72
73 {
74 my $params = {
75 'client' =>{
76 data_type => 'ApiClient',
77 description => 'API Client.',
78 required => '0',
79 }
80 };
81 __PACKAGE__->method_documentation->{ 'convert_chart_to_image' } = {
82 summary => 'Converts a chart of spreadsheet on a local drive to image.',
83 params => $params,
84 returns => 'string',
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 = 'v4.0/cells/convert/chart/image';
95
96 my $_method = 'PUT';
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('multipart/form-data');
107
108 if(defined $self->worksheet){
109 $query_params->{'worksheet'} = $client->to_query_value($self->worksheet);
110 }
111
112 if(defined $self->chart_index){
113 $query_params->{'chartIndex'} = $client->to_query_value($self->chart_index);
114 }
115
116 if(defined $self->format){
117 $query_params->{'format'} = $client->to_query_value($self->format);
118 }
119
120 if(defined $self->out_path){
121 $query_params->{'outPath'} = $client->to_query_value($self->out_path);
122 }
123
124 if(defined $self->out_storage_name){
125 $query_params->{'outStorageName'} = $client->to_query_value($self->out_storage_name);
126 }
127
128 if(defined $self->fonts_location){
129 $query_params->{'fontsLocation'} = $client->to_query_value($self->fonts_location);
130 }
131
132 if(defined $self->region){
133 $query_params->{'region'} = $client->to_query_value($self->region);
134 }
135
136 if(defined $self->password){
137 $query_params->{'password'} = $client->to_query_value($self->password);
138 }
139 my $_body_data;
140
141
142 if (defined $self->spreadsheet) {
143 $form_params->{basename($self->spreadsheet)} = [$self->spreadsheet ,basename($self->spreadsheet),'application/octet-stream'];
144 }
145
146
147 # authentication setting, if any
148 my $auth_settings = [qw()];
149
150 # make the API Call
151 my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings);
152 return $response;
153 }
154
155
156 __PACKAGE__->method_documentation({
157 'spreadsheet' => {
158 datatype => 'string',
159 base_name => 'Spreadsheet',
160 description => 'Upload spreadsheet file.',
161 format => '',
162 read_only => '',
163 },
164 'worksheet' => {
165 datatype => 'string',
166 base_name => 'worksheet',
167 description => 'worksheet name of spreadsheet.',
168 format => '',
169 read_only => '',
170 },
171 'chart_index' => {
172 datatype => 'int',
173 base_name => 'chartIndex',
174 description => 'chart index of worksheet.',
175 format => '',
176 read_only => '',
177 },
178 'format' => {
179 datatype => 'string',
180 base_name => 'format',
181 description => '(Required) The desired image type (e.g., svg, png, jpg).',
182 format => '',
183 read_only => '',
184 },
185 'out_path' => {
186 datatype => 'string',
187 base_name => 'outPath',
188 description => '(Optional) The folder path where the workbook is stored. The default is null.',
189 format => '',
190 read_only => '',
191 },
192 'out_storage_name' => {
193 datatype => 'string',
194 base_name => 'outStorageName',
195 description => 'Output file Storage Name.',
196 format => '',
197 read_only => '',
198 },
199 'fonts_location' => {
200 datatype => 'string',
201 base_name => 'fontsLocation',
202 description => 'Use Custom fonts.',
203 format => '',
204 read_only => '',
205 },
206 'region' => {
207 datatype => 'string',
208 base_name => 'region',
209 description => 'The spreadsheet region setting.',
210 format => '',
211 read_only => '',
212 },
213 'password' => {
214 datatype => 'string',
215 base_name => 'password',
216 description => 'The password for opening spreadsheet file.',
217 format => '',
218 read_only => '',
219 },
220 });
221
222
223 __PACKAGE__->attribute_map( {
224 'spreadsheet' => 'Spreadsheet',
225 'worksheet' => 'worksheet',
226 'chart_index' => 'chartIndex',
227 'format' => 'format',
228 'out_path' => 'outPath',
229 'out_storage_name' => 'outStorageName',
230 'fonts_location' => 'fontsLocation',
231 'region' => 'region',
232 'password' => 'password'
233 } );
234
235 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
236
237
238 1;