line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Licensed under the Upwork's API Terms of Use; |
2
|
|
|
|
|
|
|
# you may not use this file except in compliance with the Terms. |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software |
5
|
|
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
6
|
|
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
7
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
8
|
|
|
|
|
|
|
# limitations under the License. |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
# Author:: Maksym Novozhylov (mnovozhilov@upwork.com) |
11
|
|
|
|
|
|
|
# Copyright:: Copyright 2015(c) Upwork.com |
12
|
|
|
|
|
|
|
# License:: See LICENSE.txt and TOS - https://developers.upwork.com/api-tos.html |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package Net::Upwork::API::Routers::Snapshot; |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
2
|
|
74206
|
use strict; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
65
|
|
17
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
52
|
|
18
|
2
|
|
|
2
|
|
500
|
use parent "Net::Upwork::API"; |
|
2
|
|
|
|
|
328
|
|
|
2
|
|
|
|
|
11
|
|
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
117
|
use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
558
|
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=pod |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 NAME |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
Auth |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head1 FUNCTIONS |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=over 4 |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=item new($api) |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
Create a new object for accessing Auth API |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
B |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
$api |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
API object |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub new { |
45
|
0
|
|
|
0
|
1
|
|
my ($class, $api) = @_; |
46
|
0
|
|
|
|
|
|
return Net::Upwork::API::init_router($class, $api, ENTRY_POINT); |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=item get_by_contract |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Get snapshot info by specific contract |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
B |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
$contract |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Contract number |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
$ts |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Timestamp |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
B |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
JSON response as a string |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub get_by_contract { |
70
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
71
|
0
|
|
|
|
|
|
my $contract = shift; |
72
|
0
|
|
|
|
|
|
my $ts = shift; |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
return $self->client()->get("/team/v3/snapshots/contracts/" . $contract . "/" . $ts); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item update_by_contract |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Update snapshot info by specific contract |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
B |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
$contract |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Contract number |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$ts |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Timestamp |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
$params |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Hash of parameters |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
B |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
JSON response as a string |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub update_by_contract { |
102
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
103
|
0
|
|
|
|
|
|
my $contract = shift; |
104
|
0
|
|
|
|
|
|
my $ts = shift; |
105
|
0
|
|
|
|
|
|
my %params = @_; |
106
|
|
|
|
|
|
|
|
107
|
0
|
|
|
|
|
|
return $self->client()->put("/team/v3/snapshots/contracts/" . $contract . "/" . $ts, %params); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=item delete_by_contract |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Delete snapshot info by specific contract |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
B |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
$contract |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Contract number |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
$ts |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Timestamp |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
B |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
JSON response as a string |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=cut |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
sub delete_by_contract { |
131
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
132
|
0
|
|
|
|
|
|
my $contract = shift; |
133
|
0
|
|
|
|
|
|
my $ts = shift; |
134
|
|
|
|
|
|
|
|
135
|
0
|
|
|
|
|
|
return $self->client()->delete("/team/v2/snapshots/contracts/" . $contract . "/" . $ts); |
136
|
|
|
|
|
|
|
} |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=back |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=head1 AUTHOR |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
Maksym Novozhylov C<< >> |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=head1 COPYRIGHT |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
Copyright E Upwork Global Corp., 2015 |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=cut |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
1; |