Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatistics.pm

filter: Statementstmt 90.7% 39 / 43 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 88.2% 15 / 17 Podpod n/a totaltotal 87.3% 55 / 63 CC 2 SCAR 2.0
CC
2
Cov
89%
fetch
2.0
fetch
2.0
_context
2.0
CRAP 1.2
« Twilio/Rest/Intelligence/V2/Transcript/Media.pm ↑ Summary Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatistics.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Taskrouter::V1::Workspace::Worker::WorkerStatistics;
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::Worker::WorkerStatisticsContext;
10  
11 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 1 my ($class, $version, $workspace_sid, $worker_sid) = @_;
17 1 my $self = $class->SUPER::new($version);
18 1 $self->{solution} = { workspace_sid => $workspace_sid, worker_sid => $worker_sid };
19 1 $self->{uri} = join q{}, '/Workspaces/', Twilio::Serialize::path_segment($workspace_sid),
20 '/Workers/', Twilio::Serialize::path_segment($worker_sid), '/Statistics';
21 1 return $self;
22 }
23  
24 1 ▶sub fetch {
Subroutine fetch: called CC=2 SCAR=7.0
25 1 my ($self, $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 $response = $self->{version}->handle_request(
29 'GET',
30 $self->{uri},
31 'fetch',
32 {
33 params => {
34 EndDate => Twilio::Serialize::iso8601_date_time($options->{end_date}),
35 Minutes => $options->{minutes},
36 StartDate => Twilio::Serialize::iso8601_date_time($options->{start_date}),
37 TaskChannel => $options->{task_channel},
38 }
39 }
40 1 );
41 1 return $self->_build_instance($response);
42 }
43  
44 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
45 1 my ($self, $response) = @_;
46 return Twilio::Rest::Taskrouter::V1::Workspace::Worker::WorkerStatisticsInstance->new(
47 $self->{version}, $response->get_content,
48 $self->{solution}{workspace_sid},
49 $self->{solution}{worker_sid}
50 1 );
51 }
52  
53 package Twilio::Rest::Taskrouter::V1::Workspace::Worker::WorkerStatisticsInstance;
54  
55 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
56  
57 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
58  
59 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
60 1 my ($class, $version, $payload, $workspace_sid, $worker_sid) = @_;
61 1 my $self = $class->SUPER::new($version, $payload);
62 1 $self->{solution} = { workspace_sid => $workspace_sid, worker_sid => $worker_sid };
63 1 return $self;
64 }
65  
66 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
67 0 my ($self, @arguments) = @_;
68 0 return $self->_context->fetch(@arguments);
69 }
70  
71 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
72 0 my ($self) = @_;
73 return Twilio::Rest::Taskrouter::V1::Workspace::Worker::WorkerStatisticsContext->new(
74 $self->{version},
75 $self->{solution}{workspace_sid},
76 $self->{solution}{worker_sid}
77 0 );
78 }
79  
80 1 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
81 1 ▶sub cumulative { return $_[0]{properties}{cumulative} }
Subroutine cumulative: called CC=1 SCAR=0.0
82 1 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
83 1 ▶sub worker_sid { return $_[0]{properties}{worker_sid} }
Subroutine worker_sid: called CC=1 SCAR=0.0
84 1 ▶sub workspace_sid { return $_[0]{properties}{workspace_sid} }
Subroutine workspace_sid: called CC=1 SCAR=0.0
85  
86 2 1;
87  
88 __END__
« Twilio/Rest/Intelligence/V2/Transcript/Media.pm ↑ Summary Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatistics.pm »