| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Pricing::V1::Voice::Number; | ||||||||||||||||||||
| 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::Pricing::V1::Voice::NumberList; | ||||||||||||||||||||
| 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} = '/Voice/Numbers'; | |||||||||||||||||||
| 20 | 1 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 24 | 1 | my ($self, $number) = @_; | |||||||||||||||||||
| 25 | 1 | return Twilio::Rest::Pricing::V1::Voice::NumberContext->new($self->{version}, $number); | |||||||||||||||||||
| 26 | } | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | package Twilio::Rest::Pricing::V1::Voice::NumberContext; | ||||||||||||||||||||
| 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, $number) = @_; | |||||||||||||||||||
| 36 | 1 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 37 | 1 | $self->{solution} = { number => $number }; | |||||||||||||||||||
| 38 | 1 | $self->{uri} = join q{}, '/Voice/Numbers/', Twilio::Serialize::path_segment($number); | |||||||||||||||||||
| 39 | 1 | return $self; | |||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 43 | 1 | my ($self) = @_; | |||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 46 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 47 | } | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 1 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 50 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 51 | return Twilio::Rest::Pricing::V1::Voice::NumberInstance->new($self->{version}, | ||||||||||||||||||||
| 52 | 1 | $response->get_content, $self->{solution}{number}); | |||||||||||||||||||
| 53 | } | ||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | package Twilio::Rest::Pricing::V1::Voice::NumberInstance; | ||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.4
| |||||||||||||||||||||
| 62 | 1 | my ($class, $version, $payload, $number) = @_; | |||||||||||||||||||
| 63 | 1 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 64 | 1 | ▶ | $self->{solution} = { number => $number // $self->{properties}{number} }; | ||||||||||||||||||
|
Condition33%1/3
$number // $self->{"properties"}{"number"}
MC/DC0%0/2
$number // $self->{"properties"}{"number"}
$number
$self->{"properties"}{"number"}
Truth table33%1/3
A // B
A= $numberB= $self->{"properties"}{"number"}
| |||||||||||||||||||||
| 65 | 1 | return $self; | |||||||||||||||||||
| 66 | } | ||||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 69 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 70 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 71 | } | ||||||||||||||||||||
| 72 | |||||||||||||||||||||
| 73 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 74 | 0 | my ($self) = @_; | |||||||||||||||||||
| 75 | return Twilio::Rest::Pricing::V1::Voice::NumberContext->new($self->{version}, | ||||||||||||||||||||
| 76 | 0 | $self->{solution}{number}); | |||||||||||||||||||
| 77 | } | ||||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | 1 | ▶ | sub country { return $_[0]{properties}{country} } | ||||||||||||||||||
|
Subroutine
country: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 80 | 1 | ▶ | sub inbound_call_price { return $_[0]{properties}{inbound_call_price} } | ||||||||||||||||||
|
Subroutine
inbound_call_price: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 81 | 1 | ▶ | sub iso_country { return $_[0]{properties}{iso_country} } | ||||||||||||||||||
|
Subroutine
iso_country: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 82 | 1 | ▶ | sub number { return $_[0]{properties}{number} } | ||||||||||||||||||
|
Subroutine
number: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 83 | 1 | ▶ | sub outbound_call_price { return $_[0]{properties}{outbound_call_price} } | ||||||||||||||||||
|
Subroutine
outbound_call_price: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 84 | 1 | ▶ | sub price_unit { return $_[0]{properties}{price_unit} } | ||||||||||||||||||
|
Subroutine
price_unit: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 85 | 1 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | 2 | 1; | |||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | __END__ | ||||||||||||||||||||