Twilio/Rest/Lookups/V1/PhoneNumber.pm

filter: Statementstmt 93.2% 55 / 59 Branchbran n/a Conditioncond 40.0% 2 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 91.3% 21 / 23 Podpod n/a totaltotal 86.6% 78 / 90 CC 3 SCAR 2.2
CC
3
Cov
89%
new
2.1
fetch
2.0
fetch
2.0
CRAP 1.2
« Twilio/Rest/Intelligence/V2/Transcript/EncryptedSentences.pm ↑ Summary Twilio/Jwt/Grants/PlaybackGrant.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Lookups::V1::PhoneNumber;
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::Lookups::V1::PhoneNumberList;
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 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 2 my ($class, $version) = @_;
17 2 my $self = $class->SUPER::new($version);
18 2 $self->{solution} = {};
19 2 $self->{uri} = '/PhoneNumbers';
20 2 return $self;
21 }
22  
23 2 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
24 2 my ($self, $phone_number) = @_;
25 2 return Twilio::Rest::Lookups::V1::PhoneNumberContext->new($self->{version}, $phone_number);
26 }
27  
28 package Twilio::Rest::Lookups::V1::PhoneNumberContext;
29  
30 3 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
35 2 my ($class, $version, $phone_number) = @_;
36 2 my $self = $class->SUPER::new($version);
37 2 $self->{solution} = { phone_number => $phone_number };
38 2 $self->{uri} = join q{}, '/PhoneNumbers/', Twilio::Serialize::path_segment($phone_number);
39 2 return $self;
40 }
41  
42 2 ▶sub fetch {
Subroutine fetch: called CC=2 SCAR=7.0
43 2 my ($self, $options) = @_;
44 2 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
20
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
45  
46 my $response = $self->{version}->handle_request(
47 'GET',
48 $self->{uri},
49 'fetch',
50 {
51 params => {
52 AddOns => $options->{add_ons},
53 2 %{ Twilio::Serialize::prefixed_collapsible_map($options->{add_ons_data}, 'AddOns') },
54 CountryCode => $options->{country_code},
55 Type => $options->{type},
56 }
57 }
58 2 );
59 2 return $self->_build_instance($response);
60 }
61  
62 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
63 2 my ($self, $response) = @_;
64 return Twilio::Rest::Lookups::V1::PhoneNumberInstance->new($self->{version},
65 2 $response->get_content, $self->{solution}{phone_number});
66 }
67  
68 package Twilio::Rest::Lookups::V1::PhoneNumberInstance;
69  
70 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
71  
72 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
73  
74 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.4
75 2 my ($class, $version, $payload, $phone_number) = @_;
76 2 my $self = $class->SUPER::new($version, $payload);
77 2 ▶ $self->{solution} = { phone_number => $phone_number // $self->{properties}{phone_number} };
Condition33%1/3
$phone_number // $self->{"properties"}{"phone_number"}
l!l&&r!l&&!r
200
MC/DC0%0/2
$phone_number // $self->{"properties"}{"phone_number"}
$phone_number $self->{"properties"}{"phone_number"}
Truth table33%1/3
A // B
A= $phone_numberB= $self->{"properties"}{"phone_number"}
ABresult
1X1
011
000
78 2 return $self;
79 }
80  
81 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
82 0 my ($self, @arguments) = @_;
83 0 return $self->_context->fetch(@arguments);
84 }
85  
86 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
87 0 my ($self) = @_;
88 return Twilio::Rest::Lookups::V1::PhoneNumberContext->new($self->{version},
89 0 $self->{solution}{phone_number});
90 }
91  
92 1 ▶sub add_ons { return $_[0]{properties}{add_ons} }
Subroutine add_ons: called CC=1 SCAR=0.0
93 1 ▶sub caller_name { return $_[0]{properties}{caller_name} }
Subroutine caller_name: called CC=1 SCAR=0.0
94 1 ▶sub carrier { return $_[0]{properties}{carrier} }
Subroutine carrier: called CC=1 SCAR=0.0
95 1 ▶sub country_code { return $_[0]{properties}{country_code} }
Subroutine country_code: called CC=1 SCAR=0.0
96 1 ▶sub national_format { return $_[0]{properties}{national_format} }
Subroutine national_format: called CC=1 SCAR=0.0
97 1 ▶sub phone_number { return $_[0]{properties}{phone_number} }
Subroutine phone_number: called CC=1 SCAR=0.0
98 1 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
99  
100 3 1;
101  
102 __END__
« Twilio/Rest/Intelligence/V2/Transcript/EncryptedSentences.pm ↑ Summary Twilio/Jwt/Grants/PlaybackGrant.pm »