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::TMRangeRateModel; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
require 5.6.0; |
24
|
3
|
|
|
3
|
|
829
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
94
|
|
25
|
3
|
|
|
3
|
|
28
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
89
|
|
26
|
3
|
|
|
3
|
|
644
|
use utf8; |
|
3
|
|
|
|
|
18
|
|
|
3
|
|
|
|
|
17
|
|
27
|
3
|
|
|
3
|
|
732
|
use JSON qw(decode_json); |
|
3
|
|
|
|
|
8490
|
|
|
3
|
|
|
|
|
18
|
|
28
|
3
|
|
|
3
|
|
962
|
use Data::Dumper; |
|
3
|
|
|
|
|
6363
|
|
|
3
|
|
|
|
|
184
|
|
29
|
3
|
|
|
3
|
|
522
|
use Module::Runtime qw(use_module); |
|
3
|
|
|
|
|
1841
|
|
|
3
|
|
|
|
|
22
|
|
30
|
3
|
|
|
3
|
|
765
|
use Log::Any qw($log); |
|
3
|
|
|
|
|
8770
|
|
|
3
|
|
|
|
|
17
|
|
31
|
3
|
|
|
3
|
|
3165
|
use Date::Parse; |
|
3
|
|
|
|
|
7855
|
|
|
3
|
|
|
|
|
326
|
|
32
|
3
|
|
|
3
|
|
1080
|
use DateTime; |
|
3
|
|
|
|
|
511916
|
|
|
3
|
|
|
|
|
121
|
|
33
|
|
|
|
|
|
|
|
34
|
3
|
|
|
3
|
|
20
|
use base ( "Class::Accessor", "Class::Data::Inheritable" ); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
1889
|
|
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
|
616
|
my ( $class, %args ) = @_; |
70
|
|
|
|
|
|
|
|
71
|
1
|
|
|
|
|
3
|
my $self = bless {}, $class; |
72
|
|
|
|
|
|
|
|
73
|
1
|
|
|
|
|
2
|
foreach my $attribute ( keys %{ $class->attribute_map } ) { |
|
1
|
|
|
|
|
3
|
|
74
|
3
|
|
|
|
|
45
|
my $args_key = $class->attribute_map->{$attribute}; |
75
|
3
|
|
|
|
|
26
|
$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 => 'TMRangeRateModel', |
148
|
|
|
|
|
|
|
required => [], # TODO |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
); |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
__PACKAGE__->method_documentation( |
153
|
|
|
|
|
|
|
{ |
154
|
|
|
|
|
|
|
'from_quality' => { |
155
|
|
|
|
|
|
|
datatype => 'int', |
156
|
|
|
|
|
|
|
base_name => 'fromQuality', |
157
|
|
|
|
|
|
|
description => '', |
158
|
|
|
|
|
|
|
format => '', |
159
|
|
|
|
|
|
|
read_only => '', |
160
|
|
|
|
|
|
|
}, |
161
|
|
|
|
|
|
|
'to_quality' => { |
162
|
|
|
|
|
|
|
datatype => 'int', |
163
|
|
|
|
|
|
|
base_name => 'toQuality', |
164
|
|
|
|
|
|
|
description => '', |
165
|
|
|
|
|
|
|
format => '', |
166
|
|
|
|
|
|
|
read_only => '', |
167
|
|
|
|
|
|
|
}, |
168
|
|
|
|
|
|
|
'value' => { |
169
|
|
|
|
|
|
|
datatype => 'double', |
170
|
|
|
|
|
|
|
base_name => 'value', |
171
|
|
|
|
|
|
|
description => '', |
172
|
|
|
|
|
|
|
format => '', |
173
|
|
|
|
|
|
|
read_only => '', |
174
|
|
|
|
|
|
|
}, |
175
|
|
|
|
|
|
|
} |
176
|
|
|
|
|
|
|
); |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
__PACKAGE__->swagger_types( |
179
|
|
|
|
|
|
|
{ |
180
|
|
|
|
|
|
|
'from_quality' => 'int', |
181
|
|
|
|
|
|
|
'to_quality' => 'int', |
182
|
|
|
|
|
|
|
'value' => 'double' |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
); |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
__PACKAGE__->attribute_map( |
187
|
|
|
|
|
|
|
{ |
188
|
|
|
|
|
|
|
'from_quality' => 'fromQuality', |
189
|
|
|
|
|
|
|
'to_quality' => 'toQuality', |
190
|
|
|
|
|
|
|
'value' => 'value' |
191
|
|
|
|
|
|
|
} |
192
|
|
|
|
|
|
|
); |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } ); |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
1; |