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

filter: Statementstmt 81.7% 94 / 115 Branchbran n/a Conditioncond 55.5% 5 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 79.1% 38 / 48 Podpod n/a totaltotal 77.4% 137 / 177 CC 5 SCAR 3.0
CC
5
Cov
80%
create
2.0
page
2.0
update
2.0
CRAP 1.3
« Twilio/Rest/Api.pm ↑ Summary Twilio/Rest/Api/V2010/Account/OutgoingCallerId.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Taskrouter::V1::Workspace::Workflow;
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::WorkflowList;
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 8 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 8 my ($class, $version, $workspace_sid) = @_;
17 8 my $self = $class->SUPER::new($version);
18 8 $self->{solution} = { workspace_sid => $workspace_sid };
19 8 $self->{uri} = join q{}, '/Workspaces/', Twilio::Serialize::path_segment($workspace_sid),
20 '/Workflows';
21 8 return $self;
22 }
23  
24 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
25 1 my ($self, $friendly_name, $configuration, $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 Configuration => $configuration,
31 AssignmentCallbackUrl => $options->{assignment_callback_url},
32 FallbackAssignmentCallbackUrl => $options->{fallback_assignment_callback_url},
33 TaskReservationTimeout => $options->{task_reservation_timeout},
34 1 };
35  
36 my $response =
37 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
38 return Twilio::Rest::Taskrouter::V1::Workspace::WorkflowInstance->new($self->{version},
39 1 $response->get_content, $self->{solution}{workspace_sid});
40 }
41  
42 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
43 0 my ($self, @arguments) = @_;
44 0 return $self->read_records(@arguments);
45 }
46  
47 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
48 0 my ($self, @arguments) = @_;
49 0 return $self->stream_records(@arguments);
50 }
51  
52 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
53 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
54 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
55  
56 my $params = {
57 FriendlyName => $options->{friendly_name},
58 1 PageToken => $page_token,
59 Page => $page_number,
60 PageSize => $page_size,
61 };
62  
63 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
64 1 return $self->_build_page($response);
65 }
66  
67 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
68 0 my ($self, $target_url) = @_;
69 0 my $client = $self->{version}->get_domain->get_client;
70 0 return $self->_build_page($client->request('GET', $target_url));
71 }
72  
73 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
74 1 my ($self, $response) = @_;
75 return Twilio::Rest::Taskrouter::V1::Workspace::WorkflowPage->new($self->{version}, $response,
76 1 $self->{solution});
77 }
78  
79 6 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
80 6 my ($self, $sid) = @_;
81 return Twilio::Rest::Taskrouter::V1::Workspace::WorkflowContext->new($self->{version},
82 6 $self->{solution}{workspace_sid}, $sid);
83 }
84  
85 package Twilio::Rest::Taskrouter::V1::Workspace::WorkflowPage;
86  
87 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
88  
89 1 ▶sub records_key { return 'workflows' }
Subroutine records_key: called CC=1 SCAR=0.0
90  
91 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
92 1 my ($self, $payload) = @_;
93 return Twilio::Rest::Taskrouter::V1::Workspace::WorkflowInstance->new($self->{version}, $payload,
94 1 $self->{solution}{workspace_sid});
95 }
96  
97 package Twilio::Rest::Taskrouter::V1::Workspace::WorkflowContext;
98  
99 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
100  
101 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
102  
103 6 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
104 6 my ($class, $version, $workspace_sid, $sid) = @_;
105 6 my $self = $class->SUPER::new($version);
106 6 $self->{solution} = { workspace_sid => $workspace_sid, sid => $sid };
107 6 $self->{uri} = join q{}, '/Workspaces/', Twilio::Serialize::path_segment($workspace_sid),
108 '/Workflows/', Twilio::Serialize::path_segment($sid);
109 6 return $self;
110 }
111  
112 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
113 1 my ($self) = @_;
114 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
115 1 return 1;
116 }
117  
118 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
119 1 my ($self) = @_;
120  
121 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
122 1 return $self->_build_instance($response);
123 }
124  
125 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
126 1 my ($self, $options) = @_;
127 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
128  
129 my $data = {
130 AssignmentCallbackUrl => $options->{assignment_callback_url},
131 Configuration => $options->{configuration},
132 FallbackAssignmentCallbackUrl => $options->{fallback_assignment_callback_url},
133 FriendlyName => $options->{friendly_name},
134 ReEvaluateTasks => $options->{re_evaluate_tasks},
135 TaskReservationTimeout => $options->{task_reservation_timeout},
136 1 };
137  
138 my $response =
139 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
140 1 return $self->_build_instance($response);
141 }
142  
143 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
144 2 my ($self, $response) = @_;
145 return Twilio::Rest::Taskrouter::V1::Workspace::WorkflowInstance->new(
146 $self->{version}, $response->get_content,
147 $self->{solution}{workspace_sid}, $self->{solution}{sid}
148 2 );
149 }
150  
151 1 ▶sub cumulative_statistics {
Subroutine cumulative_statistics: called CC=1 SCAR=0.0
152 1 my ($self) = @_;
153 1 require Twilio::Rest::Taskrouter::V1::Workspace::Workflow::WorkflowCumulativeStatistics;
154 return
155 Twilio::Rest::Taskrouter::V1::Workspace::Workflow::WorkflowCumulativeStatisticsContext->new(
156 $self->{version},
157 $self->{solution}{workspace_sid},
158 $self->{solution}{sid}
159 1 );
160 }
161  
162 1 ▶sub real_time_statistics {
Subroutine real_time_statistics: called CC=1 SCAR=0.0
163 1 my ($self) = @_;
164 1 require Twilio::Rest::Taskrouter::V1::Workspace::Workflow::WorkflowRealTimeStatistics;
165 return Twilio::Rest::Taskrouter::V1::Workspace::Workflow::WorkflowRealTimeStatisticsContext->new(
166 $self->{version},
167 $self->{solution}{workspace_sid},
168 $self->{solution}{sid}
169 1 );
170 }
171  
172 1 ▶sub statistics {
Subroutine statistics: called CC=1 SCAR=0.0
173 1 my ($self) = @_;
174 1 require Twilio::Rest::Taskrouter::V1::Workspace::Workflow::WorkflowStatistics;
175 return Twilio::Rest::Taskrouter::V1::Workspace::Workflow::WorkflowStatisticsContext->new(
176 $self->{version},
177 $self->{solution}{workspace_sid},
178 $self->{solution}{sid}
179 1 );
180 }
181  
182 package Twilio::Rest::Taskrouter::V1::Workspace::WorkflowInstance;
183  
184 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
185  
186 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
187  
188 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
189 4 my ($class, $version, $payload, $workspace_sid, $sid) = @_;
190 4 my $self = $class->SUPER::new($version, $payload);
191 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
192 4 return $self;
193 }
194  
195 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
196 0 my ($self, @arguments) = @_;
197 0 return $self->_context->delete(@arguments);
198 }
199  
200 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
201 0 my ($self, @arguments) = @_;
202 0 return $self->_context->fetch(@arguments);
203 }
204  
205 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
206 0 my ($self, @arguments) = @_;
207 0 return $self->_context->update(@arguments);
208 }
209  
210 0 ▶sub cumulative_statistics {
Subroutine cumulative_statistics: not called CC=1 SCAR=6.9
211 0 my ($self, @arguments) = @_;
212 0 return $self->_context->cumulative_statistics(@arguments);
213 }
214  
215 0 ▶sub real_time_statistics {
Subroutine real_time_statistics: not called CC=1 SCAR=6.9
216 0 my ($self, @arguments) = @_;
217 0 return $self->_context->real_time_statistics(@arguments);
218 }
219  
220 0 ▶sub statistics {
Subroutine statistics: not called CC=1 SCAR=6.9
221 0 my ($self, @arguments) = @_;
222 0 return $self->_context->statistics(@arguments);
223 }
224  
225 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
226 0 my ($self) = @_;
227 return Twilio::Rest::Taskrouter::V1::Workspace::WorkflowContext->new(
228 $self->{version},
229 $self->{solution}{workspace_sid},
230 $self->{solution}{sid}
231 0 );
232 }
233  
234 4 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
235 4 ▶sub assignment_callback_url { return $_[0]{properties}{assignment_callback_url} }
Subroutine assignment_callback_url: called CC=1 SCAR=0.0
236 4 ▶sub configuration { return $_[0]{properties}{configuration} }
Subroutine configuration: called CC=1 SCAR=0.0
237 4 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
238 4 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
239 4 ▶sub document_content_type { return $_[0]{properties}{document_content_type} }
Subroutine document_content_type: called CC=1 SCAR=0.0
240 4 ▶sub fallback_assignment_callback_url { return $_[0]{properties}{fallback_assignment_callback_url} }
Subroutine fallback_assignment_callback_url: called CC=1 SCAR=0.0
241 4 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
242 4 ▶sub links { return $_[0]{properties}{links} }
Subroutine links: called CC=1 SCAR=0.0
243 4 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
244 4 ▶sub task_reservation_timeout { return $_[0]{properties}{task_reservation_timeout} }
Subroutine task_reservation_timeout: called CC=1 SCAR=0.0
245 4 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
246 4 ▶sub workspace_sid { return $_[0]{properties}{workspace_sid} }
Subroutine workspace_sid: called CC=1 SCAR=0.0
247  
248 2 1;
249  
250 __END__
« Twilio/Rest/Api.pm ↑ Summary Twilio/Rest/Api/V2010/Account/OutgoingCallerId.pm »