| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||
| 2 | package Twilio::Rest::Accounts::V1::Safelist; | ||||||||||||
| 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::Accounts::V1::SafelistList; | ||||||||||||
| 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 | 4 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||
| 16 | 4 | my ($class, $version) = @_; | |||||||||||
| 17 | 4 | my $self = $class->SUPER::new($version); | |||||||||||
| 18 | 4 | $self->{solution} = {}; | |||||||||||
| 19 | 4 | $self->{uri} = '/SafeList/Numbers'; | |||||||||||
| 20 | 4 | 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 | return Twilio::Rest::Accounts::V1::SafelistInstance->new($self->{version}, | ||||||||||||
| 31 | 1 | $response->get_content); | |||||||||||
| 32 | } | ||||||||||||
| 33 | |||||||||||||
| 34 | 2 | ▶ | sub delete { | ||||||||||
|
Subroutine
delete: called CC=2 SCAR=7.0
| |||||||||||||
| 35 | 2 | my ($self, $options) = @_; | |||||||||||
| 36 | 2 | ▶ | $options //= {}; | ||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||
| 37 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete', | ||||||||||||
| 38 | 2 | { params => { PhoneNumber => $options->{phone_number}, } }); | |||||||||||
| 39 | 2 | return 1; | |||||||||||
| 40 | } | ||||||||||||
| 41 | |||||||||||||
| 42 | 1 | ▶ | sub fetch { | ||||||||||
|
Subroutine
fetch: called CC=2 SCAR=7.0
| |||||||||||||
| 43 | 1 | my ($self, $options) = @_; | |||||||||||
| 44 | 1 | ▶ | $options //= {}; | ||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||
| 45 | |||||||||||||
| 46 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch', | ||||||||||||
| 47 | 1 | { params => { PhoneNumber => $options->{phone_number}, } }); | |||||||||||
| 48 | return Twilio::Rest::Accounts::V1::SafelistInstance->new($self->{version}, | ||||||||||||
| 49 | 1 | $response->get_content); | |||||||||||
| 50 | } | ||||||||||||
| 51 | |||||||||||||
| 52 | package Twilio::Rest::Accounts::V1::SafelistInstance; | ||||||||||||
| 53 | |||||||||||||
| 54 | 3 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 55 | |||||||||||||
| 56 | 3 | ▶ | use Twilio::Deserialize; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 57 | |||||||||||||
| 58 | 2 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||
| 59 | 2 | my ($class, $version, $payload) = @_; | |||||||||||
| 60 | 2 | my $self = $class->SUPER::new($version, $payload); | |||||||||||
| 61 | 2 | $self->{solution} = {}; | |||||||||||
| 62 | 2 | return $self; | |||||||||||
| 63 | } | ||||||||||||
| 64 | |||||||||||||
| 65 | 2 | ▶ | sub phone_number { return $_[0]{properties}{phone_number} } | ||||||||||
|
Subroutine
phone_number: called CC=1 SCAR=0.0
| |||||||||||||
| 66 | 2 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||
| 67 | |||||||||||||
| 68 | 3 | 1; | |||||||||||
| 69 | |||||||||||||
| 70 | __END__ | ||||||||||||