Twilio/Rest/Numbers/V1/PortingPortability.pm

filter: Statementstmt 93.3% 56 / 60 Branchbran n/a Conditioncond 40.0% 2 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 92.0% 23 / 25 Podpod n/a totaltotal 87.1% 81 / 93 CC 3 SCAR 2.1
CC
3
Cov
89%
new
2.1
fetch
2.0
fetch
2.0
CRAP 1.2
« Twilio/Rest/Pricing/V2/Voice/Number.pm ↑ Summary Twilio/Rest/Api/V2010/Account/Call/Siprec.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Numbers::V1::PortingPortability;
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::Numbers::V1::PortingPortabilityList;
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) = @_;
17 1 my $self = $class->SUPER::new($version);
18 1 $self->{solution} = {};
19 1 $self->{uri} = '/Porting/Portability/PhoneNumber';
20 1 return $self;
21 }
22  
23 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
24 1 my ($self, $phone_number) = @_;
25 1 return Twilio::Rest::Numbers::V1::PortingPortabilityContext->new($self->{version}, $phone_number);
26 }
27  
28 package Twilio::Rest::Numbers::V1::PortingPortabilityContext;
29  
30 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
35 1 my ($class, $version, $phone_number) = @_;
36 1 my $self = $class->SUPER::new($version);
37 1 $self->{solution} = { phone_number => $phone_number };
38 1 $self->{uri} = join q{}, '/Porting/Portability/PhoneNumber/',
39 Twilio::Serialize::path_segment($phone_number);
40 1 return $self;
41 }
42  
43 1 ▶sub fetch {
Subroutine fetch: called CC=2 SCAR=7.0
44 1 my ($self, $options) = @_;
45 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
46  
47 my $response = $self->{version}->handle_request(
48 'GET',
49 $self->{uri},
50 'fetch',
51 {
52 params => {
53 AddressSid => $options->{address_sid},
54 TargetAccountSid => $options->{target_account_sid},
55 }
56 }
57 1 );
58 1 return $self->_build_instance($response);
59 }
60  
61 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
62 1 my ($self, $response) = @_;
63 return Twilio::Rest::Numbers::V1::PortingPortabilityInstance->new($self->{version},
64 1 $response->get_content, $self->{solution}{phone_number});
65 }
66  
67 package Twilio::Rest::Numbers::V1::PortingPortabilityInstance;
68  
69 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
70  
71 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
72  
73 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.4
74 1 my ($class, $version, $payload, $phone_number) = @_;
75 1 my $self = $class->SUPER::new($version, $payload);
76 1 ▶ $self->{solution} = { phone_number => $phone_number // $self->{properties}{phone_number} };
Condition33%1/3
$phone_number // $self->{"properties"}{"phone_number"}
l!l&&r!l&&!r
100
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
77 1 return $self;
78 }
79  
80 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
81 0 my ($self, @arguments) = @_;
82 0 return $self->_context->fetch(@arguments);
83 }
84  
85 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
86 0 my ($self) = @_;
87 return Twilio::Rest::Numbers::V1::PortingPortabilityContext->new($self->{version},
88 0 $self->{solution}{phone_number});
89 }
90  
91 1 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
92 1 ▶sub country { return $_[0]{properties}{country} }
Subroutine country: called CC=1 SCAR=0.0
93 1 ▶sub not_portable_reason { return $_[0]{properties}{not_portable_reason} }
Subroutine not_portable_reason: called CC=1 SCAR=0.0
94 1 ▶sub not_portable_reason_code { return $_[0]{properties}{not_portable_reason_code} }
Subroutine not_portable_reason_code: called CC=1 SCAR=0.0
95 1 ▶sub number_type { return $_[0]{properties}{number_type} }
Subroutine number_type: called CC=1 SCAR=0.0
96 1 ▶sub phone_number { return $_[0]{properties}{phone_number} }
Subroutine phone_number: called CC=1 SCAR=0.0
97 1 ▶sub pin_and_account_number_required { return $_[0]{properties}{pin_and_account_number_required} }
Subroutine pin_and_account_number_required: called CC=1 SCAR=0.0
98 1 ▶sub portable { return $_[0]{properties}{portable} }
Subroutine portable: called CC=1 SCAR=0.0
99 1 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
100  
101 2 1;
102  
103 __END__
« Twilio/Rest/Pricing/V2/Voice/Number.pm ↑ Summary Twilio/Rest/Api/V2010/Account/Call/Siprec.pm »