File Coverage

lib/Net/Upwork/API/Routers/Metadata.pm
Criterion Covered Total %
statement 12 29 41.3
branch n/a
condition n/a
subroutine 4 12 33.3
pod 8 8 100.0
total 24 49 48.9


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::Metadata;
15              
16 2     2   71797 use strict;
  2         15  
  2         65  
17 2     2   10 use warnings;
  2         3  
  2         52  
18 2     2   456 use parent "Net::Upwork::API";
  2         301  
  2         13  
19              
20 2     2   125 use constant ENTRY_POINT => Net::Upwork::API::Client::ENTRY_POINT_API;
  2         3  
  2         714  
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_categories_v2
50              
51             Get categories (V2)
52              
53             B
54              
55             JSON response as a string
56              
57             =cut
58              
59             sub get_categories_v2 {
60 0     0 1   my $self = shift;
61              
62 0           return $self->client()->get("/profiles/v2/metadata/categories");
63             }
64              
65             =item get_skills
66              
67             Get skills
68              
69             B
70              
71             JSON response as a string
72              
73             =cut
74              
75             sub get_skills {
76 0     0 1   my $self = shift;
77              
78 0           return $self->client()->get("/profiles/v1/metadata/skills");
79             }
80              
81             =item get_skills_v2
82              
83             Get skills V2
84              
85             B
86              
87             JSON response as a string
88              
89             =cut
90              
91             sub get_skills_v2 {
92 0     0 1   my $self = shift;
93              
94 0           return $self->client()->get("/profiles/v2/metadata/skills");
95             }
96              
97             =item get_specialties
98              
99             Get specialties
100              
101             B
102              
103             JSON response as a string
104              
105             =cut
106              
107             sub get_specialties {
108 0     0 1   my $self = shift;
109              
110 0           return $self->client()->get("/profiles/v1/metadata/specialties");
111             }
112              
113             =item get_regions
114              
115             Get regions
116              
117             B
118              
119             JSON response as a string
120              
121             =cut
122              
123             sub get_regions {
124 0     0 1   my $self = shift;
125              
126 0           return $self->client()->get("/profiles/v1/metadata/regions");
127             }
128              
129             =item get_tests
130              
131             Get tests
132              
133             B
134              
135             JSON response as a string
136              
137             =cut
138              
139             sub get_tests {
140 0     0 1   my $self = shift;
141              
142 0           return $self->client()->get("/profiles/v1/metadata/tests");
143             }
144              
145             =item get_reasons
146              
147             Get reasons
148              
149             B
150              
151             $params
152              
153             Hash of parameters
154              
155             B
156              
157             JSON response as a string
158              
159             =cut
160              
161             sub get_reasons {
162 0     0 1   my $self = shift;
163 0           my %params = @_;
164              
165 0           return $self->client()->get("/profiles/v1/metadata/reasons", %params);
166             }
167              
168             =back
169              
170             =head1 AUTHOR
171              
172             Maksym Novozhylov C<< >>
173              
174             =head1 COPYRIGHT
175              
176             Copyright E Upwork Global Corp., 2015
177              
178             =cut
179              
180             1;