| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
=begin comment |
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
Smartcat Integration API |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
OpenAPI spec version: v1 |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Generated by: https://github.com/swagger-api/swagger-codegen.git |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=end comment |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=cut |
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# |
|
17
|
|
|
|
|
|
|
# NOTE: This class is auto generated by the swagger code generator program. |
|
18
|
|
|
|
|
|
|
# Do not edit the class manually. |
|
19
|
|
|
|
|
|
|
# Ref: https://github.com/swagger-api/swagger-codegen |
|
20
|
|
|
|
|
|
|
# |
|
21
|
|
|
|
|
|
|
package Smartcat::Client::DocumentApi; |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
require 5.6.0; |
|
24
|
1
|
|
|
1
|
|
861
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
29
|
|
|
25
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
86
|
|
|
26
|
1
|
|
|
1
|
|
610
|
use utf8; |
|
|
1
|
|
|
|
|
14
|
|
|
|
1
|
|
|
|
|
5
|
|
|
27
|
1
|
|
|
1
|
|
31
|
use Exporter; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
34
|
|
|
28
|
1
|
|
|
1
|
|
684
|
use JSON; |
|
|
1
|
|
|
|
|
8804
|
|
|
|
1
|
|
|
|
|
5
|
|
|
29
|
1
|
|
|
1
|
|
153
|
use Carp qw( croak ); |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
59
|
|
|
30
|
1
|
|
|
1
|
|
446
|
use Log::Any qw($log); |
|
|
1
|
|
|
|
|
8594
|
|
|
|
1
|
|
|
|
|
5
|
|
|
31
|
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
|
2774
|
use Smartcat::Client::ApiClient; |
|
|
1
|
|
|
|
|
4
|
|
|
|
1
|
|
|
|
|
40
|
|
|
33
|
|
|
|
|
|
|
|
|
34
|
1
|
|
|
1
|
|
7
|
use base "Class::Data::Inheritable"; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
522
|
|
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata( 'method_documentation' => {} ); |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub new { |
|
39
|
1
|
|
|
1
|
0
|
652
|
my $class = shift; |
|
40
|
1
|
|
|
|
|
2
|
my $api_client; |
|
41
|
|
|
|
|
|
|
|
|
42
|
1
|
50
|
33
|
|
|
7
|
if ( $_[0] && ref $_[0] && ref $_[0] eq 'Smartcat::Client::ApiClient' ) { |
|
|
|
|
33
|
|
|
|
|
|
43
|
0
|
|
|
|
|
0
|
$api_client = $_[0]; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
else { |
|
46
|
1
|
|
|
|
|
6
|
$api_client = Smartcat::Client::ApiClient->new(@_); |
|
47
|
|
|
|
|
|
|
} |
|
48
|
|
|
|
|
|
|
|
|
49
|
1
|
|
|
|
|
6
|
bless { api_client => $api_client }, $class; |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
} |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# |
|
54
|
|
|
|
|
|
|
# document_assign_executives |
|
55
|
|
|
|
|
|
|
# |
|
56
|
|
|
|
|
|
|
# |
|
57
|
|
|
|
|
|
|
# |
|
58
|
|
|
|
|
|
|
# @param string $document_id (required) |
|
59
|
|
|
|
|
|
|
# @param int $stage_number (required) |
|
60
|
|
|
|
|
|
|
# @param AssignExecutivesRequestModel $request (required) |
|
61
|
|
|
|
|
|
|
{ |
|
62
|
|
|
|
|
|
|
my $params = { |
|
63
|
|
|
|
|
|
|
'document_id' => { |
|
64
|
|
|
|
|
|
|
data_type => 'string', |
|
65
|
|
|
|
|
|
|
description => '', |
|
66
|
|
|
|
|
|
|
required => '1', |
|
67
|
|
|
|
|
|
|
}, |
|
68
|
|
|
|
|
|
|
'stage_number' => { |
|
69
|
|
|
|
|
|
|
data_type => 'int', |
|
70
|
|
|
|
|
|
|
description => '', |
|
71
|
|
|
|
|
|
|
required => '1', |
|
72
|
|
|
|
|
|
|
}, |
|
73
|
|
|
|
|
|
|
'request' => { |
|
74
|
|
|
|
|
|
|
data_type => 'AssignExecutivesRequestModel', |
|
75
|
|
|
|
|
|
|
description => '', |
|
76
|
|
|
|
|
|
|
required => '1', |
|
77
|
|
|
|
|
|
|
}, |
|
78
|
|
|
|
|
|
|
}; |
|
79
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'document_assign_executives'} = { |
|
80
|
|
|
|
|
|
|
summary => '', |
|
81
|
|
|
|
|
|
|
params => $params, |
|
82
|
|
|
|
|
|
|
returns => undef, |
|
83
|
|
|
|
|
|
|
}; |
|
84
|
|
|
|
|
|
|
} |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
# @return void |
|
87
|
|
|
|
|
|
|
# |
|
88
|
|
|
|
|
|
|
sub document_assign_executives { |
|
89
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
# verify the required parameter 'document_id' is set |
|
92
|
0
|
0
|
|
|
|
|
unless ( exists $args{'document_id'} ) { |
|
93
|
0
|
|
|
|
|
|
croak( |
|
94
|
|
|
|
|
|
|
"Missing the required parameter 'document_id' when calling document_assign_executives" |
|
95
|
|
|
|
|
|
|
); |
|
96
|
|
|
|
|
|
|
} |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
# verify the required parameter 'stage_number' is set |
|
99
|
0
|
0
|
|
|
|
|
unless ( exists $args{'stage_number'} ) { |
|
100
|
0
|
|
|
|
|
|
croak( |
|
101
|
|
|
|
|
|
|
"Missing the required parameter 'stage_number' when calling document_assign_executives" |
|
102
|
|
|
|
|
|
|
); |
|
103
|
|
|
|
|
|
|
} |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
# verify the required parameter 'request' is set |
|
106
|
0
|
0
|
|
|
|
|
unless ( exists $args{'request'} ) { |
|
107
|
0
|
|
|
|
|
|
croak( |
|
108
|
|
|
|
|
|
|
"Missing the required parameter 'request' when calling document_assign_executives" |
|
109
|
|
|
|
|
|
|
); |
|
110
|
|
|
|
|
|
|
} |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
# parse inputs |
|
113
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document/assign'; |
|
114
|
|
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
|
116
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
117
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
118
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
121
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept(); |
|
122
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
123
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
124
|
|
|
|
|
|
|
} |
|
125
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client} |
|
126
|
0
|
|
|
|
|
|
->select_header_content_type( 'application/json', 'text/json' ); |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
# query params |
|
129
|
0
|
0
|
|
|
|
|
if ( exists $args{'document_id'} ) { |
|
130
|
|
|
|
|
|
|
$query_params->{'documentId'} = |
|
131
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'document_id'} ); |
|
132
|
|
|
|
|
|
|
} |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
# query params |
|
135
|
0
|
0
|
|
|
|
|
if ( exists $args{'stage_number'} ) { |
|
136
|
|
|
|
|
|
|
$query_params->{'stageNumber'} = |
|
137
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'stage_number'} ); |
|
138
|
|
|
|
|
|
|
} |
|
139
|
|
|
|
|
|
|
|
|
140
|
0
|
|
|
|
|
|
my $_body_data; |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
# body params |
|
143
|
0
|
0
|
|
|
|
|
if ( exists $args{'request'} ) { |
|
144
|
0
|
|
|
|
|
|
$_body_data = $args{'request'}; |
|
145
|
|
|
|
|
|
|
} |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
# authentication setting, if any |
|
148
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
# make the API Call |
|
151
|
|
|
|
|
|
|
$self->{api_client}->call_api( |
|
152
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
153
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
154
|
|
|
|
|
|
|
); |
|
155
|
0
|
|
|
|
|
|
return; |
|
156
|
|
|
|
|
|
|
} |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
# |
|
159
|
|
|
|
|
|
|
# document_assign_freelancers_to_document |
|
160
|
|
|
|
|
|
|
# |
|
161
|
|
|
|
|
|
|
# Split the document into equal segments according to the number of words and assign each freelancer to one segment |
|
162
|
|
|
|
|
|
|
# |
|
163
|
|
|
|
|
|
|
# @param string $document_id Document ID (required) |
|
164
|
|
|
|
|
|
|
# @param int $stage_number Workflow stage number (required) |
|
165
|
|
|
|
|
|
|
# @param ARRAY[string] $freelancer_user_ids Assignee IDs (required) |
|
166
|
|
|
|
|
|
|
{ |
|
167
|
|
|
|
|
|
|
my $params = { |
|
168
|
|
|
|
|
|
|
'document_id' => { |
|
169
|
|
|
|
|
|
|
data_type => 'string', |
|
170
|
|
|
|
|
|
|
description => 'Document ID', |
|
171
|
|
|
|
|
|
|
required => '1', |
|
172
|
|
|
|
|
|
|
}, |
|
173
|
|
|
|
|
|
|
'stage_number' => { |
|
174
|
|
|
|
|
|
|
data_type => 'int', |
|
175
|
|
|
|
|
|
|
description => 'Workflow stage number', |
|
176
|
|
|
|
|
|
|
required => '1', |
|
177
|
|
|
|
|
|
|
}, |
|
178
|
|
|
|
|
|
|
'freelancer_user_ids' => { |
|
179
|
|
|
|
|
|
|
data_type => 'ARRAY[string]', |
|
180
|
|
|
|
|
|
|
description => 'Assignee IDs', |
|
181
|
|
|
|
|
|
|
required => '1', |
|
182
|
|
|
|
|
|
|
}, |
|
183
|
|
|
|
|
|
|
}; |
|
184
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{ |
|
185
|
|
|
|
|
|
|
'document_assign_freelancers_to_document'} = { |
|
186
|
|
|
|
|
|
|
summary => |
|
187
|
|
|
|
|
|
|
'Split the document into equal segments according to the number of words and assign each freelancer to one segment', |
|
188
|
|
|
|
|
|
|
params => $params, |
|
189
|
|
|
|
|
|
|
returns => undef, |
|
190
|
|
|
|
|
|
|
}; |
|
191
|
|
|
|
|
|
|
} |
|
192
|
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
# @return void |
|
194
|
|
|
|
|
|
|
# |
|
195
|
|
|
|
|
|
|
sub document_assign_freelancers_to_document { |
|
196
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
# verify the required parameter 'document_id' is set |
|
199
|
0
|
0
|
|
|
|
|
unless ( exists $args{'document_id'} ) { |
|
200
|
0
|
|
|
|
|
|
croak( |
|
201
|
|
|
|
|
|
|
"Missing the required parameter 'document_id' when calling document_assign_freelancers_to_document" |
|
202
|
|
|
|
|
|
|
); |
|
203
|
|
|
|
|
|
|
} |
|
204
|
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
# verify the required parameter 'stage_number' is set |
|
206
|
0
|
0
|
|
|
|
|
unless ( exists $args{'stage_number'} ) { |
|
207
|
0
|
|
|
|
|
|
croak( |
|
208
|
|
|
|
|
|
|
"Missing the required parameter 'stage_number' when calling document_assign_freelancers_to_document" |
|
209
|
|
|
|
|
|
|
); |
|
210
|
|
|
|
|
|
|
} |
|
211
|
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
# verify the required parameter 'freelancer_user_ids' is set |
|
213
|
0
|
0
|
|
|
|
|
unless ( exists $args{'freelancer_user_ids'} ) { |
|
214
|
0
|
|
|
|
|
|
croak( |
|
215
|
|
|
|
|
|
|
"Missing the required parameter 'freelancer_user_ids' when calling document_assign_freelancers_to_document" |
|
216
|
|
|
|
|
|
|
); |
|
217
|
|
|
|
|
|
|
} |
|
218
|
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
# parse inputs |
|
220
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document/assignFreelancers'; |
|
221
|
|
|
|
|
|
|
|
|
222
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
|
223
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
224
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
225
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
226
|
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
228
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept(); |
|
229
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
230
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
231
|
|
|
|
|
|
|
} |
|
232
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client} |
|
233
|
0
|
|
|
|
|
|
->select_header_content_type( 'application/json', 'text/json' ); |
|
234
|
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
# query params |
|
236
|
0
|
0
|
|
|
|
|
if ( exists $args{'document_id'} ) { |
|
237
|
|
|
|
|
|
|
$query_params->{'documentId'} = |
|
238
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'document_id'} ); |
|
239
|
|
|
|
|
|
|
} |
|
240
|
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
# query params |
|
242
|
0
|
0
|
|
|
|
|
if ( exists $args{'stage_number'} ) { |
|
243
|
|
|
|
|
|
|
$query_params->{'stageNumber'} = |
|
244
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'stage_number'} ); |
|
245
|
|
|
|
|
|
|
} |
|
246
|
|
|
|
|
|
|
|
|
247
|
0
|
|
|
|
|
|
my $_body_data; |
|
248
|
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
# body params |
|
250
|
0
|
0
|
|
|
|
|
if ( exists $args{'freelancer_user_ids'} ) { |
|
251
|
0
|
|
|
|
|
|
$_body_data = $args{'freelancer_user_ids'}; |
|
252
|
|
|
|
|
|
|
} |
|
253
|
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
# authentication setting, if any |
|
255
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
# make the API Call |
|
258
|
|
|
|
|
|
|
$self->{api_client}->call_api( |
|
259
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
260
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
261
|
|
|
|
|
|
|
); |
|
262
|
0
|
|
|
|
|
|
return; |
|
263
|
|
|
|
|
|
|
} |
|
264
|
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
# |
|
266
|
|
|
|
|
|
|
# document_assign_my_team_executives |
|
267
|
|
|
|
|
|
|
# |
|
268
|
|
|
|
|
|
|
# |
|
269
|
|
|
|
|
|
|
# |
|
270
|
|
|
|
|
|
|
# @param AssignMyTeamExecutivesRequestModel $request_model (required) |
|
271
|
|
|
|
|
|
|
{ |
|
272
|
|
|
|
|
|
|
my $params = { |
|
273
|
|
|
|
|
|
|
'request_model' => { |
|
274
|
|
|
|
|
|
|
data_type => 'AssignMyTeamExecutivesRequestModel', |
|
275
|
|
|
|
|
|
|
description => '', |
|
276
|
|
|
|
|
|
|
required => '1', |
|
277
|
|
|
|
|
|
|
}, |
|
278
|
|
|
|
|
|
|
}; |
|
279
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'document_assign_my_team_executives'} = |
|
280
|
|
|
|
|
|
|
{ |
|
281
|
|
|
|
|
|
|
summary => '', |
|
282
|
|
|
|
|
|
|
params => $params, |
|
283
|
|
|
|
|
|
|
returns => 'int', |
|
284
|
|
|
|
|
|
|
}; |
|
285
|
|
|
|
|
|
|
} |
|
286
|
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
# @return int |
|
288
|
|
|
|
|
|
|
# |
|
289
|
|
|
|
|
|
|
sub document_assign_my_team_executives { |
|
290
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
291
|
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
# verify the required parameter 'request_model' is set |
|
293
|
0
|
0
|
|
|
|
|
unless ( exists $args{'request_model'} ) { |
|
294
|
0
|
|
|
|
|
|
croak( |
|
295
|
|
|
|
|
|
|
"Missing the required parameter 'request_model' when calling document_assign_my_team_executives" |
|
296
|
|
|
|
|
|
|
); |
|
297
|
|
|
|
|
|
|
} |
|
298
|
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
# parse inputs |
|
300
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document/assignFromMyTeam'; |
|
301
|
|
|
|
|
|
|
|
|
302
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
|
303
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
304
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
305
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
306
|
|
|
|
|
|
|
|
|
307
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
308
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
|
309
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
|
310
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
311
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
312
|
|
|
|
|
|
|
} |
|
313
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client} |
|
314
|
0
|
|
|
|
|
|
->select_header_content_type( 'application/json', 'text/json' ); |
|
315
|
|
|
|
|
|
|
|
|
316
|
0
|
|
|
|
|
|
my $_body_data; |
|
317
|
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
# body params |
|
319
|
0
|
0
|
|
|
|
|
if ( exists $args{'request_model'} ) { |
|
320
|
0
|
|
|
|
|
|
$_body_data = $args{'request_model'}; |
|
321
|
|
|
|
|
|
|
} |
|
322
|
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
# authentication setting, if any |
|
324
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
325
|
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
# make the API Call |
|
327
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
|
328
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
329
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
330
|
|
|
|
|
|
|
); |
|
331
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
|
332
|
0
|
|
|
|
|
|
return; |
|
333
|
|
|
|
|
|
|
} |
|
334
|
0
|
|
|
|
|
|
my $_response_object = $self->{api_client}->deserialize( 'int', $response ); |
|
335
|
0
|
|
|
|
|
|
return $_response_object; |
|
336
|
|
|
|
|
|
|
} |
|
337
|
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
# |
|
339
|
|
|
|
|
|
|
# document_delete |
|
340
|
|
|
|
|
|
|
# |
|
341
|
|
|
|
|
|
|
# Delete one or several documents |
|
342
|
|
|
|
|
|
|
# |
|
343
|
|
|
|
|
|
|
# @param ARRAY[string] $document_ids Array of document IDs (required) |
|
344
|
|
|
|
|
|
|
{ |
|
345
|
|
|
|
|
|
|
my $params = { |
|
346
|
|
|
|
|
|
|
'document_ids' => { |
|
347
|
|
|
|
|
|
|
data_type => 'ARRAY[string]', |
|
348
|
|
|
|
|
|
|
description => 'Array of document IDs', |
|
349
|
|
|
|
|
|
|
required => '1', |
|
350
|
|
|
|
|
|
|
}, |
|
351
|
|
|
|
|
|
|
}; |
|
352
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'document_delete'} = { |
|
353
|
|
|
|
|
|
|
summary => 'Delete one or several documents', |
|
354
|
|
|
|
|
|
|
params => $params, |
|
355
|
|
|
|
|
|
|
returns => undef, |
|
356
|
|
|
|
|
|
|
}; |
|
357
|
|
|
|
|
|
|
} |
|
358
|
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
# @return void |
|
360
|
|
|
|
|
|
|
# |
|
361
|
|
|
|
|
|
|
sub document_delete { |
|
362
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
# verify the required parameter 'document_ids' is set |
|
365
|
0
|
0
|
|
|
|
|
unless ( exists $args{'document_ids'} ) { |
|
366
|
0
|
|
|
|
|
|
croak( |
|
367
|
|
|
|
|
|
|
"Missing the required parameter 'document_ids' when calling document_delete" |
|
368
|
|
|
|
|
|
|
); |
|
369
|
|
|
|
|
|
|
} |
|
370
|
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
# parse inputs |
|
372
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document'; |
|
373
|
|
|
|
|
|
|
|
|
374
|
0
|
|
|
|
|
|
my $_method = 'DELETE'; |
|
375
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
376
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
377
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
378
|
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
380
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept(); |
|
381
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
382
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
383
|
|
|
|
|
|
|
} |
|
384
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
|
385
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
|
386
|
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
# query params |
|
388
|
0
|
0
|
|
|
|
|
if ( exists $args{'document_ids'} ) { |
|
389
|
|
|
|
|
|
|
$query_params->{'documentIds'} = |
|
390
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'document_ids'} ); |
|
391
|
|
|
|
|
|
|
} |
|
392
|
|
|
|
|
|
|
|
|
393
|
0
|
|
|
|
|
|
my $_body_data; |
|
394
|
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
# authentication setting, if any |
|
396
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
397
|
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
# make the API Call |
|
399
|
|
|
|
|
|
|
$self->{api_client}->call_api( |
|
400
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
401
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
402
|
|
|
|
|
|
|
); |
|
403
|
0
|
|
|
|
|
|
return; |
|
404
|
|
|
|
|
|
|
} |
|
405
|
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
# |
|
407
|
|
|
|
|
|
|
# document_get |
|
408
|
|
|
|
|
|
|
# |
|
409
|
|
|
|
|
|
|
# Receive the document details |
|
410
|
|
|
|
|
|
|
# |
|
411
|
|
|
|
|
|
|
# @param string $document_id Document ID (required) |
|
412
|
|
|
|
|
|
|
{ |
|
413
|
|
|
|
|
|
|
my $params = { |
|
414
|
|
|
|
|
|
|
'document_id' => { |
|
415
|
|
|
|
|
|
|
data_type => 'string', |
|
416
|
|
|
|
|
|
|
description => 'Document ID', |
|
417
|
|
|
|
|
|
|
required => '1', |
|
418
|
|
|
|
|
|
|
}, |
|
419
|
|
|
|
|
|
|
}; |
|
420
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'document_get'} = { |
|
421
|
|
|
|
|
|
|
summary => 'Receive the document details', |
|
422
|
|
|
|
|
|
|
params => $params, |
|
423
|
|
|
|
|
|
|
returns => 'DocumentModel', |
|
424
|
|
|
|
|
|
|
}; |
|
425
|
|
|
|
|
|
|
} |
|
426
|
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
# @return DocumentModel |
|
428
|
|
|
|
|
|
|
# |
|
429
|
|
|
|
|
|
|
sub document_get { |
|
430
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
431
|
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
# verify the required parameter 'document_id' is set |
|
433
|
0
|
0
|
|
|
|
|
unless ( exists $args{'document_id'} ) { |
|
434
|
0
|
|
|
|
|
|
croak( |
|
435
|
|
|
|
|
|
|
"Missing the required parameter 'document_id' when calling document_get" |
|
436
|
|
|
|
|
|
|
); |
|
437
|
|
|
|
|
|
|
} |
|
438
|
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
# parse inputs |
|
440
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document'; |
|
441
|
|
|
|
|
|
|
|
|
442
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
|
443
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
444
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
445
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
446
|
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
448
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
|
449
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
|
450
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
451
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
452
|
|
|
|
|
|
|
} |
|
453
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
|
454
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
|
455
|
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
# query params |
|
457
|
0
|
0
|
|
|
|
|
if ( exists $args{'document_id'} ) { |
|
458
|
|
|
|
|
|
|
$query_params->{'documentId'} = |
|
459
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'document_id'} ); |
|
460
|
|
|
|
|
|
|
} |
|
461
|
|
|
|
|
|
|
|
|
462
|
0
|
|
|
|
|
|
my $_body_data; |
|
463
|
|
|
|
|
|
|
|
|
464
|
|
|
|
|
|
|
# authentication setting, if any |
|
465
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
466
|
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
# make the API Call |
|
468
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
|
469
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
470
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
471
|
|
|
|
|
|
|
); |
|
472
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
|
473
|
0
|
|
|
|
|
|
return; |
|
474
|
|
|
|
|
|
|
} |
|
475
|
|
|
|
|
|
|
my $_response_object = |
|
476
|
0
|
|
|
|
|
|
$self->{api_client}->deserialize( 'DocumentModel', $response ); |
|
477
|
0
|
|
|
|
|
|
return $_response_object; |
|
478
|
|
|
|
|
|
|
} |
|
479
|
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
# |
|
481
|
|
|
|
|
|
|
# document_get_auth_url |
|
482
|
|
|
|
|
|
|
# |
|
483
|
|
|
|
|
|
|
# |
|
484
|
|
|
|
|
|
|
# |
|
485
|
|
|
|
|
|
|
# @param string $user_id (required) |
|
486
|
|
|
|
|
|
|
# @param string $document_id (required) |
|
487
|
|
|
|
|
|
|
{ |
|
488
|
|
|
|
|
|
|
my $params = { |
|
489
|
|
|
|
|
|
|
'user_id' => { |
|
490
|
|
|
|
|
|
|
data_type => 'string', |
|
491
|
|
|
|
|
|
|
description => '', |
|
492
|
|
|
|
|
|
|
required => '1', |
|
493
|
|
|
|
|
|
|
}, |
|
494
|
|
|
|
|
|
|
'document_id' => { |
|
495
|
|
|
|
|
|
|
data_type => 'string', |
|
496
|
|
|
|
|
|
|
description => '', |
|
497
|
|
|
|
|
|
|
required => '1', |
|
498
|
|
|
|
|
|
|
}, |
|
499
|
|
|
|
|
|
|
}; |
|
500
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'document_get_auth_url'} = { |
|
501
|
|
|
|
|
|
|
summary => '', |
|
502
|
|
|
|
|
|
|
params => $params, |
|
503
|
|
|
|
|
|
|
returns => 'string', |
|
504
|
|
|
|
|
|
|
}; |
|
505
|
|
|
|
|
|
|
} |
|
506
|
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
# @return string |
|
508
|
|
|
|
|
|
|
# |
|
509
|
|
|
|
|
|
|
sub document_get_auth_url { |
|
510
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
511
|
|
|
|
|
|
|
|
|
512
|
|
|
|
|
|
|
# verify the required parameter 'user_id' is set |
|
513
|
0
|
0
|
|
|
|
|
unless ( exists $args{'user_id'} ) { |
|
514
|
0
|
|
|
|
|
|
croak( |
|
515
|
|
|
|
|
|
|
"Missing the required parameter 'user_id' when calling document_get_auth_url" |
|
516
|
|
|
|
|
|
|
); |
|
517
|
|
|
|
|
|
|
} |
|
518
|
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
# verify the required parameter 'document_id' is set |
|
520
|
0
|
0
|
|
|
|
|
unless ( exists $args{'document_id'} ) { |
|
521
|
0
|
|
|
|
|
|
croak( |
|
522
|
|
|
|
|
|
|
"Missing the required parameter 'document_id' when calling document_get_auth_url" |
|
523
|
|
|
|
|
|
|
); |
|
524
|
|
|
|
|
|
|
} |
|
525
|
|
|
|
|
|
|
|
|
526
|
|
|
|
|
|
|
# parse inputs |
|
527
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document/getAuthUrl'; |
|
528
|
|
|
|
|
|
|
|
|
529
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
|
530
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
531
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
532
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
533
|
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
535
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
|
536
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
|
537
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
538
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
539
|
|
|
|
|
|
|
} |
|
540
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
|
541
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
|
542
|
|
|
|
|
|
|
|
|
543
|
|
|
|
|
|
|
# query params |
|
544
|
0
|
0
|
|
|
|
|
if ( exists $args{'user_id'} ) { |
|
545
|
|
|
|
|
|
|
$query_params->{'userId'} = |
|
546
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'user_id'} ); |
|
547
|
|
|
|
|
|
|
} |
|
548
|
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
# query params |
|
550
|
0
|
0
|
|
|
|
|
if ( exists $args{'document_id'} ) { |
|
551
|
|
|
|
|
|
|
$query_params->{'documentId'} = |
|
552
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'document_id'} ); |
|
553
|
|
|
|
|
|
|
} |
|
554
|
|
|
|
|
|
|
|
|
555
|
0
|
|
|
|
|
|
my $_body_data; |
|
556
|
|
|
|
|
|
|
|
|
557
|
|
|
|
|
|
|
# authentication setting, if any |
|
558
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
559
|
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
# make the API Call |
|
561
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
|
562
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
563
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
564
|
|
|
|
|
|
|
); |
|
565
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
|
566
|
0
|
|
|
|
|
|
return; |
|
567
|
|
|
|
|
|
|
} |
|
568
|
|
|
|
|
|
|
my $_response_object = |
|
569
|
0
|
|
|
|
|
|
$self->{api_client}->deserialize( 'string', $response ); |
|
570
|
0
|
|
|
|
|
|
return $_response_object; |
|
571
|
|
|
|
|
|
|
} |
|
572
|
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
# |
|
574
|
|
|
|
|
|
|
# document_get_statistics |
|
575
|
|
|
|
|
|
|
# |
|
576
|
|
|
|
|
|
|
# |
|
577
|
|
|
|
|
|
|
# |
|
578
|
|
|
|
|
|
|
# @param string $document_id (required) |
|
579
|
|
|
|
|
|
|
# @param boolean $only_exact_matches (optional) |
|
580
|
|
|
|
|
|
|
{ |
|
581
|
|
|
|
|
|
|
my $params = { |
|
582
|
|
|
|
|
|
|
'document_id' => { |
|
583
|
|
|
|
|
|
|
data_type => 'string', |
|
584
|
|
|
|
|
|
|
description => '', |
|
585
|
|
|
|
|
|
|
required => '1', |
|
586
|
|
|
|
|
|
|
}, |
|
587
|
|
|
|
|
|
|
'only_exact_matches' => { |
|
588
|
|
|
|
|
|
|
data_type => 'boolean', |
|
589
|
|
|
|
|
|
|
description => '', |
|
590
|
|
|
|
|
|
|
required => '0', |
|
591
|
|
|
|
|
|
|
}, |
|
592
|
|
|
|
|
|
|
}; |
|
593
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'document_get_statistics'} = { |
|
594
|
|
|
|
|
|
|
summary => '', |
|
595
|
|
|
|
|
|
|
params => $params, |
|
596
|
|
|
|
|
|
|
returns => 'DocumentStatisticsModel', |
|
597
|
|
|
|
|
|
|
}; |
|
598
|
|
|
|
|
|
|
} |
|
599
|
|
|
|
|
|
|
|
|
600
|
|
|
|
|
|
|
# @return DocumentStatisticsModel |
|
601
|
|
|
|
|
|
|
# |
|
602
|
|
|
|
|
|
|
sub document_get_statistics { |
|
603
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
604
|
|
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
# verify the required parameter 'document_id' is set |
|
606
|
0
|
0
|
|
|
|
|
unless ( exists $args{'document_id'} ) { |
|
607
|
0
|
|
|
|
|
|
croak( |
|
608
|
|
|
|
|
|
|
"Missing the required parameter 'document_id' when calling document_get_statistics" |
|
609
|
|
|
|
|
|
|
); |
|
610
|
|
|
|
|
|
|
} |
|
611
|
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
# parse inputs |
|
613
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document/statistics'; |
|
614
|
|
|
|
|
|
|
|
|
615
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
|
616
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
617
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
618
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
619
|
|
|
|
|
|
|
|
|
620
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
621
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
|
622
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
|
623
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
624
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
625
|
|
|
|
|
|
|
} |
|
626
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
|
627
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
|
628
|
|
|
|
|
|
|
|
|
629
|
|
|
|
|
|
|
# query params |
|
630
|
0
|
0
|
|
|
|
|
if ( exists $args{'document_id'} ) { |
|
631
|
|
|
|
|
|
|
$query_params->{'documentId'} = |
|
632
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'document_id'} ); |
|
633
|
|
|
|
|
|
|
} |
|
634
|
|
|
|
|
|
|
|
|
635
|
|
|
|
|
|
|
# query params |
|
636
|
0
|
0
|
|
|
|
|
if ( exists $args{'only_exact_matches'} ) { |
|
637
|
|
|
|
|
|
|
$query_params->{'onlyExactMatches'} = |
|
638
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'only_exact_matches'} ); |
|
639
|
|
|
|
|
|
|
} |
|
640
|
|
|
|
|
|
|
|
|
641
|
0
|
|
|
|
|
|
my $_body_data; |
|
642
|
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
# authentication setting, if any |
|
644
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
645
|
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
# make the API Call |
|
647
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
|
648
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
649
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
650
|
|
|
|
|
|
|
); |
|
651
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
|
652
|
0
|
|
|
|
|
|
return; |
|
653
|
|
|
|
|
|
|
} |
|
654
|
|
|
|
|
|
|
my $_response_object = |
|
655
|
0
|
|
|
|
|
|
$self->{api_client}->deserialize( 'DocumentStatisticsModel', $response ); |
|
656
|
0
|
|
|
|
|
|
return $_response_object; |
|
657
|
|
|
|
|
|
|
} |
|
658
|
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
# |
|
660
|
|
|
|
|
|
|
# document_get_translation_status |
|
661
|
|
|
|
|
|
|
# |
|
662
|
|
|
|
|
|
|
# Receive the status of adding document translation |
|
663
|
|
|
|
|
|
|
# |
|
664
|
|
|
|
|
|
|
# @param string $document_id Document ID (required) |
|
665
|
|
|
|
|
|
|
{ |
|
666
|
|
|
|
|
|
|
my $params = { |
|
667
|
|
|
|
|
|
|
'document_id' => { |
|
668
|
|
|
|
|
|
|
data_type => 'string', |
|
669
|
|
|
|
|
|
|
description => 'Document ID', |
|
670
|
|
|
|
|
|
|
required => '1', |
|
671
|
|
|
|
|
|
|
}, |
|
672
|
|
|
|
|
|
|
}; |
|
673
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'document_get_translation_status'} = { |
|
674
|
|
|
|
|
|
|
summary => 'Receive the status of adding document translation', |
|
675
|
|
|
|
|
|
|
params => $params, |
|
676
|
|
|
|
|
|
|
returns => 'string', |
|
677
|
|
|
|
|
|
|
}; |
|
678
|
|
|
|
|
|
|
} |
|
679
|
|
|
|
|
|
|
|
|
680
|
|
|
|
|
|
|
# @return string |
|
681
|
|
|
|
|
|
|
# |
|
682
|
|
|
|
|
|
|
sub document_get_translation_status { |
|
683
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
684
|
|
|
|
|
|
|
|
|
685
|
|
|
|
|
|
|
# verify the required parameter 'document_id' is set |
|
686
|
0
|
0
|
|
|
|
|
unless ( exists $args{'document_id'} ) { |
|
687
|
0
|
|
|
|
|
|
croak( |
|
688
|
|
|
|
|
|
|
"Missing the required parameter 'document_id' when calling document_get_translation_status" |
|
689
|
|
|
|
|
|
|
); |
|
690
|
|
|
|
|
|
|
} |
|
691
|
|
|
|
|
|
|
|
|
692
|
|
|
|
|
|
|
# parse inputs |
|
693
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document/translate/status'; |
|
694
|
|
|
|
|
|
|
|
|
695
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
|
696
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
697
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
698
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
699
|
|
|
|
|
|
|
|
|
700
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
701
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
|
702
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
|
703
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
704
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
705
|
|
|
|
|
|
|
} |
|
706
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
|
707
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
|
708
|
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
# query params |
|
710
|
0
|
0
|
|
|
|
|
if ( exists $args{'document_id'} ) { |
|
711
|
|
|
|
|
|
|
$query_params->{'documentId'} = |
|
712
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'document_id'} ); |
|
713
|
|
|
|
|
|
|
} |
|
714
|
|
|
|
|
|
|
|
|
715
|
0
|
|
|
|
|
|
my $_body_data; |
|
716
|
|
|
|
|
|
|
|
|
717
|
|
|
|
|
|
|
# authentication setting, if any |
|
718
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
719
|
|
|
|
|
|
|
|
|
720
|
|
|
|
|
|
|
# make the API Call |
|
721
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
|
722
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
723
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
724
|
|
|
|
|
|
|
); |
|
725
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
|
726
|
0
|
|
|
|
|
|
return; |
|
727
|
|
|
|
|
|
|
} |
|
728
|
|
|
|
|
|
|
my $_response_object = |
|
729
|
0
|
|
|
|
|
|
$self->{api_client}->deserialize( 'string', $response ); |
|
730
|
0
|
|
|
|
|
|
return $_response_object; |
|
731
|
|
|
|
|
|
|
} |
|
732
|
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
# |
|
734
|
|
|
|
|
|
|
# document_get_translations_import_result |
|
735
|
|
|
|
|
|
|
# |
|
736
|
|
|
|
|
|
|
# |
|
737
|
|
|
|
|
|
|
# |
|
738
|
|
|
|
|
|
|
# @param string $document_id (required) |
|
739
|
|
|
|
|
|
|
{ |
|
740
|
|
|
|
|
|
|
my $params = { |
|
741
|
|
|
|
|
|
|
'document_id' => { |
|
742
|
|
|
|
|
|
|
data_type => 'string', |
|
743
|
|
|
|
|
|
|
description => '', |
|
744
|
|
|
|
|
|
|
required => '1', |
|
745
|
|
|
|
|
|
|
}, |
|
746
|
|
|
|
|
|
|
}; |
|
747
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{ |
|
748
|
|
|
|
|
|
|
'document_get_translations_import_result'} = { |
|
749
|
|
|
|
|
|
|
summary => '', |
|
750
|
|
|
|
|
|
|
params => $params, |
|
751
|
|
|
|
|
|
|
returns => 'Object', |
|
752
|
|
|
|
|
|
|
}; |
|
753
|
|
|
|
|
|
|
} |
|
754
|
|
|
|
|
|
|
|
|
755
|
|
|
|
|
|
|
# @return Object |
|
756
|
|
|
|
|
|
|
# |
|
757
|
|
|
|
|
|
|
sub document_get_translations_import_result { |
|
758
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
759
|
|
|
|
|
|
|
|
|
760
|
|
|
|
|
|
|
# verify the required parameter 'document_id' is set |
|
761
|
0
|
0
|
|
|
|
|
unless ( exists $args{'document_id'} ) { |
|
762
|
0
|
|
|
|
|
|
croak( |
|
763
|
|
|
|
|
|
|
"Missing the required parameter 'document_id' when calling document_get_translations_import_result" |
|
764
|
|
|
|
|
|
|
); |
|
765
|
|
|
|
|
|
|
} |
|
766
|
|
|
|
|
|
|
|
|
767
|
|
|
|
|
|
|
# parse inputs |
|
768
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document/translate/result'; |
|
769
|
|
|
|
|
|
|
|
|
770
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
|
771
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
772
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
773
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
774
|
|
|
|
|
|
|
|
|
775
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
776
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
|
777
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
|
778
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
779
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
780
|
|
|
|
|
|
|
} |
|
781
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
|
782
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
|
783
|
|
|
|
|
|
|
|
|
784
|
|
|
|
|
|
|
# query params |
|
785
|
0
|
0
|
|
|
|
|
if ( exists $args{'document_id'} ) { |
|
786
|
|
|
|
|
|
|
$query_params->{'documentId'} = |
|
787
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'document_id'} ); |
|
788
|
|
|
|
|
|
|
} |
|
789
|
|
|
|
|
|
|
|
|
790
|
0
|
|
|
|
|
|
my $_body_data; |
|
791
|
|
|
|
|
|
|
|
|
792
|
|
|
|
|
|
|
# authentication setting, if any |
|
793
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
794
|
|
|
|
|
|
|
|
|
795
|
|
|
|
|
|
|
# make the API Call |
|
796
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
|
797
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
798
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
799
|
|
|
|
|
|
|
); |
|
800
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
|
801
|
0
|
|
|
|
|
|
return; |
|
802
|
|
|
|
|
|
|
} |
|
803
|
|
|
|
|
|
|
my $_response_object = |
|
804
|
0
|
|
|
|
|
|
$self->{api_client}->deserialize( 'Object', $response ); |
|
805
|
0
|
|
|
|
|
|
return $_response_object; |
|
806
|
|
|
|
|
|
|
} |
|
807
|
|
|
|
|
|
|
|
|
808
|
|
|
|
|
|
|
# |
|
809
|
|
|
|
|
|
|
# document_rename |
|
810
|
|
|
|
|
|
|
# |
|
811
|
|
|
|
|
|
|
# Rename the assigned document |
|
812
|
|
|
|
|
|
|
# |
|
813
|
|
|
|
|
|
|
# @param string $document_id Document ID (required) |
|
814
|
|
|
|
|
|
|
# @param string $name New name (required) |
|
815
|
|
|
|
|
|
|
{ |
|
816
|
|
|
|
|
|
|
my $params = { |
|
817
|
|
|
|
|
|
|
'document_id' => { |
|
818
|
|
|
|
|
|
|
data_type => 'string', |
|
819
|
|
|
|
|
|
|
description => 'Document ID', |
|
820
|
|
|
|
|
|
|
required => '1', |
|
821
|
|
|
|
|
|
|
}, |
|
822
|
|
|
|
|
|
|
'name' => { |
|
823
|
|
|
|
|
|
|
data_type => 'string', |
|
824
|
|
|
|
|
|
|
description => 'New name', |
|
825
|
|
|
|
|
|
|
required => '1', |
|
826
|
|
|
|
|
|
|
}, |
|
827
|
|
|
|
|
|
|
}; |
|
828
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'document_rename'} = { |
|
829
|
|
|
|
|
|
|
summary => 'Rename the assigned document', |
|
830
|
|
|
|
|
|
|
params => $params, |
|
831
|
|
|
|
|
|
|
returns => undef, |
|
832
|
|
|
|
|
|
|
}; |
|
833
|
|
|
|
|
|
|
} |
|
834
|
|
|
|
|
|
|
|
|
835
|
|
|
|
|
|
|
# @return void |
|
836
|
|
|
|
|
|
|
# |
|
837
|
|
|
|
|
|
|
sub document_rename { |
|
838
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
839
|
|
|
|
|
|
|
|
|
840
|
|
|
|
|
|
|
# verify the required parameter 'document_id' is set |
|
841
|
0
|
0
|
|
|
|
|
unless ( exists $args{'document_id'} ) { |
|
842
|
0
|
|
|
|
|
|
croak( |
|
843
|
|
|
|
|
|
|
"Missing the required parameter 'document_id' when calling document_rename" |
|
844
|
|
|
|
|
|
|
); |
|
845
|
|
|
|
|
|
|
} |
|
846
|
|
|
|
|
|
|
|
|
847
|
|
|
|
|
|
|
# verify the required parameter 'name' is set |
|
848
|
0
|
0
|
|
|
|
|
unless ( exists $args{'name'} ) { |
|
849
|
0
|
|
|
|
|
|
croak( |
|
850
|
|
|
|
|
|
|
"Missing the required parameter 'name' when calling document_rename" |
|
851
|
|
|
|
|
|
|
); |
|
852
|
|
|
|
|
|
|
} |
|
853
|
|
|
|
|
|
|
|
|
854
|
|
|
|
|
|
|
# parse inputs |
|
855
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document/rename'; |
|
856
|
|
|
|
|
|
|
|
|
857
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
|
858
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
859
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
860
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
861
|
|
|
|
|
|
|
|
|
862
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
863
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept(); |
|
864
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
865
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
866
|
|
|
|
|
|
|
} |
|
867
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
|
868
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
|
869
|
|
|
|
|
|
|
|
|
870
|
|
|
|
|
|
|
# query params |
|
871
|
0
|
0
|
|
|
|
|
if ( exists $args{'document_id'} ) { |
|
872
|
|
|
|
|
|
|
$query_params->{'documentId'} = |
|
873
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'document_id'} ); |
|
874
|
|
|
|
|
|
|
} |
|
875
|
|
|
|
|
|
|
|
|
876
|
|
|
|
|
|
|
# query params |
|
877
|
0
|
0
|
|
|
|
|
if ( exists $args{'name'} ) { |
|
878
|
|
|
|
|
|
|
$query_params->{'name'} = |
|
879
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'name'} ); |
|
880
|
|
|
|
|
|
|
} |
|
881
|
|
|
|
|
|
|
|
|
882
|
0
|
|
|
|
|
|
my $_body_data; |
|
883
|
|
|
|
|
|
|
|
|
884
|
|
|
|
|
|
|
# authentication setting, if any |
|
885
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
886
|
|
|
|
|
|
|
|
|
887
|
|
|
|
|
|
|
# make the API Call |
|
888
|
|
|
|
|
|
|
$self->{api_client}->call_api( |
|
889
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
890
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
891
|
|
|
|
|
|
|
); |
|
892
|
0
|
|
|
|
|
|
return; |
|
893
|
|
|
|
|
|
|
} |
|
894
|
|
|
|
|
|
|
|
|
895
|
|
|
|
|
|
|
# |
|
896
|
|
|
|
|
|
|
# document_translate |
|
897
|
|
|
|
|
|
|
# |
|
898
|
|
|
|
|
|
|
# |
|
899
|
|
|
|
|
|
|
# |
|
900
|
|
|
|
|
|
|
# @param string $document_id (required) |
|
901
|
|
|
|
|
|
|
# @param File $translation_file (required) |
|
902
|
|
|
|
|
|
|
# @param boolean $overwrite (optional) |
|
903
|
|
|
|
|
|
|
# @param boolean $confirm_translation (optional) |
|
904
|
|
|
|
|
|
|
{ |
|
905
|
|
|
|
|
|
|
my $params = { |
|
906
|
|
|
|
|
|
|
'document_id' => { |
|
907
|
|
|
|
|
|
|
data_type => 'string', |
|
908
|
|
|
|
|
|
|
description => '', |
|
909
|
|
|
|
|
|
|
required => '1', |
|
910
|
|
|
|
|
|
|
}, |
|
911
|
|
|
|
|
|
|
'translation_file' => { |
|
912
|
|
|
|
|
|
|
data_type => 'File', |
|
913
|
|
|
|
|
|
|
description => '', |
|
914
|
|
|
|
|
|
|
required => '1', |
|
915
|
|
|
|
|
|
|
}, |
|
916
|
|
|
|
|
|
|
'overwrite' => { |
|
917
|
|
|
|
|
|
|
data_type => 'boolean', |
|
918
|
|
|
|
|
|
|
description => '', |
|
919
|
|
|
|
|
|
|
required => '0', |
|
920
|
|
|
|
|
|
|
}, |
|
921
|
|
|
|
|
|
|
'confirm_translation' => { |
|
922
|
|
|
|
|
|
|
data_type => 'boolean', |
|
923
|
|
|
|
|
|
|
description => '', |
|
924
|
|
|
|
|
|
|
required => '0', |
|
925
|
|
|
|
|
|
|
}, |
|
926
|
|
|
|
|
|
|
}; |
|
927
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'document_translate'} = { |
|
928
|
|
|
|
|
|
|
summary => '', |
|
929
|
|
|
|
|
|
|
params => $params, |
|
930
|
|
|
|
|
|
|
returns => undef, |
|
931
|
|
|
|
|
|
|
}; |
|
932
|
|
|
|
|
|
|
} |
|
933
|
|
|
|
|
|
|
|
|
934
|
|
|
|
|
|
|
# @return void |
|
935
|
|
|
|
|
|
|
# |
|
936
|
|
|
|
|
|
|
sub document_translate { |
|
937
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
938
|
|
|
|
|
|
|
|
|
939
|
|
|
|
|
|
|
# verify the required parameter 'document_id' is set |
|
940
|
0
|
0
|
|
|
|
|
unless ( exists $args{'document_id'} ) { |
|
941
|
0
|
|
|
|
|
|
croak( |
|
942
|
|
|
|
|
|
|
"Missing the required parameter 'document_id' when calling document_translate" |
|
943
|
|
|
|
|
|
|
); |
|
944
|
|
|
|
|
|
|
} |
|
945
|
|
|
|
|
|
|
|
|
946
|
|
|
|
|
|
|
# verify the required parameter 'translation_file' is set |
|
947
|
0
|
0
|
|
|
|
|
unless ( exists $args{'translation_file'} ) { |
|
948
|
0
|
|
|
|
|
|
croak( |
|
949
|
|
|
|
|
|
|
"Missing the required parameter 'translation_file' when calling document_translate" |
|
950
|
|
|
|
|
|
|
); |
|
951
|
|
|
|
|
|
|
} |
|
952
|
|
|
|
|
|
|
|
|
953
|
|
|
|
|
|
|
# parse inputs |
|
954
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document/translate'; |
|
955
|
|
|
|
|
|
|
|
|
956
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
|
957
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
958
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
959
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
960
|
|
|
|
|
|
|
|
|
961
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
962
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept(); |
|
963
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
964
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
965
|
|
|
|
|
|
|
} |
|
966
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
|
967
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type('multipart/form-data'); |
|
968
|
|
|
|
|
|
|
|
|
969
|
|
|
|
|
|
|
# query params |
|
970
|
0
|
0
|
|
|
|
|
if ( exists $args{'document_id'} ) { |
|
971
|
|
|
|
|
|
|
$query_params->{'documentId'} = |
|
972
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'document_id'} ); |
|
973
|
|
|
|
|
|
|
} |
|
974
|
|
|
|
|
|
|
|
|
975
|
|
|
|
|
|
|
# query params |
|
976
|
0
|
0
|
|
|
|
|
if ( exists $args{'overwrite'} ) { |
|
977
|
|
|
|
|
|
|
$query_params->{'overwrite'} = |
|
978
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'overwrite'} ); |
|
979
|
|
|
|
|
|
|
} |
|
980
|
|
|
|
|
|
|
|
|
981
|
|
|
|
|
|
|
# query params |
|
982
|
0
|
0
|
|
|
|
|
if ( exists $args{'confirm_translation'} ) { |
|
983
|
|
|
|
|
|
|
$query_params->{'confirmTranslation'} = |
|
984
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'confirm_translation'} ); |
|
985
|
|
|
|
|
|
|
} |
|
986
|
|
|
|
|
|
|
|
|
987
|
|
|
|
|
|
|
# form params |
|
988
|
0
|
0
|
|
|
|
|
if ( exists $args{'translation_file'} ) { |
|
989
|
|
|
|
|
|
|
$form_params->{'translationFile'} = [] |
|
990
|
0
|
0
|
|
|
|
|
unless defined $form_params->{'translationFile'}; |
|
991
|
0
|
|
|
|
|
|
push @{ $form_params->{'translationFile'} }, $args{'translation_file'}; |
|
|
0
|
|
|
|
|
|
|
|
992
|
|
|
|
|
|
|
} |
|
993
|
|
|
|
|
|
|
|
|
994
|
0
|
|
|
|
|
|
my $_body_data; |
|
995
|
|
|
|
|
|
|
|
|
996
|
|
|
|
|
|
|
# authentication setting, if any |
|
997
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
998
|
|
|
|
|
|
|
|
|
999
|
|
|
|
|
|
|
# make the API Call |
|
1000
|
|
|
|
|
|
|
$self->{api_client}->call_api( |
|
1001
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
1002
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
1003
|
|
|
|
|
|
|
); |
|
1004
|
0
|
|
|
|
|
|
return; |
|
1005
|
|
|
|
|
|
|
} |
|
1006
|
|
|
|
|
|
|
|
|
1007
|
|
|
|
|
|
|
# |
|
1008
|
|
|
|
|
|
|
# document_translate_with_xliff |
|
1009
|
|
|
|
|
|
|
# |
|
1010
|
|
|
|
|
|
|
# |
|
1011
|
|
|
|
|
|
|
# |
|
1012
|
|
|
|
|
|
|
# @param string $document_id ID of the document to update (required) |
|
1013
|
|
|
|
|
|
|
# @param boolean $confirm_translation Confirm updated segments (required) |
|
1014
|
|
|
|
|
|
|
# @param boolean $overwrite_updated_segments Overwrite the segments that have been updated since the last export of the XLIFF file (required) |
|
1015
|
|
|
|
|
|
|
# @param File $translation_file XLIFF file with updated segments (required) |
|
1016
|
|
|
|
|
|
|
{ |
|
1017
|
|
|
|
|
|
|
my $params = { |
|
1018
|
|
|
|
|
|
|
'document_id' => { |
|
1019
|
|
|
|
|
|
|
data_type => 'string', |
|
1020
|
|
|
|
|
|
|
description => 'ID of the document to update', |
|
1021
|
|
|
|
|
|
|
required => '1', |
|
1022
|
|
|
|
|
|
|
}, |
|
1023
|
|
|
|
|
|
|
'confirm_translation' => { |
|
1024
|
|
|
|
|
|
|
data_type => 'boolean', |
|
1025
|
|
|
|
|
|
|
description => 'Confirm updated segments', |
|
1026
|
|
|
|
|
|
|
required => '1', |
|
1027
|
|
|
|
|
|
|
}, |
|
1028
|
|
|
|
|
|
|
'overwrite_updated_segments' => { |
|
1029
|
|
|
|
|
|
|
data_type => 'boolean', |
|
1030
|
|
|
|
|
|
|
description => |
|
1031
|
|
|
|
|
|
|
'Overwrite the segments that have been updated since the last export of the XLIFF file', |
|
1032
|
|
|
|
|
|
|
required => '1', |
|
1033
|
|
|
|
|
|
|
}, |
|
1034
|
|
|
|
|
|
|
'translation_file' => { |
|
1035
|
|
|
|
|
|
|
data_type => 'File', |
|
1036
|
|
|
|
|
|
|
description => 'XLIFF file with updated segments', |
|
1037
|
|
|
|
|
|
|
required => '1', |
|
1038
|
|
|
|
|
|
|
}, |
|
1039
|
|
|
|
|
|
|
}; |
|
1040
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'document_translate_with_xliff'} = { |
|
1041
|
|
|
|
|
|
|
summary => '', |
|
1042
|
|
|
|
|
|
|
params => $params, |
|
1043
|
|
|
|
|
|
|
returns => undef, |
|
1044
|
|
|
|
|
|
|
}; |
|
1045
|
|
|
|
|
|
|
} |
|
1046
|
|
|
|
|
|
|
|
|
1047
|
|
|
|
|
|
|
# @return void |
|
1048
|
|
|
|
|
|
|
# |
|
1049
|
|
|
|
|
|
|
sub document_translate_with_xliff { |
|
1050
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
1051
|
|
|
|
|
|
|
|
|
1052
|
|
|
|
|
|
|
# verify the required parameter 'document_id' is set |
|
1053
|
0
|
0
|
|
|
|
|
unless ( exists $args{'document_id'} ) { |
|
1054
|
0
|
|
|
|
|
|
croak( |
|
1055
|
|
|
|
|
|
|
"Missing the required parameter 'document_id' when calling document_translate_with_xliff" |
|
1056
|
|
|
|
|
|
|
); |
|
1057
|
|
|
|
|
|
|
} |
|
1058
|
|
|
|
|
|
|
|
|
1059
|
|
|
|
|
|
|
# verify the required parameter 'confirm_translation' is set |
|
1060
|
0
|
0
|
|
|
|
|
unless ( exists $args{'confirm_translation'} ) { |
|
1061
|
0
|
|
|
|
|
|
croak( |
|
1062
|
|
|
|
|
|
|
"Missing the required parameter 'confirm_translation' when calling document_translate_with_xliff" |
|
1063
|
|
|
|
|
|
|
); |
|
1064
|
|
|
|
|
|
|
} |
|
1065
|
|
|
|
|
|
|
|
|
1066
|
|
|
|
|
|
|
# verify the required parameter 'overwrite_updated_segments' is set |
|
1067
|
0
|
0
|
|
|
|
|
unless ( exists $args{'overwrite_updated_segments'} ) { |
|
1068
|
0
|
|
|
|
|
|
croak( |
|
1069
|
|
|
|
|
|
|
"Missing the required parameter 'overwrite_updated_segments' when calling document_translate_with_xliff" |
|
1070
|
|
|
|
|
|
|
); |
|
1071
|
|
|
|
|
|
|
} |
|
1072
|
|
|
|
|
|
|
|
|
1073
|
|
|
|
|
|
|
# verify the required parameter 'translation_file' is set |
|
1074
|
0
|
0
|
|
|
|
|
unless ( exists $args{'translation_file'} ) { |
|
1075
|
0
|
|
|
|
|
|
croak( |
|
1076
|
|
|
|
|
|
|
"Missing the required parameter 'translation_file' when calling document_translate_with_xliff" |
|
1077
|
|
|
|
|
|
|
); |
|
1078
|
|
|
|
|
|
|
} |
|
1079
|
|
|
|
|
|
|
|
|
1080
|
|
|
|
|
|
|
# parse inputs |
|
1081
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document/translateWithXliff'; |
|
1082
|
|
|
|
|
|
|
|
|
1083
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
|
1084
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
1085
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
1086
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
1087
|
|
|
|
|
|
|
|
|
1088
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
1089
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept(); |
|
1090
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
1091
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
1092
|
|
|
|
|
|
|
} |
|
1093
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
|
1094
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type('multipart/form-data'); |
|
1095
|
|
|
|
|
|
|
|
|
1096
|
|
|
|
|
|
|
# query params |
|
1097
|
0
|
0
|
|
|
|
|
if ( exists $args{'document_id'} ) { |
|
1098
|
|
|
|
|
|
|
$query_params->{'documentId'} = |
|
1099
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'document_id'} ); |
|
1100
|
|
|
|
|
|
|
} |
|
1101
|
|
|
|
|
|
|
|
|
1102
|
|
|
|
|
|
|
# query params |
|
1103
|
0
|
0
|
|
|
|
|
if ( exists $args{'confirm_translation'} ) { |
|
1104
|
|
|
|
|
|
|
$query_params->{'confirmTranslation'} = |
|
1105
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'confirm_translation'} ); |
|
1106
|
|
|
|
|
|
|
} |
|
1107
|
|
|
|
|
|
|
|
|
1108
|
|
|
|
|
|
|
# query params |
|
1109
|
0
|
0
|
|
|
|
|
if ( exists $args{'overwrite_updated_segments'} ) { |
|
1110
|
|
|
|
|
|
|
$query_params->{'overwriteUpdatedSegments'} = $self->{api_client} |
|
1111
|
0
|
|
|
|
|
|
->to_query_value( $args{'overwrite_updated_segments'} ); |
|
1112
|
|
|
|
|
|
|
} |
|
1113
|
|
|
|
|
|
|
|
|
1114
|
|
|
|
|
|
|
# form params |
|
1115
|
0
|
0
|
|
|
|
|
if ( exists $args{'translation_file'} ) { |
|
1116
|
|
|
|
|
|
|
$form_params->{'translationFile'} = [] |
|
1117
|
0
|
0
|
|
|
|
|
unless defined $form_params->{'translationFile'}; |
|
1118
|
0
|
|
|
|
|
|
push @{ $form_params->{'translationFile'} }, $args{'translation_file'}; |
|
|
0
|
|
|
|
|
|
|
|
1119
|
|
|
|
|
|
|
} |
|
1120
|
|
|
|
|
|
|
|
|
1121
|
0
|
|
|
|
|
|
my $_body_data; |
|
1122
|
|
|
|
|
|
|
|
|
1123
|
|
|
|
|
|
|
# authentication setting, if any |
|
1124
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
1125
|
|
|
|
|
|
|
|
|
1126
|
|
|
|
|
|
|
# make the API Call |
|
1127
|
|
|
|
|
|
|
$self->{api_client}->call_api( |
|
1128
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
1129
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
1130
|
|
|
|
|
|
|
); |
|
1131
|
0
|
|
|
|
|
|
return; |
|
1132
|
|
|
|
|
|
|
} |
|
1133
|
|
|
|
|
|
|
|
|
1134
|
|
|
|
|
|
|
# |
|
1135
|
|
|
|
|
|
|
# document_update |
|
1136
|
|
|
|
|
|
|
# |
|
1137
|
|
|
|
|
|
|
# |
|
1138
|
|
|
|
|
|
|
# |
|
1139
|
|
|
|
|
|
|
# @param string $document_id (required) |
|
1140
|
|
|
|
|
|
|
# @param UploadDocumentPropertiesModel $update_document_model (required) |
|
1141
|
|
|
|
|
|
|
# @param $file (required) |
|
1142
|
|
|
|
|
|
|
# @param string $disassemble_algorithm_name (optional) |
|
1143
|
|
|
|
|
|
|
# @param string $preset_disassemble_algorithm (optional) |
|
1144
|
|
|
|
|
|
|
{ |
|
1145
|
|
|
|
|
|
|
my $params = { |
|
1146
|
|
|
|
|
|
|
'document_id' => { |
|
1147
|
|
|
|
|
|
|
data_type => 'string', |
|
1148
|
|
|
|
|
|
|
description => '', |
|
1149
|
|
|
|
|
|
|
required => '1', |
|
1150
|
|
|
|
|
|
|
}, |
|
1151
|
|
|
|
|
|
|
'update_document_model' => { |
|
1152
|
|
|
|
|
|
|
data_type => 'UploadDocumentPropertiesModel', |
|
1153
|
|
|
|
|
|
|
description => '', |
|
1154
|
|
|
|
|
|
|
required => '1', |
|
1155
|
|
|
|
|
|
|
}, |
|
1156
|
|
|
|
|
|
|
'file' => { |
|
1157
|
|
|
|
|
|
|
data_type => '', |
|
1158
|
|
|
|
|
|
|
description => '', |
|
1159
|
|
|
|
|
|
|
required => '1', |
|
1160
|
|
|
|
|
|
|
}, |
|
1161
|
|
|
|
|
|
|
'disassemble_algorithm_name' => { |
|
1162
|
|
|
|
|
|
|
data_type => 'string', |
|
1163
|
|
|
|
|
|
|
description => '', |
|
1164
|
|
|
|
|
|
|
required => '0', |
|
1165
|
|
|
|
|
|
|
}, |
|
1166
|
|
|
|
|
|
|
'preset_disassemble_algorithm' => { |
|
1167
|
|
|
|
|
|
|
data_type => 'string', |
|
1168
|
|
|
|
|
|
|
description => '', |
|
1169
|
|
|
|
|
|
|
required => '0', |
|
1170
|
|
|
|
|
|
|
}, |
|
1171
|
|
|
|
|
|
|
}; |
|
1172
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'document_update'} = { |
|
1173
|
|
|
|
|
|
|
summary => '', |
|
1174
|
|
|
|
|
|
|
params => $params, |
|
1175
|
|
|
|
|
|
|
returns => 'ARRAY[DocumentModel]', |
|
1176
|
|
|
|
|
|
|
}; |
|
1177
|
|
|
|
|
|
|
} |
|
1178
|
|
|
|
|
|
|
|
|
1179
|
|
|
|
|
|
|
# @return ARRAY[DocumentModel] |
|
1180
|
|
|
|
|
|
|
# |
|
1181
|
|
|
|
|
|
|
sub document_update { |
|
1182
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
|
1183
|
|
|
|
|
|
|
|
|
1184
|
|
|
|
|
|
|
# verify the required parameter 'document_id' is set |
|
1185
|
0
|
0
|
|
|
|
|
unless ( exists $args{'document_id'} ) { |
|
1186
|
0
|
|
|
|
|
|
croak( |
|
1187
|
|
|
|
|
|
|
"Missing the required parameter 'document_id' when calling document_update" |
|
1188
|
|
|
|
|
|
|
); |
|
1189
|
|
|
|
|
|
|
} |
|
1190
|
|
|
|
|
|
|
|
|
1191
|
|
|
|
|
|
|
# verify the required parameter 'update_document_model' is set |
|
1192
|
0
|
0
|
|
|
|
|
unless ( exists $args{'update_document_model'} ) { |
|
1193
|
0
|
|
|
|
|
|
croak( |
|
1194
|
|
|
|
|
|
|
"Missing the required parameter 'update_document_model' when calling document_update" |
|
1195
|
|
|
|
|
|
|
); |
|
1196
|
|
|
|
|
|
|
} |
|
1197
|
|
|
|
|
|
|
|
|
1198
|
|
|
|
|
|
|
# verify the required parameter 'file' is set |
|
1199
|
0
|
0
|
|
|
|
|
unless ( exists $args{'file'} ) { |
|
1200
|
0
|
|
|
|
|
|
croak( |
|
1201
|
|
|
|
|
|
|
"Missing the required parameter 'file' when calling document_update" |
|
1202
|
|
|
|
|
|
|
); |
|
1203
|
|
|
|
|
|
|
} |
|
1204
|
|
|
|
|
|
|
|
|
1205
|
|
|
|
|
|
|
# parse inputs |
|
1206
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/document/update'; |
|
1207
|
|
|
|
|
|
|
|
|
1208
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
|
1209
|
0
|
|
|
|
|
|
my $query_params = {}; |
|
1210
|
0
|
|
|
|
|
|
my $header_params = {}; |
|
1211
|
0
|
|
|
|
|
|
my $form_params = {}; |
|
1212
|
|
|
|
|
|
|
|
|
1213
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
|
1214
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
|
1215
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
|
1216
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
|
1217
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
|
1218
|
|
|
|
|
|
|
} |
|
1219
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
|
1220
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type('multipart/form-data'); |
|
1221
|
|
|
|
|
|
|
|
|
1222
|
|
|
|
|
|
|
# query params |
|
1223
|
0
|
0
|
|
|
|
|
if ( exists $args{'document_id'} ) { |
|
1224
|
|
|
|
|
|
|
$query_params->{'documentId'} = |
|
1225
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'document_id'} ); |
|
1226
|
|
|
|
|
|
|
} |
|
1227
|
|
|
|
|
|
|
|
|
1228
|
|
|
|
|
|
|
# query params |
|
1229
|
0
|
0
|
|
|
|
|
if ( exists $args{'disassemble_algorithm_name'} ) { |
|
1230
|
|
|
|
|
|
|
$query_params->{'disassembleAlgorithmName'} = $self->{api_client} |
|
1231
|
0
|
|
|
|
|
|
->to_query_value( $args{'disassemble_algorithm_name'} ); |
|
1232
|
|
|
|
|
|
|
} |
|
1233
|
|
|
|
|
|
|
|
|
1234
|
|
|
|
|
|
|
# query params |
|
1235
|
0
|
0
|
|
|
|
|
if ( exists $args{'preset_disassemble_algorithm'} ) { |
|
1236
|
|
|
|
|
|
|
$query_params->{'presetDisassembleAlgorithm'} = $self->{api_client} |
|
1237
|
0
|
|
|
|
|
|
->to_query_value( $args{'preset_disassemble_algorithm'} ); |
|
1238
|
|
|
|
|
|
|
} |
|
1239
|
|
|
|
|
|
|
|
|
1240
|
0
|
|
|
|
|
|
my $_body_data = []; |
|
1241
|
|
|
|
|
|
|
|
|
1242
|
|
|
|
|
|
|
# body params |
|
1243
|
0
|
0
|
|
|
|
|
if ( exists $args{'update_document_model'} ) { |
|
1244
|
|
|
|
|
|
|
push( |
|
1245
|
|
|
|
|
|
|
@$_body_data, |
|
1246
|
|
|
|
|
|
|
updateDocumentModel => [ |
|
1247
|
|
|
|
|
|
|
undef, |
|
1248
|
|
|
|
|
|
|
undef, |
|
1249
|
|
|
|
|
|
|
Content_Type => 'application/json', |
|
1250
|
0
|
|
|
|
|
|
Content => to_json( $args{'update_document_model'}->to_hash ) |
|
1251
|
|
|
|
|
|
|
] |
|
1252
|
|
|
|
|
|
|
); |
|
1253
|
|
|
|
|
|
|
} |
|
1254
|
0
|
0
|
|
|
|
|
if ( exists $args{'file'} ) { |
|
1255
|
|
|
|
|
|
|
push( |
|
1256
|
|
|
|
|
|
|
@$_body_data, |
|
1257
|
|
|
|
|
|
|
file => [ |
|
1258
|
0
|
|
|
|
|
|
$args{'file'}, undef, |
|
1259
|
|
|
|
|
|
|
Content_Type => 'application/octetstream' |
|
1260
|
|
|
|
|
|
|
] |
|
1261
|
|
|
|
|
|
|
); |
|
1262
|
|
|
|
|
|
|
} |
|
1263
|
|
|
|
|
|
|
|
|
1264
|
|
|
|
|
|
|
# authentication setting, if any |
|
1265
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
|
1266
|
|
|
|
|
|
|
|
|
1267
|
|
|
|
|
|
|
# make the API Call |
|
1268
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
|
1269
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
|
1270
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
|
1271
|
|
|
|
|
|
|
); |
|
1272
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
|
1273
|
0
|
|
|
|
|
|
return; |
|
1274
|
|
|
|
|
|
|
} |
|
1275
|
|
|
|
|
|
|
my $_response_object = |
|
1276
|
0
|
|
|
|
|
|
$self->{api_client}->deserialize( 'ARRAY[DocumentModel]', $response ); |
|
1277
|
0
|
|
|
|
|
|
return $_response_object; |
|
1278
|
|
|
|
|
|
|
} |
|
1279
|
|
|
|
|
|
|
|
|
1280
|
|
|
|
|
|
|
1; |