Twilio/Rest/Api/V2010/Account/Recording/AddOnResult.pm

filter: Statementstmt 83.5% 76 / 91 Branchbran 100% 2 / 2 Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 81.5% 31 / 38 Podpod n/a totaltotal 80.5% 112 / 139 CC 4 SCAR 2.8
CC
4
Cov
83%
page
2.0
new
2.0
read
2.0
CRAP 1.3
« Twilio/Rest/Preview/Wireless/RatePlan.pm ↑ Summary Twilio/Rest/FlexApi/V1/Channel.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Api::V2010::Account::Recording::AddOnResult;
3  
4 3 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '2.001';
8  
9 package Twilio::Rest::Api::V2010::Account::Recording::AddOnResultList;
10  
11 3 ▶use parent 'Twilio::ListResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 3 ▶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, $account_sid, $reference_sid) = @_;
17 9 my $self = $class->SUPER::new($version);
18 9 $self->{solution} = { account_sid => $account_sid, reference_sid => $reference_sid };
19 9 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
20 '/Recordings/', Twilio::Serialize::path_segment($reference_sid), '/AddOnResults.json';
21 9 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::Api::V2010::Account::Recording::AddOnResultPage->new($self->{version},
57 1 $response, $self->{solution});
58 }
59  
60 8 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
61 8 my ($self, $sid) = @_;
62 return Twilio::Rest::Api::V2010::Account::Recording::AddOnResultContext->new(
63 $self->{version},
64 $self->{solution}{account_sid},
65 8 $self->{solution}{reference_sid}, $sid
66 );
67 }
68  
69 package Twilio::Rest::Api::V2010::Account::Recording::AddOnResultPage;
70  
71 3 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
72  
73 1 ▶sub records_key { return 'add_on_results' }
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::Api::V2010::Account::Recording::AddOnResultInstance->new(
78 $self->{version}, $payload,
79 $self->{solution}{account_sid},
80 $self->{solution}{reference_sid}
81 1 );
82 }
83  
84 package Twilio::Rest::Api::V2010::Account::Recording::AddOnResultContext;
85  
86 3 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
87  
88 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
89  
90 8 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
91 8 my ($class, $version, $account_sid, $reference_sid, $sid) = @_;
92 8 my $self = $class->SUPER::new($version);
93 8 $self->{solution} = { account_sid => $account_sid, reference_sid => $reference_sid, sid => $sid };
94 8 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
95 '/Recordings/', Twilio::Serialize::path_segment($reference_sid), '/AddOnResults/',
96 Twilio::Serialize::path_segment($sid), '.json';
97 8 return $self;
98 }
99  
100 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
101 1 my ($self) = @_;
102 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
103 1 return 1;
104 }
105  
106 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
107 1 my ($self) = @_;
108  
109 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
110 1 return $self->_build_instance($response);
111 }
112  
113 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
114 1 my ($self, $response) = @_;
115 return Twilio::Rest::Api::V2010::Account::Recording::AddOnResultInstance->new(
116 $self->{version}, $response->get_content,
117 $self->{solution}{account_sid},
118 $self->{solution}{reference_sid},
119 $self->{solution}{sid}
120 1 );
121 }
122  
123 6 ▶sub payloads {
Subroutine payloads: called CC=2 SCAR=6.9
124 6 my ($self, $sid) = @_;
125 6 require Twilio::Rest::Api::V2010::Account::Recording::AddOnResult::Payload;
126 my $list = Twilio::Rest::Api::V2010::Account::Recording::AddOnResult::PayloadList->new(
127 $self->{version},
128 $self->{solution}{account_sid},
129 $self->{solution}{reference_sid},
130 $self->{solution}{sid}
131 6 );
132 6 ▶ return defined $sid ? $list->get_context($sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $sid ? : 5 1 6
133 }
134  
135 package Twilio::Rest::Api::V2010::Account::Recording::AddOnResultInstance;
136  
137 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
138  
139 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
140  
141 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
142 2 my ($class, $version, $payload, $account_sid, $reference_sid, $sid) = @_;
143 2 my $self = $class->SUPER::new($version, $payload);
144 $self->{solution} = {
145 account_sid => $account_sid,
146 reference_sid => $reference_sid,
147 sid => $sid // $self->{properties}{sid}
148 2 ▶ };
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
149 2 return $self;
150 }
151  
152 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
153 0 my ($self, @arguments) = @_;
154 0 return $self->_context->delete(@arguments);
155 }
156  
157 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
158 0 my ($self, @arguments) = @_;
159 0 return $self->_context->fetch(@arguments);
160 }
161  
162 0 ▶sub payloads {
Subroutine payloads: not called CC=1 SCAR=6.9
163 0 my ($self, @arguments) = @_;
164 0 return $self->_context->payloads(@arguments);
165 }
166  
167 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
168 0 my ($self) = @_;
169 return Twilio::Rest::Api::V2010::Account::Recording::AddOnResultContext->new(
170 $self->{version},
171 $self->{solution}{account_sid},
172 $self->{solution}{reference_sid},
173 $self->{solution}{sid}
174 0 );
175 }
176  
177 2 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
178 2 ▶sub add_on_configuration_sid { return $_[0]{properties}{add_on_configuration_sid} }
Subroutine add_on_configuration_sid: called CC=1 SCAR=0.0
179 2 ▶sub add_on_sid { return $_[0]{properties}{add_on_sid} }
Subroutine add_on_sid: called CC=1 SCAR=0.0
180 2 ▶sub date_completed { return Twilio::Deserialize::date_time($_[0]{properties}{date_completed}) }
Subroutine date_completed: called CC=1 SCAR=0.0
181 2 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
182 2 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
183 2 ▶sub reference_sid { return $_[0]{properties}{reference_sid} }
Subroutine reference_sid: called CC=1 SCAR=0.0
184 2 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
185 2 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
186 2 ▶sub subresource_uris { return $_[0]{properties}{subresource_uris} }
Subroutine subresource_uris: called CC=1 SCAR=0.0
187  
188 3 1;
189  
190 __END__
« Twilio/Rest/Preview/Wireless/RatePlan.pm ↑ Summary Twilio/Rest/FlexApi/V1/Channel.pm »