Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn.pm

filter: Statementstmt 84.3% 81 / 96 Branchbran 100% 2 / 2 Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 82.5% 33 / 40 Podpod n/a totaltotal 81.5% 119 / 146 CC 4 SCAR 2.6
CC
4
Cov
83%
page
2.0
new
2.0
read
2.0
CRAP 1.3
« Twilio/Rest/Verify/V2/Service/Entity/Challenge.pm ↑ Summary Twilio/Rest/Insights/V3/QueryJob.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOn;
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::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOnList;
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 6 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 6 my ($class, $version, $account_sid, $resource_sid) = @_;
17 6 my $self = $class->SUPER::new($version);
18 6 $self->{solution} = { account_sid => $account_sid, resource_sid => $resource_sid };
19 6 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
20 '/IncomingPhoneNumbers/', Twilio::Serialize::path_segment($resource_sid),
21 '/AssignedAddOns.json';
22 6 return $self;
23 }
24  
25 1 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
26 1 my ($self, $installed_add_on_sid) = @_;
27  
28 1 my $data = { InstalledAddOnSid => $installed_add_on_sid, };
29  
30 my $response =
31 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
32 return Twilio::Rest::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOnInstance->new(
33 $self->{version}, $response->get_content,
34 $self->{solution}{account_sid},
35 $self->{solution}{resource_sid}
36 1 );
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
01
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
52  
53 1 my $params = {
54 PageToken => $page_token,
55 Page => $page_number,
56 PageSize => $page_size,
57 };
58  
59 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
60 1 return $self->_build_page($response);
61 }
62  
63 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
64 0 my ($self, $target_url) = @_;
65 0 my $client = $self->{version}->get_domain->get_client;
66 0 return $self->_build_page($client->request('GET', $target_url));
67 }
68  
69 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
70 1 my ($self, $response) = @_;
71 return Twilio::Rest::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOnPage->new(
72 1 $self->{version}, $response, $self->{solution});
73 }
74  
75 4 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
76 4 my ($self, $sid) = @_;
77 return Twilio::Rest::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOnContext->new(
78 $self->{version},
79 $self->{solution}{account_sid},
80 4 $self->{solution}{resource_sid}, $sid
81 );
82 }
83  
84 package Twilio::Rest::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOnPage;
85  
86 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
87  
88 1 ▶sub records_key { return 'assigned_add_ons' }
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::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOnInstance->new(
93 $self->{version}, $payload,
94 $self->{solution}{account_sid},
95 $self->{solution}{resource_sid}
96 1 );
97 }
98  
99 package Twilio::Rest::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOnContext;
100  
101 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
102  
103 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
104  
105 4 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
106 4 my ($class, $version, $account_sid, $resource_sid, $sid) = @_;
107 4 my $self = $class->SUPER::new($version);
108 4 $self->{solution} = { account_sid => $account_sid, resource_sid => $resource_sid, sid => $sid };
109 4 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
110 '/IncomingPhoneNumbers/', Twilio::Serialize::path_segment($resource_sid), '/AssignedAddOns/',
111 Twilio::Serialize::path_segment($sid), '.json';
112 4 return $self;
113 }
114  
115 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
116 1 my ($self) = @_;
117 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
118 1 return 1;
119 }
120  
121 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
122 1 my ($self) = @_;
123  
124 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
125 1 return $self->_build_instance($response);
126 }
127  
128 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
129 1 my ($self, $response) = @_;
130 return Twilio::Rest::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOnInstance->new(
131 $self->{version}, $response->get_content,
132 $self->{solution}{account_sid},
133 $self->{solution}{resource_sid},
134 $self->{solution}{sid}
135 1 );
136 }
137  
138 2 ▶sub extensions {
Subroutine extensions: called CC=2 SCAR=6.9
139 2 my ($self, $sid) = @_;
140 require
141 2 Twilio::Rest::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOn::AssignedAddOnExtension;
142 my $list =
143 Twilio::Rest::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOn::AssignedAddOnExtensionList
144 ->new(
145 $self->{version},
146 $self->{solution}{account_sid},
147 $self->{solution}{resource_sid},
148 $self->{solution}{sid}
149 2 );
150 2 ▶ return defined $sid ? $list->get_context($sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $sid ? : 1 1 2
151 }
152  
153 package Twilio::Rest::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOnInstance;
154  
155 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
156  
157 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
158  
159 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
160 3 my ($class, $version, $payload, $account_sid, $resource_sid, $sid) = @_;
161 3 my $self = $class->SUPER::new($version, $payload);
162 $self->{solution} = {
163 account_sid => $account_sid,
164 resource_sid => $resource_sid,
165 sid => $sid // $self->{properties}{sid}
166 3 ▶ };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
120
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
167 3 return $self;
168 }
169  
170 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
171 0 my ($self, @arguments) = @_;
172 0 return $self->_context->delete(@arguments);
173 }
174  
175 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
176 0 my ($self, @arguments) = @_;
177 0 return $self->_context->fetch(@arguments);
178 }
179  
180 0 ▶sub extensions {
Subroutine extensions: not called CC=1 SCAR=6.9
181 0 my ($self, @arguments) = @_;
182 0 return $self->_context->extensions(@arguments);
183 }
184  
185 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
186 0 my ($self) = @_;
187 return Twilio::Rest::Api::V2010::Account::IncomingPhoneNumber::AssignedAddOnContext->new(
188 $self->{version},
189 $self->{solution}{account_sid},
190 $self->{solution}{resource_sid},
191 $self->{solution}{sid}
192 0 );
193 }
194  
195 3 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
196 3 ▶sub configuration { return $_[0]{properties}{configuration} }
Subroutine configuration: called CC=1 SCAR=0.0
197 3 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
198 3 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
199 3 ▶sub description { return $_[0]{properties}{description} }
Subroutine description: called CC=1 SCAR=0.0
200 3 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
201 3 ▶sub resource_sid { return $_[0]{properties}{resource_sid} }
Subroutine resource_sid: called CC=1 SCAR=0.0
202 3 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
203 3 ▶sub subresource_uris { return $_[0]{properties}{subresource_uris} }
Subroutine subresource_uris: called CC=1 SCAR=0.0
204 3 ▶sub unique_name { return $_[0]{properties}{unique_name} }
Subroutine unique_name: called CC=1 SCAR=0.0
205 3 ▶sub uri { return $_[0]{properties}{uri} }
Subroutine uri: called CC=1 SCAR=0.0
206  
207 2 1;
208  
209 __END__
« Twilio/Rest/Verify/V2/Service/Entity/Challenge.pm ↑ Summary Twilio/Rest/Insights/V3/QueryJob.pm »