| 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::PutWorksheetIconFilterRequest; | ||
| 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 | # PutWorksheetIconFilterRequest.name : The file name. , | ||
| 64 | # PutWorksheetIconFilterRequest.sheetName : The worksheet name. , | ||
| 65 | # PutWorksheetIconFilterRequest.range : Represents the range to which the specified AutoFilter applies. , | ||
| 66 | # PutWorksheetIconFilterRequest.fieldIndex : The integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0). , | ||
| 67 | # PutWorksheetIconFilterRequest.iconSetType : The icon set type. , | ||
| 68 | # PutWorksheetIconFilterRequest.iconId : The icon id. , | ||
| 69 | # PutWorksheetIconFilterRequest.matchBlanks : Match all blank cell in the list. , | ||
| 70 | # PutWorksheetIconFilterRequest.refresh : Refresh auto filters to hide or unhide the rows. , | ||
| 71 | # PutWorksheetIconFilterRequest.folder : The folder where the file is situated. , | ||
| 72 | # PutWorksheetIconFilterRequest.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_icon_filter' } = { | ||
| 83 | summary => 'Add an icon filter 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}/autoFilter/iconFilter'; | ||
| 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 | if(defined $self->range){ | ||
| 120 | $query_params->{'range'} = $client->to_query_value($self->range); | ||
| 121 | } | ||
| 122 | |||
| 123 | if(defined $self->field_index){ | ||
| 124 | $query_params->{'fieldIndex'} = $client->to_query_value($self->field_index); | ||
| 125 | } | ||
| 126 | |||
| 127 | if(defined $self->icon_set_type){ | ||
| 128 | $query_params->{'iconSetType'} = $client->to_query_value($self->icon_set_type); | ||
| 129 | } | ||
| 130 | |||
| 131 | if(defined $self->icon_id){ | ||
| 132 | $query_params->{'iconId'} = $client->to_query_value($self->icon_id); | ||
| 133 | } | ||
| 134 | |||
| 135 | if(defined $self->match_blanks){ | ||
| 136 | $query_params->{'matchBlanks'} = $client->to_query_value($self->match_blanks); | ||
| 137 | } | ||
| 138 | |||
| 139 | if(defined $self->refresh){ | ||
| 140 | $query_params->{'refresh'} = $client->to_query_value($self->refresh); | ||
| 141 | } | ||
| 142 | |||
| 143 | if(defined $self->folder){ | ||
| 144 | $query_params->{'folder'} = $client->to_query_value($self->folder); | ||
| 145 | } | ||
| 146 | |||
| 147 | if(defined $self->storage_name){ | ||
| 148 | $query_params->{'storageName'} = $client->to_query_value($self->storage_name); | ||
| 149 | } | ||
| 150 | my $_body_data; | ||
| 151 | |||
| 152 | |||
| 153 | |||
| 154 | # authentication setting, if any | ||
| 155 | my $auth_settings = [qw()]; | ||
| 156 | |||
| 157 | # make the API Call | ||
| 158 | my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); | ||
| 159 | return $response; | ||
| 160 | } | ||
| 161 | |||
| 162 | |||
| 163 | __PACKAGE__->method_documentation({ | ||
| 164 | 'name' => { | ||
| 165 | datatype => 'string', | ||
| 166 | base_name => 'name', | ||
| 167 | description => 'The file name.', | ||
| 168 | format => '', | ||
| 169 | read_only => '', | ||
| 170 | }, | ||
| 171 | 'sheet_name' => { | ||
| 172 | datatype => 'string', | ||
| 173 | base_name => 'sheetName', | ||
| 174 | description => 'The worksheet name.', | ||
| 175 | format => '', | ||
| 176 | read_only => '', | ||
| 177 | }, | ||
| 178 | 'range' => { | ||
| 179 | datatype => 'string', | ||
| 180 | base_name => 'range', | ||
| 181 | description => 'Represents the range to which the specified AutoFilter applies.', | ||
| 182 | format => '', | ||
| 183 | read_only => '', | ||
| 184 | }, | ||
| 185 | 'field_index' => { | ||
| 186 | datatype => 'int', | ||
| 187 | base_name => 'fieldIndex', | ||
| 188 | description => 'The integer offset of the field on which you want to base the filter (from the left of the list; the leftmost field is field 0).', | ||
| 189 | format => '', | ||
| 190 | read_only => '', | ||
| 191 | }, | ||
| 192 | 'icon_set_type' => { | ||
| 193 | datatype => 'string', | ||
| 194 | base_name => 'iconSetType', | ||
| 195 | description => 'The icon set type.', | ||
| 196 | format => '', | ||
| 197 | read_only => '', | ||
| 198 | }, | ||
| 199 | 'icon_id' => { | ||
| 200 | datatype => 'int', | ||
| 201 | base_name => 'iconId', | ||
| 202 | description => 'The icon id.', | ||
| 203 | format => '', | ||
| 204 | read_only => '', | ||
| 205 | }, | ||
| 206 | 'match_blanks' => { | ||
| 207 | datatype => 'string', | ||
| 208 | base_name => 'matchBlanks', | ||
| 209 | description => 'Match all blank cell in the list.', | ||
| 210 | format => '', | ||
| 211 | read_only => '', | ||
| 212 | }, | ||
| 213 | 'refresh' => { | ||
| 214 | datatype => 'string', | ||
| 215 | base_name => 'refresh', | ||
| 216 | description => 'Refresh auto filters to hide or unhide the rows.', | ||
| 217 | format => '', | ||
| 218 | read_only => '', | ||
| 219 | }, | ||
| 220 | 'folder' => { | ||
| 221 | datatype => 'string', | ||
| 222 | base_name => 'folder', | ||
| 223 | description => 'The folder where the file is situated.', | ||
| 224 | format => '', | ||
| 225 | read_only => '', | ||
| 226 | }, | ||
| 227 | 'storage_name' => { | ||
| 228 | datatype => 'string', | ||
| 229 | base_name => 'storageName', | ||
| 230 | description => 'The storage name where the file is situated.', | ||
| 231 | format => '', | ||
| 232 | read_only => '', | ||
| 233 | }, | ||
| 234 | }); | ||
| 235 | |||
| 236 | |||
| 237 | __PACKAGE__->attribute_map( { | ||
| 238 | 'name' => 'name', | ||
| 239 | 'sheet_name' => 'sheetName', | ||
| 240 | 'range' => 'range', | ||
| 241 | 'field_index' => 'fieldIndex', | ||
| 242 | 'icon_set_type' => 'iconSetType', | ||
| 243 | 'icon_id' => 'iconId', | ||
| 244 | 'match_blanks' => 'matchBlanks', | ||
| 245 | 'refresh' => 'refresh', | ||
| 246 | 'folder' => 'folder', | ||
| 247 | 'storage_name' => 'storageName' | ||
| 248 | } ); | ||
| 249 | |||
| 250 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 251 | |||
| 252 | |||
| 253 | 1; |