Request/TranslateTextFileRequest.pm untested

filter: Statementstmt 0.0% 0 / 83 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 109 CC 6 SCAR 26.8
CC
6
Cov
0%
run_http_request
42.0
new
2.0
BEGIN
2.0
CRAP 14.6
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::TranslateTextFileRequest;
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 # TranslateTextFileRequest.Spreadsheet : Upload spreadsheet file. ,
64 # TranslateTextFileRequest.targetLanguage : The target language code for translation (e.g., "es", "fr", "de"). ,
65 # TranslateTextFileRequest.region : The spreadsheet region setting. ,
66 # TranslateTextFileRequest.password : The password for opening spreadsheet file.
67
68 {
69 my $params = {
70 'client' =>{
71 data_type => 'ApiClient',
72 description => 'API Client.',
73 required => '0',
74 }
75 };
76 __PACKAGE__->method_documentation->{ 'translate_text_file' } = {
77 summary => 'Translates text file content to the specified target language.',
78 params => $params,
79 returns => '',
80 };
81 }
82
83 sub run_http_request {
84 my ($self, %args) = @_;
85
86 my $client = $args{'client'};
87
88 # parse inputs
89 my $_resource_path = 'v4.0/cells/ai/translate/text-file';
90
91 my $_method = 'PUT';
92 my $query_params = {};
93 my $header_params = {};
94 my $form_params = {};
95
96
97 my $_header_accept = $client->select_header_accept('application/json');
98 if ($_header_accept) {
99 $header_params->{'Accept'} = $_header_accept;
100 }
101 $header_params->{'Content-Type'} = $client->select_header_content_type('multipart/form-data');
102
103 if(defined $self->target_language){
104 $query_params->{'targetLanguage'} = $client->to_query_value($self->target_language);
105 }
106
107 if(defined $self->region){
108 $query_params->{'region'} = $client->to_query_value($self->region);
109 }
110
111 if(defined $self->password){
112 $query_params->{'password'} = $client->to_query_value($self->password);
113 }
114 my $_body_data;
115
116
117 if (defined $self->spreadsheet) {
118 $form_params->{basename($self->spreadsheet)} = [$self->spreadsheet ,basename($self->spreadsheet),'application/octet-stream'];
119 }
120
121
122 # authentication setting, if any
123 my $auth_settings = [qw()];
124
125 # make the API Call
126 my $response = $client->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings);
127 return $response;
128 }
129
130
131 __PACKAGE__->method_documentation({
132 'spreadsheet' => {
133 datatype => 'string',
134 base_name => 'Spreadsheet',
135 description => 'Upload spreadsheet file.',
136 format => '',
137 read_only => '',
138 },
139 'target_language' => {
140 datatype => 'string',
141 base_name => 'targetLanguage',
142 description => 'The target language code for translation (e.g., "es", "fr", "de").',
143 format => '',
144 read_only => '',
145 },
146 'region' => {
147 datatype => 'string',
148 base_name => 'region',
149 description => 'The spreadsheet region setting.',
150 format => '',
151 read_only => '',
152 },
153 'password' => {
154 datatype => 'string',
155 base_name => 'password',
156 description => 'The password for opening spreadsheet file.',
157 format => '',
158 read_only => '',
159 },
160 });
161
162
163 __PACKAGE__->attribute_map( {
164 'spreadsheet' => 'Spreadsheet',
165 'target_language' => 'targetLanguage',
166 'region' => 'region',
167 'password' => 'password'
168 } );
169
170 __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
171
172
173 1;