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

filter: Statementstmt 88.5% 54 / 61 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 89.6% 26 / 29 Podpod n/a totaltotal 87.1% 81 / 93 CC 2 SCAR 1.5
CC
2
Cov
87%
page
2.0
read
2.0
stream
2.0
CRAP 1.2
« Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFree.pm ↑ Summary Twilio/Rest/Bulkexports/V1/Export/Job.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::Voip;
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::AvailablePhoneNumberCountry::VoipList;
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 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 1 my ($class, $version, $account_sid, $country_code) = @_;
17 1 my $self = $class->SUPER::new($version);
18 1 $self->{solution} = { account_sid => $account_sid, country_code => $country_code };
19 1 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
20 '/AvailablePhoneNumbers/', Twilio::Serialize::path_segment($country_code), '/Voip.json';
21 1 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
10
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
37  
38 my $params = {
39 AreaCode => $options->{area_code},
40 Beta => Twilio::Serialize::boolean_to_string($options->{beta}),
41 Contains => $options->{contains},
42 Distance => $options->{distance},
43 ExcludeAllAddressRequired =>
44 Twilio::Serialize::boolean_to_string($options->{exclude_all_address_required}),
45 ExcludeForeignAddressRequired =>
46 Twilio::Serialize::boolean_to_string($options->{exclude_foreign_address_required}),
47 ExcludeLocalAddressRequired =>
48 Twilio::Serialize::boolean_to_string($options->{exclude_local_address_required}),
49 FaxEnabled => Twilio::Serialize::boolean_to_string($options->{fax_enabled}),
50 InLata => $options->{in_lata},
51 InLocality => $options->{in_locality},
52 InPostalCode => $options->{in_postal_code},
53 InRateCenter => $options->{in_rate_center},
54 InRegion => $options->{in_region},
55 MmsEnabled => Twilio::Serialize::boolean_to_string($options->{mms_enabled}),
56 NearLatLong => $options->{near_lat_long},
57 NearNumber => $options->{near_number},
58 SmsEnabled => Twilio::Serialize::boolean_to_string($options->{sms_enabled}),
59 1 VoiceEnabled => Twilio::Serialize::boolean_to_string($options->{voice_enabled}),
60 PageToken => $page_token,
61 Page => $page_number,
62 PageSize => $page_size,
63 };
64  
65 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
66 1 return $self->_build_page($response);
67 }
68  
69 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
70 0 my ($self, $target_url) = @_;
71 0 my $client = $self->{version}->get_domain->get_client;
72 0 return $self->_build_page($client->request('GET', $target_url));
73 }
74  
75 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
76 1 my ($self, $response) = @_;
77 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::VoipPage->new(
78 1 $self->{version}, $response, $self->{solution});
79 }
80  
81 package Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::VoipPage;
82  
83 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
84  
85 1 ▶sub records_key { return 'available_phone_numbers' }
Subroutine records_key: called CC=1 SCAR=0.0
86  
87 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
88 1 my ($self, $payload) = @_;
89 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::VoipInstance->new(
90 $self->{version}, $payload,
91 $self->{solution}{account_sid},
92 $self->{solution}{country_code}
93 1 );
94 }
95  
96 package Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::VoipInstance;
97  
98 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
99  
100 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
101  
102 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
103 1 my ($class, $version, $payload, $account_sid, $country_code) = @_;
104 1 my $self = $class->SUPER::new($version, $payload);
105 1 $self->{solution} = { account_sid => $account_sid, country_code => $country_code };
106 1 return $self;
107 }
108  
109 1 ▶sub address_requirements { return $_[0]{properties}{address_requirements} }
Subroutine address_requirements: called CC=1 SCAR=0.0
110 1 ▶sub beta { return $_[0]{properties}{beta} }
Subroutine beta: called CC=1 SCAR=0.0
111  
112 1 ▶sub capabilities {
Subroutine capabilities: called CC=1 SCAR=0.0
113 1 return Twilio::Deserialize::phone_number_capabilities($_[0]{properties}{capabilities});
114 }
115 1 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
116 1 ▶sub iso_country { return $_[0]{properties}{iso_country} }
Subroutine iso_country: called CC=1 SCAR=0.0
117 1 ▶sub lata { return $_[0]{properties}{lata} }
Subroutine lata: called CC=1 SCAR=0.0
118 1 ▶sub latitude { return $_[0]{properties}{latitude} }
Subroutine latitude: called CC=1 SCAR=0.0
119 1 ▶sub locality { return $_[0]{properties}{locality} }
Subroutine locality: called CC=1 SCAR=0.0
120 1 ▶sub longitude { return $_[0]{properties}{longitude} }
Subroutine longitude: called CC=1 SCAR=0.0
121 1 ▶sub phone_number { return $_[0]{properties}{phone_number} }
Subroutine phone_number: called CC=1 SCAR=0.0
122 1 ▶sub postal_code { return $_[0]{properties}{postal_code} }
Subroutine postal_code: called CC=1 SCAR=0.0
123 1 ▶sub rate_center { return $_[0]{properties}{rate_center} }
Subroutine rate_center: called CC=1 SCAR=0.0
124 1 ▶sub region { return $_[0]{properties}{region} }
Subroutine region: called CC=1 SCAR=0.0
125  
126 2 1;
127  
128 __END__
« Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFree.pm ↑ Summary Twilio/Rest/Bulkexports/V1/Export/Job.pm »