File Coverage

lib/Net/Upwork/API/Routers/Activities/Engagement.pm
Criterion Covered Total %
statement 12 27 44.4
branch n/a
condition n/a
subroutine 4 8 50.0
pod 4 4 100.0
total 20 39 51.2


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::Engagement;
15              
16 2     2   74369 use strict;
  2         14  
  2         56  
17 2     2   9 use warnings;
  2         25  
  2         58  
18 2     2   449 use parent "Net::Upwork::API";
  2         334  
  2         13  
19              
20 2     2   142 use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API;
  2         5  
  2         571  
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_specific
50              
51             List activities for specific engagement
52              
53             B
54              
55             $engagement_ref
56              
57             Engagement reference
58              
59             B
60              
61             JSON response as a string
62              
63             =cut
64              
65             sub get_specific {
66 0     0 1   my $self = shift;
67 0           my $engagement_ref = shift;
68              
69 0           return $self->client()->get("/tasks/v2/tasks/contracts/" . $engagement_ref);
70             }
71              
72             =item assign
73              
74             Assign engagements to the list of activities
75              
76             B
77              
78             $company
79              
80             Company ID
81              
82             $team
83              
84             Team ID
85              
86             $engagement
87              
88             Engagement
89              
90             $params
91              
92             Hash of parameters
93              
94             B
95              
96             JSON response as a string
97              
98             =cut
99              
100             sub assign {
101 0     0 1   my $self = shift;
102 0           my $company = shift;
103 0           my $team = shift;
104 0           my $engagement = shift;
105 0           my %params = @_;
106              
107 0           return $self->client()->put("/otask/v1/tasks/companies/" . $company . "/" . $team . "/engagements/" . $engagement, %params);
108             }
109              
110             =item assign_to_engagement
111              
112             Assign to specific engagement the list of activities
113              
114             B
115              
116             $engagement_ref
117              
118             Engagement
119              
120             $params
121              
122             Hash of parameters
123              
124             B
125              
126             JSON response as a string
127              
128             =cut
129              
130             sub assign_to_engagement {
131 0     0 1   my $self = shift;
132 0           my $engagement_ref = shift;
133 0           my %params = @_;
134              
135 0           return $self->client()->put("/tasks/v2/tasks/contracts/" . $engagement_ref, %params);
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;