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::Workdays; |
15
|
|
|
|
|
|
|
|
16
|
2
|
|
|
2
|
|
75517
|
use strict; |
|
2
|
|
|
|
|
15
|
|
|
2
|
|
|
|
|
58
|
|
17
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
55
|
|
18
|
2
|
|
|
2
|
|
488
|
use parent "Net::Upwork::API"; |
|
2
|
|
|
|
|
323
|
|
|
2
|
|
|
|
|
10
|
|
19
|
|
|
|
|
|
|
|
20
|
2
|
|
|
2
|
|
123
|
use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
513
|
|
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_company |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Get Workdays by Company |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
B |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
$company |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Company ID |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
$from_date |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
Start date |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
$till_date |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
End date |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
$params |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Hash of parameters |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
B |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
JSON response as a string |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub get_by_company { |
78
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
79
|
0
|
|
|
|
|
|
my $company = shift; |
80
|
0
|
|
|
|
|
|
my $from_date = shift; |
81
|
0
|
|
|
|
|
|
my $till_date = shift; |
82
|
0
|
|
|
|
|
|
my %params = @_; |
83
|
|
|
|
|
|
|
|
84
|
0
|
|
|
|
|
|
return $self->client()->get("/team/v3/workdays/companies/" . $company . "/" . $from_date . "," . $till_date, %params); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=item get_by_contract |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Get Workdays by Contract |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
B |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
$contract |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Contract ID |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
$from_date |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Start date |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
$till_date |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
End date |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
$params |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Hash of parameters |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
B |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
JSON response as a string |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub get_by_contract { |
116
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
117
|
0
|
|
|
|
|
|
my $contract = shift; |
118
|
0
|
|
|
|
|
|
my $from_date = shift; |
119
|
0
|
|
|
|
|
|
my $till_date = shift; |
120
|
0
|
|
|
|
|
|
my %params = @_; |
121
|
|
|
|
|
|
|
|
122
|
0
|
|
|
|
|
|
return $self->client()->get("/team/v3/workdays/contracts/" . $contract . "/" . $from_date . "," . $till_date, %params); |
123
|
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
=back |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 AUTHOR |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Maksym Novozhylov C<< >> |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head1 COPYRIGHT |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Copyright E Upwork Global Corp., 2015 |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=cut |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
1; |