Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachine.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/Messaging/V1/DomainCerts.pm ↑ Summary Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/Mobile.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::MachineToMachine;
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::MachineToMachineList;
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),
21 '/MachineToMachine.json';
22 1 return $self;
23 }
24  
25 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
26 0 my ($self, @arguments) = @_;
27 0 return $self->read_records(@arguments);
28 }
29  
30 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
31 0 my ($self, @arguments) = @_;
32 0 return $self->stream_records(@arguments);
33 }
34  
35 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
36 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
37 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
38  
39 my $params = {
40 AreaCode => $options->{area_code},
41 Beta => Twilio::Serialize::boolean_to_string($options->{beta}),
42 Contains => $options->{contains},
43 Distance => $options->{distance},
44 ExcludeAllAddressRequired =>
45 Twilio::Serialize::boolean_to_string($options->{exclude_all_address_required}),
46 ExcludeForeignAddressRequired =>
47 Twilio::Serialize::boolean_to_string($options->{exclude_foreign_address_required}),
48 ExcludeLocalAddressRequired =>
49 Twilio::Serialize::boolean_to_string($options->{exclude_local_address_required}),
50 FaxEnabled => Twilio::Serialize::boolean_to_string($options->{fax_enabled}),
51 InLata => $options->{in_lata},
52 InLocality => $options->{in_locality},
53 InPostalCode => $options->{in_postal_code},
54 InRateCenter => $options->{in_rate_center},
55 InRegion => $options->{in_region},
56 MmsEnabled => Twilio::Serialize::boolean_to_string($options->{mms_enabled}),
57 NearLatLong => $options->{near_lat_long},
58 NearNumber => $options->{near_number},
59 SmsEnabled => Twilio::Serialize::boolean_to_string($options->{sms_enabled}),
60 1 VoiceEnabled => Twilio::Serialize::boolean_to_string($options->{voice_enabled}),
61 PageToken => $page_token,
62 Page => $page_number,
63 PageSize => $page_size,
64 };
65  
66 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
67 1 return $self->_build_page($response);
68 }
69  
70 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
71 0 my ($self, $target_url) = @_;
72 0 my $client = $self->{version}->get_domain->get_client;
73 0 return $self->_build_page($client->request('GET', $target_url));
74 }
75  
76 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
77 1 my ($self, $response) = @_;
78 return Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::MachineToMachinePage->new(
79 1 $self->{version}, $response, $self->{solution});
80 }
81  
82 package Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::MachineToMachinePage;
83  
84 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
85  
86 1 ▶sub records_key { return 'available_phone_numbers' }
Subroutine records_key: called CC=1 SCAR=0.0
87  
88 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
89 1 my ($self, $payload) = @_;
90 return
91 Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::MachineToMachineInstance->new(
92 $self->{version}, $payload,
93 $self->{solution}{account_sid},
94 $self->{solution}{country_code}
95 1 );
96 }
97  
98 package Twilio::Rest::Api::V2010::Account::AvailablePhoneNumberCountry::MachineToMachineInstance;
99  
100 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
101  
102 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
103  
104 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
105 1 my ($class, $version, $payload, $account_sid, $country_code) = @_;
106 1 my $self = $class->SUPER::new($version, $payload);
107 1 $self->{solution} = { account_sid => $account_sid, country_code => $country_code };
108 1 return $self;
109 }
110  
111 1 ▶sub address_requirements { return $_[0]{properties}{address_requirements} }
Subroutine address_requirements: called CC=1 SCAR=0.0
112 1 ▶sub beta { return $_[0]{properties}{beta} }
Subroutine beta: called CC=1 SCAR=0.0
113  
114 1 ▶sub capabilities {
Subroutine capabilities: called CC=1 SCAR=0.0
115 1 return Twilio::Deserialize::phone_number_capabilities($_[0]{properties}{capabilities});
116 }
117 1 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
118 1 ▶sub iso_country { return $_[0]{properties}{iso_country} }
Subroutine iso_country: called CC=1 SCAR=0.0
119 1 ▶sub lata { return $_[0]{properties}{lata} }
Subroutine lata: called CC=1 SCAR=0.0
120 1 ▶sub latitude { return $_[0]{properties}{latitude} }
Subroutine latitude: called CC=1 SCAR=0.0
121 1 ▶sub locality { return $_[0]{properties}{locality} }
Subroutine locality: called CC=1 SCAR=0.0
122 1 ▶sub longitude { return $_[0]{properties}{longitude} }
Subroutine longitude: called CC=1 SCAR=0.0
123 1 ▶sub phone_number { return $_[0]{properties}{phone_number} }
Subroutine phone_number: called CC=1 SCAR=0.0
124 1 ▶sub postal_code { return $_[0]{properties}{postal_code} }
Subroutine postal_code: called CC=1 SCAR=0.0
125 1 ▶sub rate_center { return $_[0]{properties}{rate_center} }
Subroutine rate_center: called CC=1 SCAR=0.0
126 1 ▶sub region { return $_[0]{properties}{region} }
Subroutine region: called CC=1 SCAR=0.0
127  
128 2 1;
129  
130 __END__
« Twilio/Rest/Messaging/V1/DomainCerts.pm ↑ Summary Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/Mobile.pm »