Request/ImportXMLDataIntoSpreadsheetRequest.pm untested

filter: Statementstmt 0.0% 0 / 96 Branchbran 0.0% 0 / 22 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 134 CC 12 SCAR 43.3
CC
12
Cov
0%
run_http_request
156.0
new
2.0
BEGIN
2.0
CRAP 75.9
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::ImportXMLDataIntoSpreadsheetRequest;
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 # ImportXMLDataIntoSpreadsheetRequest.datafile : Upload data file. ,
64 # ImportXMLDataIntoSpreadsheetRequest.Spreadsheet : Upload spreadsheet file. ,
65 # ImportXMLDataIntoSpreadsheetRequest.worksheet : Need to import XML data into the worksheet. ,
66 # ImportXMLDataIntoSpreadsheetRequest.startcell : Starting position for data import ,
67 # ImportXMLDataIntoSpreadsheetRequest.insert : Controls the insertion behavior. true: inserts data; false: overwrites existing data. ,
68 # ImportXMLDataIntoSpreadsheetRequest.outPath : (Optional) The folder path where the workbook is stored. The default is null. ,
69 # ImportXMLDataIntoSpreadsheetRequest.outStorageName : Output file Storage Name. ,
70 # ImportXMLDataIntoSpreadsheetRequest.fontsLocation : Use Custom fonts. ,
71 # ImportXMLDataIntoSpreadsheetRequest.region : The spreadsheet region setting. ,
72 # ImportXMLDataIntoSpreadsheetRequest.password : The password for opening spreadsheet file.
73
74 {
75 my $params = {
76 'client' =>{
77 data_type => 'ApiClient',
78 description => 'API Client.',
79 required => '0',
80 }
81 };
82 __PACKAGE__->method_documentation->{ 'import_xml_data_into_spreadsheet' } = {
83 summary => 'Import XML data file into the local spreadsheet.',
84 params => $params,
85 returns => 'string',
86 };
87 }
88
89 sub run_http_request {
90 my ($self, %args) = @_;
91
92 my $client = $args{'client'};
93
94 # parse inputs
95 my $_resource_path = 'v4.0/cells/import/data/xml';
96
97 my $_method = 'PUT';
98 my $query_params = {};
99 my $header_params = {};
100 my $form_params = {};
101
102
103 my $_header_accept = $client->select_header_accept('application/json');
104 if ($_header_accept) {
105 $header_params->{'Accept'} = $_header_accept;
106 }
107 $header_params->{'Content-Type'} = $client->select_header_content_type('multipart/form-data');
108
109 if(defined $self->worksheet){
110 $query_params->{'worksheet'} = $client->to_query_value($self->worksheet);
111 }
112
113 if(defined $self->startcell){
114 $query_params->{'startcell'} = $client->to_query_value($self->startcell);
115 }
116
117 if(defined $self->insert){
118 $query_params->{'insert'} = $client->to_query_value($self->insert);
119 }
120
121 if(defined $self->out_path){
122 $query_params->{'outPath'} = $client->to_query_value($self->out_path);
123 }
124
125 if(defined $self->out_storage_name){
126 $query_params->{'outStorageName'} = $client->to_query_value($self->out_storage_name);
127 }
128
129 if(defined $self->fonts_location){
130 $query_params->{'fontsLocation'} = $client->to_query_value($self->fonts_location);
131 }
132
133 if(defined $self->region){
134 $query_params->{'region'} = $client->to_query_value($self->region);
135 }
136
137 if(defined $self->password){
138 $query_params->{'password'} = $client->to_query_value($self->password);
139 }
140 my $_body_data;
141
142
143 if (defined $self->datafile) {
144 $form_params->{basename($self->datafile)} = [$self->datafile ,basename($self->datafile),'application/octet-stream'];
145 }
146
147
148 if (defined $self->spreadsheet) {
149 $form_params->{basename($self->spreadsheet)} = [$self->spreadsheet ,basename($self->spreadsheet),'application/octet-stream'];
150 }
151
152
153 # authentication setting, if any
154 my $auth_settings = [qw()];
155
156 # make the API Call
157 my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings);
158 return $response;
159 }
160
161
162 __PACKAGE__->method_documentation({
163 'datafile' => {
164 datatype => 'string',
165 base_name => 'datafile',
166 description => 'Upload data file.',
167 format => '',
168 read_only => '',
169 },
170 'spreadsheet' => {
171 datatype => 'string',
172 base_name => 'Spreadsheet',
173 description => 'Upload spreadsheet file.',
174 format => '',
175 read_only => '',
176 },
177 'worksheet' => {
178 datatype => 'string',
179 base_name => 'worksheet',
180 description => 'Need to import XML data into the worksheet.',
181 format => '',
182 read_only => '',
183 },
184 'startcell' => {
185 datatype => 'string',
186 base_name => 'startcell',
187 description => 'Starting position for data import',
188 format => '',
189 read_only => '',
190 },
191 'insert' => {
192 datatype => 'string',
193 base_name => 'insert',
194 description => 'Controls the insertion behavior. true: inserts data; false: overwrites existing data.',
195 format => '',
196 read_only => '',
197 },
198 'out_path' => {
199 datatype => 'string',
200 base_name => 'outPath',
201 description => '(Optional) The folder path where the workbook is stored. The default is null.',
202 format => '',
203 read_only => '',
204 },
205 'out_storage_name' => {
206 datatype => 'string',
207 base_name => 'outStorageName',
208 description => 'Output file Storage Name.',
209 format => '',
210 read_only => '',
211 },
212 'fonts_location' => {
213 datatype => 'string',
214 base_name => 'fontsLocation',
215 description => 'Use Custom fonts.',
216 format => '',
217 read_only => '',
218 },
219 'region' => {
220 datatype => 'string',
221 base_name => 'region',
222 description => 'The spreadsheet region setting.',
223 format => '',
224 read_only => '',
225 },
226 'password' => {
227 datatype => 'string',
228 base_name => 'password',
229 description => 'The password for opening spreadsheet file.',
230 format => '',
231 read_only => '',
232 },
233 });
234
235
236 __PACKAGE__->attribute_map( {
237 'datafile' => 'datafile',
238 'spreadsheet' => 'Spreadsheet',
239 'worksheet' => 'worksheet',
240 'startcell' => 'startcell',
241 'insert' => 'insert',
242 'out_path' => 'outPath',
243 'out_storage_name' => 'outStorageName',
244 'fonts_location' => 'fontsLocation',
245 'region' => 'region',
246 'password' => 'password'
247 } );
248
249 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
250
251
252 1;