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::LspServiceModel; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
require 5.6.0; |
24
|
1
|
|
|
1
|
|
718
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
25
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
26
|
1
|
|
|
1
|
|
568
|
use utf8; |
|
1
|
|
|
|
|
15
|
|
|
1
|
|
|
|
|
5
|
|
27
|
1
|
|
|
1
|
|
633
|
use JSON qw(decode_json); |
|
1
|
|
|
|
|
8203
|
|
|
1
|
|
|
|
|
5
|
|
28
|
1
|
|
|
1
|
|
722
|
use Data::Dumper; |
|
1
|
|
|
|
|
6405
|
|
|
1
|
|
|
|
|
67
|
|
29
|
1
|
|
|
1
|
|
849
|
use Module::Runtime qw(use_module); |
|
1
|
|
|
|
|
1799
|
|
|
1
|
|
|
|
|
6
|
|
30
|
1
|
|
|
1
|
|
534
|
use Log::Any qw($log); |
|
1
|
|
|
|
|
8290
|
|
|
1
|
|
|
|
|
6
|
|
31
|
1
|
|
|
1
|
|
2701
|
use Date::Parse; |
|
1
|
|
|
|
|
7840
|
|
|
1
|
|
|
|
|
134
|
|
32
|
1
|
|
|
1
|
|
899
|
use DateTime; |
|
1
|
|
|
|
|
529838
|
|
|
1
|
|
|
|
|
64
|
|
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
1
|
|
11
|
use base ( "Class::Accessor", "Class::Data::Inheritable" ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
722
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# |
37
|
|
|
|
|
|
|
# |
38
|
|
|
|
|
|
|
# |
39
|
|
|
|
|
|
|
# NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. |
40
|
|
|
|
|
|
|
# REF: https://github.com/swagger-api/swagger-codegen |
41
|
|
|
|
|
|
|
# |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=begin comment |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Smartcat Integration API |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
OpenAPI spec version: v1 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Generated by: https://github.com/swagger-api/swagger-codegen.git |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=end comment |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# |
58
|
|
|
|
|
|
|
# NOTE: This class is auto generated by the swagger code generator program. |
59
|
|
|
|
|
|
|
# Do not edit the class manually. |
60
|
|
|
|
|
|
|
# Ref: https://github.com/swagger-api/swagger-codegen |
61
|
|
|
|
|
|
|
# |
62
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata( 'attribute_map' => {} ); |
63
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata( 'swagger_types' => {} ); |
64
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata( 'method_documentation' => {} ); |
65
|
|
|
|
|
|
|
__PACKAGE__->mk_classdata( 'class_documentation' => {} ); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# new object |
68
|
|
|
|
|
|
|
sub new { |
69
|
1
|
|
|
1
|
1
|
689
|
my ( $class, %args ) = @_; |
70
|
|
|
|
|
|
|
|
71
|
1
|
|
|
|
|
4
|
my $self = bless {}, $class; |
72
|
|
|
|
|
|
|
|
73
|
1
|
|
|
|
|
2
|
foreach my $attribute ( keys %{ $class->attribute_map } ) { |
|
1
|
|
|
|
|
3
|
|
74
|
7
|
|
|
|
|
86
|
my $args_key = $class->attribute_map->{$attribute}; |
75
|
7
|
|
|
|
|
59
|
$self->$attribute( $args{$args_key} ); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
1
|
|
|
|
|
12
|
return $self; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
# return perl hash |
82
|
|
|
|
|
|
|
sub to_hash { |
83
|
0
|
|
|
0
|
0
|
|
return decode_json( JSON->new->convert_blessed->encode(shift) ); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
# used by JSON for serialization |
87
|
|
|
|
|
|
|
sub TO_JSON { |
88
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
89
|
0
|
|
|
|
|
|
my $_data = {}; |
90
|
0
|
|
|
|
|
|
foreach my $_key ( keys %{ $self->attribute_map } ) { |
|
0
|
|
|
|
|
|
|
91
|
0
|
0
|
|
|
|
|
if ( defined $self->{$_key} ) { |
92
|
0
|
|
|
|
|
|
$_data->{ $self->attribute_map->{$_key} } = $self->{$_key}; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
} |
95
|
0
|
|
|
|
|
|
return $_data; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
# from Perl hashref |
99
|
|
|
|
|
|
|
sub from_hash { |
100
|
0
|
|
|
0
|
0
|
|
my ( $self, $hash ) = @_; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
# loop through attributes and use swagger_types to deserialize the data |
103
|
0
|
|
|
|
|
|
while ( my ( $_key, $_type ) = each %{ $self->swagger_types } ) { |
|
0
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
my $_json_attribute = $self->attribute_map->{$_key}; |
105
|
0
|
0
|
|
|
|
|
if ( $_type =~ /^array\[/i ) { # array |
|
|
0
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
my $_subclass = substr( $_type, 6, -1 ); |
107
|
0
|
|
|
|
|
|
my @_array = (); |
108
|
0
|
|
|
|
|
|
foreach my $_element ( @{ $hash->{$_json_attribute} } ) { |
|
0
|
|
|
|
|
|
|
109
|
0
|
|
|
|
|
|
push @_array, $self->_deserialize( $_subclass, $_element ); |
110
|
|
|
|
|
|
|
} |
111
|
0
|
|
|
|
|
|
$self->{$_key} = \@_array; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
elsif ( exists $hash->{$_json_attribute} ) |
114
|
|
|
|
|
|
|
{ #hash(model), primitive, datetime |
115
|
|
|
|
|
|
|
$self->{$_key} = |
116
|
0
|
|
|
|
|
|
$self->_deserialize( $_type, $hash->{$_json_attribute} ); |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
else { |
119
|
0
|
|
|
|
|
|
$log->debugf( "Warning: %s (%s) does not exist in input hash\n", |
120
|
|
|
|
|
|
|
$_key, $_json_attribute ); |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
0
|
|
|
|
|
|
return $self; |
125
|
|
|
|
|
|
|
} |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
# deserialize non-array data |
128
|
|
|
|
|
|
|
sub _deserialize { |
129
|
0
|
|
|
0
|
|
|
my ( $self, $type, $data ) = @_; |
130
|
0
|
|
|
|
|
|
$log->debugf( "deserializing %s with %s", Dumper($data), $type ); |
131
|
|
|
|
|
|
|
|
132
|
0
|
0
|
|
|
|
|
if ( $type eq 'DateTime' ) { |
|
|
0
|
|
|
|
|
|
133
|
0
|
|
|
|
|
|
return DateTime->from_epoch( epoch => str2time($data) ); |
134
|
|
|
|
|
|
|
} |
135
|
|
|
|
|
|
|
elsif ( grep( /^$type$/, ( 'int', 'double', 'string', 'boolean' ) ) ) { |
136
|
0
|
|
|
|
|
|
return $data; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
else { # hash(model) |
139
|
0
|
|
|
|
|
|
my $_instance = eval "Smartcat::Client::Object::$type->new()"; |
140
|
0
|
|
|
|
|
|
return $_instance->from_hash($data); |
141
|
|
|
|
|
|
|
} |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
__PACKAGE__->class_documentation( |
145
|
|
|
|
|
|
|
{ |
146
|
|
|
|
|
|
|
description => '', |
147
|
|
|
|
|
|
|
class => 'LspServiceModel', |
148
|
|
|
|
|
|
|
required => [], # TODO |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
); |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
__PACKAGE__->method_documentation( |
153
|
|
|
|
|
|
|
{ |
154
|
|
|
|
|
|
|
'source_language' => { |
155
|
|
|
|
|
|
|
datatype => 'string', |
156
|
|
|
|
|
|
|
base_name => 'sourceLanguage', |
157
|
|
|
|
|
|
|
description => '', |
158
|
|
|
|
|
|
|
format => '', |
159
|
|
|
|
|
|
|
read_only => '', |
160
|
|
|
|
|
|
|
}, |
161
|
|
|
|
|
|
|
'target_language' => { |
162
|
|
|
|
|
|
|
datatype => 'string', |
163
|
|
|
|
|
|
|
base_name => 'targetLanguage', |
164
|
|
|
|
|
|
|
description => '', |
165
|
|
|
|
|
|
|
format => '', |
166
|
|
|
|
|
|
|
read_only => '', |
167
|
|
|
|
|
|
|
}, |
168
|
|
|
|
|
|
|
'name' => { |
169
|
|
|
|
|
|
|
datatype => 'string', |
170
|
|
|
|
|
|
|
base_name => 'name', |
171
|
|
|
|
|
|
|
description => '', |
172
|
|
|
|
|
|
|
format => '', |
173
|
|
|
|
|
|
|
read_only => '', |
174
|
|
|
|
|
|
|
}, |
175
|
|
|
|
|
|
|
'price_per_unit' => { |
176
|
|
|
|
|
|
|
datatype => 'double', |
177
|
|
|
|
|
|
|
base_name => 'pricePerUnit', |
178
|
|
|
|
|
|
|
description => '', |
179
|
|
|
|
|
|
|
format => '', |
180
|
|
|
|
|
|
|
read_only => '', |
181
|
|
|
|
|
|
|
}, |
182
|
|
|
|
|
|
|
'price_per_unit_currency' => { |
183
|
|
|
|
|
|
|
datatype => 'string', |
184
|
|
|
|
|
|
|
base_name => 'pricePerUnitCurrency', |
185
|
|
|
|
|
|
|
description => '', |
186
|
|
|
|
|
|
|
format => '', |
187
|
|
|
|
|
|
|
read_only => '', |
188
|
|
|
|
|
|
|
}, |
189
|
|
|
|
|
|
|
'service_types' => { |
190
|
|
|
|
|
|
|
datatype => 'ARRAY[string]', |
191
|
|
|
|
|
|
|
base_name => 'serviceTypes', |
192
|
|
|
|
|
|
|
description => '', |
193
|
|
|
|
|
|
|
format => '', |
194
|
|
|
|
|
|
|
read_only => '', |
195
|
|
|
|
|
|
|
}, |
196
|
|
|
|
|
|
|
'specializations' => { |
197
|
|
|
|
|
|
|
datatype => 'ARRAY[string]', |
198
|
|
|
|
|
|
|
base_name => 'specializations', |
199
|
|
|
|
|
|
|
description => '', |
200
|
|
|
|
|
|
|
format => '', |
201
|
|
|
|
|
|
|
read_only => '', |
202
|
|
|
|
|
|
|
}, |
203
|
|
|
|
|
|
|
} |
204
|
|
|
|
|
|
|
); |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
__PACKAGE__->swagger_types( |
207
|
|
|
|
|
|
|
{ |
208
|
|
|
|
|
|
|
'source_language' => 'string', |
209
|
|
|
|
|
|
|
'target_language' => 'string', |
210
|
|
|
|
|
|
|
'name' => 'string', |
211
|
|
|
|
|
|
|
'price_per_unit' => 'double', |
212
|
|
|
|
|
|
|
'price_per_unit_currency' => 'string', |
213
|
|
|
|
|
|
|
'service_types' => 'ARRAY[string]', |
214
|
|
|
|
|
|
|
'specializations' => 'ARRAY[string]' |
215
|
|
|
|
|
|
|
} |
216
|
|
|
|
|
|
|
); |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
__PACKAGE__->attribute_map( |
219
|
|
|
|
|
|
|
{ |
220
|
|
|
|
|
|
|
'source_language' => 'sourceLanguage', |
221
|
|
|
|
|
|
|
'target_language' => 'targetLanguage', |
222
|
|
|
|
|
|
|
'name' => 'name', |
223
|
|
|
|
|
|
|
'price_per_unit' => 'pricePerUnit', |
224
|
|
|
|
|
|
|
'price_per_unit_currency' => 'pricePerUnitCurrency', |
225
|
|
|
|
|
|
|
'service_types' => 'serviceTypes', |
226
|
|
|
|
|
|
|
'specializations' => 'specializations' |
227
|
|
|
|
|
|
|
} |
228
|
|
|
|
|
|
|
); |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
1; |