Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue.pm

filter: Statementstmt 82.9% 102 / 123 Branchbran n/a Conditioncond 55.5% 5 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 80.7% 42 / 52 Podpod n/a totaltotal 78.8% 149 / 189 CC 5 SCAR 2.8
CC
5
Cov
81%
create
2.0
page
2.0
update
2.0
CRAP 1.3
« Twilio/Rest/Trunking/V1.pm ↑ Summary Twilio/Rest/Supersim/V1/Sim.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue;
3  
4 2 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 our $VERSION = '2.001';
8  
9 package Twilio::Rest::Taskrouter::V1::Workspace::TaskQueueList;
10  
11 2 ▶use parent 'Twilio::ListResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 10 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 10 my ($class, $version, $workspace_sid) = @_;
17 10 my $self = $class->SUPER::new($version);
18 10 $self->{solution} = { workspace_sid => $workspace_sid };
19 10 $self->{uri} = join q{}, '/Workspaces/', Twilio::Serialize::path_segment($workspace_sid),
20 '/TaskQueues';
21 10 return $self;
22 }
23  
24 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
25 1 my ($self, $friendly_name, $options) = @_;
26 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
10
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
27  
28 my $data = {
29 FriendlyName => $friendly_name,
30 AssignmentActivitySid => $options->{assignment_activity_sid},
31 MaxReservedWorkers => $options->{max_reserved_workers},
32 ReservationActivitySid => $options->{reservation_activity_sid},
33 TargetWorkers => $options->{target_workers},
34 TaskOrder => $options->{task_order},
35 1 };
36  
37 my $response =
38 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
39 return Twilio::Rest::Taskrouter::V1::Workspace::TaskQueueInstance->new($self->{version},
40 1 $response->get_content, $self->{solution}{workspace_sid});
41 }
42  
43 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
44 0 my ($self, @arguments) = @_;
45 0 return $self->read_records(@arguments);
46 }
47  
48 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
49 0 my ($self, @arguments) = @_;
50 0 return $self->stream_records(@arguments);
51 }
52  
53 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
54 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
55 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
10
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
56  
57 my $params = {
58 EvaluateWorkerAttributes => $options->{evaluate_worker_attributes},
59 FriendlyName => $options->{friendly_name},
60 Ordering => $options->{ordering},
61 WorkerSid => $options->{worker_sid},
62 1 PageToken => $page_token,
63 Page => $page_number,
64 PageSize => $page_size,
65 };
66  
67 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
68 1 return $self->_build_page($response);
69 }
70  
71 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
72 0 my ($self, $target_url) = @_;
73 0 my $client = $self->{version}->get_domain->get_client;
74 0 return $self->_build_page($client->request('GET', $target_url));
75 }
76  
77 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
78 1 my ($self, $response) = @_;
79 return Twilio::Rest::Taskrouter::V1::Workspace::TaskQueuePage->new($self->{version}, $response,
80 1 $self->{solution});
81 }
82  
83 6 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
84 6 my ($self, $sid) = @_;
85 return Twilio::Rest::Taskrouter::V1::Workspace::TaskQueueContext->new($self->{version},
86 6 $self->{solution}{workspace_sid}, $sid);
87 }
88  
89 1 ▶sub bulk_real_time_statistics {
Subroutine bulk_real_time_statistics: called CC=1 SCAR=0.0
90 1 my ($self) = @_;
91 1 require Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueueBulkRealTimeStatistics;
92 return
93 Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueueBulkRealTimeStatisticsList->new(
94 1 $self->{version}, $self->{solution}{workspace_sid});
95 }
96  
97 1 ▶sub statistics {
Subroutine statistics: called CC=1 SCAR=0.0
98 1 my ($self) = @_;
99 1 require Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueuesStatistics;
100 return Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueuesStatisticsList->new(
101 1 $self->{version}, $self->{solution}{workspace_sid});
102 }
103  
104 package Twilio::Rest::Taskrouter::V1::Workspace::TaskQueuePage;
105  
106 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
107  
108 1 ▶sub records_key { return 'task_queues' }
Subroutine records_key: called CC=1 SCAR=0.0
109  
110 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
111 1 my ($self, $payload) = @_;
112 return Twilio::Rest::Taskrouter::V1::Workspace::TaskQueueInstance->new($self->{version},
113 1 $payload, $self->{solution}{workspace_sid});
114 }
115  
116 package Twilio::Rest::Taskrouter::V1::Workspace::TaskQueueContext;
117  
118 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
119  
120 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
121  
122 6 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
123 6 my ($class, $version, $workspace_sid, $sid) = @_;
124 6 my $self = $class->SUPER::new($version);
125 6 $self->{solution} = { workspace_sid => $workspace_sid, sid => $sid };
126 6 $self->{uri} = join q{}, '/Workspaces/', Twilio::Serialize::path_segment($workspace_sid),
127 '/TaskQueues/', Twilio::Serialize::path_segment($sid);
128 6 return $self;
129 }
130  
131 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
132 1 my ($self) = @_;
133 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
134 1 return 1;
135 }
136  
137 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
138 1 my ($self) = @_;
139  
140 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
141 1 return $self->_build_instance($response);
142 }
143  
144 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
145 1 my ($self, $options) = @_;
146 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
10
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
147  
148 my $data = {
149 AssignmentActivitySid => $options->{assignment_activity_sid},
150 FriendlyName => $options->{friendly_name},
151 MaxReservedWorkers => $options->{max_reserved_workers},
152 ReservationActivitySid => $options->{reservation_activity_sid},
153 TargetWorkers => $options->{target_workers},
154 TaskOrder => $options->{task_order},
155 1 };
156  
157 my $response =
158 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
159 1 return $self->_build_instance($response);
160 }
161  
162 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
163 2 my ($self, $response) = @_;
164 return Twilio::Rest::Taskrouter::V1::Workspace::TaskQueueInstance->new(
165 $self->{version}, $response->get_content,
166 $self->{solution}{workspace_sid}, $self->{solution}{sid}
167 2 );
168 }
169  
170 1 ▶sub cumulative_statistics {
Subroutine cumulative_statistics: called CC=1 SCAR=0.0
171 1 my ($self) = @_;
172 1 require Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueueCumulativeStatistics;
173 return
174 Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueueCumulativeStatisticsContext->new(
175 $self->{version},
176 $self->{solution}{workspace_sid},
177 $self->{solution}{sid}
178 1 );
179 }
180  
181 1 ▶sub real_time_statistics {
Subroutine real_time_statistics: called CC=1 SCAR=0.0
182 1 my ($self) = @_;
183 1 require Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueueRealTimeStatistics;
184 return
185 Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueueRealTimeStatisticsContext->new(
186 $self->{version},
187 $self->{solution}{workspace_sid},
188 $self->{solution}{sid}
189 1 );
190 }
191  
192 1 ▶sub statistics {
Subroutine statistics: called CC=1 SCAR=0.0
193 1 my ($self) = @_;
194 1 require Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueueStatistics;
195 return Twilio::Rest::Taskrouter::V1::Workspace::TaskQueue::TaskQueueStatisticsContext->new(
196 $self->{version},
197 $self->{solution}{workspace_sid},
198 $self->{solution}{sid}
199 1 );
200 }
201  
202 package Twilio::Rest::Taskrouter::V1::Workspace::TaskQueueInstance;
203  
204 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
205  
206 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
207  
208 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
209 4 my ($class, $version, $payload, $workspace_sid, $sid) = @_;
210 4 my $self = $class->SUPER::new($version, $payload);
211 4 ▶ $self->{solution} = { workspace_sid => $workspace_sid, sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
220
MC/DC0%0/2
$sid // $self->{"properties"}{"sid"}
$sid $self->{"properties"}{"sid"}
Truth table66%2/3
A // B
A= $sidB= $self->{"properties"}{"sid"}
ABresult
1X1
011
000
212 4 return $self;
213 }
214  
215 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
216 0 my ($self, @arguments) = @_;
217 0 return $self->_context->delete(@arguments);
218 }
219  
220 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
221 0 my ($self, @arguments) = @_;
222 0 return $self->_context->fetch(@arguments);
223 }
224  
225 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
226 0 my ($self, @arguments) = @_;
227 0 return $self->_context->update(@arguments);
228 }
229  
230 0 ▶sub cumulative_statistics {
Subroutine cumulative_statistics: not called CC=1 SCAR=6.9
231 0 my ($self, @arguments) = @_;
232 0 return $self->_context->cumulative_statistics(@arguments);
233 }
234  
235 0 ▶sub real_time_statistics {
Subroutine real_time_statistics: not called CC=1 SCAR=6.9
236 0 my ($self, @arguments) = @_;
237 0 return $self->_context->real_time_statistics(@arguments);
238 }
239  
240 0 ▶sub statistics {
Subroutine statistics: not called CC=1 SCAR=6.9
241 0 my ($self, @arguments) = @_;
242 0 return $self->_context->statistics(@arguments);
243 }
244  
245 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
246 0 my ($self) = @_;
247 return Twilio::Rest::Taskrouter::V1::Workspace::TaskQueueContext->new(
248 $self->{version},
249 $self->{solution}{workspace_sid},
250 $self->{solution}{sid}
251 0 );
252 }
253  
254 4 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
255 4 ▶sub assignment_activity_name { return $_[0]{properties}{assignment_activity_name} }
Subroutine assignment_activity_name: called CC=1 SCAR=0.0
256 4 ▶sub assignment_activity_sid { return $_[0]{properties}{assignment_activity_sid} }
Subroutine assignment_activity_sid: called CC=1 SCAR=0.0
257 4 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
258 4 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
259 4 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
260 4 ▶sub links { return $_[0]{properties}{links} }
Subroutine links: called CC=1 SCAR=0.0
261 4 ▶sub max_reserved_workers { return $_[0]{properties}{max_reserved_workers} }
Subroutine max_reserved_workers: called CC=1 SCAR=0.0
262 4 ▶sub reservation_activity_name { return $_[0]{properties}{reservation_activity_name} }
Subroutine reservation_activity_name: called CC=1 SCAR=0.0
263 4 ▶sub reservation_activity_sid { return $_[0]{properties}{reservation_activity_sid} }
Subroutine reservation_activity_sid: called CC=1 SCAR=0.0
264 4 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
265 4 ▶sub target_workers { return $_[0]{properties}{target_workers} }
Subroutine target_workers: called CC=1 SCAR=0.0
266 4 ▶sub task_order { return $_[0]{properties}{task_order} }
Subroutine task_order: called CC=1 SCAR=0.0
267 4 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
268 4 ▶sub workspace_sid { return $_[0]{properties}{workspace_sid} }
Subroutine workspace_sid: called CC=1 SCAR=0.0
269  
270 2 1;
271  
272 __END__
« Twilio/Rest/Trunking/V1.pm ↑ Summary Twilio/Rest/Supersim/V1/Sim.pm »