Twilio/Rest/Supersim/V1/Network.pm

filter: Statementstmt 85.3% 64 / 75 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 82.7% 24 / 29 Podpod n/a totaltotal 81.2% 91 / 112 CC 3 SCAR 2.6
CC
3
Cov
84%
page
2.0
new
2.0
read
2.0
CRAP 1.3
« Twilio/Rest/Pricing/V1/PhoneNumber/Country.pm ↑ Summary Twilio/Rest/Trusthub/V1/EndUserType.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Supersim::V1::Network;
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::NetworkList;
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 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 2 my ($class, $version) = @_;
17 2 my $self = $class->SUPER::new($version);
18 2 $self->{solution} = {};
19 2 $self->{uri} = '/Networks';
20 2 return $self;
21 }
22  
23 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
24 0 my ($self, @arguments) = @_;
25 0 return $self->read_records(@arguments);
26 }
27  
28 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
29 0 my ($self, @arguments) = @_;
30 0 return $self->stream_records(@arguments);
31 }
32  
33 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
34 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
35 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
10
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
36  
37 my $params = {
38 IsoCountry => $options->{iso_country},
39 Mcc => $options->{mcc},
40 Mnc => $options->{mnc},
41 1 PageToken => $page_token,
42 Page => $page_number,
43 PageSize => $page_size,
44 };
45  
46 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
47 1 return $self->_build_page($response);
48 }
49  
50 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
51 0 my ($self, $target_url) = @_;
52 0 my $client = $self->{version}->get_domain->get_client;
53 0 return $self->_build_page($client->request('GET', $target_url));
54 }
55  
56 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
57 1 my ($self, $response) = @_;
58 return Twilio::Rest::Supersim::V1::NetworkPage->new($self->{version}, $response,
59 1 $self->{solution});
60 }
61  
62 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
63 1 my ($self, $sid) = @_;
64 1 return Twilio::Rest::Supersim::V1::NetworkContext->new($self->{version}, $sid);
65 }
66  
67 package Twilio::Rest::Supersim::V1::NetworkPage;
68  
69 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
70  
71 1 ▶sub records_key { return 'networks' }
Subroutine records_key: called CC=1 SCAR=0.0
72  
73 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
74 1 my ($self, $payload) = @_;
75 1 return Twilio::Rest::Supersim::V1::NetworkInstance->new($self->{version}, $payload);
76 }
77  
78 package Twilio::Rest::Supersim::V1::NetworkContext;
79  
80 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
81  
82 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
83  
84 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
85 1 my ($class, $version, $sid) = @_;
86 1 my $self = $class->SUPER::new($version);
87 1 $self->{solution} = { sid => $sid };
88 1 $self->{uri} = join q{}, '/Networks/', Twilio::Serialize::path_segment($sid);
89 1 return $self;
90 }
91  
92 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
93 1 my ($self) = @_;
94  
95 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
96 1 return $self->_build_instance($response);
97 }
98  
99 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
100 1 my ($self, $response) = @_;
101 return Twilio::Rest::Supersim::V1::NetworkInstance->new($self->{version}, $response->get_content,
102 1 $self->{solution}{sid});
103 }
104  
105 package Twilio::Rest::Supersim::V1::NetworkInstance;
106  
107 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
108  
109 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
110  
111 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
112 2 my ($class, $version, $payload, $sid) = @_;
113 2 my $self = $class->SUPER::new($version, $payload);
114 2 ▶ $self->{solution} = { sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
110
MC/DC0%0/2
$sid // $self->{"properties"}{"sid"}
$sid $self->{"properties"}{"sid"}
Truth table66%2/3
A // B
A= $sidB= $self->{"properties"}{"sid"}
ABresult
1X1
011
000
115 2 return $self;
116 }
117  
118 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
119 0 my ($self, @arguments) = @_;
120 0 return $self->_context->fetch(@arguments);
121 }
122  
123 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
124 0 my ($self) = @_;
125 0 return Twilio::Rest::Supersim::V1::NetworkContext->new($self->{version}, $self->{solution}{sid});
126 }
127  
128 2 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
129 2 ▶sub identifiers { return $_[0]{properties}{identifiers} }
Subroutine identifiers: called CC=1 SCAR=0.0
130 2 ▶sub iso_country { return $_[0]{properties}{iso_country} }
Subroutine iso_country: called CC=1 SCAR=0.0
131 2 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
132 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
133  
134 2 1;
135  
136 __END__
« Twilio/Rest/Pricing/V1/PhoneNumber/Country.pm ↑ Summary Twilio/Rest/Trusthub/V1/EndUserType.pm »