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

filter: Statementstmt 87.9% 80 / 91 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 87.1% 34 / 39 Podpod n/a totaltotal 84.7% 117 / 138 CC 3 SCAR 2.0
CC
3
Cov
86%
page
2.0
new
2.0
read
2.0
CRAP 1.2
« Twilio/Rest/Monitor/V1/Event.pm ↑ Summary Twilio/Rest/Iam/V1/RolePermission.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::Payload;
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::AddOnResult::PayloadList;
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 6 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 6 my ($class, $version, $account_sid, $reference_sid, $add_on_result_sid) = @_;
17 6 my $self = $class->SUPER::new($version);
18 $self->{solution} = {
19 6 account_sid => $account_sid,
20 reference_sid => $reference_sid,
21 add_on_result_sid => $add_on_result_sid
22 };
23 6 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
24 '/Recordings/', Twilio::Serialize::path_segment($reference_sid), '/AddOnResults/',
25 Twilio::Serialize::path_segment($add_on_result_sid), '/Payloads.json';
26 6 return $self;
27 }
28  
29 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
30 0 my ($self, @arguments) = @_;
31 0 return $self->read_records(@arguments);
32 }
33  
34 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
35 0 my ($self, @arguments) = @_;
36 0 return $self->stream_records(@arguments);
37 }
38  
39 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
40 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
41 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
42  
43 1 my $params = {
44 PageToken => $page_token,
45 Page => $page_number,
46 PageSize => $page_size,
47 };
48  
49 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
50 1 return $self->_build_page($response);
51 }
52  
53 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
54 0 my ($self, $target_url) = @_;
55 0 my $client = $self->{version}->get_domain->get_client;
56 0 return $self->_build_page($client->request('GET', $target_url));
57 }
58  
59 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
60 1 my ($self, $response) = @_;
61 return Twilio::Rest::Api::V2010::Account::Recording::AddOnResult::PayloadPage->new(
62 1 $self->{version}, $response, $self->{solution});
63 }
64  
65 5 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
66 5 my ($self, $sid) = @_;
67 return Twilio::Rest::Api::V2010::Account::Recording::AddOnResult::PayloadContext->new(
68 $self->{version},
69 $self->{solution}{account_sid},
70 $self->{solution}{reference_sid},
71 5 $self->{solution}{add_on_result_sid}, $sid
72 );
73 }
74  
75 package Twilio::Rest::Api::V2010::Account::Recording::AddOnResult::PayloadPage;
76  
77 3 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
78  
79 1 ▶sub records_key { return 'payloads' }
Subroutine records_key: called CC=1 SCAR=0.0
80  
81 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
82 1 my ($self, $payload) = @_;
83 return Twilio::Rest::Api::V2010::Account::Recording::AddOnResult::PayloadInstance->new(
84 $self->{version}, $payload,
85 $self->{solution}{account_sid},
86 $self->{solution}{reference_sid},
87 $self->{solution}{add_on_result_sid}
88 1 );
89 }
90  
91 package Twilio::Rest::Api::V2010::Account::Recording::AddOnResult::PayloadContext;
92  
93 3 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
94  
95 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
96  
97 6 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
98 6 my ($class, $version, $account_sid, $reference_sid, $add_on_result_sid, $sid) = @_;
99 6 my $self = $class->SUPER::new($version);
100 $self->{solution} = {
101 6 account_sid => $account_sid,
102 reference_sid => $reference_sid,
103 add_on_result_sid => $add_on_result_sid,
104 sid => $sid
105 };
106 6 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
107 '/Recordings/', Twilio::Serialize::path_segment($reference_sid), '/AddOnResults/',
108 Twilio::Serialize::path_segment($add_on_result_sid), '/Payloads/',
109 Twilio::Serialize::path_segment($sid), '.json';
110 6 return $self;
111 }
112  
113 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
114 1 my ($self) = @_;
115 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
116 1 return 1;
117 }
118  
119 2 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
120 2 my ($self) = @_;
121  
122 2 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
123 2 return $self->_build_instance($response);
124 }
125  
126 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
127 2 my ($self, $response) = @_;
128 return Twilio::Rest::Api::V2010::Account::Recording::AddOnResult::PayloadInstance->new(
129 $self->{version}, $response->get_content,
130 $self->{solution}{account_sid},
131 $self->{solution}{reference_sid},
132 $self->{solution}{add_on_result_sid},
133 $self->{solution}{sid}
134 2 );
135 }
136  
137 3 ▶sub data {
Subroutine data: called CC=1 SCAR=0.0
138 3 my ($self) = @_;
139 3 require Twilio::Rest::Api::V2010::Account::Recording::AddOnResult::Payload::Data;
140 return Twilio::Rest::Api::V2010::Account::Recording::AddOnResult::Payload::DataContext->new(
141 $self->{version},
142 $self->{solution}{account_sid},
143 $self->{solution}{reference_sid},
144 $self->{solution}{add_on_result_sid},
145 $self->{solution}{sid}
146 3 );
147 }
148  
149 package Twilio::Rest::Api::V2010::Account::Recording::AddOnResult::PayloadInstance;
150  
151 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
152  
153 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
154  
155 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
156 3 my ($class, $version, $payload, $account_sid, $reference_sid, $add_on_result_sid, $sid) = @_;
157 3 my $self = $class->SUPER::new($version, $payload);
158 $self->{solution} = {
159 account_sid => $account_sid,
160 reference_sid => $reference_sid,
161 add_on_result_sid => $add_on_result_sid,
162 sid => $sid // $self->{properties}{sid}
163 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
164 3 return $self;
165 }
166  
167 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
168 0 my ($self, @arguments) = @_;
169 0 return $self->_context->delete(@arguments);
170 }
171  
172 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
173 0 my ($self, @arguments) = @_;
174 0 return $self->_context->fetch(@arguments);
175 }
176  
177 1 ▶sub data {
Subroutine data: called CC=1 SCAR=0.0
178 1 my ($self, @arguments) = @_;
179 1 return $self->_context->data(@arguments);
180 }
181  
182 1 ▶sub _context {
Subroutine _context: called CC=1 SCAR=0.0
183 1 my ($self) = @_;
184 return Twilio::Rest::Api::V2010::Account::Recording::AddOnResult::PayloadContext->new(
185 $self->{version},
186 $self->{solution}{account_sid},
187 $self->{solution}{reference_sid},
188 $self->{solution}{add_on_result_sid},
189 $self->{solution}{sid}
190 1 );
191 }
192  
193 2 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
194 2 ▶sub add_on_configuration_sid { return $_[0]{properties}{add_on_configuration_sid} }
Subroutine add_on_configuration_sid: called CC=1 SCAR=0.0
195 2 ▶sub add_on_result_sid { return $_[0]{properties}{add_on_result_sid} }
Subroutine add_on_result_sid: called CC=1 SCAR=0.0
196 2 ▶sub add_on_sid { return $_[0]{properties}{add_on_sid} }
Subroutine add_on_sid: called CC=1 SCAR=0.0
197 2 ▶sub content_type { return $_[0]{properties}{content_type} }
Subroutine content_type: called CC=1 SCAR=0.0
198 2 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
199 2 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
200 2 ▶sub label { return $_[0]{properties}{label} }
Subroutine label: called CC=1 SCAR=0.0
201 2 ▶sub reference_sid { return $_[0]{properties}{reference_sid} }
Subroutine reference_sid: called CC=1 SCAR=0.0
202 2 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
203 2 ▶sub subresource_uris { return $_[0]{properties}{subresource_uris} }
Subroutine subresource_uris: called CC=1 SCAR=0.0
204  
205 3 1;
206  
207 __END__
« Twilio/Rest/Monitor/V1/Event.pm ↑ Summary Twilio/Rest/Iam/V1/RolePermission.pm »