| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||
| 2 | package Twilio::Rest::Accounts::V1::SecondaryAuthToken; | ||||||||||||
| 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::SecondaryAuthTokenContext; | ||||||||||||
| 10 | |||||||||||||
| 11 | 3 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 12 | |||||||||||||
| 13 | 3 | ▶ | 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} = '/AuthTokens/Secondary'; | |||||||||||
| 20 | 3 | return $self; | |||||||||||
| 21 | } | ||||||||||||
| 22 | |||||||||||||
| 23 | 2 | ▶ | sub create { | ||||||||||
|
Subroutine
create: called CC=2 SCAR=6.9
| |||||||||||||
| 24 | 2 | my ($self, $options) = @_; | |||||||||||
| 25 | 2 | ▶ | $options //= {}; | ||||||||||
|
Condition100%2/2
$options //= {}
MC/DC100%1/1
$options //= {}
$options
Truth table100%2/2
A
A= $options
| |||||||||||||
| 26 | |||||||||||||
| 27 | my $data = { SuppressEmailNotification => | ||||||||||||
| 28 | 2 | Twilio::Serialize::boolean_to_string($options->{suppress_email_notification}), }; | |||||||||||
| 29 | |||||||||||||
| 30 | my $response = | ||||||||||||
| 31 | 2 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||
| 32 | 2 | return $self->_build_instance($response); | |||||||||||
| 33 | } | ||||||||||||
| 34 | |||||||||||||
| 35 | 1 | ▶ | sub delete { | ||||||||||
|
Subroutine
delete: called CC=2 SCAR=7.0
| |||||||||||||
| 36 | 1 | my ($self, $options) = @_; | |||||||||||
| 37 | 1 | ▶ | $options //= {}; | ||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||
| 38 | $self->{version}->handle_request( | ||||||||||||
| 39 | 'DELETE', | ||||||||||||
| 40 | $self->{uri}, | ||||||||||||
| 41 | 'delete', | ||||||||||||
| 42 | { | ||||||||||||
| 43 | params => { | ||||||||||||
| 44 | SuppressEmailNotification => | ||||||||||||
| 45 | 1 | Twilio::Serialize::boolean_to_string($options->{suppress_email_notification}), | |||||||||||
| 46 | } | ||||||||||||
| 47 | } | ||||||||||||
| 48 | ); | ||||||||||||
| 49 | 1 | return 1; | |||||||||||
| 50 | } | ||||||||||||
| 51 | |||||||||||||
| 52 | 2 | ▶ | sub _build_instance { | ||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||
| 53 | 2 | my ($self, $response) = @_; | |||||||||||
| 54 | return Twilio::Rest::Accounts::V1::SecondaryAuthTokenInstance->new($self->{version}, | ||||||||||||
| 55 | 2 | $response->get_content); | |||||||||||
| 56 | } | ||||||||||||
| 57 | |||||||||||||
| 58 | package Twilio::Rest::Accounts::V1::SecondaryAuthTokenInstance; | ||||||||||||
| 59 | |||||||||||||
| 60 | 3 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 61 | |||||||||||||
| 62 | 3 | ▶ | use Twilio::Deserialize; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 63 | |||||||||||||
| 64 | 2 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||
| 65 | 2 | my ($class, $version, $payload) = @_; | |||||||||||
| 66 | 2 | my $self = $class->SUPER::new($version, $payload); | |||||||||||
| 67 | 2 | $self->{solution} = {}; | |||||||||||
| 68 | 2 | return $self; | |||||||||||
| 69 | } | ||||||||||||
| 70 | |||||||||||||
| 71 | 0 | ▶ | sub create { | ||||||||||
|
Subroutine
create: not called CC=1 SCAR=6.9
| |||||||||||||
| 72 | 0 | my ($self, @arguments) = @_; | |||||||||||
| 73 | 0 | return $self->_context->create(@arguments); | |||||||||||
| 74 | } | ||||||||||||
| 75 | |||||||||||||
| 76 | 0 | ▶ | sub delete { | ||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||
| 77 | 0 | my ($self, @arguments) = @_; | |||||||||||
| 78 | 0 | return $self->_context->delete(@arguments); | |||||||||||
| 79 | } | ||||||||||||
| 80 | |||||||||||||
| 81 | 0 | ▶ | sub _context { | ||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||
| 82 | 0 | my ($self) = @_; | |||||||||||
| 83 | 0 | return Twilio::Rest::Accounts::V1::SecondaryAuthTokenContext->new($self->{version}); | |||||||||||
| 84 | } | ||||||||||||
| 85 | |||||||||||||
| 86 | 1 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||
| 87 | 1 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||
| 88 | 1 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||
| 89 | 2 | ▶ | sub secondary_auth_token { return $_[0]{properties}{secondary_auth_token} } | ||||||||||
|
Subroutine
secondary_auth_token: called CC=1 SCAR=0.0
| |||||||||||||
| 90 | 1 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||
| 91 | |||||||||||||
| 92 | 3 | 1; | |||||||||||
| 93 | |||||||||||||
| 94 | __END__ | ||||||||||||