Twilio/Rest/Studio/V1/Flow.pm

filter: Statementstmt 82.2% 79 / 96 Branchbran 100% 4 / 4 Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 79.4% 31 / 39 Podpod n/a totaltotal 79.5% 117 / 147 CC 5 SCAR 3.2
CC
5
Cov
82%
page
2.0
new
2.0
read
2.0
CRAP 1.4
« Twilio/Rest/Conversations/V1/Service/Conversation/Message.pm ↑ Summary Twilio/Rest/Proxy/V1/Service/Session.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Studio::V1::Flow;
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::V1::FlowList;
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 20 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 20 my ($class, $version) = @_;
17 20 my $self = $class->SUPER::new($version);
18 20 $self->{solution} = {};
19 20 $self->{uri} = '/Flows';
20 20 return $self;
21 }
22  
23 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
24 0 my ($self, @arguments) = @_;
25 0 return $self->read_records(@arguments);
26 }
27  
28 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
29 0 my ($self, @arguments) = @_;
30 0 return $self->stream_records(@arguments);
31 }
32  
33 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
34 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
35 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
36  
37 1 my $params = {
38 PageToken => $page_token,
39 Page => $page_number,
40 PageSize => $page_size,
41 };
42  
43 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
44 1 return $self->_build_page($response);
45 }
46  
47 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
48 0 my ($self, $target_url) = @_;
49 0 my $client = $self->{version}->get_domain->get_client;
50 0 return $self->_build_page($client->request('GET', $target_url));
51 }
52  
53 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
54 1 my ($self, $response) = @_;
55 1 return Twilio::Rest::Studio::V1::FlowPage->new($self->{version}, $response, $self->{solution});
56 }
57  
58 19 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
59 19 my ($self, $sid) = @_;
60 19 return Twilio::Rest::Studio::V1::FlowContext->new($self->{version}, $sid);
61 }
62  
63 package Twilio::Rest::Studio::V1::FlowPage;
64  
65 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
66  
67 1 ▶sub records_key { return 'flows' }
Subroutine records_key: called CC=1 SCAR=0.0
68  
69 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
70 1 my ($self, $payload) = @_;
71 1 return Twilio::Rest::Studio::V1::FlowInstance->new($self->{version}, $payload);
72 }
73  
74 package Twilio::Rest::Studio::V1::FlowContext;
75  
76 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
77  
78 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
79  
80 19 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
81 19 my ($class, $version, $sid) = @_;
82 19 my $self = $class->SUPER::new($version);
83 19 $self->{solution} = { sid => $sid };
84 19 $self->{uri} = join q{}, '/Flows/', Twilio::Serialize::path_segment($sid);
85 19 return $self;
86 }
87  
88 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
89 1 my ($self) = @_;
90 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
91 1 return 1;
92 }
93  
94 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
95 1 my ($self) = @_;
96  
97 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
98 1 return $self->_build_instance($response);
99 }
100  
101 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
102 1 my ($self, $response) = @_;
103 return Twilio::Rest::Studio::V1::FlowInstance->new($self->{version}, $response->get_content,
104 1 $self->{solution}{sid});
105 }
106  
107 8 ▶sub engagements {
Subroutine engagements: called CC=2 SCAR=6.9
108 8 my ($self, $sid) = @_;
109 8 require Twilio::Rest::Studio::V1::Flow::Engagement;
110 my $list =
111 8 Twilio::Rest::Studio::V1::Flow::EngagementList->new($self->{version}, $self->{solution}{sid});
112 8 ▶ return defined $sid ? $list->get_context($sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $sid ? : 6 2 8
113 }
114  
115 9 ▶sub executions {
Subroutine executions: called CC=2 SCAR=6.9
116 9 my ($self, $sid) = @_;
117 9 require Twilio::Rest::Studio::V1::Flow::Execution;
118 my $list =
119 9 Twilio::Rest::Studio::V1::Flow::ExecutionList->new($self->{version}, $self->{solution}{sid});
120 9 ▶ return defined $sid ? $list->get_context($sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $sid ? : 7 2 9
121 }
122  
123 package Twilio::Rest::Studio::V1::FlowInstance;
124  
125 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
126  
127 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
128  
129 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
130 2 my ($class, $version, $payload, $sid) = @_;
131 2 my $self = $class->SUPER::new($version, $payload);
132 2 ▶ $self->{solution} = { 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
133 2 return $self;
134 }
135  
136 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
137 0 my ($self, @arguments) = @_;
138 0 return $self->_context->delete(@arguments);
139 }
140  
141 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
142 0 my ($self, @arguments) = @_;
143 0 return $self->_context->fetch(@arguments);
144 }
145  
146 0 ▶sub engagements {
Subroutine engagements: not called CC=1 SCAR=6.9
147 0 my ($self, @arguments) = @_;
148 0 return $self->_context->engagements(@arguments);
149 }
150  
151 0 ▶sub executions {
Subroutine executions: not called CC=1 SCAR=6.9
152 0 my ($self, @arguments) = @_;
153 0 return $self->_context->executions(@arguments);
154 }
155  
156 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
157 0 my ($self) = @_;
158 0 return Twilio::Rest::Studio::V1::FlowContext->new($self->{version}, $self->{solution}{sid});
159 }
160  
161 2 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
162 2 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
163 2 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
164 2 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
165 2 ▶sub links { return $_[0]{properties}{links} }
Subroutine links: called CC=1 SCAR=0.0
166 2 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
167 2 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
168 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
169 2 ▶sub version { return $_[0]{properties}{version} }
Subroutine version: called CC=1 SCAR=0.0
170  
171 2 1;
172  
173 __END__
« Twilio/Rest/Conversations/V1/Service/Conversation/Message.pm ↑ Summary Twilio/Rest/Proxy/V1/Service/Session.pm »