Request/PutPivotTableFieldRequest.pm untested

filter: Statementstmt 0.0% 0 / 96 Branchbran 0.0% 0 / 18 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 130 CC 10 SCAR 38.9
CC
10
Cov
0%
run_http_request
110.0
new
2.0
BEGIN
2.0
CRAP 49.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::PutPivotTableFieldRequest;
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 # PutPivotTableFieldRequest.name : The file name. ,
64 # PutPivotTableFieldRequest.sheetName : The worksheet name. ,
65 # PutPivotTableFieldRequest.pivotTableIndex : The PivotTable index. ,
66 # PutPivotTableFieldRequest.pivotFieldType : The fields area type. ,
67 # PutPivotTableFieldRequest.pivotTableFieldRequest : PivotTableFieldRequest The PivotTable field request. ,
68 # PutPivotTableFieldRequest.needReCalculate : Whether the specific PivotTable calculate(true/false). ,
69 # PutPivotTableFieldRequest.folder : The folder where the file is situated. ,
70 # PutPivotTableFieldRequest.storageName : The storage name where the file is situated.
71
72 {
73 my $params = {
74 'client' =>{
75 data_type => 'ApiClient',
76 description => 'API Client.',
77 required => '0',
78 }
79 };
80 __PACKAGE__->method_documentation->{ 'put_pivot_table_field' } = {
81 summary => 'Add a pivot field in the PivotTable.',
82 params => $params,
83 returns => 'CellsCloudResponse',
84 };
85 }
86
87 sub run_http_request {
88 my ($self, %args) = @_;
89
90 my $client = $args{'client'};
91
92 # parse inputs
93 my $_resource_path = 'v3.0/cells/{name}/worksheets/{sheetName}/pivottables/{pivotTableIndex}/PivotField';
94
95 my $_method = 'PUT';
96 my $query_params = {};
97 my $header_params = {};
98 my $form_params = {};
99
100
101 my $_header_accept = $client->select_header_accept('application/json');
102 if ($_header_accept) {
103 $header_params->{'Accept'} = $_header_accept;
104 }
105 $header_params->{'Content-Type'} = $client->select_header_content_type('application/json');
106 if(defined $self->name){
107 my $_base_variable = "{" . "name" . "}";
108 my $_base_value = $client->to_path_value($self->name);
109 $_resource_path =~ s/$_base_variable/$_base_value/g;
110 }
111
112 if(defined $self->sheet_name){
113 my $_base_variable = "{" . "sheetName" . "}";
114 my $_base_value = $client->to_path_value($self->sheet_name);
115 $_resource_path =~ s/$_base_variable/$_base_value/g;
116 }
117
118 if(defined $self->pivot_table_index){
119 my $_base_variable = "{" . "pivotTableIndex" . "}";
120 my $_base_value = $client->to_path_value($self->pivot_table_index);
121 $_resource_path =~ s/$_base_variable/$_base_value/g;
122 }
123 if(defined $self->pivot_field_type){
124 $query_params->{'pivotFieldType'} = $client->to_query_value($self->pivot_field_type);
125 }
126
127 if(defined $self->need_re_calculate){
128 $query_params->{'needReCalculate'} = $client->to_query_value($self->need_re_calculate);
129 }
130
131 if(defined $self->folder){
132 $query_params->{'folder'} = $client->to_query_value($self->folder);
133 }
134
135 if(defined $self->storage_name){
136 $query_params->{'storageName'} = $client->to_query_value($self->storage_name);
137 }
138 my $_body_data;
139
140
141 # body params
142 if (defined $self->pivot_table_field_request) {
143 $_body_data = JSON->new->convert_blessed->encode( $self->pivot_table_field_request);
144 }
145
146
147
148 # authentication setting, if any
149 my $auth_settings = [qw()];
150
151 # make the API Call
152 my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings);
153 return $response;
154 }
155
156
157 __PACKAGE__->method_documentation({
158 'name' => {
159 datatype => 'string',
160 base_name => 'name',
161 description => 'The file name.',
162 format => '',
163 read_only => '',
164 },
165 'sheet_name' => {
166 datatype => 'string',
167 base_name => 'sheetName',
168 description => 'The worksheet name.',
169 format => '',
170 read_only => '',
171 },
172 'pivot_table_index' => {
173 datatype => 'int',
174 base_name => 'pivotTableIndex',
175 description => 'The PivotTable index.',
176 format => '',
177 read_only => '',
178 },
179 'pivot_field_type' => {
180 datatype => 'string',
181 base_name => 'pivotFieldType',
182 description => 'The fields area type.',
183 format => '',
184 read_only => '',
185 },
186 'pivot_table_field_request' => {
187 datatype => 'PivotTableFieldRequest',
188 base_name => 'pivotTableFieldRequest',
189 description => 'PivotTableFieldRequest The PivotTable field request.',
190 format => '',
191 read_only => '',
192 },
193 'need_re_calculate' => {
194 datatype => 'string',
195 base_name => 'needReCalculate',
196 description => 'Whether the specific PivotTable calculate(true/false).',
197 format => '',
198 read_only => '',
199 },
200 'folder' => {
201 datatype => 'string',
202 base_name => 'folder',
203 description => 'The folder where the file is situated.',
204 format => '',
205 read_only => '',
206 },
207 'storage_name' => {
208 datatype => 'string',
209 base_name => 'storageName',
210 description => 'The storage name where the file is situated.',
211 format => '',
212 read_only => '',
213 },
214 });
215
216
217 __PACKAGE__->attribute_map( {
218 'name' => 'name',
219 'sheet_name' => 'sheetName',
220 'pivot_table_index' => 'pivotTableIndex',
221 'pivot_field_type' => 'pivotFieldType',
222 'pivot_table_field_request' => 'pivotTableFieldRequest',
223 'need_re_calculate' => 'needReCalculate',
224 'folder' => 'folder',
225 'storage_name' => 'storageName'
226 } );
227
228 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
229
230
231 1;