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::Activities::Team; |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
2
|
|
73079
|
use strict; |
|
2
|
|
|
|
|
14
|
|
|
2
|
|
|
|
|
56
|
|
17
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
54
|
|
18
|
2
|
|
|
2
|
|
518
|
use parent "Net::Upwork::API"; |
|
2
|
|
|
|
|
317
|
|
|
2
|
|
|
|
|
10
|
|
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
112
|
use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
1185
|
|
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_list |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
List all oTask/Activity records within a team |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
B |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
$company |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Company ID |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
$team |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Team ID |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
B |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
JSON response as a string |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=cut |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub get_list { |
70
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
71
|
0
|
|
|
|
|
|
my $company = shift; |
72
|
0
|
|
|
|
|
|
my $team = shift; |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
return get_by_type($self, $company, $team); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item get_specific_list |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
List all oTask/Activity records within a Company by specified code(s) |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
B |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
$company |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Company ID |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$team |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Team ID |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
$code |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Code(s) |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
B |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
JSON response as a string |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub get_specific_list { |
102
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
103
|
0
|
|
|
|
|
|
my $company = shift; |
104
|
0
|
|
|
|
|
|
my $team = shift; |
105
|
0
|
|
|
|
|
|
my $code = shift; |
106
|
|
|
|
|
|
|
|
107
|
0
|
|
|
|
|
|
return get_by_type($self, $company, $team, $code); |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=item add_activity |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
Create an oTask/Activity record within a team |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
B |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
$company |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Company ID |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
$team |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Team ID |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
$params |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Hash of params |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
B |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
JSON response as a string |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=cut |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
sub add_activity { |
135
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
136
|
0
|
|
|
|
|
|
my $company = shift; |
137
|
0
|
|
|
|
|
|
my $team = shift; |
138
|
0
|
|
|
|
|
|
my %params = @_; |
139
|
|
|
|
|
|
|
|
140
|
0
|
|
|
|
|
|
return $self->client()->post("/otask/v1/tasks/companies/" . $company . "/teams/" . $team . "/tasks", %params); |
141
|
|
|
|
|
|
|
} |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=item update_activities |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
Update specific oTask/Activity record within a team |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
B |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
$company |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
Company ID |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
$team |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
Team ID |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
$code |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
Code |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
$params |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
Hash of params |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
B |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
JSON response as a string |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=cut |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
sub update_activities { |
172
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
173
|
0
|
|
|
|
|
|
my $company = shift; |
174
|
0
|
|
|
|
|
|
my $team = shift; |
175
|
0
|
|
|
|
|
|
my $code = shift; |
176
|
0
|
|
|
|
|
|
my %params = @_; |
177
|
|
|
|
|
|
|
|
178
|
0
|
|
|
|
|
|
return $self->client()->put("/otask/v1/tasks/companies/" . $company . "/teams/" . $team . "/tasks/" . $code, %params); |
179
|
|
|
|
|
|
|
} |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=item archive_activities |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
Archive specific oTask/Activity record within a team |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
B |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
$company |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
Company ID |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
$team |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
Team ID |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
$code |
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
Code |
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
B |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
JSON response as a string |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=cut |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
sub archive_activities { |
206
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
207
|
0
|
|
|
|
|
|
my $company = shift; |
208
|
0
|
|
|
|
|
|
my $team = shift; |
209
|
0
|
|
|
|
|
|
my $code = shift; |
210
|
|
|
|
|
|
|
|
211
|
0
|
|
|
|
|
|
return $self->client()->put("/otask/v1/tasks/companies/" . $company . "/teams/" . $team . "/archive/" . $code); |
212
|
|
|
|
|
|
|
} |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=item unarchive_activities |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
Unarchive specific oTask/Activity record within a team |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
B |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
$company |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
Company ID |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
$team |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
Team ID |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
$code |
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
Code |
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
B |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
JSON response as a string |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
=cut |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
sub unarchive_activities { |
239
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
240
|
0
|
|
|
|
|
|
my $company = shift; |
241
|
0
|
|
|
|
|
|
my $team = shift; |
242
|
0
|
|
|
|
|
|
my $code = shift; |
243
|
|
|
|
|
|
|
|
244
|
0
|
|
|
|
|
|
return $self->client()->put("/otask/v1/tasks/companies/" . $company . "/teams/" . $team . "/unarchive/" . $code); |
245
|
|
|
|
|
|
|
} |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
=item update_batch |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
Update a group of oTask/Activity records within a company |
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
B |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
$company |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
Company ID |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
$params |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
Hash of params |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
B |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
JSON response as a string |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
=cut |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
sub update_batch { |
268
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
269
|
0
|
|
|
|
|
|
my $company = shift; |
270
|
0
|
|
|
|
|
|
my %params = @_; |
271
|
|
|
|
|
|
|
|
272
|
0
|
|
|
|
|
|
return $self->client()->put("/otask/v1/tasks/companies/" . $company . "/tasks/batch", %params); |
273
|
|
|
|
|
|
|
} |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
=item get_by_type |
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
Get by type |
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
B |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
$company |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
Company ID |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
$team |
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
Team ID |
288
|
|
|
|
|
|
|
|
289
|
|
|
|
|
|
|
$code |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
Optional, code. |
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
B |
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
String |
296
|
|
|
|
|
|
|
|
297
|
|
|
|
|
|
|
=cut |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
sub get_by_type { |
300
|
0
|
|
|
0
|
1
|
|
my ($self, $company, $team, $code) = @_; |
301
|
0
|
|
0
|
|
|
|
$code ||= ""; |
302
|
|
|
|
|
|
|
|
303
|
0
|
|
|
|
|
|
my $url = ""; |
304
|
0
|
0
|
|
|
|
|
unless ($code eq "") { |
305
|
0
|
|
|
|
|
|
$url .= "/" . $code; |
306
|
|
|
|
|
|
|
} |
307
|
|
|
|
|
|
|
|
308
|
0
|
|
|
|
|
|
return $self->client()->get("/otask/v1/tasks/companies/" . $company . "/teams/" . $team . "/tasks" . $url); |
309
|
|
|
|
|
|
|
} |
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
=back |
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
=head1 AUTHOR |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
Maksym Novozhylov C<< >> |
316
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=head1 COPYRIGHT |
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
Copyright E Upwork Global Corp., 2015 |
320
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
=cut |
322
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
1; |