| 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::RemoveDuplicateSubstringsRequest; | ||
| 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 | # RemoveDuplicateSubstringsRequest.Spreadsheet : Upload spreadsheet file. , | ||
| 64 | # RemoveDuplicateSubstringsRequest.delimiters : comma, semicolon, space, tab, line-break , | ||
| 65 | # RemoveDuplicateSubstringsRequest.treatConsecutiveDelimitersAsOne : collapse adjacent delimiters into a single separator. , | ||
| 66 | # RemoveDuplicateSubstringsRequest.caseSensitive : , | ||
| 67 | # RemoveDuplicateSubstringsRequest.worksheet : , | ||
| 68 | # RemoveDuplicateSubstringsRequest.range : , | ||
| 69 | # RemoveDuplicateSubstringsRequest.outPath : (Optional) The folder path where the workbook is stored. The default is null. , | ||
| 70 | # RemoveDuplicateSubstringsRequest.outStorageName : Output file Storage Name. , | ||
| 71 | # RemoveDuplicateSubstringsRequest.region : The spreadsheet region setting. , | ||
| 72 | # RemoveDuplicateSubstringsRequest.password : The password for opening spreadsheet file. | ||
| 73 | |||
| 74 | { | ||
| 75 | my $params = { | ||
| 76 | 'client' =>{ | ||
| 77 | data_type => 'ApiClient', | ||
| 78 | description => 'API Client.', | ||
| 79 | required => '0', | ||
| 80 | } | ||
| 81 | }; | ||
| 82 | __PACKAGE__->method_documentation->{ 'remove_duplicate_substrings' } = { | ||
| 83 | summary => 'Finds and removes repeated substrings inside every cell of the chosen range, using user-defined or preset delimiters, while preserving formulas, formatting and data-validation.', | ||
| 84 | params => $params, | ||
| 85 | returns => 'string', | ||
| 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 = 'v4.0/cells/content/remove/duplicate-substrings'; | ||
| 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('multipart/form-data'); | ||
| 108 | |||
| 109 | if(defined $self->delimiters){ | ||
| 110 | $query_params->{'delimiters'} = $client->to_query_value($self->delimiters); | ||
| 111 | } | ||
| 112 | |||
| 113 | if(defined $self->treat_consecutive_delimiters_as_one){ | ||
| 114 | $query_params->{'treatConsecutiveDelimitersAsOne'} = $client->to_query_value($self->treat_consecutive_delimiters_as_one); | ||
| 115 | } | ||
| 116 | |||
| 117 | if(defined $self->case_sensitive){ | ||
| 118 | $query_params->{'caseSensitive'} = $client->to_query_value($self->case_sensitive); | ||
| 119 | } | ||
| 120 | |||
| 121 | if(defined $self->worksheet){ | ||
| 122 | $query_params->{'worksheet'} = $client->to_query_value($self->worksheet); | ||
| 123 | } | ||
| 124 | |||
| 125 | if(defined $self->range){ | ||
| 126 | $query_params->{'range'} = $client->to_query_value($self->range); | ||
| 127 | } | ||
| 128 | |||
| 129 | if(defined $self->out_path){ | ||
| 130 | $query_params->{'outPath'} = $client->to_query_value($self->out_path); | ||
| 131 | } | ||
| 132 | |||
| 133 | if(defined $self->out_storage_name){ | ||
| 134 | $query_params->{'outStorageName'} = $client->to_query_value($self->out_storage_name); | ||
| 135 | } | ||
| 136 | |||
| 137 | if(defined $self->region){ | ||
| 138 | $query_params->{'region'} = $client->to_query_value($self->region); | ||
| 139 | } | ||
| 140 | |||
| 141 | if(defined $self->password){ | ||
| 142 | $query_params->{'password'} = $client->to_query_value($self->password); | ||
| 143 | } | ||
| 144 | my $_body_data; | ||
| 145 | |||
| 146 | |||
| 147 | if (defined $self->spreadsheet) { | ||
| 148 | $form_params->{basename($self->spreadsheet)} = [$self->spreadsheet ,basename($self->spreadsheet),'application/octet-stream']; | ||
| 149 | } | ||
| 150 | |||
| 151 | |||
| 152 | # authentication setting, if any | ||
| 153 | my $auth_settings = [qw()]; | ||
| 154 | |||
| 155 | # make the API Call | ||
| 156 | my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); | ||
| 157 | return $response; | ||
| 158 | } | ||
| 159 | |||
| 160 | |||
| 161 | __PACKAGE__->method_documentation({ | ||
| 162 | 'spreadsheet' => { | ||
| 163 | datatype => 'string', | ||
| 164 | base_name => 'Spreadsheet', | ||
| 165 | description => 'Upload spreadsheet file.', | ||
| 166 | format => '', | ||
| 167 | read_only => '', | ||
| 168 | }, | ||
| 169 | 'delimiters' => { | ||
| 170 | datatype => 'string', | ||
| 171 | base_name => 'delimiters', | ||
| 172 | description => 'comma, semicolon, space, tab, line-break ', | ||
| 173 | format => '', | ||
| 174 | read_only => '', | ||
| 175 | }, | ||
| 176 | 'treat_consecutive_delimiters_as_one' => { | ||
| 177 | datatype => 'string', | ||
| 178 | base_name => 'treatConsecutiveDelimitersAsOne', | ||
| 179 | description => 'collapse adjacent delimiters into a single separator.', | ||
| 180 | format => '', | ||
| 181 | read_only => '', | ||
| 182 | }, | ||
| 183 | 'case_sensitive' => { | ||
| 184 | datatype => 'string', | ||
| 185 | base_name => 'caseSensitive', | ||
| 186 | description => '', | ||
| 187 | format => '', | ||
| 188 | read_only => '', | ||
| 189 | }, | ||
| 190 | 'worksheet' => { | ||
| 191 | datatype => 'string', | ||
| 192 | base_name => 'worksheet', | ||
| 193 | description => '', | ||
| 194 | format => '', | ||
| 195 | read_only => '', | ||
| 196 | }, | ||
| 197 | 'range' => { | ||
| 198 | datatype => 'string', | ||
| 199 | base_name => 'range', | ||
| 200 | description => '', | ||
| 201 | format => '', | ||
| 202 | read_only => '', | ||
| 203 | }, | ||
| 204 | 'out_path' => { | ||
| 205 | datatype => 'string', | ||
| 206 | base_name => 'outPath', | ||
| 207 | description => '(Optional) The folder path where the workbook is stored. The default is null.', | ||
| 208 | format => '', | ||
| 209 | read_only => '', | ||
| 210 | }, | ||
| 211 | 'out_storage_name' => { | ||
| 212 | datatype => 'string', | ||
| 213 | base_name => 'outStorageName', | ||
| 214 | description => 'Output file Storage Name.', | ||
| 215 | format => '', | ||
| 216 | read_only => '', | ||
| 217 | }, | ||
| 218 | 'region' => { | ||
| 219 | datatype => 'string', | ||
| 220 | base_name => 'region', | ||
| 221 | description => 'The spreadsheet region setting.', | ||
| 222 | format => '', | ||
| 223 | read_only => '', | ||
| 224 | }, | ||
| 225 | 'password' => { | ||
| 226 | datatype => 'string', | ||
| 227 | base_name => 'password', | ||
| 228 | description => 'The password for opening spreadsheet file.', | ||
| 229 | format => '', | ||
| 230 | read_only => '', | ||
| 231 | }, | ||
| 232 | }); | ||
| 233 | |||
| 234 | |||
| 235 | __PACKAGE__->attribute_map( { | ||
| 236 | 'spreadsheet' => 'Spreadsheet', | ||
| 237 | 'delimiters' => 'delimiters', | ||
| 238 | 'treat_consecutive_delimiters_as_one' => 'treatConsecutiveDelimitersAsOne', | ||
| 239 | 'case_sensitive' => 'caseSensitive', | ||
| 240 | 'worksheet' => 'worksheet', | ||
| 241 | 'range' => 'range', | ||
| 242 | 'out_path' => 'outPath', | ||
| 243 | 'out_storage_name' => 'outStorageName', | ||
| 244 | 'region' => 'region', | ||
| 245 | 'password' => 'password' | ||
| 246 | } ); | ||
| 247 | |||
| 248 | __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); | ||
| 249 | |||
| 250 | |||
| 251 | 1; |