| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Api::V2010::Account::Call::UserDefinedMessageSubscription; | ||||||||||||||||||||
| 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::Api::V2010::Account::Call::UserDefinedMessageSubscriptionList; | ||||||||||||||||||||
| 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 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 2 | my ($class, $version, $account_sid, $call_sid) = @_; | |||||||||||||||||||
| 17 | 2 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 2 | $self->{solution} = { account_sid => $account_sid, call_sid => $call_sid }; | |||||||||||||||||||
| 19 | 2 | $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid), '/Calls/', | |||||||||||||||||||
| 20 | Twilio::Serialize::path_segment($call_sid), '/UserDefinedMessageSubscriptions.json'; | ||||||||||||||||||||
| 21 | 2 | return $self; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 25 | 1 | my ($self, $callback, $options) = @_; | |||||||||||||||||||
| 26 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | my $data = { | ||||||||||||||||||||
| 29 | Callback => $callback, | ||||||||||||||||||||
| 30 | IdempotencyKey => $options->{idempotency_key}, | ||||||||||||||||||||
| 31 | Method => $options->{method}, | ||||||||||||||||||||
| 32 | 1 | }; | |||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | my $response = | ||||||||||||||||||||
| 35 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 36 | return Twilio::Rest::Api::V2010::Account::Call::UserDefinedMessageSubscriptionInstance->new( | ||||||||||||||||||||
| 37 | $self->{version}, $response->get_content, | ||||||||||||||||||||
| 38 | $self->{solution}{account_sid}, | ||||||||||||||||||||
| 39 | $self->{solution}{call_sid} | ||||||||||||||||||||
| 40 | 1 | ); | |||||||||||||||||||
| 41 | } | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | 1 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 44 | 1 | my ($self, $sid) = @_; | |||||||||||||||||||
| 45 | return Twilio::Rest::Api::V2010::Account::Call::UserDefinedMessageSubscriptionContext->new( | ||||||||||||||||||||
| 46 | $self->{version}, | ||||||||||||||||||||
| 47 | $self->{solution}{account_sid}, | ||||||||||||||||||||
| 48 | 1 | $self->{solution}{call_sid}, $sid | |||||||||||||||||||
| 49 | ); | ||||||||||||||||||||
| 50 | } | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | package Twilio::Rest::Api::V2010::Account::Call::UserDefinedMessageSubscriptionContext; | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 59 | 1 | my ($class, $version, $account_sid, $call_sid, $sid) = @_; | |||||||||||||||||||
| 60 | 1 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 61 | 1 | $self->{solution} = { account_sid => $account_sid, call_sid => $call_sid, sid => $sid }; | |||||||||||||||||||
| 62 | 1 | $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid), '/Calls/', | |||||||||||||||||||
| 63 | Twilio::Serialize::path_segment($call_sid), '/UserDefinedMessageSubscriptions/', | ||||||||||||||||||||
| 64 | Twilio::Serialize::path_segment($sid), '.json'; | ||||||||||||||||||||
| 65 | 1 | return $self; | |||||||||||||||||||
| 66 | } | ||||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 69 | 1 | my ($self) = @_; | |||||||||||||||||||
| 70 | 1 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete'); | |||||||||||||||||||
| 71 | 1 | return 1; | |||||||||||||||||||
| 72 | } | ||||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | package Twilio::Rest::Api::V2010::Account::Call::UserDefinedMessageSubscriptionInstance; | ||||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 79 | |||||||||||||||||||||
| 80 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.4
| |||||||||||||||||||||
| 81 | 1 | my ($class, $version, $payload, $account_sid, $call_sid, $sid) = @_; | |||||||||||||||||||
| 82 | 1 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 83 | $self->{solution} = | ||||||||||||||||||||
| 84 | 1 | ▶ | { account_sid => $account_sid, call_sid => $call_sid, sid => $sid // $self->{properties}{sid} }; | ||||||||||||||||||
|
Condition33%1/3
$sid // $self->{"properties"}{"sid"}
MC/DC0%0/2
$sid // $self->{"properties"}{"sid"}
$sid
$self->{"properties"}{"sid"}
Truth table33%1/3
A // B
A= $sidB= $self->{"properties"}{"sid"}
| |||||||||||||||||||||
| 85 | 1 | return $self; | |||||||||||||||||||
| 86 | } | ||||||||||||||||||||
| 87 | |||||||||||||||||||||
| 88 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 89 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 90 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 91 | } | ||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 94 | 0 | my ($self) = @_; | |||||||||||||||||||
| 95 | return Twilio::Rest::Api::V2010::Account::Call::UserDefinedMessageSubscriptionContext->new( | ||||||||||||||||||||
| 96 | $self->{version}, | ||||||||||||||||||||
| 97 | $self->{solution}{account_sid}, | ||||||||||||||||||||
| 98 | $self->{solution}{call_sid}, | ||||||||||||||||||||
| 99 | $self->{solution}{sid} | ||||||||||||||||||||
| 100 | 0 | ); | |||||||||||||||||||
| 101 | } | ||||||||||||||||||||
| 102 | |||||||||||||||||||||
| 103 | 1 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 104 | 1 | ▶ | sub call_sid { return $_[0]{properties}{call_sid} } | ||||||||||||||||||
|
Subroutine
call_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 105 | 1 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 106 | 1 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 107 | 1 | ▶ | sub uri { return $_[0]{properties}{uri} } | ||||||||||||||||||
|
Subroutine
uri: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | 2 | 1; | |||||||||||||||||||
| 110 | |||||||||||||||||||||
| 111 | __END__ | ||||||||||||||||||||