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