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::Object::DocumentModel; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
require 5.6.0; |
24
|
2
|
|
|
2
|
|
759
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
61
|
|
25
|
2
|
|
|
2
|
|
24
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
111
|
|
26
|
2
|
|
|
2
|
|
577
|
use utf8; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
13
|
|
27
|
2
|
|
|
2
|
|
656
|
use JSON qw(decode_json); |
|
2
|
|
|
|
|
8084
|
|
|
2
|
|
|
|
|
12
|
|
28
|
2
|
|
|
2
|
|
891
|
use Data::Dumper; |
|
2
|
|
|
|
|
6392
|
|
|
2
|
|
|
|
|
143
|
|
29
|
2
|
|
|
2
|
|
514
|
use Module::Runtime qw(use_module); |
|
2
|
|
|
|
|
1839
|
|
|
2
|
|
|
|
|
16
|
|
30
|
2
|
|
|
2
|
|
615
|
use Log::Any qw($log); |
|
2
|
|
|
|
|
8767
|
|
|
2
|
|
|
|
|
14
|
|
31
|
2
|
|
|
2
|
|
2911
|
use Date::Parse; |
|
2
|
|
|
|
|
7743
|
|
|
2
|
|
|
|
|
246
|
|
32
|
2
|
|
|
2
|
|
902
|
use DateTime; |
|
2
|
|
|
|
|
504059
|
|
|
2
|
|
|
|
|
72
|
|
33
|
|
|
|
|
|
|
|
34
|
2
|
|
|
2
|
|
1247
|
use Smartcat::Client::Object::DocumentWorkflowStageModel; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
12
|
|
35
|
|
|
|
|
|
|
|
36
|
2
|
|
|
2
|
|
115
|
use base ( "Class::Accessor", "Class::Data::Inheritable" ); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
2049
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# |
39
|
|
|
|
|
|
|
# |
40
|
|
|
|
|
|
|
# |
41
|
|
|
|
|
|
|
# NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. |
42
|
|
|
|
|
|
|
# REF: https://github.com/swagger-api/swagger-codegen |
43
|
|
|
|
|
|
|
# |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=begin comment |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
Smartcat Integration API |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
OpenAPI spec version: v1 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Generated by: https://github.com/swagger-api/swagger-codegen.git |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=end comment |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
# |
60
|
|
|
|
|
|
|
# NOTE: This class is auto generated by the swagger code generator program. |
61
|
|
|
|
|
|
|
# Do not edit the class manually. |
62
|
|
|
|
|
|
|
# Ref: https://github.com/swagger-api/swagger-codegen |
63
|
|
|
|
|
|
|
# |
64
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata( 'attribute_map' => {} ); |
65
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata( 'swagger_types' => {} ); |
66
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata( 'method_documentation' => {} ); |
67
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata( 'class_documentation' => {} ); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
# new object |
70
|
|
|
|
|
|
|
sub new { |
71
|
1
|
|
|
1
|
1
|
654
|
my ( $class, %args ) = @_; |
72
|
|
|
|
|
|
|
|
73
|
1
|
|
|
|
|
3
|
my $self = bless {}, $class; |
74
|
|
|
|
|
|
|
|
75
|
1
|
|
|
|
|
2
|
foreach my $attribute ( keys %{ $class->attribute_map } ) { |
|
1
|
|
|
|
|
3
|
|
76
|
15
|
|
|
|
|
165
|
my $args_key = $class->attribute_map->{$attribute}; |
77
|
15
|
|
|
|
|
119
|
$self->$attribute( $args{$args_key} ); |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
1
|
|
|
|
|
12
|
return $self; |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# return perl hash |
84
|
|
|
|
|
|
|
sub to_hash { |
85
|
0
|
|
|
0
|
0
|
|
return decode_json( JSON->new->convert_blessed->encode(shift) ); |
86
|
|
|
|
|
|
|
} |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# used by JSON for serialization |
89
|
|
|
|
|
|
|
sub TO_JSON { |
90
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
91
|
0
|
|
|
|
|
|
my $_data = {}; |
92
|
0
|
|
|
|
|
|
foreach my $_key ( keys %{ $self->attribute_map } ) { |
|
0
|
|
|
|
|
|
|
93
|
0
|
0
|
|
|
|
|
if ( defined $self->{$_key} ) { |
94
|
0
|
|
|
|
|
|
$_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
} |
97
|
0
|
|
|
|
|
|
return $_data; |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
# from Perl hashref |
101
|
|
|
|
|
|
|
sub from_hash { |
102
|
0
|
|
|
0
|
0
|
|
my ( $self, $hash ) = @_; |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
# loop through attributes and use swagger_types to deserialize the data |
105
|
0
|
|
|
|
|
|
while ( my ( $_key, $_type ) = each %{ $self->swagger_types } ) { |
|
0
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
my $_json_attribute = $self->attribute_map->{$_key}; |
107
|
0
|
0
|
|
|
|
|
if ( $_type =~ /^array\[/i ) { # array |
|
|
0
|
|
|
|
|
|
108
|
0
|
|
|
|
|
|
my $_subclass = substr( $_type, 6, -1 ); |
109
|
0
|
|
|
|
|
|
my @_array = (); |
110
|
0
|
|
|
|
|
|
foreach my $_element ( @{ $hash->{$_json_attribute} } ) { |
|
0
|
|
|
|
|
|
|
111
|
0
|
|
|
|
|
|
push @_array, $self->_deserialize( $_subclass, $_element ); |
112
|
|
|
|
|
|
|
} |
113
|
0
|
|
|
|
|
|
$self->{$_key} = \@_array; |
114
|
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
elsif ( exists $hash->{$_json_attribute} ) |
116
|
|
|
|
|
|
|
{ #hash(model), primitive, datetime |
117
|
|
|
|
|
|
|
$self->{$_key} = |
118
|
0
|
|
|
|
|
|
$self->_deserialize( $_type, $hash->{$_json_attribute} ); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
else { |
121
|
0
|
|
|
|
|
|
$log->debugf( "Warning: %s (%s) does not exist in input hash\n", |
122
|
|
|
|
|
|
|
$_key, $_json_attribute ); |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
0
|
|
|
|
|
|
return $self; |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
# deserialize non-array data |
130
|
|
|
|
|
|
|
sub _deserialize { |
131
|
0
|
|
|
0
|
|
|
my ( $self, $type, $data ) = @_; |
132
|
0
|
|
|
|
|
|
$log->debugf( "deserializing %s with %s", Dumper($data), $type ); |
133
|
|
|
|
|
|
|
|
134
|
0
|
0
|
|
|
|
|
if ( $type eq 'DateTime' ) { |
|
|
0
|
|
|
|
|
|
135
|
0
|
|
|
|
|
|
return DateTime->from_epoch( epoch => str2time($data) ); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { |
138
|
0
|
|
|
|
|
|
return $data; |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
else { # hash(model) |
141
|
0
|
|
|
|
|
|
my $_instance = eval "Smartcat::Client::Object::$type->new()"; |
142
|
0
|
|
|
|
|
|
return $_instance->from_hash($data); |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
} |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
__PACKAGE__->class_documentation( |
147
|
|
|
|
|
|
|
{ |
148
|
|
|
|
|
|
|
description => '', |
149
|
|
|
|
|
|
|
class => 'DocumentModel', |
150
|
|
|
|
|
|
|
required => [], # TODO |
151
|
|
|
|
|
|
|
} |
152
|
|
|
|
|
|
|
); |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
__PACKAGE__->method_documentation( |
155
|
|
|
|
|
|
|
{ |
156
|
|
|
|
|
|
|
'id' => { |
157
|
|
|
|
|
|
|
datatype => 'string', |
158
|
|
|
|
|
|
|
base_name => 'id', |
159
|
|
|
|
|
|
|
description => '', |
160
|
|
|
|
|
|
|
format => '', |
161
|
|
|
|
|
|
|
read_only => '', |
162
|
|
|
|
|
|
|
}, |
163
|
|
|
|
|
|
|
'name' => { |
164
|
|
|
|
|
|
|
datatype => 'string', |
165
|
|
|
|
|
|
|
base_name => 'name', |
166
|
|
|
|
|
|
|
description => '', |
167
|
|
|
|
|
|
|
format => '', |
168
|
|
|
|
|
|
|
read_only => '', |
169
|
|
|
|
|
|
|
}, |
170
|
|
|
|
|
|
|
'creation_date' => { |
171
|
|
|
|
|
|
|
datatype => 'DateTime', |
172
|
|
|
|
|
|
|
base_name => 'creationDate', |
173
|
|
|
|
|
|
|
description => '', |
174
|
|
|
|
|
|
|
format => '', |
175
|
|
|
|
|
|
|
read_only => '', |
176
|
|
|
|
|
|
|
}, |
177
|
|
|
|
|
|
|
'deadline' => { |
178
|
|
|
|
|
|
|
datatype => 'DateTime', |
179
|
|
|
|
|
|
|
base_name => 'deadline', |
180
|
|
|
|
|
|
|
description => '', |
181
|
|
|
|
|
|
|
format => '', |
182
|
|
|
|
|
|
|
read_only => '', |
183
|
|
|
|
|
|
|
}, |
184
|
|
|
|
|
|
|
'source_language' => { |
185
|
|
|
|
|
|
|
datatype => 'string', |
186
|
|
|
|
|
|
|
base_name => 'sourceLanguage', |
187
|
|
|
|
|
|
|
description => '', |
188
|
|
|
|
|
|
|
format => '', |
189
|
|
|
|
|
|
|
read_only => '', |
190
|
|
|
|
|
|
|
}, |
191
|
|
|
|
|
|
|
'document_disassembling_status' => { |
192
|
|
|
|
|
|
|
datatype => 'string', |
193
|
|
|
|
|
|
|
base_name => 'documentDisassemblingStatus', |
194
|
|
|
|
|
|
|
description => '', |
195
|
|
|
|
|
|
|
format => '', |
196
|
|
|
|
|
|
|
read_only => '', |
197
|
|
|
|
|
|
|
}, |
198
|
|
|
|
|
|
|
'target_language' => { |
199
|
|
|
|
|
|
|
datatype => 'string', |
200
|
|
|
|
|
|
|
base_name => 'targetLanguage', |
201
|
|
|
|
|
|
|
description => '', |
202
|
|
|
|
|
|
|
format => '', |
203
|
|
|
|
|
|
|
read_only => '', |
204
|
|
|
|
|
|
|
}, |
205
|
|
|
|
|
|
|
'status' => { |
206
|
|
|
|
|
|
|
datatype => 'string', |
207
|
|
|
|
|
|
|
base_name => 'status', |
208
|
|
|
|
|
|
|
description => '', |
209
|
|
|
|
|
|
|
format => '', |
210
|
|
|
|
|
|
|
read_only => '', |
211
|
|
|
|
|
|
|
}, |
212
|
|
|
|
|
|
|
'words_count' => { |
213
|
|
|
|
|
|
|
datatype => 'int', |
214
|
|
|
|
|
|
|
base_name => 'wordsCount', |
215
|
|
|
|
|
|
|
description => '', |
216
|
|
|
|
|
|
|
format => '', |
217
|
|
|
|
|
|
|
read_only => '', |
218
|
|
|
|
|
|
|
}, |
219
|
|
|
|
|
|
|
'status_modification_date' => { |
220
|
|
|
|
|
|
|
datatype => 'DateTime', |
221
|
|
|
|
|
|
|
base_name => 'statusModificationDate', |
222
|
|
|
|
|
|
|
description => '', |
223
|
|
|
|
|
|
|
format => '', |
224
|
|
|
|
|
|
|
read_only => '', |
225
|
|
|
|
|
|
|
}, |
226
|
|
|
|
|
|
|
'pretranslate_completed' => { |
227
|
|
|
|
|
|
|
datatype => 'boolean', |
228
|
|
|
|
|
|
|
base_name => 'pretranslateCompleted', |
229
|
|
|
|
|
|
|
description => '', |
230
|
|
|
|
|
|
|
format => '', |
231
|
|
|
|
|
|
|
read_only => '', |
232
|
|
|
|
|
|
|
}, |
233
|
|
|
|
|
|
|
'workflow_stages' => { |
234
|
|
|
|
|
|
|
datatype => 'ARRAY[DocumentWorkflowStageModel]', |
235
|
|
|
|
|
|
|
base_name => 'workflowStages', |
236
|
|
|
|
|
|
|
description => '', |
237
|
|
|
|
|
|
|
format => '', |
238
|
|
|
|
|
|
|
read_only => '', |
239
|
|
|
|
|
|
|
}, |
240
|
|
|
|
|
|
|
'external_id' => { |
241
|
|
|
|
|
|
|
datatype => 'string', |
242
|
|
|
|
|
|
|
base_name => 'externalId', |
243
|
|
|
|
|
|
|
description => '', |
244
|
|
|
|
|
|
|
format => '', |
245
|
|
|
|
|
|
|
read_only => '', |
246
|
|
|
|
|
|
|
}, |
247
|
|
|
|
|
|
|
'meta_info' => { |
248
|
|
|
|
|
|
|
datatype => 'string', |
249
|
|
|
|
|
|
|
base_name => 'metaInfo', |
250
|
|
|
|
|
|
|
description => '', |
251
|
|
|
|
|
|
|
format => '', |
252
|
|
|
|
|
|
|
read_only => '', |
253
|
|
|
|
|
|
|
}, |
254
|
|
|
|
|
|
|
'placeholders_are_enabled' => { |
255
|
|
|
|
|
|
|
datatype => 'boolean', |
256
|
|
|
|
|
|
|
base_name => 'placeholdersAreEnabled', |
257
|
|
|
|
|
|
|
description => '', |
258
|
|
|
|
|
|
|
format => '', |
259
|
|
|
|
|
|
|
read_only => '', |
260
|
|
|
|
|
|
|
}, |
261
|
|
|
|
|
|
|
} |
262
|
|
|
|
|
|
|
); |
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
__PACKAGE__->swagger_types( |
265
|
|
|
|
|
|
|
{ |
266
|
|
|
|
|
|
|
'id' => 'string', |
267
|
|
|
|
|
|
|
'name' => 'string', |
268
|
|
|
|
|
|
|
'creation_date' => 'DateTime', |
269
|
|
|
|
|
|
|
'deadline' => 'DateTime', |
270
|
|
|
|
|
|
|
'source_language' => 'string', |
271
|
|
|
|
|
|
|
'document_disassembling_status' => 'string', |
272
|
|
|
|
|
|
|
'target_language' => 'string', |
273
|
|
|
|
|
|
|
'status' => 'string', |
274
|
|
|
|
|
|
|
'words_count' => 'int', |
275
|
|
|
|
|
|
|
'status_modification_date' => 'DateTime', |
276
|
|
|
|
|
|
|
'pretranslate_completed' => 'boolean', |
277
|
|
|
|
|
|
|
'workflow_stages' => 'ARRAY[DocumentWorkflowStageModel]', |
278
|
|
|
|
|
|
|
'external_id' => 'string', |
279
|
|
|
|
|
|
|
'meta_info' => 'string', |
280
|
|
|
|
|
|
|
'placeholders_are_enabled' => 'boolean' |
281
|
|
|
|
|
|
|
} |
282
|
|
|
|
|
|
|
); |
283
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
__PACKAGE__->attribute_map( |
285
|
|
|
|
|
|
|
{ |
286
|
|
|
|
|
|
|
'id' => 'id', |
287
|
|
|
|
|
|
|
'name' => 'name', |
288
|
|
|
|
|
|
|
'creation_date' => 'creationDate', |
289
|
|
|
|
|
|
|
'deadline' => 'deadline', |
290
|
|
|
|
|
|
|
'source_language' => 'sourceLanguage', |
291
|
|
|
|
|
|
|
'document_disassembling_status' => 'documentDisassemblingStatus', |
292
|
|
|
|
|
|
|
'target_language' => 'targetLanguage', |
293
|
|
|
|
|
|
|
'status' => 'status', |
294
|
|
|
|
|
|
|
'words_count' => 'wordsCount', |
295
|
|
|
|
|
|
|
'status_modification_date' => 'statusModificationDate', |
296
|
|
|
|
|
|
|
'pretranslate_completed' => 'pretranslateCompleted', |
297
|
|
|
|
|
|
|
'workflow_stages' => 'workflowStages', |
298
|
|
|
|
|
|
|
'external_id' => 'externalId', |
299
|
|
|
|
|
|
|
'meta_info' => 'metaInfo', |
300
|
|
|
|
|
|
|
'placeholders_are_enabled' => 'placeholdersAreEnabled' |
301
|
|
|
|
|
|
|
} |
302
|
|
|
|
|
|
|
); |
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
1; |