« Twilio/Rest/FlexApi/V1/InsightsAssessmentsComment.pm
↑ Summary
Twilio/Rest/Intelligence/V2/Transcript/Media.pm »
| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Verify::V2::Safelist; | ||||||||||||||||||||
| 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::Verify::V2::SafelistList; | ||||||||||||||||||||
| 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 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 3 | my ($class, $version) = @_; | |||||||||||||||||||
| 17 | 3 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 3 | $self->{solution} = {}; | |||||||||||||||||||
| 19 | 3 | $self->{uri} = '/SafeList/Numbers'; | |||||||||||||||||||
| 20 | 3 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 24 | 1 | my ($self, $phone_number) = @_; | |||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 1 | my $data = { PhoneNumber => $phone_number, }; | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | my $response = | ||||||||||||||||||||
| 29 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 30 | 1 | return Twilio::Rest::Verify::V2::SafelistInstance->new($self->{version}, $response->get_content); | |||||||||||||||||||
| 31 | } | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 2 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 34 | 2 | my ($self, $phone_number) = @_; | |||||||||||||||||||
| 35 | 2 | return Twilio::Rest::Verify::V2::SafelistContext->new($self->{version}, $phone_number); | |||||||||||||||||||
| 36 | } | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | package Twilio::Rest::Verify::V2::SafelistContext; | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 45 | 2 | my ($class, $version, $phone_number) = @_; | |||||||||||||||||||
| 46 | 2 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 47 | 2 | $self->{solution} = { phone_number => $phone_number }; | |||||||||||||||||||
| 48 | 2 | $self->{uri} = join q{}, '/SafeList/Numbers/', Twilio::Serialize::path_segment($phone_number); | |||||||||||||||||||
| 49 | 2 | return $self; | |||||||||||||||||||
| 50 | } | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 53 | 1 | my ($self) = @_; | |||||||||||||||||||
| 54 | 1 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete'); | |||||||||||||||||||
| 55 | 1 | return 1; | |||||||||||||||||||
| 56 | } | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 59 | 1 | my ($self) = @_; | |||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 62 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 63 | } | ||||||||||||||||||||
| 64 | |||||||||||||||||||||
| 65 | 1 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 66 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 67 | return Twilio::Rest::Verify::V2::SafelistInstance->new($self->{version}, $response->get_content, | ||||||||||||||||||||
| 68 | 1 | $self->{solution}{phone_number}); | |||||||||||||||||||
| 69 | } | ||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | package Twilio::Rest::Verify::V2::SafelistInstance; | ||||||||||||||||||||
| 72 | |||||||||||||||||||||
| 73 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 76 | |||||||||||||||||||||
| 77 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 78 | 2 | my ($class, $version, $payload, $phone_number) = @_; | |||||||||||||||||||
| 79 | 2 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 80 | 2 | ▶ | $self->{solution} = { phone_number => $phone_number // $self->{properties}{phone_number} }; | ||||||||||||||||||
|
Condition66%2/3
$phone_number // $self->{"properties"}{"phone_number"}
MC/DC0%0/2
$phone_number // $self->{"properties"}{"phone_number"}
$phone_number
$self->{"properties"}{"phone_number"}
Truth table66%2/3
A // B
A= $phone_numberB= $self->{"properties"}{"phone_number"}
| |||||||||||||||||||||
| 81 | 2 | return $self; | |||||||||||||||||||
| 82 | } | ||||||||||||||||||||
| 83 | |||||||||||||||||||||
| 84 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 85 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 86 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 87 | } | ||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 90 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 91 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 92 | } | ||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 95 | 0 | my ($self) = @_; | |||||||||||||||||||
| 96 | return Twilio::Rest::Verify::V2::SafelistContext->new($self->{version}, | ||||||||||||||||||||
| 97 | 0 | $self->{solution}{phone_number}); | |||||||||||||||||||
| 98 | } | ||||||||||||||||||||
| 99 | |||||||||||||||||||||
| 100 | 2 | ▶ | sub phone_number { return $_[0]{properties}{phone_number} } | ||||||||||||||||||
|
Subroutine
phone_number: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 101 | 2 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 102 | 2 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | 2 | 1; | |||||||||||||||||||
| 105 | |||||||||||||||||||||
| 106 | __END__ | ||||||||||||||||||||