Request/PostSplitRequest.pm untested

filter: Statementstmt 0.0% 0 / 89 Branchbran 0.0% 0 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 121 CC 9 SCAR 36.4
CC
9
Cov
0%
run_http_request
90.0
new
2.0
BEGIN
2.0
CRAP 38.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::PostSplitRequest;
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 # PostSplitRequest.File : File to upload ,
64 # PostSplitRequest.outFormat : The output data file format.(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 # PostSplitRequest.password : The password needed to open an Excel file. ,
66 # PostSplitRequest.from : sheet index ,
67 # PostSplitRequest.to : sheet index ,
68 # PostSplitRequest.checkExcelRestriction : Whether check restriction of excel file when user modify cells related objects. ,
69 # PostSplitRequest.region : The regional settings for workbook.
70
71 {
72 my $params = {
73 'client' =>{
74 data_type => 'ApiClient',
75 description => 'API Client.',
76 required => '0',
77 }
78 };
79 __PACKAGE__->method_documentation->{ 'post_split' } = {
80 summary => 'Split Excel spreadsheet files based on worksheets and create output files in various formats.',
81 params => $params,
82 returns => 'FilesResult',
83 };
84 }
85
86 sub run_http_request {
87 my ($self, %args) = @_;
88
89 my $client = $args{'client'};
90
91 # parse inputs
92 my $_resource_path = 'v3.0/cells/split';
93
94 my $_method = 'POST';
95 my $query_params = {};
96 my $header_params = {};
97 my $form_params = {};
98
99
100 my $_header_accept = $client->select_header_accept('application/json');
101 if ($_header_accept) {
102 $header_params->{'Accept'} = $_header_accept;
103 }
104 $header_params->{'Content-Type'} = $client->select_header_content_type('multipart/form-data');
105
106 if(defined $self->out_format){
107 $query_params->{'outFormat'} = $client->to_query_value($self->out_format);
108 }
109
110 if(defined $self->password){
111 $query_params->{'password'} = $client->to_query_value($self->password);
112 }
113
114 if(defined $self->from){
115 $query_params->{'from'} = $client->to_query_value($self->from);
116 }
117
118 if(defined $self->to){
119 $query_params->{'to'} = $client->to_query_value($self->to);
120 }
121
122 if(defined $self->check_excel_restriction){
123 $query_params->{'checkExcelRestriction'} = $client->to_query_value($self->check_excel_restriction);
124 }
125
126 if(defined $self->region){
127 $query_params->{'region'} = $client->to_query_value($self->region);
128 }
129 my $_body_data;
130
131
132 if (defined $self->file) {
133 $form_params->{basename($self->file)} = [$self->file ,basename($self->file),'application/octet-stream'];
134 }
135
136
137 # authentication setting, if any
138 my $auth_settings = [qw()];
139
140 # make the API Call
141 my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings);
142 return $response;
143 }
144
145
146 __PACKAGE__->method_documentation({
147 'file' => {
148 datatype => 'string',
149 base_name => 'File',
150 description => 'File to upload',
151 format => '',
152 read_only => '',
153 },
154 'out_format' => {
155 datatype => 'string',
156 base_name => 'outFormat',
157 description => 'The output data file format.(CSV/XLS/HTML/MHTML/ODS/PDF/XML/TXT/TIFF/XLSB/XLSM/XLSX/XLTM/XLTX/XPS/PNG/JPG/JPEG/GIF/EMF/BMP/MD[Markdown]/Numbers)',
158 format => '',
159 read_only => '',
160 },
161 'password' => {
162 datatype => 'string',
163 base_name => 'password',
164 description => 'The password needed to open an Excel file.',
165 format => '',
166 read_only => '',
167 },
168 'from' => {
169 datatype => 'int',
170 base_name => 'from',
171 description => 'sheet index',
172 format => '',
173 read_only => '',
174 },
175 'to' => {
176 datatype => 'int',
177 base_name => 'to',
178 description => 'sheet index',
179 format => '',
180 read_only => '',
181 },
182 'check_excel_restriction' => {
183 datatype => 'string',
184 base_name => 'checkExcelRestriction',
185 description => 'Whether check restriction of excel file when user modify cells related objects.',
186 format => '',
187 read_only => '',
188 },
189 'region' => {
190 datatype => 'string',
191 base_name => 'region',
192 description => 'The regional settings for workbook.',
193 format => '',
194 read_only => '',
195 },
196 });
197
198
199 __PACKAGE__->attribute_map( {
200 'file' => 'File',
201 'out_format' => 'outFormat',
202 'password' => 'password',
203 'from' => 'from',
204 'to' => 'to',
205 'check_excel_restriction' => 'checkExcelRestriction',
206 'region' => 'region'
207 } );
208
209 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
210
211
212 1;