« Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMapping.pm
↑ Summary
Twilio/Rest/Trunking/V1/Trunk/IpAccessControlList.pm »
| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Trunking::V1::Trunk::CredentialList; | ||||||||||||||||||||
| 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::Trunking::V1::Trunk::CredentialListList; | ||||||||||||||||||||
| 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 | 4 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 4 | my ($class, $version, $trunk_sid) = @_; | |||||||||||||||||||
| 17 | 4 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 4 | $self->{solution} = { trunk_sid => $trunk_sid }; | |||||||||||||||||||
| 19 | 4 | $self->{uri} = join q{}, '/Trunks/', Twilio::Serialize::path_segment($trunk_sid), | |||||||||||||||||||
| 20 | '/CredentialLists'; | ||||||||||||||||||||
| 21 | 4 | return $self; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 25 | 1 | my ($self, $credential_list_sid) = @_; | |||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 1 | my $data = { CredentialListSid => $credential_list_sid, }; | |||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | my $response = | ||||||||||||||||||||
| 30 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 31 | return Twilio::Rest::Trunking::V1::Trunk::CredentialListInstance->new($self->{version}, | ||||||||||||||||||||
| 32 | 1 | $response->get_content, $self->{solution}{trunk_sid}); | |||||||||||||||||||
| 33 | } | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 0 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 36 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 37 | 0 | return $self->read_records(@arguments); | |||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 0 | ▶ | sub stream { | ||||||||||||||||||
|
Subroutine
stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 41 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 42 | 0 | return $self->stream_records(@arguments); | |||||||||||||||||||
| 43 | } | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 1 | ▶ | sub page { | ||||||||||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 46 | 1 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||||||||||
| 47 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 1 | my $params = { | |||||||||||||||||||
| 50 | PageToken => $page_token, | ||||||||||||||||||||
| 51 | Page => $page_number, | ||||||||||||||||||||
| 52 | PageSize => $page_size, | ||||||||||||||||||||
| 53 | }; | ||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | 1 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||||||||||
| 56 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 57 | } | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 60 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 61 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 62 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 63 | } | ||||||||||||||||||||
| 64 | |||||||||||||||||||||
| 65 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 66 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 67 | return Twilio::Rest::Trunking::V1::Trunk::CredentialListPage->new($self->{version}, $response, | ||||||||||||||||||||
| 68 | 1 | $self->{solution}); | |||||||||||||||||||
| 69 | } | ||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | 2 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 72 | 2 | my ($self, $sid) = @_; | |||||||||||||||||||
| 73 | return Twilio::Rest::Trunking::V1::Trunk::CredentialListContext->new($self->{version}, | ||||||||||||||||||||
| 74 | 2 | $self->{solution}{trunk_sid}, $sid); | |||||||||||||||||||
| 75 | } | ||||||||||||||||||||
| 76 | |||||||||||||||||||||
| 77 | package Twilio::Rest::Trunking::V1::Trunk::CredentialListPage; | ||||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 80 | |||||||||||||||||||||
| 81 | 1 | ▶ | sub records_key { return 'credential_lists' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 84 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 85 | return Twilio::Rest::Trunking::V1::Trunk::CredentialListInstance->new($self->{version}, $payload, | ||||||||||||||||||||
| 86 | 1 | $self->{solution}{trunk_sid}); | |||||||||||||||||||
| 87 | } | ||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | package Twilio::Rest::Trunking::V1::Trunk::CredentialListContext; | ||||||||||||||||||||
| 90 | |||||||||||||||||||||
| 91 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 94 | |||||||||||||||||||||
| 95 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 96 | 2 | my ($class, $version, $trunk_sid, $sid) = @_; | |||||||||||||||||||
| 97 | 2 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 98 | 2 | $self->{solution} = { trunk_sid => $trunk_sid, sid => $sid }; | |||||||||||||||||||
| 99 | 2 | $self->{uri} = join q{}, '/Trunks/', Twilio::Serialize::path_segment($trunk_sid), | |||||||||||||||||||
| 100 | '/CredentialLists/', Twilio::Serialize::path_segment($sid); | ||||||||||||||||||||
| 101 | 2 | return $self; | |||||||||||||||||||
| 102 | } | ||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 105 | 1 | my ($self) = @_; | |||||||||||||||||||
| 106 | 1 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete'); | |||||||||||||||||||
| 107 | 1 | return 1; | |||||||||||||||||||
| 108 | } | ||||||||||||||||||||
| 109 | |||||||||||||||||||||
| 110 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 111 | 1 | my ($self) = @_; | |||||||||||||||||||
| 112 | |||||||||||||||||||||
| 113 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 114 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 115 | } | ||||||||||||||||||||
| 116 | |||||||||||||||||||||
| 117 | 1 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 118 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 119 | return Twilio::Rest::Trunking::V1::Trunk::CredentialListInstance->new( | ||||||||||||||||||||
| 120 | $self->{version}, $response->get_content, | ||||||||||||||||||||
| 121 | $self->{solution}{trunk_sid}, $self->{solution}{sid} | ||||||||||||||||||||
| 122 | 1 | ); | |||||||||||||||||||
| 123 | } | ||||||||||||||||||||
| 124 | |||||||||||||||||||||
| 125 | package Twilio::Rest::Trunking::V1::Trunk::CredentialListInstance; | ||||||||||||||||||||
| 126 | |||||||||||||||||||||
| 127 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 128 | |||||||||||||||||||||
| 129 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 130 | |||||||||||||||||||||
| 131 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 132 | 3 | my ($class, $version, $payload, $trunk_sid, $sid) = @_; | |||||||||||||||||||
| 133 | 3 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 134 | 3 | ▶ | $self->{solution} = { trunk_sid => $trunk_sid, sid => $sid // $self->{properties}{sid} }; | ||||||||||||||||||
|
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
MC/DC0%0/2
$sid // $self->{"properties"}{"sid"}
$sid
$self->{"properties"}{"sid"}
Truth table66%2/3
A // B
A= $sidB= $self->{"properties"}{"sid"}
| |||||||||||||||||||||
| 135 | 3 | return $self; | |||||||||||||||||||
| 136 | } | ||||||||||||||||||||
| 137 | |||||||||||||||||||||
| 138 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 139 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 140 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 141 | } | ||||||||||||||||||||
| 142 | |||||||||||||||||||||
| 143 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 144 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 145 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 146 | } | ||||||||||||||||||||
| 147 | |||||||||||||||||||||
| 148 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 149 | 0 | my ($self) = @_; | |||||||||||||||||||
| 150 | return Twilio::Rest::Trunking::V1::Trunk::CredentialListContext->new( | ||||||||||||||||||||
| 151 | $self->{version}, | ||||||||||||||||||||
| 152 | $self->{solution}{trunk_sid}, | ||||||||||||||||||||
| 153 | $self->{solution}{sid} | ||||||||||||||||||||
| 154 | 0 | ); | |||||||||||||||||||
| 155 | } | ||||||||||||||||||||
| 156 | |||||||||||||||||||||
| 157 | 3 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 158 | 3 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 159 | 3 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 160 | 3 | ▶ | sub friendly_name { return $_[0]{properties}{friendly_name} } | ||||||||||||||||||
|
Subroutine
friendly_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 161 | 3 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 162 | 3 | ▶ | sub trunk_sid { return $_[0]{properties}{trunk_sid} } | ||||||||||||||||||
|
Subroutine
trunk_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 163 | 3 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 164 | |||||||||||||||||||||
| 165 | 2 | 1; | |||||||||||||||||||
| 166 | |||||||||||||||||||||
| 167 | __END__ | ||||||||||||||||||||