Twilio/Rest/Studio/V2/Flow/Execution.pm

filter: Statementstmt 82.7% 91 / 110 Branchbran 100% 2 / 2 Conditioncond 57.1% 4 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 80.4% 37 / 46 Podpod n/a totaltotal 79.2% 134 / 169 CC 5 SCAR 2.9
CC
5
Cov
82%
create
2.0
page
2.0
new
2.0
CRAP 1.3
« Twilio/Rest/Api/V2010/Account/Sip/CredentialList/Credential.pm ↑ Summary Twilio/Rest/Api/V2010/Account/Sip/CredentialList.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Studio::V2::Flow::Execution;
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::Studio::V2::Flow::ExecutionList;
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 9 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 9 my ($class, $version, $flow_sid) = @_;
17 9 my $self = $class->SUPER::new($version);
18 9 $self->{solution} = { flow_sid => $flow_sid };
19 9 $self->{uri} = join q{}, '/Flows/', Twilio::Serialize::path_segment($flow_sid), '/Executions';
20 9 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 1 my ($self, $to, $from, $options) = @_;
25 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
26  
27 my $data = {
28 To => $to,
29 From => $from,
30 1 Parameters => Twilio::Serialize::json_object($options->{parameters}),
31 };
32  
33 my $response =
34 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
35 return Twilio::Rest::Studio::V2::Flow::ExecutionInstance->new($self->{version},
36 1 $response->get_content, $self->{solution}{flow_sid});
37 }
38  
39 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
40 0 my ($self, @arguments) = @_;
41 0 return $self->read_records(@arguments);
42 }
43  
44 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
45 0 my ($self, @arguments) = @_;
46 0 return $self->stream_records(@arguments);
47 }
48  
49 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
50 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
51 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
52  
53 my $params = {
54 DateCreatedFrom => Twilio::Serialize::iso8601_date_time($options->{date_created_from}),
55 DateCreatedTo => Twilio::Serialize::iso8601_date_time($options->{date_created_to}),
56 status => $options->{status},
57 1 PageToken => $page_token,
58 Page => $page_number,
59 PageSize => $page_size,
60 };
61  
62 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
63 1 return $self->_build_page($response);
64 }
65  
66 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
67 0 my ($self, $target_url) = @_;
68 0 my $client = $self->{version}->get_domain->get_client;
69 0 return $self->_build_page($client->request('GET', $target_url));
70 }
71  
72 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
73 1 my ($self, $response) = @_;
74 return Twilio::Rest::Studio::V2::Flow::ExecutionPage->new($self->{version}, $response,
75 1 $self->{solution});
76 }
77  
78 7 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
79 7 my ($self, $sid) = @_;
80 return Twilio::Rest::Studio::V2::Flow::ExecutionContext->new($self->{version},
81 7 $self->{solution}{flow_sid}, $sid);
82 }
83  
84 package Twilio::Rest::Studio::V2::Flow::ExecutionPage;
85  
86 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
87  
88 1 ▶sub records_key { return 'executions' }
Subroutine records_key: called CC=1 SCAR=0.0
89  
90 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
91 1 my ($self, $payload) = @_;
92 return Twilio::Rest::Studio::V2::Flow::ExecutionInstance->new($self->{version}, $payload,
93 1 $self->{solution}{flow_sid});
94 }
95  
96 package Twilio::Rest::Studio::V2::Flow::ExecutionContext;
97  
98 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
99  
100 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
101  
102 7 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
103 7 my ($class, $version, $flow_sid, $sid) = @_;
104 7 my $self = $class->SUPER::new($version);
105 7 $self->{solution} = { flow_sid => $flow_sid, sid => $sid };
106 7 $self->{uri} = join q{}, '/Flows/', Twilio::Serialize::path_segment($flow_sid), '/Executions/',
107 Twilio::Serialize::path_segment($sid);
108 7 return $self;
109 }
110  
111 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
112 1 my ($self) = @_;
113 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
114 1 return 1;
115 }
116  
117 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
118 1 my ($self) = @_;
119  
120 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
121 1 return $self->_build_instance($response);
122 }
123  
124 1 ▶sub update {
Subroutine update: called CC=1 SCAR=0.0
125 1 my ($self, $status) = @_;
126  
127 1 my $data = { Status => $status, };
128  
129 my $response =
130 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
131 1 return $self->_build_instance($response);
132 }
133  
134 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
135 2 my ($self, $response) = @_;
136 return Twilio::Rest::Studio::V2::Flow::ExecutionInstance->new(
137 $self->{version}, $response->get_content,
138 $self->{solution}{flow_sid}, $self->{solution}{sid}
139 2 );
140 }
141  
142 1 ▶sub execution_context {
Subroutine execution_context: called CC=1 SCAR=0.0
143 1 my ($self) = @_;
144 1 require Twilio::Rest::Studio::V2::Flow::Execution::ExecutionContext;
145 return Twilio::Rest::Studio::V2::Flow::Execution::ExecutionContextContext->new(
146 $self->{version},
147 $self->{solution}{flow_sid},
148 $self->{solution}{sid}
149 1 );
150 }
151  
152 3 ▶sub steps {
Subroutine steps: called CC=2 SCAR=6.9
153 3 my ($self, $sid) = @_;
154 3 require Twilio::Rest::Studio::V2::Flow::Execution::ExecutionStep;
155 my $list = Twilio::Rest::Studio::V2::Flow::Execution::ExecutionStepList->new(
156 $self->{version},
157 $self->{solution}{flow_sid},
158 $self->{solution}{sid}
159 3 );
160 3 ▶ return defined $sid ? $list->get_context($sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $sid ? : 2 1 3
161 }
162  
163 package Twilio::Rest::Studio::V2::Flow::ExecutionInstance;
164  
165 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
166  
167 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
168  
169 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
170 4 my ($class, $version, $payload, $flow_sid, $sid) = @_;
171 4 my $self = $class->SUPER::new($version, $payload);
172 4 ▶ $self->{solution} = { flow_sid => $flow_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
173 4 return $self;
174 }
175  
176 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
177 0 my ($self, @arguments) = @_;
178 0 return $self->_context->delete(@arguments);
179 }
180  
181 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
182 0 my ($self, @arguments) = @_;
183 0 return $self->_context->fetch(@arguments);
184 }
185  
186 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
187 0 my ($self, @arguments) = @_;
188 0 return $self->_context->update(@arguments);
189 }
190  
191 0 ▶sub execution_context {
Subroutine execution_context: not called CC=1 SCAR=6.9
192 0 my ($self, @arguments) = @_;
193 0 return $self->_context->execution_context(@arguments);
194 }
195  
196 0 ▶sub steps {
Subroutine steps: not called CC=1 SCAR=6.9
197 0 my ($self, @arguments) = @_;
198 0 return $self->_context->steps(@arguments);
199 }
200  
201 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
202 0 my ($self) = @_;
203 return Twilio::Rest::Studio::V2::Flow::ExecutionContext->new(
204 $self->{version},
205 $self->{solution}{flow_sid},
206 $self->{solution}{sid}
207 0 );
208 }
209  
210 4 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
211 4 ▶sub contact_channel_address { return $_[0]{properties}{contact_channel_address} }
Subroutine contact_channel_address: called CC=1 SCAR=0.0
212 4 ▶sub contact_sid { return $_[0]{properties}{contact_sid} }
Subroutine contact_sid: called CC=1 SCAR=0.0
213 4 ▶sub context { return $_[0]{properties}{context} }
Subroutine context: called CC=1 SCAR=0.0
214 4 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
215 4 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
216 4 ▶sub flow_sid { return $_[0]{properties}{flow_sid} }
Subroutine flow_sid: called CC=1 SCAR=0.0
217 4 ▶sub flow_version { return $_[0]{properties}{flow_version} }
Subroutine flow_version: called CC=1 SCAR=0.0
218 4 ▶sub initiated_by { return $_[0]{properties}{initiated_by} }
Subroutine initiated_by: called CC=1 SCAR=0.0
219 4 ▶sub links { return $_[0]{properties}{links} }
Subroutine links: called CC=1 SCAR=0.0
220 4 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
221 4 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
222 4 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
223  
224 2 1;
225  
226 __END__
« Twilio/Rest/Api/V2010/Account/Sip/CredentialList/Credential.pm ↑ Summary Twilio/Rest/Api/V2010/Account/Sip/CredentialList.pm »