| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Sync::V1::Service::SyncList; | ||||||||||||||||||||
| 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::Sync::V1::Service::SyncListList; | ||||||||||||||||||||
| 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 | 15 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 15 | my ($class, $version, $service_sid) = @_; | |||||||||||||||||||
| 17 | 15 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 15 | $self->{solution} = { service_sid => $service_sid }; | |||||||||||||||||||
| 19 | 15 | $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid), '/Lists'; | |||||||||||||||||||
| 20 | 15 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 24 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 25 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | my $data = { | ||||||||||||||||||||
| 28 | CollectionTtl => $options->{collection_ttl}, | ||||||||||||||||||||
| 29 | Ttl => $options->{ttl}, | ||||||||||||||||||||
| 30 | UniqueName => $options->{unique_name}, | ||||||||||||||||||||
| 31 | 1 | }; | |||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | my $response = | ||||||||||||||||||||
| 34 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 35 | return Twilio::Rest::Sync::V1::Service::SyncListInstance->new($self->{version}, | ||||||||||||||||||||
| 36 | 1 | $response->get_content, $self->{solution}{service_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 | 1 | my $params = { | |||||||||||||||||||
| 54 | PageToken => $page_token, | ||||||||||||||||||||
| 55 | Page => $page_number, | ||||||||||||||||||||
| 56 | PageSize => $page_size, | ||||||||||||||||||||
| 57 | }; | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 1 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||||||||||
| 60 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 61 | } | ||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 64 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 65 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 66 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 67 | } | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 70 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 71 | return Twilio::Rest::Sync::V1::Service::SyncListPage->new($self->{version}, $response, | ||||||||||||||||||||
| 72 | 1 | $self->{solution}); | |||||||||||||||||||
| 73 | } | ||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 13 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 76 | 13 | my ($self, $sid) = @_; | |||||||||||||||||||
| 77 | return Twilio::Rest::Sync::V1::Service::SyncListContext->new($self->{version}, | ||||||||||||||||||||
| 78 | 13 | $self->{solution}{service_sid}, $sid); | |||||||||||||||||||
| 79 | } | ||||||||||||||||||||
| 80 | |||||||||||||||||||||
| 81 | package Twilio::Rest::Sync::V1::Service::SyncListPage; | ||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | 3 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | 1 | ▶ | sub records_key { return 'lists' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 88 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 89 | return Twilio::Rest::Sync::V1::Service::SyncListInstance->new($self->{version}, $payload, | ||||||||||||||||||||
| 90 | 1 | $self->{solution}{service_sid}); | |||||||||||||||||||
| 91 | } | ||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | package Twilio::Rest::Sync::V1::Service::SyncListContext; | ||||||||||||||||||||
| 94 | |||||||||||||||||||||
| 95 | 3 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 96 | |||||||||||||||||||||
| 97 | 3 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 98 | |||||||||||||||||||||
| 99 | 13 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 100 | 13 | my ($class, $version, $service_sid, $sid) = @_; | |||||||||||||||||||
| 101 | 13 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 102 | 13 | $self->{solution} = { service_sid => $service_sid, sid => $sid }; | |||||||||||||||||||
| 103 | 13 | $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid), '/Lists/', | |||||||||||||||||||
| 104 | Twilio::Serialize::path_segment($sid); | ||||||||||||||||||||
| 105 | 13 | 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 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 115 | 1 | my ($self) = @_; | |||||||||||||||||||
| 116 | |||||||||||||||||||||
| 117 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 118 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 119 | } | ||||||||||||||||||||
| 120 | |||||||||||||||||||||
| 121 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 122 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 123 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 124 | |||||||||||||||||||||
| 125 | my $data = { | ||||||||||||||||||||
| 126 | CollectionTtl => $options->{collection_ttl}, | ||||||||||||||||||||
| 127 | Ttl => $options->{ttl}, | ||||||||||||||||||||
| 128 | 1 | }; | |||||||||||||||||||
| 129 | |||||||||||||||||||||
| 130 | my $response = | ||||||||||||||||||||
| 131 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data }); | |||||||||||||||||||
| 132 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 133 | } | ||||||||||||||||||||
| 134 | |||||||||||||||||||||
| 135 | 2 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 136 | 2 | my ($self, $response) = @_; | |||||||||||||||||||
| 137 | return Twilio::Rest::Sync::V1::Service::SyncListInstance->new( | ||||||||||||||||||||
| 138 | $self->{version}, $response->get_content, | ||||||||||||||||||||
| 139 | $self->{solution}{service_sid}, $self->{solution}{sid} | ||||||||||||||||||||
| 140 | 2 | ); | |||||||||||||||||||
| 141 | } | ||||||||||||||||||||
| 142 | |||||||||||||||||||||
| 143 | 6 | ▶ | sub sync_list_items { | ||||||||||||||||||
|
Subroutine
sync_list_items: called CC=2 SCAR=6.9
| |||||||||||||||||||||
| 144 | 6 | my ($self, $index) = @_; | |||||||||||||||||||
| 145 | 6 | require Twilio::Rest::Sync::V1::Service::SyncList::SyncListItem; | |||||||||||||||||||
| 146 | my $list = Twilio::Rest::Sync::V1::Service::SyncList::SyncListItemList->new( | ||||||||||||||||||||
| 147 | $self->{version}, | ||||||||||||||||||||
| 148 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 149 | $self->{solution}{sid} | ||||||||||||||||||||
| 150 | 6 | ); | |||||||||||||||||||
| 151 | 6 | ▶ | return defined $index ? $list->get_context($index) : $list; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 152 | } | ||||||||||||||||||||
| 153 | |||||||||||||||||||||
| 154 | 4 | ▶ | sub sync_list_permissions { | ||||||||||||||||||
|
Subroutine
sync_list_permissions: called CC=2 SCAR=6.9
| |||||||||||||||||||||
| 155 | 4 | my ($self, $identity) = @_; | |||||||||||||||||||
| 156 | 4 | require Twilio::Rest::Sync::V1::Service::SyncList::SyncListPermission; | |||||||||||||||||||
| 157 | my $list = Twilio::Rest::Sync::V1::Service::SyncList::SyncListPermissionList->new( | ||||||||||||||||||||
| 158 | $self->{version}, | ||||||||||||||||||||
| 159 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 160 | $self->{solution}{sid} | ||||||||||||||||||||
| 161 | 4 | ); | |||||||||||||||||||
| 162 | 4 | ▶ | return defined $identity ? $list->get_context($identity) : $list; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 163 | } | ||||||||||||||||||||
| 164 | |||||||||||||||||||||
| 165 | package Twilio::Rest::Sync::V1::Service::SyncListInstance; | ||||||||||||||||||||
| 166 | |||||||||||||||||||||
| 167 | 3 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 168 | |||||||||||||||||||||
| 169 | 3 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 170 | |||||||||||||||||||||
| 171 | 4 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 172 | 4 | my ($class, $version, $payload, $service_sid, $sid) = @_; | |||||||||||||||||||
| 173 | 4 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 174 | 4 | ▶ | $self->{solution} = { service_sid => $service_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"}
| |||||||||||||||||||||
| 175 | 4 | return $self; | |||||||||||||||||||
| 176 | } | ||||||||||||||||||||
| 177 | |||||||||||||||||||||
| 178 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 179 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 180 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 181 | } | ||||||||||||||||||||
| 182 | |||||||||||||||||||||
| 183 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 184 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 185 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 186 | } | ||||||||||||||||||||
| 187 | |||||||||||||||||||||
| 188 | 0 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 189 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 190 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 191 | } | ||||||||||||||||||||
| 192 | |||||||||||||||||||||
| 193 | 0 | ▶ | sub sync_list_items { | ||||||||||||||||||
|
Subroutine
sync_list_items: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 194 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 195 | 0 | return $self->_context->sync_list_items(@arguments); | |||||||||||||||||||
| 196 | } | ||||||||||||||||||||
| 197 | |||||||||||||||||||||
| 198 | 0 | ▶ | sub sync_list_permissions { | ||||||||||||||||||
|
Subroutine
sync_list_permissions: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 199 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 200 | 0 | return $self->_context->sync_list_permissions(@arguments); | |||||||||||||||||||
| 201 | } | ||||||||||||||||||||
| 202 | |||||||||||||||||||||
| 203 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 204 | 0 | my ($self) = @_; | |||||||||||||||||||
| 205 | return Twilio::Rest::Sync::V1::Service::SyncListContext->new( | ||||||||||||||||||||
| 206 | $self->{version}, | ||||||||||||||||||||
| 207 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 208 | $self->{solution}{sid} | ||||||||||||||||||||
| 209 | 0 | ); | |||||||||||||||||||
| 210 | } | ||||||||||||||||||||
| 211 | |||||||||||||||||||||
| 212 | 4 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 213 | 4 | ▶ | sub created_by { return $_[0]{properties}{created_by} } | ||||||||||||||||||
|
Subroutine
created_by: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 214 | 4 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 215 | 4 | ▶ | sub date_expires { return Twilio::Deserialize::date_time($_[0]{properties}{date_expires}) } | ||||||||||||||||||
|
Subroutine
date_expires: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 216 | 4 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 217 | 4 | ▶ | sub links { return $_[0]{properties}{links} } | ||||||||||||||||||
|
Subroutine
links: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 218 | 4 | ▶ | sub revision { return $_[0]{properties}{revision} } | ||||||||||||||||||
|
Subroutine
revision: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 219 | 4 | ▶ | sub service_sid { return $_[0]{properties}{service_sid} } | ||||||||||||||||||
|
Subroutine
service_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 220 | 4 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 221 | 4 | ▶ | sub unique_name { return $_[0]{properties}{unique_name} } | ||||||||||||||||||
|
Subroutine
unique_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 222 | 4 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 223 | |||||||||||||||||||||
| 224 | 3 | 1; | |||||||||||||||||||
| 225 | |||||||||||||||||||||
| 226 | __END__ | ||||||||||||||||||||