« Request/PutWorksheetCommentRequest.pm
↑ Summary
Request/PutWorksheetFormatConditionAreaRequest.pm »
| 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::PutWorksheetConditionalFormattingRequest; | ||
| 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 | # PutWorksheetConditionalFormattingRequest.name : The file name. , | ||
| 64 | # PutWorksheetConditionalFormattingRequest.sheetName : The worksheet name. , | ||
| 65 | # PutWorksheetConditionalFormattingRequest.formatcondition : , | ||
| 66 | # PutWorksheetConditionalFormattingRequest.cellArea : Adds a conditional formatted cell range. , | ||
| 67 | # PutWorksheetConditionalFormattingRequest.folder : The folder where the file is situated. , | ||
| 68 | # PutWorksheetConditionalFormattingRequest.storageName : The storage name where the file is situated. | ||
| 69 | |||
| 70 | { | ||
| 71 | my $params = { | ||
| 72 | 'client' =>{ | ||
| 73 | data_type => 'ApiClient', | ||
| 74 | description => 'API Client.', | ||
| 75 | required => '0', | ||
| 76 | } | ||
| 77 | }; | ||
| 78 | __PACKAGE__->method_documentation->{ 'put_worksheet_conditional_formatting' } = { | ||
| 79 | summary => 'Add conditional formatting in the worksheet.', | ||
| 80 | params => $params, | ||
| 81 | returns => 'CellsCloudResponse', | ||
| 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/{name}/worksheets/{sheetName}/conditionalFormattings'; | ||
| 92 | |||
| 93 | my $_method = 'PUT'; | ||
| 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('application/json'); | ||
| 104 | if(defined $self->name){ | ||
| 105 | my $_base_variable = "{" . "name" . "}"; | ||
| 106 | my $_base_value = $client->to_path_value($self->name); | ||
| 107 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 108 | } | ||
| 109 | |||
| 110 | if(defined $self->sheet_name){ | ||
| 111 | my $_base_variable = "{" . "sheetName" . "}"; | ||
| 112 | my $_base_value = $client->to_path_value($self->sheet_name); | ||
| 113 | $_resource_path =~ s/$_base_variable/$_base_value/g; | ||
| 114 | } | ||
| 115 | if(defined $self->cell_area){ | ||
| 116 | $query_params->{'cellArea'} = $client->to_query_value($self->cell_area); | ||
| 117 | } | ||
| 118 | |||
| 119 | if(defined $self->folder){ | ||
| 120 | $query_params->{'folder'} = $client->to_query_value($self->folder); | ||
| 121 | } | ||
| 122 | |||
| 123 | if(defined $self->storage_name){ | ||
| 124 | $query_params->{'storageName'} = $client->to_query_value($self->storage_name); | ||
| 125 | } | ||
| 126 | my $_body_data; | ||
| 127 | |||
| 128 | |||
| 129 | # body params | ||
| 130 | if (defined $self->formatcondition) { | ||
| 131 | $_body_data = JSON->new->convert_blessed->encode( $self->formatcondition); | ||
| 132 | } | ||
| 133 | |||
| 134 | |||
| 135 | |||
| 136 | # authentication setting, if any | ||
| 137 | my $auth_settings = [qw()]; | ||
| 138 | |||
| 139 | # make the API Call | ||
| 140 | my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); | ||
| 141 | return $response; | ||
| 142 | } | ||
| 143 | |||
| 144 | |||
| 145 | __PACKAGE__->method_documentation({ | ||
| 146 | 'name' => { | ||
| 147 | datatype => 'string', | ||
| 148 | base_name => 'name', | ||
| 149 | description => 'The file name.', | ||
| 150 | format => '', | ||
| 151 | read_only => '', | ||
| 152 | }, | ||
| 153 | 'sheet_name' => { | ||
| 154 | datatype => 'string', | ||
| 155 | base_name => 'sheetName', | ||
| 156 | description => 'The worksheet name.', | ||
| 157 | format => '', | ||
| 158 | read_only => '', | ||
| 159 | }, | ||
| 160 | 'formatcondition' => { | ||
| 161 | datatype => 'FormatCondition', | ||
| 162 | base_name => 'formatcondition', | ||
| 163 | description => '', | ||
| 164 | format => '', | ||
| 165 | read_only => '', | ||
| 166 | }, | ||
| 167 | 'cell_area' => { | ||
| 168 | datatype => 'string', | ||
| 169 | base_name => 'cellArea', | ||
| 170 | description => 'Adds a conditional formatted cell range.', | ||
| 171 | format => '', | ||
| 172 | read_only => '', | ||
| 173 | }, | ||
| 174 | 'folder' => { | ||
| 175 | datatype => 'string', | ||
| 176 | base_name => 'folder', | ||
| 177 | description => 'The folder where the file is situated.', | ||
| 178 | format => '', | ||
| 179 | read_only => '', | ||
| 180 | }, | ||
| 181 | 'storage_name' => { | ||
| 182 | datatype => 'string', | ||
| 183 | base_name => 'storageName', | ||
| 184 | description => 'The storage name where the file is situated.', | ||
| 185 | format => '', | ||
| 186 | read_only => '', | ||
| 187 | }, | ||
| 188 | }); | ||
| 189 | |||
| 190 | |||
| 191 | __PACKAGE__->attribute_map( { | ||
| 192 | 'name' => 'name', | ||
| 193 | 'sheet_name' => 'sheetName', | ||
| 194 | 'formatcondition' => 'formatcondition', | ||
| 195 | 'cell_area' => 'cellArea', | ||
| 196 | 'folder' => 'folder', | ||
| 197 | 'storage_name' => 'storageName' | ||
| 198 | } ); | ||
| 199 | |||
| 200 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 201 | |||
| 202 | |||
| 203 | 1; |