« Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignment.pm
↑ Summary
Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannel.pm »
| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Trusthub::V1::TrustProducts::TrustProductsChannelEndpointAssignment; | ||||||||||||||||||||
| 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::Trusthub::V1::TrustProducts::TrustProductsChannelEndpointAssignmentList; | ||||||||||||||||||||
| 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, $trust_product_sid) = @_; | |||||||||||||||||||
| 17 | 4 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 4 | $self->{solution} = { trust_product_sid => $trust_product_sid }; | |||||||||||||||||||
| 19 | 4 | $self->{uri} = join q{}, '/TrustProducts/', Twilio::Serialize::path_segment($trust_product_sid), | |||||||||||||||||||
| 20 | '/ChannelEndpointAssignments'; | ||||||||||||||||||||
| 21 | 4 | return $self; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 25 | 1 | my ($self, $channel_endpoint_type, $channel_endpoint_sid) = @_; | |||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 1 | my $data = { | |||||||||||||||||||
| 28 | ChannelEndpointType => $channel_endpoint_type, | ||||||||||||||||||||
| 29 | ChannelEndpointSid => $channel_endpoint_sid, | ||||||||||||||||||||
| 30 | }; | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | my $response = | ||||||||||||||||||||
| 33 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 34 | return | ||||||||||||||||||||
| 35 | Twilio::Rest::Trusthub::V1::TrustProducts::TrustProductsChannelEndpointAssignmentInstance->new( | ||||||||||||||||||||
| 36 | 1 | $self->{version}, $response->get_content, $self->{solution}{trust_product_sid}); | |||||||||||||||||||
| 37 | } | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | 0 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 40 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 41 | 0 | return $self->read_records(@arguments); | |||||||||||||||||||
| 42 | } | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | 0 | ▶ | sub stream { | ||||||||||||||||||
|
Subroutine
stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 45 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 46 | 0 | return $self->stream_records(@arguments); | |||||||||||||||||||
| 47 | } | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 1 | ▶ | sub page { | ||||||||||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 50 | 1 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||||||||||
| 51 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | my $params = { | ||||||||||||||||||||
| 54 | ChannelEndpointSid => $options->{channel_endpoint_sid}, | ||||||||||||||||||||
| 55 | ChannelEndpointSids => $options->{channel_endpoint_sids}, | ||||||||||||||||||||
| 56 | 1 | 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 | ||||||||||||||||||||
| 74 | Twilio::Rest::Trusthub::V1::TrustProducts::TrustProductsChannelEndpointAssignmentPage->new( | ||||||||||||||||||||
| 75 | 1 | $self->{version}, $response, $self->{solution}); | |||||||||||||||||||
| 76 | } | ||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | 2 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 79 | 2 | my ($self, $sid) = @_; | |||||||||||||||||||
| 80 | return | ||||||||||||||||||||
| 81 | Twilio::Rest::Trusthub::V1::TrustProducts::TrustProductsChannelEndpointAssignmentContext->new( | ||||||||||||||||||||
| 82 | 2 | $self->{version}, $self->{solution}{trust_product_sid}, $sid); | |||||||||||||||||||
| 83 | } | ||||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | package Twilio::Rest::Trusthub::V1::TrustProducts::TrustProductsChannelEndpointAssignmentPage; | ||||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | 1 | ▶ | sub records_key { return 'results' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 90 | |||||||||||||||||||||
| 91 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 92 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 93 | return | ||||||||||||||||||||
| 94 | Twilio::Rest::Trusthub::V1::TrustProducts::TrustProductsChannelEndpointAssignmentInstance->new( | ||||||||||||||||||||
| 95 | 1 | $self->{version}, $payload, $self->{solution}{trust_product_sid}); | |||||||||||||||||||
| 96 | } | ||||||||||||||||||||
| 97 | |||||||||||||||||||||
| 98 | package Twilio::Rest::Trusthub::V1::TrustProducts::TrustProductsChannelEndpointAssignmentContext; | ||||||||||||||||||||
| 99 | |||||||||||||||||||||
| 100 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 101 | |||||||||||||||||||||
| 102 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 105 | 2 | my ($class, $version, $trust_product_sid, $sid) = @_; | |||||||||||||||||||
| 106 | 2 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 107 | 2 | $self->{solution} = { trust_product_sid => $trust_product_sid, sid => $sid }; | |||||||||||||||||||
| 108 | 2 | $self->{uri} = join q{}, '/TrustProducts/', Twilio::Serialize::path_segment($trust_product_sid), | |||||||||||||||||||
| 109 | '/ChannelEndpointAssignments/', Twilio::Serialize::path_segment($sid); | ||||||||||||||||||||
| 110 | 2 | return $self; | |||||||||||||||||||
| 111 | } | ||||||||||||||||||||
| 112 | |||||||||||||||||||||
| 113 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 114 | 1 | my ($self) = @_; | |||||||||||||||||||
| 115 | 1 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete'); | |||||||||||||||||||
| 116 | 1 | return 1; | |||||||||||||||||||
| 117 | } | ||||||||||||||||||||
| 118 | |||||||||||||||||||||
| 119 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 120 | 1 | my ($self) = @_; | |||||||||||||||||||
| 121 | |||||||||||||||||||||
| 122 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 123 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 124 | } | ||||||||||||||||||||
| 125 | |||||||||||||||||||||
| 126 | 1 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 127 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 128 | return | ||||||||||||||||||||
| 129 | Twilio::Rest::Trusthub::V1::TrustProducts::TrustProductsChannelEndpointAssignmentInstance->new( | ||||||||||||||||||||
| 130 | $self->{version}, $response->get_content, | ||||||||||||||||||||
| 131 | $self->{solution}{trust_product_sid}, | ||||||||||||||||||||
| 132 | $self->{solution}{sid} | ||||||||||||||||||||
| 133 | 1 | ); | |||||||||||||||||||
| 134 | } | ||||||||||||||||||||
| 135 | |||||||||||||||||||||
| 136 | package Twilio::Rest::Trusthub::V1::TrustProducts::TrustProductsChannelEndpointAssignmentInstance; | ||||||||||||||||||||
| 137 | |||||||||||||||||||||
| 138 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 139 | |||||||||||||||||||||
| 140 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 141 | |||||||||||||||||||||
| 142 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 143 | 3 | my ($class, $version, $payload, $trust_product_sid, $sid) = @_; | |||||||||||||||||||
| 144 | 3 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 145 | $self->{solution} = | ||||||||||||||||||||
| 146 | 3 | ▶ | { trust_product_sid => $trust_product_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"}
| |||||||||||||||||||||
| 147 | 3 | return $self; | |||||||||||||||||||
| 148 | } | ||||||||||||||||||||
| 149 | |||||||||||||||||||||
| 150 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 151 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 152 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 153 | } | ||||||||||||||||||||
| 154 | |||||||||||||||||||||
| 155 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 156 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 157 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 158 | } | ||||||||||||||||||||
| 159 | |||||||||||||||||||||
| 160 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 161 | 0 | my ($self) = @_; | |||||||||||||||||||
| 162 | return | ||||||||||||||||||||
| 163 | Twilio::Rest::Trusthub::V1::TrustProducts::TrustProductsChannelEndpointAssignmentContext->new( | ||||||||||||||||||||
| 164 | $self->{version}, | ||||||||||||||||||||
| 165 | $self->{solution}{trust_product_sid}, | ||||||||||||||||||||
| 166 | $self->{solution}{sid} | ||||||||||||||||||||
| 167 | 0 | ); | |||||||||||||||||||
| 168 | } | ||||||||||||||||||||
| 169 | |||||||||||||||||||||
| 170 | 3 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 171 | 3 | ▶ | sub channel_endpoint_sid { return $_[0]{properties}{channel_endpoint_sid} } | ||||||||||||||||||
|
Subroutine
channel_endpoint_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 172 | 3 | ▶ | sub channel_endpoint_type { return $_[0]{properties}{channel_endpoint_type} } | ||||||||||||||||||
|
Subroutine
channel_endpoint_type: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 173 | 3 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 174 | 3 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 175 | 3 | ▶ | sub trust_product_sid { return $_[0]{properties}{trust_product_sid} } | ||||||||||||||||||
|
Subroutine
trust_product_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 176 | 3 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 177 | |||||||||||||||||||||
| 178 | 2 | 1; | |||||||||||||||||||
| 179 | |||||||||||||||||||||
| 180 | __END__ | ||||||||||||||||||||