Request/PostMergeRequest.pm untested

filter: Statementstmt 0.0% 0 / 90 Branchbran 0.0% 0 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 120 CC 8 SCAR 33.6
CC
8
Cov
0%
run_http_request
72.0
new
2.0
BEGIN
2.0
CRAP 28.7
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::PostMergeRequest;
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 # PostMergeRequest.File : File to upload ,
64 # PostMergeRequest.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 # PostMergeRequest.mergeToOneSheet : Merge all workbooks into a sheet. ,
66 # PostMergeRequest.password : The password needed to open an Excel file. ,
67 # PostMergeRequest.checkExcelRestriction : Whether check restriction of excel file when user modify cells related objects. ,
68 # PostMergeRequest.region : The regional settings for workbook.
69
70 {
71 my $params = {
72 'client' =>{
73 data_type => 'ApiClient',
74 description => 'API Client.',
75 required => '0',
76 }
77 };
78 __PACKAGE__->method_documentation->{ 'post_merge' } = {
79 summary => 'Merge cells in the worksheet.',
80 params => $params,
81 returns => 'FileInfo',
82 };
83 }
84
85 sub run_http_request {
86 my ($self, %args) = @_;
87
88 my $client = $args{'client'};
89
90 # parse inputs
91 my $_resource_path = 'v3.0/cells/merge';
92
93 my $_method = 'POST';
94 my $query_params = {};
95 my $header_params = {};
96 my $form_params = {};
97
98
99 my $_header_accept = $client->select_header_accept('application/json');
100 if ($_header_accept) {
101 $header_params->{'Accept'} = $_header_accept;
102 }
103 $header_params->{'Content-Type'} = $client->select_header_content_type('multipart/form-data');
104
105 if(defined $self->out_format){
106 $query_params->{'outFormat'} = $client->to_query_value($self->out_format);
107 }
108
109 if(defined $self->merge_to_one_sheet){
110 $query_params->{'mergeToOneSheet'} = $client->to_query_value($self->merge_to_one_sheet);
111 }
112
113 if(defined $self->password){
114 $query_params->{'password'} = $client->to_query_value($self->password);
115 }
116
117 if(defined $self->check_excel_restriction){
118 $query_params->{'checkExcelRestriction'} = $client->to_query_value($self->check_excel_restriction);
119 }
120
121 if(defined $self->region){
122 $query_params->{'region'} = $client->to_query_value($self->region);
123 }
124 my $_body_data;
125
126
127 if (defined $self->file) {
128 my $map_file = $self->file;
129 while ( my ($filename,$value) = each( %$map_file ) ) {
130 $form_params->{$filename} = [$value ,$filename,'application/octet-stream'];
131 }
132 }
133
134
135 # authentication setting, if any
136 my $auth_settings = [qw()];
137
138 # make the API Call
139 my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings);
140 return $response;
141 }
142
143
144 __PACKAGE__->method_documentation({
145 'file' => {
146 datatype => 'string',
147 base_name => 'File',
148 description => 'File to upload',
149 format => '',
150 read_only => '',
151 },
152 'out_format' => {
153 datatype => 'string',
154 base_name => 'outFormat',
155 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)',
156 format => '',
157 read_only => '',
158 },
159 'merge_to_one_sheet' => {
160 datatype => 'string',
161 base_name => 'mergeToOneSheet',
162 description => 'Merge all workbooks into a sheet.',
163 format => '',
164 read_only => '',
165 },
166 'password' => {
167 datatype => 'string',
168 base_name => 'password',
169 description => 'The password needed to open an Excel file.',
170 format => '',
171 read_only => '',
172 },
173 'check_excel_restriction' => {
174 datatype => 'string',
175 base_name => 'checkExcelRestriction',
176 description => 'Whether check restriction of excel file when user modify cells related objects.',
177 format => '',
178 read_only => '',
179 },
180 'region' => {
181 datatype => 'string',
182 base_name => 'region',
183 description => 'The regional settings for workbook.',
184 format => '',
185 read_only => '',
186 },
187 });
188
189
190 __PACKAGE__->attribute_map( {
191 'file' => 'File',
192 'out_format' => 'outFormat',
193 'merge_to_one_sheet' => 'mergeToOneSheet',
194 'password' => 'password',
195 'check_excel_restriction' => 'checkExcelRestriction',
196 'region' => 'region'
197 } );
198
199 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
200
201
202 1;