Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry.pm

filter: Statementstmt 77.2% 85 / 110 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 72.0% 31 / 43 Podpod n/a totaltotal 73.9% 119 / 161 CC 3 SCAR 3.0
CC
3
Cov
77%
page
2.0
new
2.0
read
2.0
CRAP 1.4
« Twilio/Rest/Webhooks/V1/Rule.pm ↑ Summary Twilio/Rest/Api.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry;
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::AvailablePhoneNumberCountryList;
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 10 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 10 my ($class, $version, $account_sid) = @_;
17 10 my $self = $class->SUPER::new($version);
18 10 $self->{solution} = { account_sid => $account_sid };
19 10 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
20 '/AvailablePhoneNumbers.json';
21 10 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::AvailablePhoneNumberCountryPage->new($self->{version},
57 1 $response, $self->{solution});
58 }
59  
60 9 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
61 9 my ($self, $country_code) = @_;
62 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountryContext->new(
63 $self->{version}, $self->{solution}{account_sid},
64 9 $country_code);
65 }
66  
67 package Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountryPage;
68  
69 3 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
70  
71 1 ▶sub records_key { return 'countries' }
Subroutine records_key: called CC=1 SCAR=0.0
72  
73 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
74 1 my ($self, $payload) = @_;
75 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountryInstance->new(
76 1 $self->{version}, $payload, $self->{solution}{account_sid});
77 }
78  
79 package Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountryContext;
80  
81 3 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
82  
83 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
84  
85 9 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
86 9 my ($class, $version, $account_sid, $country_code) = @_;
87 9 my $self = $class->SUPER::new($version);
88 9 $self->{solution} = { account_sid => $account_sid, country_code => $country_code };
89 9 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
90 '/AvailablePhoneNumbers/', Twilio::Serialize::path_segment($country_code), '.json';
91 9 return $self;
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::Api::V2010::Account::AvailablePhoneNumberCountryInstance->new(
104 $self->{version}, $response->get_content,
105 $self->{solution}{account_sid},
106 $self->{solution}{country_code}
107 1 );
108 }
109  
110 2 ▶sub local {
Subroutine local: called CC=1 SCAR=0.0
111 2 my ($self) = @_;
112 2 require Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::Local;
113 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::LocalList->new(
114 $self->{version},
115 $self->{solution}{account_sid},
116 $self->{solution}{country_code}
117 2 );
118 }
119  
120 1 ▶sub machine_to_machine {
Subroutine machine_to_machine: called CC=1 SCAR=0.0
121 1 my ($self) = @_;
122 1 require Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::MachineToMachine;
123 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::MachineToMachineList->new(
124 $self->{version},
125 $self->{solution}{account_sid},
126 $self->{solution}{country_code}
127 1 );
128 }
129  
130 1 ▶sub mobile {
Subroutine mobile: called CC=1 SCAR=0.0
131 1 my ($self) = @_;
132 1 require Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::Mobile;
133 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::MobileList->new(
134 $self->{version},
135 $self->{solution}{account_sid},
136 $self->{solution}{country_code}
137 1 );
138 }
139  
140 1 ▶sub national {
Subroutine national: called CC=1 SCAR=0.0
141 1 my ($self) = @_;
142 1 require Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::National;
143 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::NationalList->new(
144 $self->{version},
145 $self->{solution}{account_sid},
146 $self->{solution}{country_code}
147 1 );
148 }
149  
150 1 ▶sub shared_cost {
Subroutine shared_cost: called CC=1 SCAR=0.0
151 1 my ($self) = @_;
152 1 require Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::SharedCost;
153 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::SharedCostList->new(
154 $self->{version},
155 $self->{solution}{account_sid},
156 $self->{solution}{country_code}
157 1 );
158 }
159  
160 1 ▶sub toll_free {
Subroutine toll_free: called CC=1 SCAR=0.0
161 1 my ($self) = @_;
162 1 require Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::TollFree;
163 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::TollFreeList->new(
164 $self->{version},
165 $self->{solution}{account_sid},
166 $self->{solution}{country_code}
167 1 );
168 }
169  
170 1 ▶sub voip {
Subroutine voip: called CC=1 SCAR=0.0
171 1 my ($self) = @_;
172 1 require Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::Voip;
173 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::VoipList->new(
174 $self->{version},
175 $self->{solution}{account_sid},
176 $self->{solution}{country_code}
177 1 );
178 }
179  
180 package Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountryInstance;
181  
182 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
183  
184 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
185  
186 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
187 2 my ($class, $version, $payload, $account_sid, $country_code) = @_;
188 2 my $self = $class->SUPER::new($version, $payload);
189 $self->{solution} = {
190 account_sid => $account_sid,
191 country_code => $country_code // $self->{properties}{country_code}
192 2 ▶ };
Condition66%2/3
$country_code // $self->{"properties"}{"country_code"}
l!l&&r!l&&!r
110
MC/DC0%0/2
$country_code // $self->{"properties"}{"country_code"}
$country_code $self->{"properties"}{"country_code"}
Truth table66%2/3
A // B
A= $country_codeB= $self->{"properties"}{"country_code"}
ABresult
1X1
011
000
193 2 return $self;
194 }
195  
196 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
197 0 my ($self, @arguments) = @_;
198 0 return $self->_context->fetch(@arguments);
199 }
200  
201 0 ▶sub local {
Subroutine local: not called CC=1 SCAR=6.9
202 0 my ($self, @arguments) = @_;
203 0 return $self->_context->local(@arguments);
204 }
205  
206 0 ▶sub machine_to_machine {
Subroutine machine_to_machine: not called CC=1 SCAR=6.9
207 0 my ($self, @arguments) = @_;
208 0 return $self->_context->machine_to_machine(@arguments);
209 }
210  
211 0 ▶sub mobile {
Subroutine mobile: not called CC=1 SCAR=6.9
212 0 my ($self, @arguments) = @_;
213 0 return $self->_context->mobile(@arguments);
214 }
215  
216 0 ▶sub national {
Subroutine national: not called CC=1 SCAR=6.9
217 0 my ($self, @arguments) = @_;
218 0 return $self->_context->national(@arguments);
219 }
220  
221 0 ▶sub shared_cost {
Subroutine shared_cost: not called CC=1 SCAR=6.9
222 0 my ($self, @arguments) = @_;
223 0 return $self->_context->shared_cost(@arguments);
224 }
225  
226 0 ▶sub toll_free {
Subroutine toll_free: not called CC=1 SCAR=6.9
227 0 my ($self, @arguments) = @_;
228 0 return $self->_context->toll_free(@arguments);
229 }
230  
231 0 ▶sub voip {
Subroutine voip: not called CC=1 SCAR=6.9
232 0 my ($self, @arguments) = @_;
233 0 return $self->_context->voip(@arguments);
234 }
235  
236 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
237 0 my ($self) = @_;
238 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountryContext->new(
239 $self->{version},
240 $self->{solution}{account_sid},
241 $self->{solution}{country_code}
242 0 );
243 }
244  
245 2 ▶sub beta { return $_[0]{properties}{beta} }
Subroutine beta: called CC=1 SCAR=0.0
246 2 ▶sub country { return $_[0]{properties}{country} }
Subroutine country: called CC=1 SCAR=0.0
247 2 ▶sub country_code { return $_[0]{properties}{country_code} }
Subroutine country_code: called CC=1 SCAR=0.0
248 2 ▶sub subresource_uris { return $_[0]{properties}{subresource_uris} }
Subroutine subresource_uris: called CC=1 SCAR=0.0
249 2 ▶sub uri { return $_[0]{properties}{uri} }
Subroutine uri: called CC=1 SCAR=0.0
250  
251 3 1;
252  
253 __END__
« Twilio/Rest/Webhooks/V1/Rule.pm ↑ Summary Twilio/Rest/Api.pm »