« Twilio/Rest/Knowledge/V2/Knowledge.pm
↑ Summary
Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItem.pm »
| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Api::V2010::Account::SigningKey; | ||||||||||||||||||||
| 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::SigningKeyList; | ||||||||||||||||||||
| 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, $account_sid) = @_; | |||||||||||||||||||
| 17 | 4 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 4 | $self->{solution} = { account_sid => $account_sid }; | |||||||||||||||||||
| 19 | 4 | $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid), | |||||||||||||||||||
| 20 | '/SigningKeys.json'; | ||||||||||||||||||||
| 21 | 4 | return $self; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 0 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 25 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 26 | 0 | return $self->read_records(@arguments); | |||||||||||||||||||
| 27 | } | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 0 | ▶ | sub stream { | ||||||||||||||||||
|
Subroutine
stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 30 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 31 | 0 | return $self->stream_records(@arguments); | |||||||||||||||||||
| 32 | } | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 1 | ▶ | sub page { | ||||||||||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 35 | 1 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||||||||||
| 36 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 1 | my $params = { | |||||||||||||||||||
| 39 | PageToken => $page_token, | ||||||||||||||||||||
| 40 | Page => $page_number, | ||||||||||||||||||||
| 41 | PageSize => $page_size, | ||||||||||||||||||||
| 42 | }; | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | 1 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||||||||||
| 45 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 49 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 50 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 51 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 52 | } | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 55 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 56 | return Twilio::Rest::Api::V2010::Account::SigningKeyPage->new($self->{version}, $response, | ||||||||||||||||||||
| 57 | 1 | $self->{solution}); | |||||||||||||||||||
| 58 | } | ||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | 3 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 61 | 3 | my ($self, $sid) = @_; | |||||||||||||||||||
| 62 | return Twilio::Rest::Api::V2010::Account::SigningKeyContext->new($self->{version}, | ||||||||||||||||||||
| 63 | 3 | $self->{solution}{account_sid}, $sid); | |||||||||||||||||||
| 64 | } | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | package Twilio::Rest::Api::V2010::Account::SigningKeyPage; | ||||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | 1 | ▶ | sub records_key { return 'signing_keys' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 73 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 74 | return Twilio::Rest::Api::V2010::Account::SigningKeyInstance->new($self->{version}, $payload, | ||||||||||||||||||||
| 75 | 1 | $self->{solution}{account_sid}); | |||||||||||||||||||
| 76 | } | ||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | package Twilio::Rest::Api::V2010::Account::SigningKeyContext; | ||||||||||||||||||||
| 79 | |||||||||||||||||||||
| 80 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 83 | |||||||||||||||||||||
| 84 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 85 | 3 | my ($class, $version, $account_sid, $sid) = @_; | |||||||||||||||||||
| 86 | 3 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 87 | 3 | $self->{solution} = { account_sid => $account_sid, sid => $sid }; | |||||||||||||||||||
| 88 | 3 | $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid), | |||||||||||||||||||
| 89 | '/SigningKeys/', Twilio::Serialize::path_segment($sid), '.json'; | ||||||||||||||||||||
| 90 | 3 | return $self; | |||||||||||||||||||
| 91 | } | ||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 94 | 1 | my ($self) = @_; | |||||||||||||||||||
| 95 | 1 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete'); | |||||||||||||||||||
| 96 | 1 | return 1; | |||||||||||||||||||
| 97 | } | ||||||||||||||||||||
| 98 | |||||||||||||||||||||
| 99 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 100 | 1 | my ($self) = @_; | |||||||||||||||||||
| 101 | |||||||||||||||||||||
| 102 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 103 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 104 | } | ||||||||||||||||||||
| 105 | |||||||||||||||||||||
| 106 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 107 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 108 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 109 | |||||||||||||||||||||
| 110 | 1 | my $data = { FriendlyName => $options->{friendly_name}, }; | |||||||||||||||||||
| 111 | |||||||||||||||||||||
| 112 | my $response = | ||||||||||||||||||||
| 113 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data }); | |||||||||||||||||||
| 114 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 115 | } | ||||||||||||||||||||
| 116 | |||||||||||||||||||||
| 117 | 2 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 118 | 2 | my ($self, $response) = @_; | |||||||||||||||||||
| 119 | return Twilio::Rest::Api::V2010::Account::SigningKeyInstance->new( | ||||||||||||||||||||
| 120 | $self->{version}, $response->get_content, | ||||||||||||||||||||
| 121 | $self->{solution}{account_sid}, $self->{solution}{sid} | ||||||||||||||||||||
| 122 | 2 | ); | |||||||||||||||||||
| 123 | } | ||||||||||||||||||||
| 124 | |||||||||||||||||||||
| 125 | package Twilio::Rest::Api::V2010::Account::SigningKeyInstance; | ||||||||||||||||||||
| 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, $account_sid, $sid) = @_; | |||||||||||||||||||
| 133 | 3 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 134 | 3 | ▶ | $self->{solution} = { account_sid => $account_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 update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 149 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 150 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 151 | } | ||||||||||||||||||||
| 152 | |||||||||||||||||||||
| 153 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 154 | 0 | my ($self) = @_; | |||||||||||||||||||
| 155 | return Twilio::Rest::Api::V2010::Account::SigningKeyContext->new( | ||||||||||||||||||||
| 156 | $self->{version}, | ||||||||||||||||||||
| 157 | $self->{solution}{account_sid}, | ||||||||||||||||||||
| 158 | $self->{solution}{sid} | ||||||||||||||||||||
| 159 | 0 | ); | |||||||||||||||||||
| 160 | } | ||||||||||||||||||||
| 161 | |||||||||||||||||||||
| 162 | 3 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 163 | 3 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 164 | 3 | ▶ | sub friendly_name { return $_[0]{properties}{friendly_name} } | ||||||||||||||||||
|
Subroutine
friendly_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 165 | 3 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 166 | |||||||||||||||||||||
| 167 | 2 | 1; | |||||||||||||||||||
| 168 | |||||||||||||||||||||
| 169 | __END__ | ||||||||||||||||||||