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

filter: Statementstmt 87.3% 76 / 87 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 87.8% 36 / 41 Podpod n/a totaltotal 84.5% 115 / 136 CC 3 SCAR 1.9
CC
3
Cov
86%
page
2.0
new
2.0
read
2.0
CRAP 1.2
« Twilio/Rest/Insights/V1/Room/Participant.pm ↑ Summary Twilio/Rest/Memory/V1/Revision.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Taskrouter::V1::Workspace::Event;
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::EventList;
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 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 2 my ($class, $version, $workspace_sid) = @_;
17 2 my $self = $class->SUPER::new($version);
18 2 $self->{solution} = { workspace_sid => $workspace_sid };
19 2 $self->{uri} = join q{}, '/Workspaces/', Twilio::Serialize::path_segment($workspace_sid),
20 '/Events';
21 2 return $self;
22 }
23  
24 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
25 0 my ($self, @arguments) = @_;
26 0 return $self->read_records(@arguments);
27 }
28  
29 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
30 0 my ($self, @arguments) = @_;
31 0 return $self->stream_records(@arguments);
32 }
33  
34 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
35 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
36 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
37  
38 my $params = {
39 EndDate => Twilio::Serialize::iso8601_date_time($options->{end_date}),
40 EventType => $options->{event_type},
41 Minutes => $options->{minutes},
42 ReservationSid => $options->{reservation_sid},
43 Sid => $options->{sid},
44 StartDate => Twilio::Serialize::iso8601_date_time($options->{start_date}),
45 TaskChannel => $options->{task_channel},
46 TaskQueueSid => $options->{task_queue_sid},
47 TaskSid => $options->{task_sid},
48 WorkerSid => $options->{worker_sid},
49 WorkflowSid => $options->{workflow_sid},
50 1 PageToken => $page_token,
51 Page => $page_number,
52 PageSize => $page_size,
53 };
54  
55 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
56 1 return $self->_build_page($response);
57 }
58  
59 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
60 0 my ($self, $target_url) = @_;
61 0 my $client = $self->{version}->get_domain->get_client;
62 0 return $self->_build_page($client->request('GET', $target_url));
63 }
64  
65 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
66 1 my ($self, $response) = @_;
67 return Twilio::Rest::Taskrouter::V1::Workspace::EventPage->new($self->{version}, $response,
68 1 $self->{solution});
69 }
70  
71 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
72 1 my ($self, $sid) = @_;
73 return Twilio::Rest::Taskrouter::V1::Workspace::EventContext->new($self->{version},
74 1 $self->{solution}{workspace_sid}, $sid);
75 }
76  
77 package Twilio::Rest::Taskrouter::V1::Workspace::EventPage;
78  
79 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
80  
81 1 ▶sub records_key { return 'events' }
Subroutine records_key: called CC=1 SCAR=0.0
82  
83 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
84 1 my ($self, $payload) = @_;
85 return Twilio::Rest::Taskrouter::V1::Workspace::EventInstance->new($self->{version}, $payload,
86 1 $self->{solution}{workspace_sid});
87 }
88  
89 package Twilio::Rest::Taskrouter::V1::Workspace::EventContext;
90  
91 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
92  
93 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
94  
95 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
96 1 my ($class, $version, $workspace_sid, $sid) = @_;
97 1 my $self = $class->SUPER::new($version);
98 1 $self->{solution} = { workspace_sid => $workspace_sid, sid => $sid };
99 1 $self->{uri} = join q{}, '/Workspaces/', Twilio::Serialize::path_segment($workspace_sid),
100 '/Events/', Twilio::Serialize::path_segment($sid);
101 1 return $self;
102 }
103  
104 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
105 1 my ($self) = @_;
106  
107 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
108 1 return $self->_build_instance($response);
109 }
110  
111 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
112 1 my ($self, $response) = @_;
113 return Twilio::Rest::Taskrouter::V1::Workspace::EventInstance->new(
114 $self->{version}, $response->get_content,
115 $self->{solution}{workspace_sid}, $self->{solution}{sid}
116 1 );
117 }
118  
119 package Twilio::Rest::Taskrouter::V1::Workspace::EventInstance;
120  
121 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
122  
123 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
124  
125 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
126 2 my ($class, $version, $payload, $workspace_sid, $sid) = @_;
127 2 my $self = $class->SUPER::new($version, $payload);
128 2 ▶ $self->{solution} = { workspace_sid => $workspace_sid, sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
110
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
129 2 return $self;
130 }
131  
132 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
133 0 my ($self, @arguments) = @_;
134 0 return $self->_context->fetch(@arguments);
135 }
136  
137 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
138 0 my ($self) = @_;
139 return Twilio::Rest::Taskrouter::V1::Workspace::EventContext->new(
140 $self->{version},
141 $self->{solution}{workspace_sid},
142 $self->{solution}{sid}
143 0 );
144 }
145  
146 2 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
147 2 ▶sub actor_sid { return $_[0]{properties}{actor_sid} }
Subroutine actor_sid: called CC=1 SCAR=0.0
148 2 ▶sub actor_type { return $_[0]{properties}{actor_type} }
Subroutine actor_type: called CC=1 SCAR=0.0
149 2 ▶sub actor_url { return $_[0]{properties}{actor_url} }
Subroutine actor_url: called CC=1 SCAR=0.0
150 2 ▶sub description { return $_[0]{properties}{description} }
Subroutine description: called CC=1 SCAR=0.0
151 2 ▶sub event_data { return $_[0]{properties}{event_data} }
Subroutine event_data: called CC=1 SCAR=0.0
152 2 ▶sub event_date { return Twilio::Deserialize::date_time($_[0]{properties}{event_date}) }
Subroutine event_date: called CC=1 SCAR=0.0
153 2 ▶sub event_date_ms { return $_[0]{properties}{event_date_ms} }
Subroutine event_date_ms: called CC=1 SCAR=0.0
154 2 ▶sub event_type { return $_[0]{properties}{event_type} }
Subroutine event_type: called CC=1 SCAR=0.0
155 2 ▶sub resource_sid { return $_[0]{properties}{resource_sid} }
Subroutine resource_sid: called CC=1 SCAR=0.0
156 2 ▶sub resource_type { return $_[0]{properties}{resource_type} }
Subroutine resource_type: called CC=1 SCAR=0.0
157 2 ▶sub resource_url { return $_[0]{properties}{resource_url} }
Subroutine resource_url: called CC=1 SCAR=0.0
158 2 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
159 2 ▶sub source { return $_[0]{properties}{source} }
Subroutine source: called CC=1 SCAR=0.0
160 2 ▶sub source_ip_address { return $_[0]{properties}{source_ip_address} }
Subroutine source_ip_address: called CC=1 SCAR=0.0
161 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
162 2 ▶sub workspace_sid { return $_[0]{properties}{workspace_sid} }
Subroutine workspace_sid: called CC=1 SCAR=0.0
163  
164 2 1;
165  
166 __END__
« Twilio/Rest/Insights/V1/Room/Participant.pm ↑ Summary Twilio/Rest/Memory/V1/Revision.pm »