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

filter: Statementstmt 85.5% 77 / 90 Branchbran n/a Conditioncond 57.1% 4 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 84.6% 33 / 39 Podpod n/a totaltotal 81.4% 114 / 140 CC 4 SCAR 2.5
CC
4
Cov
84%
page
2.0
update
2.0
new
2.0
CRAP 1.3
« Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignment.pm ↑ Summary Twilio/Rest/Bulkexports/V1/Export/Day.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::WorkerChannel;
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::WorkerChannelList;
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 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 3 my ($class, $version, $workspace_sid, $worker_sid) = @_;
17 3 my $self = $class->SUPER::new($version);
18 3 $self->{solution} = { workspace_sid => $workspace_sid, worker_sid => $worker_sid };
19 3 $self->{uri} = join q{}, '/Workspaces/', Twilio::Serialize::path_segment($workspace_sid),
20 '/Workers/', Twilio::Serialize::path_segment($worker_sid), '/Channels';
21 3 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
01
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
37  
38 1 my $params = {
39 PageToken => $page_token,
40 Page => $page_number,
41 PageSize => $page_size,
42 };
43  
44 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
45 1 return $self->_build_page($response);
46 }
47  
48 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
49 0 my ($self, $target_url) = @_;
50 0 my $client = $self->{version}->get_domain->get_client;
51 0 return $self->_build_page($client->request('GET', $target_url));
52 }
53  
54 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
55 1 my ($self, $response) = @_;
56 return Twilio::Rest::Taskrouter::V1::Workspace::Worker::WorkerChannelPage->new($self->{version},
57 1 $response, $self->{solution});
58 }
59  
60 2 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
61 2 my ($self, $sid) = @_;
62 return Twilio::Rest::Taskrouter::V1::Workspace::Worker::WorkerChannelContext->new(
63 $self->{version},
64 $self->{solution}{workspace_sid},
65 2 $self->{solution}{worker_sid}, $sid
66 );
67 }
68  
69 package Twilio::Rest::Taskrouter::V1::Workspace::Worker::WorkerChannelPage;
70  
71 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
72  
73 1 ▶sub records_key { return 'channels' }
Subroutine records_key: called CC=1 SCAR=0.0
74  
75 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
76 1 my ($self, $payload) = @_;
77 return Twilio::Rest::Taskrouter::V1::Workspace::Worker::WorkerChannelInstance->new(
78 $self->{version}, $payload,
79 $self->{solution}{workspace_sid},
80 $self->{solution}{worker_sid}
81 1 );
82 }
83  
84 package Twilio::Rest::Taskrouter::V1::Workspace::Worker::WorkerChannelContext;
85  
86 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
87  
88 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
89  
90 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
91 2 my ($class, $version, $workspace_sid, $worker_sid, $sid) = @_;
92 2 my $self = $class->SUPER::new($version);
93 2 $self->{solution} = { workspace_sid => $workspace_sid, worker_sid => $worker_sid, sid => $sid };
94 2 $self->{uri} = join q{}, '/Workspaces/', Twilio::Serialize::path_segment($workspace_sid),
95 '/Workers/', Twilio::Serialize::path_segment($worker_sid), '/Channels/',
96 Twilio::Serialize::path_segment($sid);
97 2 return $self;
98 }
99  
100 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
101 1 my ($self) = @_;
102  
103 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
104 1 return $self->_build_instance($response);
105 }
106  
107 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
108 1 my ($self, $options) = @_;
109 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
110  
111 my $data = {
112 Available => Twilio::Serialize::boolean_to_string($options->{available}),
113 Capacity => $options->{capacity},
114 1 };
115  
116 my $response =
117 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
118 1 return $self->_build_instance($response);
119 }
120  
121 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
122 2 my ($self, $response) = @_;
123 return Twilio::Rest::Taskrouter::V1::Workspace::Worker::WorkerChannelInstance->new(
124 $self->{version}, $response->get_content,
125 $self->{solution}{workspace_sid},
126 $self->{solution}{worker_sid},
127 $self->{solution}{sid}
128 2 );
129 }
130  
131 package Twilio::Rest::Taskrouter::V1::Workspace::Worker::WorkerChannelInstance;
132  
133 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
134  
135 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
136  
137 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
138 3 my ($class, $version, $payload, $workspace_sid, $worker_sid, $sid) = @_;
139 3 my $self = $class->SUPER::new($version, $payload);
140 $self->{solution} = {
141 workspace_sid => $workspace_sid,
142 worker_sid => $worker_sid,
143 sid => $sid // $self->{properties}{sid}
144 3 ▶ };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
210
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
145 3 return $self;
146 }
147  
148 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
149 0 my ($self, @arguments) = @_;
150 0 return $self->_context->fetch(@arguments);
151 }
152  
153 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
154 0 my ($self, @arguments) = @_;
155 0 return $self->_context->update(@arguments);
156 }
157  
158 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
159 0 my ($self) = @_;
160 return Twilio::Rest::Taskrouter::V1::Workspace::Worker::WorkerChannelContext->new(
161 $self->{version},
162 $self->{solution}{workspace_sid},
163 $self->{solution}{worker_sid},
164 $self->{solution}{sid}
165 0 );
166 }
167  
168 3 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
169 3 ▶sub assigned_tasks { return $_[0]{properties}{assigned_tasks} }
Subroutine assigned_tasks: called CC=1 SCAR=0.0
170 3 ▶sub available { return $_[0]{properties}{available} }
Subroutine available: called CC=1 SCAR=0.0
171 3 ▶sub available_capacity_percentage { return $_[0]{properties}{available_capacity_percentage} }
Subroutine available_capacity_percentage: called CC=1 SCAR=0.0
172 3 ▶sub configured_capacity { return $_[0]{properties}{configured_capacity} }
Subroutine configured_capacity: called CC=1 SCAR=0.0
173 3 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
174 3 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
175 3 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
176 3 ▶sub task_channel_sid { return $_[0]{properties}{task_channel_sid} }
Subroutine task_channel_sid: called CC=1 SCAR=0.0
177 3 ▶sub task_channel_unique_name { return $_[0]{properties}{task_channel_unique_name} }
Subroutine task_channel_unique_name: called CC=1 SCAR=0.0
178 3 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
179 3 ▶sub worker_sid { return $_[0]{properties}{worker_sid} }
Subroutine worker_sid: called CC=1 SCAR=0.0
180 3 ▶sub workspace_sid { return $_[0]{properties}{workspace_sid} }
Subroutine workspace_sid: called CC=1 SCAR=0.0
181  
182 2 1;
183  
184 __END__
« Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignment.pm ↑ Summary Twilio/Rest/Bulkexports/V1/Export/Day.pm »