File Coverage

blib/lib/App/Dochazka/CLI/Commands/RestTest/Schedule.pm
Criterion Covered Total %
statement 79 82 96.3
branch n/a
condition n/a
subroutine 21 22 95.4
pod n/a
total 100 104 96.1


line stmt bran cond sub pod time code
1             # *************************************************************************
2             # Copyright (c) 2014-2016, SUSE LLC
3             #
4             # All rights reserved.
5             #
6             # Redistribution and use in source and binary forms, with or without
7             # modification, are permitted provided that the following conditions are met:
8             #
9             # 1. Redistributions of source code must retain the above copyright notice,
10             # this list of conditions and the following disclaimer.
11             #
12             # 2. Redistributions in binary form must reproduce the above copyright
13             # notice, this list of conditions and the following disclaimer in the
14             # documentation and/or other materials provided with the distribution.
15             #
16             # 3. Neither the name of SUSE LLC nor the names of its contributors may be
17             # used to endorse or promote products derived from this software without
18             # specific prior written permission.
19             #
20             # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21             # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22             # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23             # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24             # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25             # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26             # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27             # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28             # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29             # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30             # POSSIBILITY OF SUCH DAMAGE.
31             # *************************************************************************
32             #
33              
34 20     20   284 use 5.012;
  20         70  
35 20     20   93 use strict;
  20         46  
  20         344  
36 20     20   82 use warnings;
  20         39  
  20         14696  
37              
38             # $METHOD schedule
39             sub _method_schedule {
40 8     8   3940 my ( $ts, $th ) = @_;
41 8         25 my $method = $ts->[0];
42              
43 8         42 return [ $method, "schedule", $th->{_REST} ];
44             }
45              
46             # $METHOD schedule all
47             sub _method_schedule_all {
48 8     8   3864 my ( $ts, $th ) = @_;
49 8         22 my $method = $ts->[0];
50              
51 8         38 return [ $method, "schedule/all", $th->{_REST} ];
52             }
53              
54             # $METHOD schedule all disabled
55             sub _method_schedule_all_disabled {
56 8     8   3745 my ( $ts, $th ) = @_;
57 8         23 my $method = $ts->[0];
58              
59 8         38 return [ $method, "schedule/all/disabled", $th->{_REST} ];
60             }
61              
62             # $METHOD schedule eid $NUM
63             sub _method_schedule_eid_num {
64 8     8   3872 my ( $ts, $th ) = @_;
65 8         22 my $method = $ts->[0];
66 8         21 my $eid = $th->{_NUM};
67              
68 8         45 return [ $method, "schedule/eid/$eid", $th->{_REST} ];
69             }
70              
71             # $METHOD schedule eid $NUM $TIMESTAMP
72             sub _method_schedule_eid_num_timestamp {
73 8     8   3940 my ( $ts, $th ) = @_;
74 8         20 my $method = $ts->[0];
75 8         18 my $eid = $th->{_NUM};
76 8         31 my $timestamp = $th->{_TIMESTAMP};
77              
78 8         43 return [ $method, "schedule/eid/$eid/$timestamp", $th->{_REST} ];
79             }
80              
81             # $METHOD schedule history eid $NUM
82             sub _method_schedule_history_eid_num {
83 8     8   3703 my ( $ts, $th ) = @_;
84 8         22 my $method = $ts->[0];
85 8         20 my $eid = $th->{_NUM};
86              
87 8         38 return [ $method, "schedule/history/eid/$eid", $th->{_REST} ];
88             }
89              
90             # $METHOD schedule history eid $NUM $TSRANGE
91             sub _method_schedule_history_eid_num_tsrange {
92 8     8   3622 my ( $ts, $th ) = @_;
93 8         18 my $method = $ts->[0];
94 8         20 my $eid = $th->{_NUM};
95 8         18 my $tsr = $th->{_TSRANGE};
96              
97 8         40 return [ $method, "schedule/history/eid/$eid/$tsr", $th->{_REST} ];
98             }
99              
100             # $METHOD schedule history nick $TERM
101             sub _method_schedule_history_nick_term {
102 8     8   3726 my ( $ts, $th ) = @_;
103 8         24 my $method = $ts->[0];
104 8         16 my $nick = $th->{_TERM};
105              
106 8         42 return [ $method, "schedule/history/nick/$nick", $th->{_REST} ];
107             }
108              
109             # $METHOD schedule history nick $TERM $TSRANGE
110             sub _method_schedule_history_nick_term_tsrange {
111 8     8   3794 my ( $ts, $th ) = @_;
112 8         22 my $method = $ts->[0];
113 8         17 my $nick = $th->{_TERM};
114 8         21 my $tsr = $th->{_TSRANGE};
115              
116 8         44 return [ $method, "schedule/history/nick/$nick/$tsr", $th->{_REST} ];
117             }
118              
119             # $METHOD schedule history self
120             sub _method_schedule_history_self {
121 8     8   3975 my ( $ts, $th ) = @_;
122 8         22 my $method = $ts->[0];
123              
124 8         44 return [ $method, "schedule/history/self", $th->{_REST} ];
125             }
126              
127             # $METHOD schedule history self $TSRANGE
128             sub _method_schedule_history_self_tsrange {
129 8     8   3794 my ( $ts, $th ) = @_;
130 8         21 my $method = $ts->[0];
131 8         21 my $tsr = $th->{_TSRANGE};
132              
133 8         44 return [ $method, "schedule/history/self/$tsr", $th->{_REST} ];
134             }
135              
136             # $METHOD schedule history shid $NUM
137             sub _method_schedule_history_shid_num {
138 8     8   3754 my ( $ts, $th ) = @_;
139 8         20 my $method = $ts->[0];
140 8         21 my $shid = $th->{_NUM};
141              
142 8         45 return [ $method, "schedule/history/shid/$shid", $th->{_REST} ];
143             }
144              
145             # $METHOD schedule nick $TERM
146             sub _method_schedule_nick_term {
147 8     8   3872 my ( $ts, $th ) = @_;
148 8         21 my $method = $ts->[0];
149 8         18 my $nick = $th->{_TERM};
150              
151 8         37 return [ $method, "schedule/nick/$nick", $th->{_REST} ];
152             }
153              
154             # $METHOD schedule nick $TERM $TIMESTAMP
155             sub _method_schedule_nick_term_timestamp {
156 8     8   3769 my ( $ts, $th ) = @_;
157 8         29 my $method = $ts->[0];
158 8         17 my $nick = $th->{_TERM};
159 8         18 my $timestamp = $th->{_TIMESTAMP};
160              
161 8         44 return [ $method, "schedule/nick/$nick/$timestamp", $th->{_REST} ];
162             }
163              
164             # $METHOD schedule self
165             sub _method_schedule_self {
166 8     8   3965 my ( $ts, $th ) = @_;
167 8         25 my $method = $ts->[0];
168              
169 8         37 return [ $method, "schedule/self", $th->{_REST} ];
170             }
171              
172             # $METHOD schedule self $TIMESTAMP
173             sub _method_schedule_self_timestamp {
174 8     8   3809 my ( $ts, $th ) = @_;
175 8         23 my $method = $ts->[0];
176 8         23 my $timestamp = $th->{_TIMESTAMP};
177              
178 8         44 return [ $method, "schedule/self/$timestamp", $th->{_REST} ];
179             }
180              
181             # $METHOD schedule sid $NUMBER
182             sub _method_schedule_sid_num {
183 8     8   3639 my ( $ts, $th ) = @_;
184 8         22 my $method = $ts->[0];
185 8         21 my $sid = $th->{_NUM};
186              
187 8         42 return [ $method, "schedule/sid/$sid", $th->{_REST} ];
188             }
189              
190             # $METHOD schedule scode $SCODE
191             sub _method_schedule_scode_term {
192 8     8   3658 my ( $ts, $th ) = @_;
193 8         19 my $method = $ts->[0];
194 8         23 my $scode = $th->{_TERM};
195              
196 8         43 return [ $method, "schedule/scode/$scode", $th->{_REST} ];
197             }
198              
199             # $METHOD schedule new
200             sub _method_schedule_new {
201 0     0     my ( $ts, $th ) = @_;
202 0           my $method = $ts->[0];
203              
204 0           return [ $method, "schedule/new", $th->{_REST} ];
205             }
206              
207             1;