| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Messaging::V2::ChannelsSender; | ||||||||||||||||||||
| 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::Messaging::V2::ChannelsSenderList; | ||||||||||||||||||||
| 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 | 11 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 11 | my ($class, $version) = @_; | |||||||||||||||||||
| 17 | 11 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 11 | $self->{solution} = {}; | |||||||||||||||||||
| 19 | 11 | $self->{uri} = '/Channels/Senders'; | |||||||||||||||||||
| 20 | 11 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 24 | 1 | my ($self, $body) = @_; | |||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 1 | my $data = Twilio::Serialize::json_body($body, {}); | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | my $response = $self->{version}->handle_request( | ||||||||||||||||||||
| 29 | 'POST', | ||||||||||||||||||||
| 30 | $self->{uri}, | ||||||||||||||||||||
| 31 | 1 | 'create', | |||||||||||||||||||
| 32 | { | ||||||||||||||||||||
| 33 | data => $data, | ||||||||||||||||||||
| 34 | headers => { 'Content-Type' => 'application/json', } | ||||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | ); | ||||||||||||||||||||
| 37 | return Twilio::Rest::Messaging::V2::ChannelsSenderInstance->new($self->{version}, | ||||||||||||||||||||
| 38 | 1 | $response->get_content); | |||||||||||||||||||
| 39 | } | ||||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 1 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: called CC=2 SCAR=7.1
| |||||||||||||||||||||
| 42 | 1 | my ($self, $channel, $options, @arguments) = @_; | |||||||||||||||||||
| 43 | 1 | ▶ | return $self->read_records({ %{ $options // {} }, channel => $channel }, @arguments); | ||||||||||||||||||
|
Condition50%1/2
$options // {}
MC/DC0%0/1
$options // {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | 0 | ▶ | sub stream { | ||||||||||||||||||
|
Subroutine
stream: not called CC=2 SCAR=17.9
| |||||||||||||||||||||
| 47 | 0 | my ($self, $channel, $options, @arguments) = @_; | |||||||||||||||||||
| 48 | 0 | ▶ | return $self->stream_records({ %{ $options // {} }, channel => $channel }, @arguments); | ||||||||||||||||||
|
Condition0%0/2
$options // {}
MC/DC0%0/1
$options // {}
$options
Truth table0%0/2
A
A= $options
| |||||||||||||||||||||
| 49 | } | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 2 | ▶ | sub page { | ||||||||||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 52 | 2 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||||||||||
| 53 | 2 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | my $params = { | ||||||||||||||||||||
| 56 | Channel => $options->{channel}, | ||||||||||||||||||||
| 57 | 2 | PageToken => $page_token, | |||||||||||||||||||
| 58 | Page => $page_number, | ||||||||||||||||||||
| 59 | PageSize => $page_size, | ||||||||||||||||||||
| 60 | }; | ||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | 2 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||||||||||
| 63 | 2 | return $self->_build_page($response); | |||||||||||||||||||
| 64 | } | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 67 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 68 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 69 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 70 | } | ||||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | 2 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 73 | 2 | my ($self, $response) = @_; | |||||||||||||||||||
| 74 | return Twilio::Rest::Messaging::V2::ChannelsSenderPage->new($self->{version}, $response, | ||||||||||||||||||||
| 75 | 2 | $self->{solution}); | |||||||||||||||||||
| 76 | } | ||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | 8 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 79 | 8 | my ($self, $sid) = @_; | |||||||||||||||||||
| 80 | 8 | return Twilio::Rest::Messaging::V2::ChannelsSenderContext->new($self->{version}, $sid); | |||||||||||||||||||
| 81 | } | ||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | package Twilio::Rest::Messaging::V2::ChannelsSenderPage; | ||||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | 3 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | 2 | ▶ | sub records_key { return 'senders' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | 2 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 90 | 2 | my ($self, $payload) = @_; | |||||||||||||||||||
| 91 | 2 | return Twilio::Rest::Messaging::V2::ChannelsSenderInstance->new($self->{version}, $payload); | |||||||||||||||||||
| 92 | } | ||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | package Twilio::Rest::Messaging::V2::ChannelsSenderContext; | ||||||||||||||||||||
| 95 | |||||||||||||||||||||
| 96 | 3 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 97 | |||||||||||||||||||||
| 98 | 3 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 99 | |||||||||||||||||||||
| 100 | 8 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 101 | 8 | my ($class, $version, $sid) = @_; | |||||||||||||||||||
| 102 | 8 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 103 | 8 | $self->{solution} = { sid => $sid }; | |||||||||||||||||||
| 104 | 8 | $self->{uri} = join q{}, '/Channels/Senders/', Twilio::Serialize::path_segment($sid); | |||||||||||||||||||
| 105 | 8 | return $self; | |||||||||||||||||||
| 106 | } | ||||||||||||||||||||
| 107 | |||||||||||||||||||||
| 108 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 109 | 1 | my ($self) = @_; | |||||||||||||||||||
| 110 | 1 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete'); | |||||||||||||||||||
| 111 | 1 | return 1; | |||||||||||||||||||
| 112 | } | ||||||||||||||||||||
| 113 | |||||||||||||||||||||
| 114 | 6 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 115 | 6 | my ($self) = @_; | |||||||||||||||||||
| 116 | |||||||||||||||||||||
| 117 | 6 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 118 | 6 | return $self->_build_instance($response); | |||||||||||||||||||
| 119 | } | ||||||||||||||||||||
| 120 | |||||||||||||||||||||
| 121 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 122 | 1 | my ($self, $body) = @_; | |||||||||||||||||||
| 123 | |||||||||||||||||||||
| 124 | 1 | my $data = Twilio::Serialize::json_body($body, {}); | |||||||||||||||||||
| 125 | |||||||||||||||||||||
| 126 | my $response = $self->{version}->handle_request( | ||||||||||||||||||||
| 127 | 'POST', | ||||||||||||||||||||
| 128 | $self->{uri}, | ||||||||||||||||||||
| 129 | 1 | 'update', | |||||||||||||||||||
| 130 | { | ||||||||||||||||||||
| 131 | data => $data, | ||||||||||||||||||||
| 132 | headers => { 'Content-Type' => 'application/json', } | ||||||||||||||||||||
| 133 | } | ||||||||||||||||||||
| 134 | ); | ||||||||||||||||||||
| 135 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 136 | } | ||||||||||||||||||||
| 137 | |||||||||||||||||||||
| 138 | 7 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 139 | 7 | my ($self, $response) = @_; | |||||||||||||||||||
| 140 | return Twilio::Rest::Messaging::V2::ChannelsSenderInstance->new($self->{version}, | ||||||||||||||||||||
| 141 | 7 | $response->get_content, $self->{solution}{sid}); | |||||||||||||||||||
| 142 | } | ||||||||||||||||||||
| 143 | |||||||||||||||||||||
| 144 | package Twilio::Rest::Messaging::V2::ChannelsSenderInstance; | ||||||||||||||||||||
| 145 | |||||||||||||||||||||
| 146 | 3 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 147 | |||||||||||||||||||||
| 148 | 3 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 149 | |||||||||||||||||||||
| 150 | 10 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 151 | 10 | my ($class, $version, $payload, $sid) = @_; | |||||||||||||||||||
| 152 | 10 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 153 | 10 | ▶ | $self->{solution} = { 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"}
| |||||||||||||||||||||
| 154 | 10 | return $self; | |||||||||||||||||||
| 155 | } | ||||||||||||||||||||
| 156 | |||||||||||||||||||||
| 157 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 158 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 159 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 160 | } | ||||||||||||||||||||
| 161 | |||||||||||||||||||||
| 162 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 163 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 164 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 165 | } | ||||||||||||||||||||
| 166 | |||||||||||||||||||||
| 167 | 0 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 168 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 169 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 170 | } | ||||||||||||||||||||
| 171 | |||||||||||||||||||||
| 172 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 173 | 0 | my ($self) = @_; | |||||||||||||||||||
| 174 | return Twilio::Rest::Messaging::V2::ChannelsSenderContext->new($self->{version}, | ||||||||||||||||||||
| 175 | 0 | $self->{solution}{sid}); | |||||||||||||||||||
| 176 | } | ||||||||||||||||||||
| 177 | |||||||||||||||||||||
| 178 | 10 | ▶ | sub compliance { return $_[0]{properties}{compliance} } | ||||||||||||||||||
|
Subroutine
compliance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 179 | 10 | ▶ | sub configuration { return $_[0]{properties}{configuration} } | ||||||||||||||||||
|
Subroutine
configuration: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 180 | 1 | ▶ | sub display_name_status { return $_[0]{properties}{display_name_status} } | ||||||||||||||||||
|
Subroutine
display_name_status: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 181 | 4 | ▶ | sub friendly_name { return $_[0]{properties}{friendly_name} } | ||||||||||||||||||
|
Subroutine
friendly_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 182 | 6 | ▶ | sub offline_reasons { return $_[0]{properties}{offline_reasons} } | ||||||||||||||||||
|
Subroutine
offline_reasons: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 183 | 3 | ▶ | sub pending_display_name { return $_[0]{properties}{pending_display_name} } | ||||||||||||||||||
|
Subroutine
pending_display_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 184 | 3 | ▶ | sub pending_display_name_status { return $_[0]{properties}{pending_display_name_status} } | ||||||||||||||||||
|
Subroutine
pending_display_name_status: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 185 | |||||||||||||||||||||
| 186 | 3 | ▶ | sub pending_display_name_status_date { | ||||||||||||||||||
|
Subroutine
pending_display_name_status_date: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 187 | 3 | return Twilio::Deserialize::date_time($_[0]{properties}{pending_display_name_status_date}); | |||||||||||||||||||
| 188 | } | ||||||||||||||||||||
| 189 | 5 | ▶ | sub profile { return $_[0]{properties}{profile} } | ||||||||||||||||||
|
Subroutine
profile: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 190 | 4 | ▶ | sub properties { return $_[0]{properties}{properties} } | ||||||||||||||||||
|
Subroutine
properties: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 191 | 4 | ▶ | sub sender_id { return $_[0]{properties}{sender_id} } | ||||||||||||||||||
|
Subroutine
sender_id: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 192 | 5 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 193 | 4 | ▶ | sub status { return $_[0]{properties}{status} } | ||||||||||||||||||
|
Subroutine
status: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 194 | 4 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 195 | 4 | ▶ | sub webhook { return $_[0]{properties}{webhook} } | ||||||||||||||||||
|
Subroutine
webhook: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 196 | |||||||||||||||||||||
| 197 | 3 | 1; | |||||||||||||||||||
| 198 | |||||||||||||||||||||
| 199 | __END__ | ||||||||||||||||||||