Request/PutWorksheetFormatConditionRequest.pm untested

filter: Statementstmt 0.0% 0 / 100 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 / 138 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::PutWorksheetFormatConditionRequest;
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 # PutWorksheetFormatConditionRequest.name : The file name. ,
64 # PutWorksheetFormatConditionRequest.sheetName : The worksheet name. ,
65 # PutWorksheetFormatConditionRequest.index : Gets the Conditional Formatting element at the specified index. ,
66 # PutWorksheetFormatConditionRequest.cellArea : Adds a conditional formatted cell range. ,
67 # PutWorksheetFormatConditionRequest.type : Format condition type(CellValue/Expression/ColorScale/DataBar/IconSet/Top10/UniqueValues/DuplicateValues/ContainsText/NotContainsText/BeginsWith/EndsWith/ContainsBlanks/NotContainsBlanks/ContainsErrors/NotContainsErrors/TimePeriod/AboveAverage). ,
68 # PutWorksheetFormatConditionRequest.operatorType : Represents the operator type of conditional format and data validation(Between/Equal/GreaterThan/GreaterOrEqual/LessThan/None/NotBetween/NotEqual). ,
69 # PutWorksheetFormatConditionRequest.formula1 : The value or expression associated with conditional formatting. ,
70 # PutWorksheetFormatConditionRequest.formula2 : The value or expression associated with conditional formatting. ,
71 # PutWorksheetFormatConditionRequest.folder : The folder where the file is situated. ,
72 # PutWorksheetFormatConditionRequest.storageName : The storage name where the file is situated.
73
74 {
75 my $params = {
76 'client' =>{
77 data_type => 'ApiClient',
78 description => 'API Client.',
79 required => '0',
80 }
81 };
82 __PACKAGE__->method_documentation->{ 'put_worksheet_format_condition' } = {
83 summary => 'Add a format condition in the worksheet.',
84 params => $params,
85 returns => 'CellsCloudResponse',
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 = 'v3.0/cells/{name}/worksheets/{sheetName}/conditionalFormattings/{index}';
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('application/json');
108 if(defined $self->name){
109 my $_base_variable = "{" . "name" . "}";
110 my $_base_value = $client->to_path_value($self->name);
111 $_resource_path =~ s/$_base_variable/$_base_value/g;
112 }
113
114 if(defined $self->sheet_name){
115 my $_base_variable = "{" . "sheetName" . "}";
116 my $_base_value = $client->to_path_value($self->sheet_name);
117 $_resource_path =~ s/$_base_variable/$_base_value/g;
118 }
119
120 if(defined $self->index){
121 my $_base_variable = "{" . "index" . "}";
122 my $_base_value = $client->to_path_value($self->index);
123 $_resource_path =~ s/$_base_variable/$_base_value/g;
124 }
125 if(defined $self->cell_area){
126 $query_params->{'cellArea'} = $client->to_query_value($self->cell_area);
127 }
128
129 if(defined $self->type){
130 $query_params->{'type'} = $client->to_query_value($self->type);
131 }
132
133 if(defined $self->operator_type){
134 $query_params->{'operatorType'} = $client->to_query_value($self->operator_type);
135 }
136
137 if(defined $self->formula1){
138 $query_params->{'formula1'} = $client->to_query_value($self->formula1);
139 }
140
141 if(defined $self->formula2){
142 $query_params->{'formula2'} = $client->to_query_value($self->formula2);
143 }
144
145 if(defined $self->folder){
146 $query_params->{'folder'} = $client->to_query_value($self->folder);
147 }
148
149 if(defined $self->storage_name){
150 $query_params->{'storageName'} = $client->to_query_value($self->storage_name);
151 }
152 my $_body_data;
153
154
155
156 # authentication setting, if any
157 my $auth_settings = [qw()];
158
159 # make the API Call
160 my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings);
161 return $response;
162 }
163
164
165 __PACKAGE__->method_documentation({
166 'name' => {
167 datatype => 'string',
168 base_name => 'name',
169 description => 'The file name.',
170 format => '',
171 read_only => '',
172 },
173 'sheet_name' => {
174 datatype => 'string',
175 base_name => 'sheetName',
176 description => 'The worksheet name.',
177 format => '',
178 read_only => '',
179 },
180 'index' => {
181 datatype => 'int',
182 base_name => 'index',
183 description => 'Gets the Conditional Formatting element at the specified index.',
184 format => '',
185 read_only => '',
186 },
187 'cell_area' => {
188 datatype => 'string',
189 base_name => 'cellArea',
190 description => 'Adds a conditional formatted cell range.',
191 format => '',
192 read_only => '',
193 },
194 'type' => {
195 datatype => 'string',
196 base_name => 'type',
197 description => 'Format condition type(CellValue/Expression/ColorScale/DataBar/IconSet/Top10/UniqueValues/DuplicateValues/ContainsText/NotContainsText/BeginsWith/EndsWith/ContainsBlanks/NotContainsBlanks/ContainsErrors/NotContainsErrors/TimePeriod/AboveAverage).',
198 format => '',
199 read_only => '',
200 },
201 'operator_type' => {
202 datatype => 'string',
203 base_name => 'operatorType',
204 description => 'Represents the operator type of conditional format and data validation(Between/Equal/GreaterThan/GreaterOrEqual/LessThan/None/NotBetween/NotEqual).',
205 format => '',
206 read_only => '',
207 },
208 'formula1' => {
209 datatype => 'string',
210 base_name => 'formula1',
211 description => 'The value or expression associated with conditional formatting.',
212 format => '',
213 read_only => '',
214 },
215 'formula2' => {
216 datatype => 'string',
217 base_name => 'formula2',
218 description => 'The value or expression associated with conditional formatting.',
219 format => '',
220 read_only => '',
221 },
222 'folder' => {
223 datatype => 'string',
224 base_name => 'folder',
225 description => 'The folder where the file is situated.',
226 format => '',
227 read_only => '',
228 },
229 'storage_name' => {
230 datatype => 'string',
231 base_name => 'storageName',
232 description => 'The storage name where the file is situated.',
233 format => '',
234 read_only => '',
235 },
236 });
237
238
239 __PACKAGE__->attribute_map( {
240 'name' => 'name',
241 'sheet_name' => 'sheetName',
242 'index' => 'index',
243 'cell_area' => 'cellArea',
244 'type' => 'type',
245 'operator_type' => 'operatorType',
246 'formula1' => 'formula1',
247 'formula2' => 'formula2',
248 'folder' => 'folder',
249 'storage_name' => 'storageName'
250 } );
251
252 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
253
254
255 1;