« Twilio/Rest/Conversations/V1/Service/Conversation/Webhook.pm
↑ Summary
Twilio/Rest/Taskrouter/V1/Workspace/Activity.pm »
| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::IpMessaging::V2::Service::Channel::Webhook; | ||||||||||||||||||||
| 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::IpMessaging::V2::Service::Channel::WebhookList; | ||||||||||||||||||||
| 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 | 5 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 5 | my ($class, $version, $service_sid, $channel_sid) = @_; | |||||||||||||||||||
| 17 | 5 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 5 | $self->{solution} = { service_sid => $service_sid, channel_sid => $channel_sid }; | |||||||||||||||||||
| 19 | 5 | $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid), | |||||||||||||||||||
| 20 | '/Channels/', Twilio::Serialize::path_segment($channel_sid), '/Webhooks'; | ||||||||||||||||||||
| 21 | 5 | return $self; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 25 | 1 | my ($self, $type, $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 | Type => $type, | ||||||||||||||||||||
| 30 | 'Configuration.Filters' => $options->{configuration_filters}, | ||||||||||||||||||||
| 31 | 'Configuration.FlowSid' => $options->{configuration_flow_sid}, | ||||||||||||||||||||
| 32 | 'Configuration.Method' => $options->{configuration_method}, | ||||||||||||||||||||
| 33 | 'Configuration.RetryCount' => $options->{configuration_retry_count}, | ||||||||||||||||||||
| 34 | 'Configuration.Triggers' => $options->{configuration_triggers}, | ||||||||||||||||||||
| 35 | 'Configuration.Url' => $options->{configuration_url}, | ||||||||||||||||||||
| 36 | 1 | }; | |||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | my $response = | ||||||||||||||||||||
| 39 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 40 | return Twilio::Rest::IpMessaging::V2::Service::Channel::WebhookInstance->new( | ||||||||||||||||||||
| 41 | $self->{version}, $response->get_content, | ||||||||||||||||||||
| 42 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 43 | $self->{solution}{channel_sid} | ||||||||||||||||||||
| 44 | 1 | ); | |||||||||||||||||||
| 45 | } | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 0 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 48 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 49 | 0 | return $self->read_records(@arguments); | |||||||||||||||||||
| 50 | } | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 0 | ▶ | sub stream { | ||||||||||||||||||
|
Subroutine
stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 53 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 54 | 0 | return $self->stream_records(@arguments); | |||||||||||||||||||
| 55 | } | ||||||||||||||||||||
| 56 | |||||||||||||||||||||
| 57 | 1 | ▶ | sub page { | ||||||||||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 58 | 1 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||||||||||
| 59 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 60 | |||||||||||||||||||||
| 61 | 1 | my $params = { | |||||||||||||||||||
| 62 | PageToken => $page_token, | ||||||||||||||||||||
| 63 | Page => $page_number, | ||||||||||||||||||||
| 64 | PageSize => $page_size, | ||||||||||||||||||||
| 65 | }; | ||||||||||||||||||||
| 66 | |||||||||||||||||||||
| 67 | 1 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||||||||||
| 68 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 69 | } | ||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 72 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 73 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 74 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 75 | } | ||||||||||||||||||||
| 76 | |||||||||||||||||||||
| 77 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 78 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 79 | return Twilio::Rest::IpMessaging::V2::Service::Channel::WebhookPage->new($self->{version}, | ||||||||||||||||||||
| 80 | 1 | $response, $self->{solution}); | |||||||||||||||||||
| 81 | } | ||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | 3 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 84 | 3 | my ($self, $sid) = @_; | |||||||||||||||||||
| 85 | return Twilio::Rest::IpMessaging::V2::Service::Channel::WebhookContext->new( | ||||||||||||||||||||
| 86 | $self->{version}, | ||||||||||||||||||||
| 87 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 88 | 3 | $self->{solution}{channel_sid}, $sid | |||||||||||||||||||
| 89 | ); | ||||||||||||||||||||
| 90 | } | ||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | package Twilio::Rest::IpMessaging::V2::Service::Channel::WebhookPage; | ||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 95 | |||||||||||||||||||||
| 96 | 1 | ▶ | sub records_key { return 'webhooks' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 97 | |||||||||||||||||||||
| 98 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 99 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 100 | return Twilio::Rest::IpMessaging::V2::Service::Channel::WebhookInstance->new( | ||||||||||||||||||||
| 101 | $self->{version}, $payload, | ||||||||||||||||||||
| 102 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 103 | $self->{solution}{channel_sid} | ||||||||||||||||||||
| 104 | 1 | ); | |||||||||||||||||||
| 105 | } | ||||||||||||||||||||
| 106 | |||||||||||||||||||||
| 107 | package Twilio::Rest::IpMessaging::V2::Service::Channel::WebhookContext; | ||||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 110 | |||||||||||||||||||||
| 111 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 112 | |||||||||||||||||||||
| 113 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 114 | 3 | my ($class, $version, $service_sid, $channel_sid, $sid) = @_; | |||||||||||||||||||
| 115 | 3 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 116 | 3 | $self->{solution} = { service_sid => $service_sid, channel_sid => $channel_sid, sid => $sid }; | |||||||||||||||||||
| 117 | 3 | $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid), | |||||||||||||||||||
| 118 | '/Channels/', Twilio::Serialize::path_segment($channel_sid), '/Webhooks/', | ||||||||||||||||||||
| 119 | Twilio::Serialize::path_segment($sid); | ||||||||||||||||||||
| 120 | 3 | return $self; | |||||||||||||||||||
| 121 | } | ||||||||||||||||||||
| 122 | |||||||||||||||||||||
| 123 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 124 | 1 | my ($self) = @_; | |||||||||||||||||||
| 125 | 1 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete'); | |||||||||||||||||||
| 126 | 1 | return 1; | |||||||||||||||||||
| 127 | } | ||||||||||||||||||||
| 128 | |||||||||||||||||||||
| 129 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 130 | 1 | my ($self) = @_; | |||||||||||||||||||
| 131 | |||||||||||||||||||||
| 132 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 133 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 134 | } | ||||||||||||||||||||
| 135 | |||||||||||||||||||||
| 136 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 137 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 138 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 139 | |||||||||||||||||||||
| 140 | my $data = { | ||||||||||||||||||||
| 141 | 'Configuration.Filters' => $options->{configuration_filters}, | ||||||||||||||||||||
| 142 | 'Configuration.FlowSid' => $options->{configuration_flow_sid}, | ||||||||||||||||||||
| 143 | 'Configuration.Method' => $options->{configuration_method}, | ||||||||||||||||||||
| 144 | 'Configuration.RetryCount' => $options->{configuration_retry_count}, | ||||||||||||||||||||
| 145 | 'Configuration.Triggers' => $options->{configuration_triggers}, | ||||||||||||||||||||
| 146 | 'Configuration.Url' => $options->{configuration_url}, | ||||||||||||||||||||
| 147 | 1 | }; | |||||||||||||||||||
| 148 | |||||||||||||||||||||
| 149 | my $response = | ||||||||||||||||||||
| 150 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data }); | |||||||||||||||||||
| 151 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 152 | } | ||||||||||||||||||||
| 153 | |||||||||||||||||||||
| 154 | 2 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 155 | 2 | my ($self, $response) = @_; | |||||||||||||||||||
| 156 | return Twilio::Rest::IpMessaging::V2::Service::Channel::WebhookInstance->new( | ||||||||||||||||||||
| 157 | $self->{version}, $response->get_content, | ||||||||||||||||||||
| 158 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 159 | $self->{solution}{channel_sid}, | ||||||||||||||||||||
| 160 | $self->{solution}{sid} | ||||||||||||||||||||
| 161 | 2 | ); | |||||||||||||||||||
| 162 | } | ||||||||||||||||||||
| 163 | |||||||||||||||||||||
| 164 | package Twilio::Rest::IpMessaging::V2::Service::Channel::WebhookInstance; | ||||||||||||||||||||
| 165 | |||||||||||||||||||||
| 166 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 167 | |||||||||||||||||||||
| 168 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 169 | |||||||||||||||||||||
| 170 | 4 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 171 | 4 | my ($class, $version, $payload, $service_sid, $channel_sid, $sid) = @_; | |||||||||||||||||||
| 172 | 4 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 173 | $self->{solution} = { | ||||||||||||||||||||
| 174 | service_sid => $service_sid, | ||||||||||||||||||||
| 175 | channel_sid => $channel_sid, | ||||||||||||||||||||
| 176 | sid => $sid // $self->{properties}{sid} | ||||||||||||||||||||
| 177 | 4 | ▶ | }; | ||||||||||||||||||
|
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"}
| |||||||||||||||||||||
| 178 | 4 | return $self; | |||||||||||||||||||
| 179 | } | ||||||||||||||||||||
| 180 | |||||||||||||||||||||
| 181 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 182 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 183 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 184 | } | ||||||||||||||||||||
| 185 | |||||||||||||||||||||
| 186 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 187 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 188 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 189 | } | ||||||||||||||||||||
| 190 | |||||||||||||||||||||
| 191 | 0 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 192 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 193 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 194 | } | ||||||||||||||||||||
| 195 | |||||||||||||||||||||
| 196 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 197 | 0 | my ($self) = @_; | |||||||||||||||||||
| 198 | return Twilio::Rest::IpMessaging::V2::Service::Channel::WebhookContext->new( | ||||||||||||||||||||
| 199 | $self->{version}, | ||||||||||||||||||||
| 200 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 201 | $self->{solution}{channel_sid}, | ||||||||||||||||||||
| 202 | $self->{solution}{sid} | ||||||||||||||||||||
| 203 | 0 | ); | |||||||||||||||||||
| 204 | } | ||||||||||||||||||||
| 205 | |||||||||||||||||||||
| 206 | 4 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 207 | 4 | ▶ | sub channel_sid { return $_[0]{properties}{channel_sid} } | ||||||||||||||||||
|
Subroutine
channel_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 208 | 4 | ▶ | sub configuration { return $_[0]{properties}{configuration} } | ||||||||||||||||||
|
Subroutine
configuration: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 209 | 4 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 210 | 4 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 211 | 4 | ▶ | sub service_sid { return $_[0]{properties}{service_sid} } | ||||||||||||||||||
|
Subroutine
service_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 212 | 4 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 213 | 4 | ▶ | sub type { return $_[0]{properties}{type} } | ||||||||||||||||||
|
Subroutine
type: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 214 | 4 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 215 | |||||||||||||||||||||
| 216 | 2 | 1; | |||||||||||||||||||
| 217 | |||||||||||||||||||||
| 218 | __END__ | ||||||||||||||||||||