File Coverage

blib/lib/App/Dochazka/CLI/Commands/RestTest/Schedule.pm
Criterion Covered Total %
statement 79 79 100.0
branch n/a
condition n/a
subroutine 21 21 100.0
pod n/a
total 100 100 100.0


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   244 use 5.012;
  20         43  
35 20     20   63 use strict;
  20         21  
  20         293  
36 20     20   56 use warnings;
  20         18  
  20         11925  
37              
38             # $METHOD schedule
39             sub _method_schedule {
40 8     8   2906 my ( $ts, $th ) = @_;
41 8         13 my $method = $ts->[0];
42              
43 8         35 return [ $method, "schedule", $th->{_REST} ];
44             }
45              
46             # $METHOD schedule all
47             sub _method_schedule_all {
48 8     8   2920 my ( $ts, $th ) = @_;
49 8         15 my $method = $ts->[0];
50              
51 8         34 return [ $method, "schedule/all", $th->{_REST} ];
52             }
53              
54             # $METHOD schedule all disabled
55             sub _method_schedule_all_disabled {
56 8     8   2862 my ( $ts, $th ) = @_;
57 8         15 my $method = $ts->[0];
58              
59 8         33 return [ $method, "schedule/all/disabled", $th->{_REST} ];
60             }
61              
62             # $METHOD schedule eid $NUM
63             sub _method_schedule_eid_num {
64 8     8   2877 my ( $ts, $th ) = @_;
65 8         14 my $method = $ts->[0];
66 8         12 my $eid = $th->{_NUM};
67              
68 8         37 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   2921 my ( $ts, $th ) = @_;
74 8         14 my $method = $ts->[0];
75 8         10 my $eid = $th->{_NUM};
76 8         9 my $timestamp = $th->{_TIMESTAMP};
77              
78 8         44 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   3269 my ( $ts, $th ) = @_;
84 8         15 my $method = $ts->[0];
85 8         10 my $eid = $th->{_NUM};
86              
87 8         41 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   2916 my ( $ts, $th ) = @_;
93 8         13 my $method = $ts->[0];
94 8         14 my $eid = $th->{_NUM};
95 8         10 my $tsr = $th->{_TSRANGE};
96              
97 8         44 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   2930 my ( $ts, $th ) = @_;
103 8         14 my $method = $ts->[0];
104 8         10 my $nick = $th->{_TERM};
105              
106 8         35 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   3005 my ( $ts, $th ) = @_;
112 8         12 my $method = $ts->[0];
113 8         12 my $nick = $th->{_TERM};
114 8         9 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   2873 my ( $ts, $th ) = @_;
122 8         13 my $method = $ts->[0];
123              
124 8         35 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   2873 my ( $ts, $th ) = @_;
130 8         14 my $method = $ts->[0];
131 8         9 my $tsr = $th->{_TSRANGE};
132              
133 8         37 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   2862 my ( $ts, $th ) = @_;
139 8         15 my $method = $ts->[0];
140 8         13 my $shid = $th->{_NUM};
141              
142 8         37 return [ $method, "schedule/history/shid/$shid", $th->{_REST} ];
143             }
144              
145             # $METHOD schedule nick $TERM
146             sub _method_schedule_nick_term {
147 8     8   2965 my ( $ts, $th ) = @_;
148 8         13 my $method = $ts->[0];
149 8         11 my $nick = $th->{_TERM};
150              
151 8         41 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   2966 my ( $ts, $th ) = @_;
157 8         13 my $method = $ts->[0];
158 8         10 my $nick = $th->{_TERM};
159 8         9 my $timestamp = $th->{_TIMESTAMP};
160              
161 8         43 return [ $method, "schedule/nick/$nick/$timestamp", $th->{_REST} ];
162             }
163              
164             # $METHOD schedule self
165             sub _method_schedule_self {
166 8     8   2912 my ( $ts, $th ) = @_;
167 8         13 my $method = $ts->[0];
168              
169 8         35 return [ $method, "schedule/self", $th->{_REST} ];
170             }
171              
172             # $METHOD schedule self $TIMESTAMP
173             sub _method_schedule_self_timestamp {
174 8     8   2951 my ( $ts, $th ) = @_;
175 8         14 my $method = $ts->[0];
176 8         9 my $timestamp = $th->{_TIMESTAMP};
177              
178 8         40 return [ $method, "schedule/self/$timestamp", $th->{_REST} ];
179             }
180              
181             # $METHOD schedule sid $NUMBER
182             sub _method_schedule_sid_num {
183 8     8   2940 my ( $ts, $th ) = @_;
184 8         13 my $method = $ts->[0];
185 8         13 my $sid = $th->{_NUM};
186              
187 8         40 return [ $method, "schedule/sid/$sid", $th->{_REST} ];
188             }
189              
190             # $METHOD schedule scode $SCODE
191             sub _method_schedule_scode_term {
192 8     8   2961 my ( $ts, $th ) = @_;
193 8         15 my $method = $ts->[0];
194 8         11 my $scode = $th->{_TERM};
195              
196 8         39 return [ $method, "schedule/scode/$scode", $th->{_REST} ];
197             }
198              
199             1;