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::TranslationMemoriesApi; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
require 5.6.0; |
24
|
1
|
|
|
1
|
|
781
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
25
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
26
|
1
|
|
|
1
|
|
588
|
use utf8; |
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
5
|
|
27
|
1
|
|
|
1
|
|
31
|
use Exporter; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
28
|
1
|
|
|
1
|
|
5
|
use Carp qw( croak ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
29
|
1
|
|
|
1
|
|
451
|
use Log::Any qw($log); |
|
1
|
|
|
|
|
8431
|
|
|
1
|
|
|
|
|
5
|
|
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
1
|
|
2621
|
use Smartcat::Client::ApiClient; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
40
|
|
32
|
|
|
|
|
|
|
|
33
|
1
|
|
|
1
|
|
8
|
use base "Class::Data::Inheritable"; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
529
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata( 'method_documentation' => {} ); |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub new { |
38
|
1
|
|
|
1
|
0
|
1048
|
my $class = shift; |
39
|
1
|
|
|
|
|
2
|
my $api_client; |
40
|
|
|
|
|
|
|
|
41
|
1
|
50
|
33
|
|
|
7
|
if ( $_[0] && ref $_[0] && ref $_[0] eq 'Smartcat::Client::ApiClient' ) { |
|
|
|
33
|
|
|
|
|
42
|
0
|
|
|
|
|
0
|
$api_client = $_[0]; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
else { |
45
|
1
|
|
|
|
|
6
|
$api_client = Smartcat::Client::ApiClient->new(@_); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
5
|
bless { api_client => $api_client }, $class; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
# |
53
|
|
|
|
|
|
|
# translation_memories_create_empty_tm |
54
|
|
|
|
|
|
|
# |
55
|
|
|
|
|
|
|
# |
56
|
|
|
|
|
|
|
# |
57
|
|
|
|
|
|
|
# @param CreateTranslationMemoryModel $model (required) |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
my $params = { |
60
|
|
|
|
|
|
|
'model' => { |
61
|
|
|
|
|
|
|
data_type => 'CreateTranslationMemoryModel', |
62
|
|
|
|
|
|
|
description => '', |
63
|
|
|
|
|
|
|
required => '1', |
64
|
|
|
|
|
|
|
}, |
65
|
|
|
|
|
|
|
}; |
66
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'translation_memories_create_empty_tm'} |
67
|
|
|
|
|
|
|
= { |
68
|
|
|
|
|
|
|
summary => '', |
69
|
|
|
|
|
|
|
params => $params, |
70
|
|
|
|
|
|
|
returns => 'string', |
71
|
|
|
|
|
|
|
}; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
# @return string |
75
|
|
|
|
|
|
|
# |
76
|
|
|
|
|
|
|
sub translation_memories_create_empty_tm { |
77
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
# verify the required parameter 'model' is set |
80
|
0
|
0
|
|
|
|
|
unless ( exists $args{'model'} ) { |
81
|
0
|
|
|
|
|
|
croak( |
82
|
|
|
|
|
|
|
"Missing the required parameter 'model' when calling translation_memories_create_empty_tm" |
83
|
|
|
|
|
|
|
); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
# parse inputs |
87
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/translationmemory'; |
88
|
|
|
|
|
|
|
|
89
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
90
|
0
|
|
|
|
|
|
my $query_params = {}; |
91
|
0
|
|
|
|
|
|
my $header_params = {}; |
92
|
0
|
|
|
|
|
|
my $form_params = {}; |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
95
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
96
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
97
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
98
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client} |
101
|
0
|
|
|
|
|
|
->select_header_content_type( 'application/json', 'text/json' ); |
102
|
|
|
|
|
|
|
|
103
|
0
|
|
|
|
|
|
my $_body_data; |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
# body params |
106
|
0
|
0
|
|
|
|
|
if ( exists $args{'model'} ) { |
107
|
0
|
|
|
|
|
|
$_body_data = $args{'model'}; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
# authentication setting, if any |
111
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
# make the API Call |
114
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
115
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
116
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
117
|
|
|
|
|
|
|
); |
118
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
119
|
0
|
|
|
|
|
|
return; |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
my $_response_object = |
122
|
0
|
|
|
|
|
|
$self->{api_client}->deserialize( 'string', $response ); |
123
|
0
|
|
|
|
|
|
return $_response_object; |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
# |
127
|
|
|
|
|
|
|
# translation_memories_export_file |
128
|
|
|
|
|
|
|
# |
129
|
|
|
|
|
|
|
# |
130
|
|
|
|
|
|
|
# |
131
|
|
|
|
|
|
|
# @param string $tm_id (required) |
132
|
|
|
|
|
|
|
# @param string $export_mode (required) |
133
|
|
|
|
|
|
|
# @param boolean $with_tags (required) |
134
|
|
|
|
|
|
|
{ |
135
|
|
|
|
|
|
|
my $params = { |
136
|
|
|
|
|
|
|
'tm_id' => { |
137
|
|
|
|
|
|
|
data_type => 'string', |
138
|
|
|
|
|
|
|
description => '', |
139
|
|
|
|
|
|
|
required => '1', |
140
|
|
|
|
|
|
|
}, |
141
|
|
|
|
|
|
|
'export_mode' => { |
142
|
|
|
|
|
|
|
data_type => 'string', |
143
|
|
|
|
|
|
|
description => '', |
144
|
|
|
|
|
|
|
required => '1', |
145
|
|
|
|
|
|
|
}, |
146
|
|
|
|
|
|
|
'with_tags' => { |
147
|
|
|
|
|
|
|
data_type => 'boolean', |
148
|
|
|
|
|
|
|
description => '', |
149
|
|
|
|
|
|
|
required => '1', |
150
|
|
|
|
|
|
|
}, |
151
|
|
|
|
|
|
|
}; |
152
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'translation_memories_export_file'} = { |
153
|
|
|
|
|
|
|
summary => '', |
154
|
|
|
|
|
|
|
params => $params, |
155
|
|
|
|
|
|
|
returns => 'Object', |
156
|
|
|
|
|
|
|
}; |
157
|
|
|
|
|
|
|
} |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
# @return Object |
160
|
|
|
|
|
|
|
# |
161
|
|
|
|
|
|
|
sub translation_memories_export_file { |
162
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
# verify the required parameter 'tm_id' is set |
165
|
0
|
0
|
|
|
|
|
unless ( exists $args{'tm_id'} ) { |
166
|
0
|
|
|
|
|
|
croak( |
167
|
|
|
|
|
|
|
"Missing the required parameter 'tm_id' when calling translation_memories_export_file" |
168
|
|
|
|
|
|
|
); |
169
|
|
|
|
|
|
|
} |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
# verify the required parameter 'export_mode' is set |
172
|
0
|
0
|
|
|
|
|
unless ( exists $args{'export_mode'} ) { |
173
|
0
|
|
|
|
|
|
croak( |
174
|
|
|
|
|
|
|
"Missing the required parameter 'export_mode' when calling translation_memories_export_file" |
175
|
|
|
|
|
|
|
); |
176
|
|
|
|
|
|
|
} |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
# verify the required parameter 'with_tags' is set |
179
|
0
|
0
|
|
|
|
|
unless ( exists $args{'with_tags'} ) { |
180
|
0
|
|
|
|
|
|
croak( |
181
|
|
|
|
|
|
|
"Missing the required parameter 'with_tags' when calling translation_memories_export_file" |
182
|
|
|
|
|
|
|
); |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
# parse inputs |
186
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/translationmemory/{tmId}/file'; |
187
|
|
|
|
|
|
|
|
188
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
189
|
0
|
|
|
|
|
|
my $query_params = {}; |
190
|
0
|
|
|
|
|
|
my $header_params = {}; |
191
|
0
|
|
|
|
|
|
my $form_params = {}; |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
194
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
195
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
196
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
197
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
198
|
|
|
|
|
|
|
} |
199
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
200
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
# query params |
203
|
0
|
0
|
|
|
|
|
if ( exists $args{'export_mode'} ) { |
204
|
|
|
|
|
|
|
$query_params->{'exportMode'} = |
205
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'export_mode'} ); |
206
|
|
|
|
|
|
|
} |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
# query params |
209
|
0
|
0
|
|
|
|
|
if ( exists $args{'with_tags'} ) { |
210
|
|
|
|
|
|
|
$query_params->{'withTags'} = |
211
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'with_tags'} ); |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
# path params |
215
|
0
|
0
|
|
|
|
|
if ( exists $args{'tm_id'} ) { |
216
|
0
|
|
|
|
|
|
my $_base_variable = "{" . "tmId" . "}"; |
217
|
0
|
|
|
|
|
|
my $_base_value = $self->{api_client}->to_path_value( $args{'tm_id'} ); |
218
|
0
|
|
|
|
|
|
$_resource_path =~ s/$_base_variable/$_base_value/g; |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
|
221
|
0
|
|
|
|
|
|
my $_body_data; |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
# authentication setting, if any |
224
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
# make the API Call |
227
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
228
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
229
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
230
|
|
|
|
|
|
|
); |
231
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
232
|
0
|
|
|
|
|
|
return; |
233
|
|
|
|
|
|
|
} |
234
|
|
|
|
|
|
|
my $_response_object = |
235
|
0
|
|
|
|
|
|
$self->{api_client}->deserialize( 'Object', $response ); |
236
|
0
|
|
|
|
|
|
return $_response_object; |
237
|
|
|
|
|
|
|
} |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
# |
240
|
|
|
|
|
|
|
# translation_memories_get_meta_info |
241
|
|
|
|
|
|
|
# |
242
|
|
|
|
|
|
|
# Receiving TM details |
243
|
|
|
|
|
|
|
# |
244
|
|
|
|
|
|
|
# @param string $tm_id TM ID (required) |
245
|
|
|
|
|
|
|
{ |
246
|
|
|
|
|
|
|
my $params = { |
247
|
|
|
|
|
|
|
'tm_id' => { |
248
|
|
|
|
|
|
|
data_type => 'string', |
249
|
|
|
|
|
|
|
description => 'TM ID', |
250
|
|
|
|
|
|
|
required => '1', |
251
|
|
|
|
|
|
|
}, |
252
|
|
|
|
|
|
|
}; |
253
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'translation_memories_get_meta_info'} = |
254
|
|
|
|
|
|
|
{ |
255
|
|
|
|
|
|
|
summary => 'Receiving TM details', |
256
|
|
|
|
|
|
|
params => $params, |
257
|
|
|
|
|
|
|
returns => 'TranslationMemoryModel', |
258
|
|
|
|
|
|
|
}; |
259
|
|
|
|
|
|
|
} |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
# @return TranslationMemoryModel |
262
|
|
|
|
|
|
|
# |
263
|
|
|
|
|
|
|
sub translation_memories_get_meta_info { |
264
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
# verify the required parameter 'tm_id' is set |
267
|
0
|
0
|
|
|
|
|
unless ( exists $args{'tm_id'} ) { |
268
|
0
|
|
|
|
|
|
croak( |
269
|
|
|
|
|
|
|
"Missing the required parameter 'tm_id' when calling translation_memories_get_meta_info" |
270
|
|
|
|
|
|
|
); |
271
|
|
|
|
|
|
|
} |
272
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
# parse inputs |
274
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/translationmemory/{tmId}'; |
275
|
|
|
|
|
|
|
|
276
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
277
|
0
|
|
|
|
|
|
my $query_params = {}; |
278
|
0
|
|
|
|
|
|
my $header_params = {}; |
279
|
0
|
|
|
|
|
|
my $form_params = {}; |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
282
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
283
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
284
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
285
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
286
|
|
|
|
|
|
|
} |
287
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
288
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
289
|
|
|
|
|
|
|
|
290
|
|
|
|
|
|
|
# path params |
291
|
0
|
0
|
|
|
|
|
if ( exists $args{'tm_id'} ) { |
292
|
0
|
|
|
|
|
|
my $_base_variable = "{" . "tmId" . "}"; |
293
|
0
|
|
|
|
|
|
my $_base_value = $self->{api_client}->to_path_value( $args{'tm_id'} ); |
294
|
0
|
|
|
|
|
|
$_resource_path =~ s/$_base_variable/$_base_value/g; |
295
|
|
|
|
|
|
|
} |
296
|
|
|
|
|
|
|
|
297
|
0
|
|
|
|
|
|
my $_body_data; |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
# authentication setting, if any |
300
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
# make the API Call |
303
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
304
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
305
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
306
|
|
|
|
|
|
|
); |
307
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
308
|
0
|
|
|
|
|
|
return; |
309
|
|
|
|
|
|
|
} |
310
|
|
|
|
|
|
|
my $_response_object = |
311
|
0
|
|
|
|
|
|
$self->{api_client}->deserialize( 'TranslationMemoryModel', $response ); |
312
|
0
|
|
|
|
|
|
return $_response_object; |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
# |
316
|
|
|
|
|
|
|
# translation_memories_get_pending_tasks |
317
|
|
|
|
|
|
|
# |
318
|
|
|
|
|
|
|
# Receive a collection of TMX import tasks |
319
|
|
|
|
|
|
|
# |
320
|
|
|
|
|
|
|
{ |
321
|
|
|
|
|
|
|
my $params = {}; |
322
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{ |
323
|
|
|
|
|
|
|
'translation_memories_get_pending_tasks'} = { |
324
|
|
|
|
|
|
|
summary => 'Receive a collection of TMX import tasks', |
325
|
|
|
|
|
|
|
params => $params, |
326
|
|
|
|
|
|
|
returns => 'ARRAY[TMImportTaskModel]', |
327
|
|
|
|
|
|
|
}; |
328
|
|
|
|
|
|
|
} |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
# @return ARRAY[TMImportTaskModel] |
331
|
|
|
|
|
|
|
# |
332
|
|
|
|
|
|
|
sub translation_memories_get_pending_tasks { |
333
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
# parse inputs |
336
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/translationmemory/task'; |
337
|
|
|
|
|
|
|
|
338
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
339
|
0
|
|
|
|
|
|
my $query_params = {}; |
340
|
0
|
|
|
|
|
|
my $header_params = {}; |
341
|
0
|
|
|
|
|
|
my $form_params = {}; |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
344
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
345
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
346
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
347
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
348
|
|
|
|
|
|
|
} |
349
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
350
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
351
|
|
|
|
|
|
|
|
352
|
0
|
|
|
|
|
|
my $_body_data; |
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
# authentication setting, if any |
355
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
# make the API Call |
358
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
359
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
360
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
361
|
|
|
|
|
|
|
); |
362
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
363
|
0
|
|
|
|
|
|
return; |
364
|
|
|
|
|
|
|
} |
365
|
|
|
|
|
|
|
my $_response_object = |
366
|
0
|
|
|
|
|
|
$self->{api_client}->deserialize( 'ARRAY[TMImportTaskModel]', $response ); |
367
|
0
|
|
|
|
|
|
return $_response_object; |
368
|
|
|
|
|
|
|
} |
369
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
# |
371
|
|
|
|
|
|
|
# translation_memories_get_tm_translations |
372
|
|
|
|
|
|
|
# |
373
|
|
|
|
|
|
|
# |
374
|
|
|
|
|
|
|
# |
375
|
|
|
|
|
|
|
# @param TMMatchesRequest $request (required) |
376
|
|
|
|
|
|
|
# @param string $tm_id (required) |
377
|
|
|
|
|
|
|
{ |
378
|
|
|
|
|
|
|
my $params = { |
379
|
|
|
|
|
|
|
'request' => { |
380
|
|
|
|
|
|
|
data_type => 'TMMatchesRequest', |
381
|
|
|
|
|
|
|
description => '', |
382
|
|
|
|
|
|
|
required => '1', |
383
|
|
|
|
|
|
|
}, |
384
|
|
|
|
|
|
|
'tm_id' => { |
385
|
|
|
|
|
|
|
data_type => 'string', |
386
|
|
|
|
|
|
|
description => '', |
387
|
|
|
|
|
|
|
required => '1', |
388
|
|
|
|
|
|
|
}, |
389
|
|
|
|
|
|
|
}; |
390
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{ |
391
|
|
|
|
|
|
|
'translation_memories_get_tm_translations'} = { |
392
|
|
|
|
|
|
|
summary => '', |
393
|
|
|
|
|
|
|
params => $params, |
394
|
|
|
|
|
|
|
returns => 'SegmentWithMatchesModel', |
395
|
|
|
|
|
|
|
}; |
396
|
|
|
|
|
|
|
} |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
# @return SegmentWithMatchesModel |
399
|
|
|
|
|
|
|
# |
400
|
|
|
|
|
|
|
sub translation_memories_get_tm_translations { |
401
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
# verify the required parameter 'request' is set |
404
|
0
|
0
|
|
|
|
|
unless ( exists $args{'request'} ) { |
405
|
0
|
|
|
|
|
|
croak( |
406
|
|
|
|
|
|
|
"Missing the required parameter 'request' when calling translation_memories_get_tm_translations" |
407
|
|
|
|
|
|
|
); |
408
|
|
|
|
|
|
|
} |
409
|
|
|
|
|
|
|
|
410
|
|
|
|
|
|
|
# verify the required parameter 'tm_id' is set |
411
|
0
|
0
|
|
|
|
|
unless ( exists $args{'tm_id'} ) { |
412
|
0
|
|
|
|
|
|
croak( |
413
|
|
|
|
|
|
|
"Missing the required parameter 'tm_id' when calling translation_memories_get_tm_translations" |
414
|
|
|
|
|
|
|
); |
415
|
|
|
|
|
|
|
} |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
# parse inputs |
418
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/translationmemory/matches'; |
419
|
|
|
|
|
|
|
|
420
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
421
|
0
|
|
|
|
|
|
my $query_params = {}; |
422
|
0
|
|
|
|
|
|
my $header_params = {}; |
423
|
0
|
|
|
|
|
|
my $form_params = {}; |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
426
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
427
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
428
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
429
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
430
|
|
|
|
|
|
|
} |
431
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client} |
432
|
0
|
|
|
|
|
|
->select_header_content_type( 'application/json', 'text/json' ); |
433
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
# query params |
435
|
0
|
0
|
|
|
|
|
if ( exists $args{'tm_id'} ) { |
436
|
|
|
|
|
|
|
$query_params->{'tmId'} = |
437
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'tm_id'} ); |
438
|
|
|
|
|
|
|
} |
439
|
|
|
|
|
|
|
|
440
|
0
|
|
|
|
|
|
my $_body_data; |
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
# body params |
443
|
0
|
0
|
|
|
|
|
if ( exists $args{'request'} ) { |
444
|
0
|
|
|
|
|
|
$_body_data = $args{'request'}; |
445
|
|
|
|
|
|
|
} |
446
|
|
|
|
|
|
|
|
447
|
|
|
|
|
|
|
# authentication setting, if any |
448
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
449
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
# make the API Call |
451
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
452
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
453
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
454
|
|
|
|
|
|
|
); |
455
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
456
|
0
|
|
|
|
|
|
return; |
457
|
|
|
|
|
|
|
} |
458
|
|
|
|
|
|
|
my $_response_object = |
459
|
0
|
|
|
|
|
|
$self->{api_client}->deserialize( 'SegmentWithMatchesModel', $response ); |
460
|
0
|
|
|
|
|
|
return $_response_object; |
461
|
|
|
|
|
|
|
} |
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
# |
464
|
|
|
|
|
|
|
# translation_memories_get_translation_memories_batch |
465
|
|
|
|
|
|
|
# |
466
|
|
|
|
|
|
|
# |
467
|
|
|
|
|
|
|
# |
468
|
|
|
|
|
|
|
# @param string $last_processed_id (required) |
469
|
|
|
|
|
|
|
# @param int $batch_size (required) |
470
|
|
|
|
|
|
|
# @param string $source_language (optional) |
471
|
|
|
|
|
|
|
# @param string $target_language (optional) |
472
|
|
|
|
|
|
|
# @param string $client_id (optional) |
473
|
|
|
|
|
|
|
# @param string $search_name (optional) |
474
|
|
|
|
|
|
|
{ |
475
|
|
|
|
|
|
|
my $params = { |
476
|
|
|
|
|
|
|
'last_processed_id' => { |
477
|
|
|
|
|
|
|
data_type => 'string', |
478
|
|
|
|
|
|
|
description => '', |
479
|
|
|
|
|
|
|
required => '1', |
480
|
|
|
|
|
|
|
}, |
481
|
|
|
|
|
|
|
'batch_size' => { |
482
|
|
|
|
|
|
|
data_type => 'int', |
483
|
|
|
|
|
|
|
description => '', |
484
|
|
|
|
|
|
|
required => '1', |
485
|
|
|
|
|
|
|
}, |
486
|
|
|
|
|
|
|
'source_language' => { |
487
|
|
|
|
|
|
|
data_type => 'string', |
488
|
|
|
|
|
|
|
description => '', |
489
|
|
|
|
|
|
|
required => '0', |
490
|
|
|
|
|
|
|
}, |
491
|
|
|
|
|
|
|
'target_language' => { |
492
|
|
|
|
|
|
|
data_type => 'string', |
493
|
|
|
|
|
|
|
description => '', |
494
|
|
|
|
|
|
|
required => '0', |
495
|
|
|
|
|
|
|
}, |
496
|
|
|
|
|
|
|
'client_id' => { |
497
|
|
|
|
|
|
|
data_type => 'string', |
498
|
|
|
|
|
|
|
description => '', |
499
|
|
|
|
|
|
|
required => '0', |
500
|
|
|
|
|
|
|
}, |
501
|
|
|
|
|
|
|
'search_name' => { |
502
|
|
|
|
|
|
|
data_type => 'string', |
503
|
|
|
|
|
|
|
description => '', |
504
|
|
|
|
|
|
|
required => '0', |
505
|
|
|
|
|
|
|
}, |
506
|
|
|
|
|
|
|
}; |
507
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{ |
508
|
|
|
|
|
|
|
'translation_memories_get_translation_memories_batch'} = { |
509
|
|
|
|
|
|
|
summary => '', |
510
|
|
|
|
|
|
|
params => $params, |
511
|
|
|
|
|
|
|
returns => 'ARRAY[TranslationMemoryModel]', |
512
|
|
|
|
|
|
|
}; |
513
|
|
|
|
|
|
|
} |
514
|
|
|
|
|
|
|
|
515
|
|
|
|
|
|
|
# @return ARRAY[TranslationMemoryModel] |
516
|
|
|
|
|
|
|
# |
517
|
|
|
|
|
|
|
sub translation_memories_get_translation_memories_batch { |
518
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
519
|
|
|
|
|
|
|
|
520
|
|
|
|
|
|
|
# verify the required parameter 'last_processed_id' is set |
521
|
0
|
0
|
|
|
|
|
unless ( exists $args{'last_processed_id'} ) { |
522
|
0
|
|
|
|
|
|
croak( |
523
|
|
|
|
|
|
|
"Missing the required parameter 'last_processed_id' when calling translation_memories_get_translation_memories_batch" |
524
|
|
|
|
|
|
|
); |
525
|
|
|
|
|
|
|
} |
526
|
|
|
|
|
|
|
|
527
|
|
|
|
|
|
|
# verify the required parameter 'batch_size' is set |
528
|
0
|
0
|
|
|
|
|
unless ( exists $args{'batch_size'} ) { |
529
|
0
|
|
|
|
|
|
croak( |
530
|
|
|
|
|
|
|
"Missing the required parameter 'batch_size' when calling translation_memories_get_translation_memories_batch" |
531
|
|
|
|
|
|
|
); |
532
|
|
|
|
|
|
|
} |
533
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
# parse inputs |
535
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/translationmemory'; |
536
|
|
|
|
|
|
|
|
537
|
0
|
|
|
|
|
|
my $_method = 'GET'; |
538
|
0
|
|
|
|
|
|
my $query_params = {}; |
539
|
0
|
|
|
|
|
|
my $header_params = {}; |
540
|
0
|
|
|
|
|
|
my $form_params = {}; |
541
|
|
|
|
|
|
|
|
542
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
543
|
|
|
|
|
|
|
my $_header_accept = $self->{api_client} |
544
|
0
|
|
|
|
|
|
->select_header_accept( 'application/json', 'text/json' ); |
545
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
546
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
547
|
|
|
|
|
|
|
} |
548
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
549
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
550
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
# query params |
552
|
0
|
0
|
|
|
|
|
if ( exists $args{'last_processed_id'} ) { |
553
|
|
|
|
|
|
|
$query_params->{'lastProcessedId'} = |
554
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'last_processed_id'} ); |
555
|
|
|
|
|
|
|
} |
556
|
|
|
|
|
|
|
|
557
|
|
|
|
|
|
|
# query params |
558
|
0
|
0
|
|
|
|
|
if ( exists $args{'batch_size'} ) { |
559
|
|
|
|
|
|
|
$query_params->{'batchSize'} = |
560
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'batch_size'} ); |
561
|
|
|
|
|
|
|
} |
562
|
|
|
|
|
|
|
|
563
|
|
|
|
|
|
|
# query params |
564
|
0
|
0
|
|
|
|
|
if ( exists $args{'source_language'} ) { |
565
|
|
|
|
|
|
|
$query_params->{'sourceLanguage'} = |
566
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'source_language'} ); |
567
|
|
|
|
|
|
|
} |
568
|
|
|
|
|
|
|
|
569
|
|
|
|
|
|
|
# query params |
570
|
0
|
0
|
|
|
|
|
if ( exists $args{'target_language'} ) { |
571
|
|
|
|
|
|
|
$query_params->{'targetLanguage'} = |
572
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'target_language'} ); |
573
|
|
|
|
|
|
|
} |
574
|
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
# query params |
576
|
0
|
0
|
|
|
|
|
if ( exists $args{'client_id'} ) { |
577
|
|
|
|
|
|
|
$query_params->{'clientId'} = |
578
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'client_id'} ); |
579
|
|
|
|
|
|
|
} |
580
|
|
|
|
|
|
|
|
581
|
|
|
|
|
|
|
# query params |
582
|
0
|
0
|
|
|
|
|
if ( exists $args{'search_name'} ) { |
583
|
|
|
|
|
|
|
$query_params->{'searchName'} = |
584
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'search_name'} ); |
585
|
|
|
|
|
|
|
} |
586
|
|
|
|
|
|
|
|
587
|
0
|
|
|
|
|
|
my $_body_data; |
588
|
|
|
|
|
|
|
|
589
|
|
|
|
|
|
|
# authentication setting, if any |
590
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
591
|
|
|
|
|
|
|
|
592
|
|
|
|
|
|
|
# make the API Call |
593
|
|
|
|
|
|
|
my $response = $self->{api_client}->call_api( |
594
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
595
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
596
|
|
|
|
|
|
|
); |
597
|
0
|
0
|
|
|
|
|
if ( !$response ) { |
598
|
0
|
|
|
|
|
|
return; |
599
|
|
|
|
|
|
|
} |
600
|
|
|
|
|
|
|
my $_response_object = $self->{api_client} |
601
|
0
|
|
|
|
|
|
->deserialize( 'ARRAY[TranslationMemoryModel]', $response ); |
602
|
0
|
|
|
|
|
|
return $_response_object; |
603
|
|
|
|
|
|
|
} |
604
|
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
# |
606
|
|
|
|
|
|
|
# translation_memories_import |
607
|
|
|
|
|
|
|
# |
608
|
|
|
|
|
|
|
# TMX import to TM |
609
|
|
|
|
|
|
|
# |
610
|
|
|
|
|
|
|
# @param string $tm_id TM ID (required) |
611
|
|
|
|
|
|
|
# @param boolean $replace_all_content Requirement to replace the contents of the TM completely (required) |
612
|
|
|
|
|
|
|
# @param File $tmx_file Uploaded TMX file (required) |
613
|
|
|
|
|
|
|
{ |
614
|
|
|
|
|
|
|
my $params = { |
615
|
|
|
|
|
|
|
'tm_id' => { |
616
|
|
|
|
|
|
|
data_type => 'string', |
617
|
|
|
|
|
|
|
description => 'TM ID', |
618
|
|
|
|
|
|
|
required => '1', |
619
|
|
|
|
|
|
|
}, |
620
|
|
|
|
|
|
|
'replace_all_content' => { |
621
|
|
|
|
|
|
|
data_type => 'boolean', |
622
|
|
|
|
|
|
|
description => |
623
|
|
|
|
|
|
|
'Requirement to replace the contents of the TM completely', |
624
|
|
|
|
|
|
|
required => '1', |
625
|
|
|
|
|
|
|
}, |
626
|
|
|
|
|
|
|
'tmx_file' => { |
627
|
|
|
|
|
|
|
data_type => 'File', |
628
|
|
|
|
|
|
|
description => 'Uploaded TMX file', |
629
|
|
|
|
|
|
|
required => '1', |
630
|
|
|
|
|
|
|
}, |
631
|
|
|
|
|
|
|
}; |
632
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{'translation_memories_import'} = { |
633
|
|
|
|
|
|
|
summary => 'TMX import to TM', |
634
|
|
|
|
|
|
|
params => $params, |
635
|
|
|
|
|
|
|
returns => undef, |
636
|
|
|
|
|
|
|
}; |
637
|
|
|
|
|
|
|
} |
638
|
|
|
|
|
|
|
|
639
|
|
|
|
|
|
|
# @return void |
640
|
|
|
|
|
|
|
# |
641
|
|
|
|
|
|
|
sub translation_memories_import { |
642
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
643
|
|
|
|
|
|
|
|
644
|
|
|
|
|
|
|
# verify the required parameter 'tm_id' is set |
645
|
0
|
0
|
|
|
|
|
unless ( exists $args{'tm_id'} ) { |
646
|
0
|
|
|
|
|
|
croak( |
647
|
|
|
|
|
|
|
"Missing the required parameter 'tm_id' when calling translation_memories_import" |
648
|
|
|
|
|
|
|
); |
649
|
|
|
|
|
|
|
} |
650
|
|
|
|
|
|
|
|
651
|
|
|
|
|
|
|
# verify the required parameter 'replace_all_content' is set |
652
|
0
|
0
|
|
|
|
|
unless ( exists $args{'replace_all_content'} ) { |
653
|
0
|
|
|
|
|
|
croak( |
654
|
|
|
|
|
|
|
"Missing the required parameter 'replace_all_content' when calling translation_memories_import" |
655
|
|
|
|
|
|
|
); |
656
|
|
|
|
|
|
|
} |
657
|
|
|
|
|
|
|
|
658
|
|
|
|
|
|
|
# verify the required parameter 'tmx_file' is set |
659
|
0
|
0
|
|
|
|
|
unless ( exists $args{'tmx_file'} ) { |
660
|
0
|
|
|
|
|
|
croak( |
661
|
|
|
|
|
|
|
"Missing the required parameter 'tmx_file' when calling translation_memories_import" |
662
|
|
|
|
|
|
|
); |
663
|
|
|
|
|
|
|
} |
664
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
# parse inputs |
666
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/translationmemory/{tmId}'; |
667
|
|
|
|
|
|
|
|
668
|
0
|
|
|
|
|
|
my $_method = 'POST'; |
669
|
0
|
|
|
|
|
|
my $query_params = {}; |
670
|
0
|
|
|
|
|
|
my $header_params = {}; |
671
|
0
|
|
|
|
|
|
my $form_params = {}; |
672
|
|
|
|
|
|
|
|
673
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
674
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept(); |
675
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
676
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
677
|
|
|
|
|
|
|
} |
678
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
679
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type('multipart/form-data'); |
680
|
|
|
|
|
|
|
|
681
|
|
|
|
|
|
|
# query params |
682
|
0
|
0
|
|
|
|
|
if ( exists $args{'replace_all_content'} ) { |
683
|
|
|
|
|
|
|
$query_params->{'replaceAllContent'} = |
684
|
0
|
|
|
|
|
|
$self->{api_client}->to_query_value( $args{'replace_all_content'} ); |
685
|
|
|
|
|
|
|
} |
686
|
|
|
|
|
|
|
|
687
|
|
|
|
|
|
|
# path params |
688
|
0
|
0
|
|
|
|
|
if ( exists $args{'tm_id'} ) { |
689
|
0
|
|
|
|
|
|
my $_base_variable = "{" . "tmId" . "}"; |
690
|
0
|
|
|
|
|
|
my $_base_value = $self->{api_client}->to_path_value( $args{'tm_id'} ); |
691
|
0
|
|
|
|
|
|
$_resource_path =~ s/$_base_variable/$_base_value/g; |
692
|
|
|
|
|
|
|
} |
693
|
|
|
|
|
|
|
|
694
|
|
|
|
|
|
|
# form params |
695
|
0
|
0
|
|
|
|
|
if ( exists $args{'tmx_file'} ) { |
696
|
0
|
0
|
|
|
|
|
$form_params->{'tmxFile'} = [] unless defined $form_params->{'tmxFile'}; |
697
|
0
|
|
|
|
|
|
push @{ $form_params->{'tmxFile'} }, $args{'tmx_file'}; |
|
0
|
|
|
|
|
|
|
698
|
|
|
|
|
|
|
} |
699
|
|
|
|
|
|
|
|
700
|
0
|
|
|
|
|
|
my $_body_data; |
701
|
|
|
|
|
|
|
|
702
|
|
|
|
|
|
|
# authentication setting, if any |
703
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
704
|
|
|
|
|
|
|
|
705
|
|
|
|
|
|
|
# make the API Call |
706
|
|
|
|
|
|
|
$self->{api_client}->call_api( |
707
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
708
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
709
|
|
|
|
|
|
|
); |
710
|
0
|
|
|
|
|
|
return; |
711
|
|
|
|
|
|
|
} |
712
|
|
|
|
|
|
|
|
713
|
|
|
|
|
|
|
# |
714
|
|
|
|
|
|
|
# translation_memories_remove_specific_import_task |
715
|
|
|
|
|
|
|
# |
716
|
|
|
|
|
|
|
# Remove a given import task |
717
|
|
|
|
|
|
|
# |
718
|
|
|
|
|
|
|
# @param string $task_id ID of the task for import to the TM (required) |
719
|
|
|
|
|
|
|
{ |
720
|
|
|
|
|
|
|
my $params = { |
721
|
|
|
|
|
|
|
'task_id' => { |
722
|
|
|
|
|
|
|
data_type => 'string', |
723
|
|
|
|
|
|
|
description => 'ID of the task for import to the TM', |
724
|
|
|
|
|
|
|
required => '1', |
725
|
|
|
|
|
|
|
}, |
726
|
|
|
|
|
|
|
}; |
727
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{ |
728
|
|
|
|
|
|
|
'translation_memories_remove_specific_import_task'} = { |
729
|
|
|
|
|
|
|
summary => 'Remove a given import task', |
730
|
|
|
|
|
|
|
params => $params, |
731
|
|
|
|
|
|
|
returns => undef, |
732
|
|
|
|
|
|
|
}; |
733
|
|
|
|
|
|
|
} |
734
|
|
|
|
|
|
|
|
735
|
|
|
|
|
|
|
# @return void |
736
|
|
|
|
|
|
|
# |
737
|
|
|
|
|
|
|
sub translation_memories_remove_specific_import_task { |
738
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
739
|
|
|
|
|
|
|
|
740
|
|
|
|
|
|
|
# verify the required parameter 'task_id' is set |
741
|
0
|
0
|
|
|
|
|
unless ( exists $args{'task_id'} ) { |
742
|
0
|
|
|
|
|
|
croak( |
743
|
|
|
|
|
|
|
"Missing the required parameter 'task_id' when calling translation_memories_remove_specific_import_task" |
744
|
|
|
|
|
|
|
); |
745
|
|
|
|
|
|
|
} |
746
|
|
|
|
|
|
|
|
747
|
|
|
|
|
|
|
# parse inputs |
748
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/translationmemory/task/{taskId}'; |
749
|
|
|
|
|
|
|
|
750
|
0
|
|
|
|
|
|
my $_method = 'DELETE'; |
751
|
0
|
|
|
|
|
|
my $query_params = {}; |
752
|
0
|
|
|
|
|
|
my $header_params = {}; |
753
|
0
|
|
|
|
|
|
my $form_params = {}; |
754
|
|
|
|
|
|
|
|
755
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
756
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept(); |
757
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
758
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
759
|
|
|
|
|
|
|
} |
760
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
761
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
762
|
|
|
|
|
|
|
|
763
|
|
|
|
|
|
|
# path params |
764
|
0
|
0
|
|
|
|
|
if ( exists $args{'task_id'} ) { |
765
|
0
|
|
|
|
|
|
my $_base_variable = "{" . "taskId" . "}"; |
766
|
|
|
|
|
|
|
my $_base_value = |
767
|
0
|
|
|
|
|
|
$self->{api_client}->to_path_value( $args{'task_id'} ); |
768
|
0
|
|
|
|
|
|
$_resource_path =~ s/$_base_variable/$_base_value/g; |
769
|
|
|
|
|
|
|
} |
770
|
|
|
|
|
|
|
|
771
|
0
|
|
|
|
|
|
my $_body_data; |
772
|
|
|
|
|
|
|
|
773
|
|
|
|
|
|
|
# authentication setting, if any |
774
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
775
|
|
|
|
|
|
|
|
776
|
|
|
|
|
|
|
# make the API Call |
777
|
|
|
|
|
|
|
$self->{api_client}->call_api( |
778
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
779
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
780
|
|
|
|
|
|
|
); |
781
|
0
|
|
|
|
|
|
return; |
782
|
|
|
|
|
|
|
} |
783
|
|
|
|
|
|
|
|
784
|
|
|
|
|
|
|
# |
785
|
|
|
|
|
|
|
# translation_memories_remove_translation_memory |
786
|
|
|
|
|
|
|
# |
787
|
|
|
|
|
|
|
# Delete the TM |
788
|
|
|
|
|
|
|
# |
789
|
|
|
|
|
|
|
# @param string $tm_id TM ID (required) |
790
|
|
|
|
|
|
|
{ |
791
|
|
|
|
|
|
|
my $params = { |
792
|
|
|
|
|
|
|
'tm_id' => { |
793
|
|
|
|
|
|
|
data_type => 'string', |
794
|
|
|
|
|
|
|
description => 'TM ID', |
795
|
|
|
|
|
|
|
required => '1', |
796
|
|
|
|
|
|
|
}, |
797
|
|
|
|
|
|
|
}; |
798
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{ |
799
|
|
|
|
|
|
|
'translation_memories_remove_translation_memory'} = { |
800
|
|
|
|
|
|
|
summary => 'Delete the TM', |
801
|
|
|
|
|
|
|
params => $params, |
802
|
|
|
|
|
|
|
returns => undef, |
803
|
|
|
|
|
|
|
}; |
804
|
|
|
|
|
|
|
} |
805
|
|
|
|
|
|
|
|
806
|
|
|
|
|
|
|
# @return void |
807
|
|
|
|
|
|
|
# |
808
|
|
|
|
|
|
|
sub translation_memories_remove_translation_memory { |
809
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
810
|
|
|
|
|
|
|
|
811
|
|
|
|
|
|
|
# verify the required parameter 'tm_id' is set |
812
|
0
|
0
|
|
|
|
|
unless ( exists $args{'tm_id'} ) { |
813
|
0
|
|
|
|
|
|
croak( |
814
|
|
|
|
|
|
|
"Missing the required parameter 'tm_id' when calling translation_memories_remove_translation_memory" |
815
|
|
|
|
|
|
|
); |
816
|
|
|
|
|
|
|
} |
817
|
|
|
|
|
|
|
|
818
|
|
|
|
|
|
|
# parse inputs |
819
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/translationmemory/{tmId}'; |
820
|
|
|
|
|
|
|
|
821
|
0
|
|
|
|
|
|
my $_method = 'DELETE'; |
822
|
0
|
|
|
|
|
|
my $query_params = {}; |
823
|
0
|
|
|
|
|
|
my $header_params = {}; |
824
|
0
|
|
|
|
|
|
my $form_params = {}; |
825
|
|
|
|
|
|
|
|
826
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
827
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept(); |
828
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
829
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
830
|
|
|
|
|
|
|
} |
831
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = |
832
|
0
|
|
|
|
|
|
$self->{api_client}->select_header_content_type(); |
833
|
|
|
|
|
|
|
|
834
|
|
|
|
|
|
|
# path params |
835
|
0
|
0
|
|
|
|
|
if ( exists $args{'tm_id'} ) { |
836
|
0
|
|
|
|
|
|
my $_base_variable = "{" . "tmId" . "}"; |
837
|
0
|
|
|
|
|
|
my $_base_value = $self->{api_client}->to_path_value( $args{'tm_id'} ); |
838
|
0
|
|
|
|
|
|
$_resource_path =~ s/$_base_variable/$_base_value/g; |
839
|
|
|
|
|
|
|
} |
840
|
|
|
|
|
|
|
|
841
|
0
|
|
|
|
|
|
my $_body_data; |
842
|
|
|
|
|
|
|
|
843
|
|
|
|
|
|
|
# authentication setting, if any |
844
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
845
|
|
|
|
|
|
|
|
846
|
|
|
|
|
|
|
# make the API Call |
847
|
|
|
|
|
|
|
$self->{api_client}->call_api( |
848
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
849
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
850
|
|
|
|
|
|
|
); |
851
|
0
|
|
|
|
|
|
return; |
852
|
|
|
|
|
|
|
} |
853
|
|
|
|
|
|
|
|
854
|
|
|
|
|
|
|
# |
855
|
|
|
|
|
|
|
# translation_memories_set_tm_target_languages |
856
|
|
|
|
|
|
|
# |
857
|
|
|
|
|
|
|
# Set an array of target languages required by the TM |
858
|
|
|
|
|
|
|
# |
859
|
|
|
|
|
|
|
# @param string $tm_id TM ID (required) |
860
|
|
|
|
|
|
|
# @param ARRAY[string] $target_languages Array of the required target languages (required) |
861
|
|
|
|
|
|
|
{ |
862
|
|
|
|
|
|
|
my $params = { |
863
|
|
|
|
|
|
|
'tm_id' => { |
864
|
|
|
|
|
|
|
data_type => 'string', |
865
|
|
|
|
|
|
|
description => 'TM ID', |
866
|
|
|
|
|
|
|
required => '1', |
867
|
|
|
|
|
|
|
}, |
868
|
|
|
|
|
|
|
'target_languages' => { |
869
|
|
|
|
|
|
|
data_type => 'ARRAY[string]', |
870
|
|
|
|
|
|
|
description => 'Array of the required target languages', |
871
|
|
|
|
|
|
|
required => '1', |
872
|
|
|
|
|
|
|
}, |
873
|
|
|
|
|
|
|
}; |
874
|
|
|
|
|
|
|
__PACKAGE__->method_documentation->{ |
875
|
|
|
|
|
|
|
'translation_memories_set_tm_target_languages'} = { |
876
|
|
|
|
|
|
|
summary => 'Set an array of target languages required by the TM', |
877
|
|
|
|
|
|
|
params => $params, |
878
|
|
|
|
|
|
|
returns => undef, |
879
|
|
|
|
|
|
|
}; |
880
|
|
|
|
|
|
|
} |
881
|
|
|
|
|
|
|
|
882
|
|
|
|
|
|
|
# @return void |
883
|
|
|
|
|
|
|
# |
884
|
|
|
|
|
|
|
sub translation_memories_set_tm_target_languages { |
885
|
0
|
|
|
0
|
0
|
|
my ( $self, %args ) = @_; |
886
|
|
|
|
|
|
|
|
887
|
|
|
|
|
|
|
# verify the required parameter 'tm_id' is set |
888
|
0
|
0
|
|
|
|
|
unless ( exists $args{'tm_id'} ) { |
889
|
0
|
|
|
|
|
|
croak( |
890
|
|
|
|
|
|
|
"Missing the required parameter 'tm_id' when calling translation_memories_set_tm_target_languages" |
891
|
|
|
|
|
|
|
); |
892
|
|
|
|
|
|
|
} |
893
|
|
|
|
|
|
|
|
894
|
|
|
|
|
|
|
# verify the required parameter 'target_languages' is set |
895
|
0
|
0
|
|
|
|
|
unless ( exists $args{'target_languages'} ) { |
896
|
0
|
|
|
|
|
|
croak( |
897
|
|
|
|
|
|
|
"Missing the required parameter 'target_languages' when calling translation_memories_set_tm_target_languages" |
898
|
|
|
|
|
|
|
); |
899
|
|
|
|
|
|
|
} |
900
|
|
|
|
|
|
|
|
901
|
|
|
|
|
|
|
# parse inputs |
902
|
0
|
|
|
|
|
|
my $_resource_path = '/api/integration/v1/translationmemory/{tmId}/targets'; |
903
|
|
|
|
|
|
|
|
904
|
0
|
|
|
|
|
|
my $_method = 'PUT'; |
905
|
0
|
|
|
|
|
|
my $query_params = {}; |
906
|
0
|
|
|
|
|
|
my $header_params = {}; |
907
|
0
|
|
|
|
|
|
my $form_params = {}; |
908
|
|
|
|
|
|
|
|
909
|
|
|
|
|
|
|
# 'Accept' and 'Content-Type' header |
910
|
0
|
|
|
|
|
|
my $_header_accept = $self->{api_client}->select_header_accept(); |
911
|
0
|
0
|
|
|
|
|
if ($_header_accept) { |
912
|
0
|
|
|
|
|
|
$header_params->{'Accept'} = $_header_accept; |
913
|
|
|
|
|
|
|
} |
914
|
|
|
|
|
|
|
$header_params->{'Content-Type'} = $self->{api_client} |
915
|
0
|
|
|
|
|
|
->select_header_content_type( 'application/json', 'text/json' ); |
916
|
|
|
|
|
|
|
|
917
|
|
|
|
|
|
|
# path params |
918
|
0
|
0
|
|
|
|
|
if ( exists $args{'tm_id'} ) { |
919
|
0
|
|
|
|
|
|
my $_base_variable = "{" . "tmId" . "}"; |
920
|
0
|
|
|
|
|
|
my $_base_value = $self->{api_client}->to_path_value( $args{'tm_id'} ); |
921
|
0
|
|
|
|
|
|
$_resource_path =~ s/$_base_variable/$_base_value/g; |
922
|
|
|
|
|
|
|
} |
923
|
|
|
|
|
|
|
|
924
|
0
|
|
|
|
|
|
my $_body_data; |
925
|
|
|
|
|
|
|
|
926
|
|
|
|
|
|
|
# body params |
927
|
0
|
0
|
|
|
|
|
if ( exists $args{'target_languages'} ) { |
928
|
0
|
|
|
|
|
|
$_body_data = $args{'target_languages'}; |
929
|
|
|
|
|
|
|
} |
930
|
|
|
|
|
|
|
|
931
|
|
|
|
|
|
|
# authentication setting, if any |
932
|
0
|
|
|
|
|
|
my $auth_settings = [qw()]; |
933
|
|
|
|
|
|
|
|
934
|
|
|
|
|
|
|
# make the API Call |
935
|
|
|
|
|
|
|
$self->{api_client}->call_api( |
936
|
0
|
|
|
|
|
|
$_resource_path, $_method, $query_params, $form_params, |
937
|
|
|
|
|
|
|
$header_params, $_body_data, $auth_settings |
938
|
|
|
|
|
|
|
); |
939
|
0
|
|
|
|
|
|
return; |
940
|
|
|
|
|
|
|
} |
941
|
|
|
|
|
|
|
|
942
|
|
|
|
|
|
|
1; |