| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Supersim::V1::NetworkAccessProfile; | ||||||||||||||||||||
| 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::Supersim::V1::NetworkAccessProfileList; | ||||||||||||||||||||
| 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 | 8 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 8 | my ($class, $version) = @_; | |||||||||||||||||||
| 17 | 8 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 8 | $self->{solution} = {}; | |||||||||||||||||||
| 19 | 8 | $self->{uri} = '/NetworkAccessProfiles'; | |||||||||||||||||||
| 20 | 8 | 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 | Networks => $options->{networks}, | ||||||||||||||||||||
| 29 | UniqueName => $options->{unique_name}, | ||||||||||||||||||||
| 30 | 1 | }; | |||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | my $response = | ||||||||||||||||||||
| 33 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 34 | return Twilio::Rest::Supersim::V1::NetworkAccessProfileInstance->new($self->{version}, | ||||||||||||||||||||
| 35 | 1 | $response->get_content); | |||||||||||||||||||
| 36 | } | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | 0 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 39 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 40 | 0 | return $self->read_records(@arguments); | |||||||||||||||||||
| 41 | } | ||||||||||||||||||||
| 42 | |||||||||||||||||||||
| 43 | 0 | ▶ | sub stream { | ||||||||||||||||||
|
Subroutine
stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 44 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 45 | 0 | return $self->stream_records(@arguments); | |||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 1 | ▶ | sub page { | ||||||||||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 49 | 1 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||||||||||
| 50 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 1 | my $params = { | |||||||||||||||||||
| 53 | PageToken => $page_token, | ||||||||||||||||||||
| 54 | Page => $page_number, | ||||||||||||||||||||
| 55 | PageSize => $page_size, | ||||||||||||||||||||
| 56 | }; | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | 1 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||||||||||
| 59 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 60 | } | ||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 63 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 64 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 65 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 66 | } | ||||||||||||||||||||
| 67 | |||||||||||||||||||||
| 68 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 69 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 70 | return Twilio::Rest::Supersim::V1::NetworkAccessProfilePage->new($self->{version}, $response, | ||||||||||||||||||||
| 71 | 1 | $self->{solution}); | |||||||||||||||||||
| 72 | } | ||||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | 6 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 75 | 6 | my ($self, $sid) = @_; | |||||||||||||||||||
| 76 | 6 | return Twilio::Rest::Supersim::V1::NetworkAccessProfileContext->new($self->{version}, $sid); | |||||||||||||||||||
| 77 | } | ||||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | package Twilio::Rest::Supersim::V1::NetworkAccessProfilePage; | ||||||||||||||||||||
| 80 | |||||||||||||||||||||
| 81 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | 1 | ▶ | sub records_key { return 'network_access_profiles' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 86 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 87 | 1 | return Twilio::Rest::Supersim::V1::NetworkAccessProfileInstance->new($self->{version}, $payload); | |||||||||||||||||||
| 88 | } | ||||||||||||||||||||
| 89 | |||||||||||||||||||||
| 90 | package Twilio::Rest::Supersim::V1::NetworkAccessProfileContext; | ||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 95 | |||||||||||||||||||||
| 96 | 6 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 97 | 6 | my ($class, $version, $sid) = @_; | |||||||||||||||||||
| 98 | 6 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 99 | 6 | $self->{solution} = { sid => $sid }; | |||||||||||||||||||
| 100 | 6 | $self->{uri} = join q{}, '/NetworkAccessProfiles/', Twilio::Serialize::path_segment($sid); | |||||||||||||||||||
| 101 | 6 | return $self; | |||||||||||||||||||
| 102 | } | ||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 105 | 1 | my ($self) = @_; | |||||||||||||||||||
| 106 | |||||||||||||||||||||
| 107 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 108 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 109 | } | ||||||||||||||||||||
| 110 | |||||||||||||||||||||
| 111 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 112 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 113 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 114 | |||||||||||||||||||||
| 115 | 1 | my $data = { UniqueName => $options->{unique_name}, }; | |||||||||||||||||||
| 116 | |||||||||||||||||||||
| 117 | my $response = | ||||||||||||||||||||
| 118 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data }); | |||||||||||||||||||
| 119 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 120 | } | ||||||||||||||||||||
| 121 | |||||||||||||||||||||
| 122 | 2 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 123 | 2 | my ($self, $response) = @_; | |||||||||||||||||||
| 124 | return Twilio::Rest::Supersim::V1::NetworkAccessProfileInstance->new($self->{version}, | ||||||||||||||||||||
| 125 | 2 | $response->get_content, $self->{solution}{sid}); | |||||||||||||||||||
| 126 | } | ||||||||||||||||||||
| 127 | |||||||||||||||||||||
| 128 | 4 | ▶ | sub networks { | ||||||||||||||||||
|
Subroutine
networks: called CC=2 SCAR=6.9
| |||||||||||||||||||||
| 129 | 4 | my ($self, $sid) = @_; | |||||||||||||||||||
| 130 | 4 | require Twilio::Rest::Supersim::V1::NetworkAccessProfile::NetworkAccessProfileNetwork; | |||||||||||||||||||
| 131 | my $list = Twilio::Rest::Supersim::V1::NetworkAccessProfile::NetworkAccessProfileNetworkList->new( | ||||||||||||||||||||
| 132 | 4 | $self->{version}, $self->{solution}{sid}); | |||||||||||||||||||
| 133 | 4 | ▶ | return defined $sid ? $list->get_context($sid) : $list; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 134 | } | ||||||||||||||||||||
| 135 | |||||||||||||||||||||
| 136 | package Twilio::Rest::Supersim::V1::NetworkAccessProfileInstance; | ||||||||||||||||||||
| 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 | 4 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 143 | 4 | my ($class, $version, $payload, $sid) = @_; | |||||||||||||||||||
| 144 | 4 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 145 | 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"}
| |||||||||||||||||||||
| 146 | 4 | return $self; | |||||||||||||||||||
| 147 | } | ||||||||||||||||||||
| 148 | |||||||||||||||||||||
| 149 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 150 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 151 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 152 | } | ||||||||||||||||||||
| 153 | |||||||||||||||||||||
| 154 | 0 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 155 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 156 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 157 | } | ||||||||||||||||||||
| 158 | |||||||||||||||||||||
| 159 | 0 | ▶ | sub networks { | ||||||||||||||||||
|
Subroutine
networks: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 160 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 161 | 0 | return $self->_context->networks(@arguments); | |||||||||||||||||||
| 162 | } | ||||||||||||||||||||
| 163 | |||||||||||||||||||||
| 164 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 165 | 0 | my ($self) = @_; | |||||||||||||||||||
| 166 | return Twilio::Rest::Supersim::V1::NetworkAccessProfileContext->new($self->{version}, | ||||||||||||||||||||
| 167 | 0 | $self->{solution}{sid}); | |||||||||||||||||||
| 168 | } | ||||||||||||||||||||
| 169 | |||||||||||||||||||||
| 170 | 4 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 171 | 4 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 172 | 4 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 173 | 4 | ▶ | sub links { return $_[0]{properties}{links} } | ||||||||||||||||||
|
Subroutine
links: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 174 | 4 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 175 | 4 | ▶ | sub unique_name { return $_[0]{properties}{unique_name} } | ||||||||||||||||||
|
Subroutine
unique_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 176 | 4 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 177 | |||||||||||||||||||||
| 178 | 2 | 1; | |||||||||||||||||||
| 179 | |||||||||||||||||||||
| 180 | __END__ | ||||||||||||||||||||