« Twilio/Rest/Trunking/V1/Trunk/IpAccessControlList.pm
↑ Summary
Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignment.pm »
| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesChannelEndpointAssignment; | ||||||||||||||||||||
| 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::CustomerProfiles::CustomerProfilesChannelEndpointAssignmentList; | ||||||||||||||||||||
| 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, $customer_profile_sid) = @_; | |||||||||||||||||||
| 17 | 4 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 4 | $self->{solution} = { customer_profile_sid => $customer_profile_sid }; | |||||||||||||||||||
| 19 | 4 | $self->{uri} = join q{}, '/CustomerProfiles/', | |||||||||||||||||||
| 20 | Twilio::Serialize::path_segment($customer_profile_sid), '/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::CustomerProfiles::CustomerProfilesChannelEndpointAssignmentInstance | ||||||||||||||||||||
| 36 | 1 | ->new($self->{version}, $response->get_content, $self->{solution}{customer_profile_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::CustomerProfiles::CustomerProfilesChannelEndpointAssignmentPage | ||||||||||||||||||||
| 75 | 1 | ->new($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::CustomerProfiles::CustomerProfilesChannelEndpointAssignmentContext | ||||||||||||||||||||
| 82 | 2 | ->new($self->{version}, $self->{solution}{customer_profile_sid}, $sid); | |||||||||||||||||||
| 83 | } | ||||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | package Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesChannelEndpointAssignmentPage; | ||||||||||||||||||||
| 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::CustomerProfiles::CustomerProfilesChannelEndpointAssignmentInstance | ||||||||||||||||||||
| 95 | 1 | ->new($self->{version}, $payload, $self->{solution}{customer_profile_sid}); | |||||||||||||||||||
| 96 | } | ||||||||||||||||||||
| 97 | |||||||||||||||||||||
| 98 | package Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesChannelEndpointAssignmentContext; | ||||||||||||||||||||
| 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, $customer_profile_sid, $sid) = @_; | |||||||||||||||||||
| 106 | 2 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 107 | 2 | $self->{solution} = { customer_profile_sid => $customer_profile_sid, sid => $sid }; | |||||||||||||||||||
| 108 | 2 | $self->{uri} = join q{}, '/CustomerProfiles/', | |||||||||||||||||||
| 109 | Twilio::Serialize::path_segment($customer_profile_sid), '/ChannelEndpointAssignments/', | ||||||||||||||||||||
| 110 | Twilio::Serialize::path_segment($sid); | ||||||||||||||||||||
| 111 | 2 | return $self; | |||||||||||||||||||
| 112 | } | ||||||||||||||||||||
| 113 | |||||||||||||||||||||
| 114 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 115 | 1 | my ($self) = @_; | |||||||||||||||||||
| 116 | 1 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete'); | |||||||||||||||||||
| 117 | 1 | return 1; | |||||||||||||||||||
| 118 | } | ||||||||||||||||||||
| 119 | |||||||||||||||||||||
| 120 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 121 | 1 | my ($self) = @_; | |||||||||||||||||||
| 122 | |||||||||||||||||||||
| 123 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 124 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 125 | } | ||||||||||||||||||||
| 126 | |||||||||||||||||||||
| 127 | 1 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 128 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 129 | return | ||||||||||||||||||||
| 130 | Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesChannelEndpointAssignmentInstance | ||||||||||||||||||||
| 131 | ->new( | ||||||||||||||||||||
| 132 | $self->{version}, $response->get_content, | ||||||||||||||||||||
| 133 | $self->{solution}{customer_profile_sid}, | ||||||||||||||||||||
| 134 | $self->{solution}{sid} | ||||||||||||||||||||
| 135 | 1 | ); | |||||||||||||||||||
| 136 | } | ||||||||||||||||||||
| 137 | |||||||||||||||||||||
| 138 | package Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesChannelEndpointAssignmentInstance; | ||||||||||||||||||||
| 139 | |||||||||||||||||||||
| 140 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 141 | |||||||||||||||||||||
| 142 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 143 | |||||||||||||||||||||
| 144 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 145 | 3 | my ($class, $version, $payload, $customer_profile_sid, $sid) = @_; | |||||||||||||||||||
| 146 | 3 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 147 | $self->{solution} = | ||||||||||||||||||||
| 148 | 3 | ▶ | { customer_profile_sid => $customer_profile_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"}
| |||||||||||||||||||||
| 149 | 3 | return $self; | |||||||||||||||||||
| 150 | } | ||||||||||||||||||||
| 151 | |||||||||||||||||||||
| 152 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 153 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 154 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 155 | } | ||||||||||||||||||||
| 156 | |||||||||||||||||||||
| 157 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 158 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 159 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 160 | } | ||||||||||||||||||||
| 161 | |||||||||||||||||||||
| 162 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 163 | 0 | my ($self) = @_; | |||||||||||||||||||
| 164 | return | ||||||||||||||||||||
| 165 | Twilio::Rest::Trusthub::V1::CustomerProfiles::CustomerProfilesChannelEndpointAssignmentContext | ||||||||||||||||||||
| 166 | ->new( | ||||||||||||||||||||
| 167 | $self->{version}, | ||||||||||||||||||||
| 168 | $self->{solution}{customer_profile_sid}, | ||||||||||||||||||||
| 169 | $self->{solution}{sid} | ||||||||||||||||||||
| 170 | 0 | ); | |||||||||||||||||||
| 171 | } | ||||||||||||||||||||
| 172 | |||||||||||||||||||||
| 173 | 3 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 174 | 3 | ▶ | sub channel_endpoint_sid { return $_[0]{properties}{channel_endpoint_sid} } | ||||||||||||||||||
|
Subroutine
channel_endpoint_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 175 | 3 | ▶ | sub channel_endpoint_type { return $_[0]{properties}{channel_endpoint_type} } | ||||||||||||||||||
|
Subroutine
channel_endpoint_type: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 176 | 3 | ▶ | sub customer_profile_sid { return $_[0]{properties}{customer_profile_sid} } | ||||||||||||||||||
|
Subroutine
customer_profile_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 177 | 3 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 178 | 3 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 179 | 3 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 180 | |||||||||||||||||||||
| 181 | 2 | 1; | |||||||||||||||||||
| 182 | |||||||||||||||||||||
| 183 | __END__ | ||||||||||||||||||||