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::DocumentTargetId; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
require 5.6.0; |
24
|
1
|
|
|
1
|
|
719
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
25
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
24
|
|
26
|
1
|
|
|
1
|
|
589
|
use utf8; |
|
1
|
|
|
|
|
15
|
|
|
1
|
|
|
|
|
5
|
|
27
|
1
|
|
|
1
|
|
638
|
use JSON qw(decode_json); |
|
1
|
|
|
|
|
8189
|
|
|
1
|
|
|
|
|
4
|
|
28
|
1
|
|
|
1
|
|
717
|
use Data::Dumper; |
|
1
|
|
|
|
|
6367
|
|
|
1
|
|
|
|
|
63
|
|
29
|
1
|
|
|
1
|
|
500
|
use Module::Runtime qw(use_module); |
|
1
|
|
|
|
|
1833
|
|
|
1
|
|
|
|
|
6
|
|
30
|
1
|
|
|
1
|
|
529
|
use Log::Any qw($log); |
|
1
|
|
|
|
|
8358
|
|
|
1
|
|
|
|
|
5
|
|
31
|
1
|
|
|
1
|
|
2613
|
use Date::Parse; |
|
1
|
|
|
|
|
7745
|
|
|
1
|
|
|
|
|
502
|
|
32
|
1
|
|
|
1
|
|
861
|
use DateTime; |
|
1
|
|
|
|
|
508789
|
|
|
1
|
|
|
|
|
59
|
|
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
1
|
|
11
|
use base ( "Class::Accessor", "Class::Data::Inheritable" ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
609
|
|
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
|
1106
|
my ( $class, %args ) = @_; |
70
|
|
|
|
|
|
|
|
71
|
1
|
|
|
|
|
2
|
my $self = bless {}, $class; |
72
|
|
|
|
|
|
|
|
73
|
1
|
|
|
|
|
2
|
foreach my $attribute ( keys %{ $class->attribute_map } ) { |
|
1
|
|
|
|
|
4
|
|
74
|
2
|
|
|
|
|
75
|
my $args_key = $class->attribute_map->{$attribute}; |
75
|
2
|
|
|
|
|
22
|
$self->$attribute( $args{$args_key} ); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
1
|
|
|
|
|
13
|
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 => 'DocumentTargetId', |
148
|
|
|
|
|
|
|
required => [], # TODO |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
); |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
__PACKAGE__->method_documentation( |
153
|
|
|
|
|
|
|
{ |
154
|
|
|
|
|
|
|
'document_id' => { |
155
|
|
|
|
|
|
|
datatype => 'int', |
156
|
|
|
|
|
|
|
base_name => 'DocumentId', |
157
|
|
|
|
|
|
|
description => '', |
158
|
|
|
|
|
|
|
format => '', |
159
|
|
|
|
|
|
|
read_only => '', |
160
|
|
|
|
|
|
|
}, |
161
|
|
|
|
|
|
|
'language_id' => { |
162
|
|
|
|
|
|
|
datatype => 'int', |
163
|
|
|
|
|
|
|
base_name => 'LanguageId', |
164
|
|
|
|
|
|
|
description => '', |
165
|
|
|
|
|
|
|
format => '', |
166
|
|
|
|
|
|
|
read_only => '', |
167
|
|
|
|
|
|
|
}, |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
); |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
__PACKAGE__->swagger_types( |
172
|
|
|
|
|
|
|
{ |
173
|
|
|
|
|
|
|
'document_id' => 'int', |
174
|
|
|
|
|
|
|
'language_id' => 'int' |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
); |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
__PACKAGE__->attribute_map( |
179
|
|
|
|
|
|
|
{ |
180
|
|
|
|
|
|
|
'document_id' => 'DocumentId', |
181
|
|
|
|
|
|
|
'language_id' => 'LanguageId' |
182
|
|
|
|
|
|
|
} |
183
|
|
|
|
|
|
|
); |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
1; |