| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Numbers::V2::RegulatoryCompliance::EndUser; | ||||||||||||||||||||
| 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::Numbers::V2::RegulatoryCompliance::EndUserList; | ||||||||||||||||||||
| 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) = @_; | |||||||||||||||||||
| 17 | 5 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 5 | $self->{solution} = {}; | |||||||||||||||||||
| 19 | 5 | $self->{uri} = '/RegulatoryCompliance/EndUsers'; | |||||||||||||||||||
| 20 | 5 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 24 | 1 | my ($self, $friendly_name, $type, $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 | FriendlyName => $friendly_name, | ||||||||||||||||||||
| 29 | Type => $type, | ||||||||||||||||||||
| 30 | 1 | Attributes => Twilio::Serialize::json_object($options->{attributes}), | |||||||||||||||||||
| 31 | }; | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | my $response = | ||||||||||||||||||||
| 34 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 35 | return Twilio::Rest::Numbers::V2::RegulatoryCompliance::EndUserInstance->new($self->{version}, | ||||||||||||||||||||
| 36 | 1 | $response->get_content); | |||||||||||||||||||
| 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::Numbers::V2::RegulatoryCompliance::EndUserPage->new($self->{version}, | ||||||||||||||||||||
| 72 | 1 | $response, $self->{solution}); | |||||||||||||||||||
| 73 | } | ||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 3 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 76 | 3 | my ($self, $sid) = @_; | |||||||||||||||||||
| 77 | return Twilio::Rest::Numbers::V2::RegulatoryCompliance::EndUserContext->new($self->{version}, | ||||||||||||||||||||
| 78 | 3 | $sid); | |||||||||||||||||||
| 79 | } | ||||||||||||||||||||
| 80 | |||||||||||||||||||||
| 81 | package Twilio::Rest::Numbers::V2::RegulatoryCompliance::EndUserPage; | ||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | 1 | ▶ | sub records_key { return 'results' } | ||||||||||||||||||
|
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::Numbers::V2::RegulatoryCompliance::EndUserInstance->new($self->{version}, | ||||||||||||||||||||
| 90 | 1 | $payload); | |||||||||||||||||||
| 91 | } | ||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | package Twilio::Rest::Numbers::V2::RegulatoryCompliance::EndUserContext; | ||||||||||||||||||||
| 94 | |||||||||||||||||||||
| 95 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 96 | |||||||||||||||||||||
| 97 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 98 | |||||||||||||||||||||
| 99 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 100 | 3 | my ($class, $version, $sid) = @_; | |||||||||||||||||||
| 101 | 3 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 102 | 3 | $self->{solution} = { sid => $sid }; | |||||||||||||||||||
| 103 | 3 | $self->{uri} = join q{}, '/RegulatoryCompliance/EndUsers/', Twilio::Serialize::path_segment($sid); | |||||||||||||||||||
| 104 | 3 | return $self; | |||||||||||||||||||
| 105 | } | ||||||||||||||||||||
| 106 | |||||||||||||||||||||
| 107 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 108 | 1 | my ($self) = @_; | |||||||||||||||||||
| 109 | 1 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete'); | |||||||||||||||||||
| 110 | 1 | return 1; | |||||||||||||||||||
| 111 | } | ||||||||||||||||||||
| 112 | |||||||||||||||||||||
| 113 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 114 | 1 | my ($self) = @_; | |||||||||||||||||||
| 115 | |||||||||||||||||||||
| 116 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 117 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 118 | } | ||||||||||||||||||||
| 119 | |||||||||||||||||||||
| 120 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 121 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 122 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 123 | |||||||||||||||||||||
| 124 | my $data = { | ||||||||||||||||||||
| 125 | Attributes => Twilio::Serialize::json_object($options->{attributes}), | ||||||||||||||||||||
| 126 | FriendlyName => $options->{friendly_name}, | ||||||||||||||||||||
| 127 | 1 | }; | |||||||||||||||||||
| 128 | |||||||||||||||||||||
| 129 | my $response = | ||||||||||||||||||||
| 130 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data }); | |||||||||||||||||||
| 131 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 132 | } | ||||||||||||||||||||
| 133 | |||||||||||||||||||||
| 134 | 2 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 135 | 2 | my ($self, $response) = @_; | |||||||||||||||||||
| 136 | return Twilio::Rest::Numbers::V2::RegulatoryCompliance::EndUserInstance->new($self->{version}, | ||||||||||||||||||||
| 137 | 2 | $response->get_content, $self->{solution}{sid}); | |||||||||||||||||||
| 138 | } | ||||||||||||||||||||
| 139 | |||||||||||||||||||||
| 140 | package Twilio::Rest::Numbers::V2::RegulatoryCompliance::EndUserInstance; | ||||||||||||||||||||
| 141 | |||||||||||||||||||||
| 142 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 143 | |||||||||||||||||||||
| 144 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 145 | |||||||||||||||||||||
| 146 | 4 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 147 | 4 | my ($class, $version, $payload, $sid) = @_; | |||||||||||||||||||
| 148 | 4 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 149 | 4 | ▶ | $self->{solution} = { 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"}
| |||||||||||||||||||||
| 150 | 4 | return $self; | |||||||||||||||||||
| 151 | } | ||||||||||||||||||||
| 152 | |||||||||||||||||||||
| 153 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 154 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 155 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 156 | } | ||||||||||||||||||||
| 157 | |||||||||||||||||||||
| 158 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 159 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 160 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 161 | } | ||||||||||||||||||||
| 162 | |||||||||||||||||||||
| 163 | 0 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 164 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 165 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 166 | } | ||||||||||||||||||||
| 167 | |||||||||||||||||||||
| 168 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 169 | 0 | my ($self) = @_; | |||||||||||||||||||
| 170 | return Twilio::Rest::Numbers::V2::RegulatoryCompliance::EndUserContext->new($self->{version}, | ||||||||||||||||||||
| 171 | 0 | $self->{solution}{sid}); | |||||||||||||||||||
| 172 | } | ||||||||||||||||||||
| 173 | |||||||||||||||||||||
| 174 | 4 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 175 | 4 | ▶ | sub attributes { return $_[0]{properties}{attributes} } | ||||||||||||||||||
|
Subroutine
attributes: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 176 | 4 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 177 | 4 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 178 | 4 | ▶ | sub friendly_name { return $_[0]{properties}{friendly_name} } | ||||||||||||||||||
|
Subroutine
friendly_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 179 | 4 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 180 | 4 | ▶ | sub type { return $_[0]{properties}{type} } | ||||||||||||||||||
|
Subroutine
type: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 181 | 4 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 182 | |||||||||||||||||||||
| 183 | 2 | 1; | |||||||||||||||||||
| 184 | |||||||||||||||||||||
| 185 | __END__ | ||||||||||||||||||||