Twilio/Rest/Supersim/V1/Fleet.pm

filter: Statementstmt 86.6% 84 / 97 Branchbran n/a Conditioncond 55.5% 5 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 85.7% 36 / 42 Podpod n/a totaltotal 81.7% 125 / 153 CC 5 SCAR 2.7
CC
5
Cov
84%
create
2.0
page
2.0
update
2.0
CRAP 1.3
« Twilio/Rest/Wireless/V1/RatePlan.pm ↑ Summary Twilio/Rest/Serverless/V1/Service/Environment/Deployment.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Supersim::V1::Fleet;
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::FleetList;
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) = @_;
17 4 my $self = $class->SUPER::new($version);
18 4 $self->{solution} = {};
19 4 $self->{uri} = '/Fleets';
20 4 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 1 my ($self, $network_access_profile, $options) = @_;
25 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
26  
27 my $data = {
28 NetworkAccessProfile => $network_access_profile,
29 DataEnabled => Twilio::Serialize::boolean_to_string($options->{data_enabled}),
30 DataLimit => $options->{data_limit},
31 IpCommandsMethod => $options->{ip_commands_method},
32 IpCommandsUrl => $options->{ip_commands_url},
33 SmsCommandsEnabled => Twilio::Serialize::boolean_to_string($options->{sms_commands_enabled}),
34 SmsCommandsMethod => $options->{sms_commands_method},
35 SmsCommandsUrl => $options->{sms_commands_url},
36 UniqueName => $options->{unique_name},
37 1 };
38  
39 my $response =
40 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
41 1 return Twilio::Rest::Supersim::V1::FleetInstance->new($self->{version}, $response->get_content);
42 }
43  
44 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
45 0 my ($self, @arguments) = @_;
46 0 return $self->read_records(@arguments);
47 }
48  
49 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
50 0 my ($self, @arguments) = @_;
51 0 return $self->stream_records(@arguments);
52 }
53  
54 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
55 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
56 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
57  
58 my $params = {
59 NetworkAccessProfile => $options->{network_access_profile},
60 1 PageToken => $page_token,
61 Page => $page_number,
62 PageSize => $page_size,
63 };
64  
65 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
66 1 return $self->_build_page($response);
67 }
68  
69 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
70 0 my ($self, $target_url) = @_;
71 0 my $client = $self->{version}->get_domain->get_client;
72 0 return $self->_build_page($client->request('GET', $target_url));
73 }
74  
75 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
76 1 my ($self, $response) = @_;
77 1 return Twilio::Rest::Supersim::V1::FleetPage->new($self->{version}, $response, $self->{solution});
78 }
79  
80 2 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
81 2 my ($self, $sid) = @_;
82 2 return Twilio::Rest::Supersim::V1::FleetContext->new($self->{version}, $sid);
83 }
84  
85 package Twilio::Rest::Supersim::V1::FleetPage;
86  
87 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
88  
89 1 ▶sub records_key { return 'fleets' }
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 1 return Twilio::Rest::Supersim::V1::FleetInstance->new($self->{version}, $payload);
94 }
95  
96 package Twilio::Rest::Supersim::V1::FleetContext;
97  
98 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
99  
100 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
101  
102 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
103 2 my ($class, $version, $sid) = @_;
104 2 my $self = $class->SUPER::new($version);
105 2 $self->{solution} = { sid => $sid };
106 2 $self->{uri} = join q{}, '/Fleets/', Twilio::Serialize::path_segment($sid);
107 2 return $self;
108 }
109  
110 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
111 1 my ($self) = @_;
112  
113 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
114 1 return $self->_build_instance($response);
115 }
116  
117 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
118 1 my ($self, $options) = @_;
119 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
120  
121 my $data = {
122 DataLimit => $options->{data_limit},
123 IpCommandsMethod => $options->{ip_commands_method},
124 IpCommandsUrl => $options->{ip_commands_url},
125 NetworkAccessProfile => $options->{network_access_profile},
126 SmsCommandsMethod => $options->{sms_commands_method},
127 SmsCommandsUrl => $options->{sms_commands_url},
128 UniqueName => $options->{unique_name},
129 1 };
130  
131 my $response =
132 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
133 1 return $self->_build_instance($response);
134 }
135  
136 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
137 2 my ($self, $response) = @_;
138 return Twilio::Rest::Supersim::V1::FleetInstance->new($self->{version}, $response->get_content,
139 2 $self->{solution}{sid});
140 }
141  
142 package Twilio::Rest::Supersim::V1::FleetInstance;
143  
144 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
145  
146 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
147  
148 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
149 4 my ($class, $version, $payload, $sid) = @_;
150 4 my $self = $class->SUPER::new($version, $payload);
151 4 ▶ $self->{solution} = { sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
220
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
152 4 return $self;
153 }
154  
155 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
156 0 my ($self, @arguments) = @_;
157 0 return $self->_context->fetch(@arguments);
158 }
159  
160 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
161 0 my ($self, @arguments) = @_;
162 0 return $self->_context->update(@arguments);
163 }
164  
165 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
166 0 my ($self) = @_;
167 0 return Twilio::Rest::Supersim::V1::FleetContext->new($self->{version}, $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 data_enabled { return $_[0]{properties}{data_enabled} }
Subroutine data_enabled: called CC=1 SCAR=0.0
172 4 ▶sub data_limit { return $_[0]{properties}{data_limit} }
Subroutine data_limit: called CC=1 SCAR=0.0
173 4 ▶sub data_metering { return $_[0]{properties}{data_metering} }
Subroutine data_metering: called CC=1 SCAR=0.0
174 4 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
175 4 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
176 4 ▶sub ip_commands_method { return $_[0]{properties}{ip_commands_method} }
Subroutine ip_commands_method: called CC=1 SCAR=0.0
177 4 ▶sub ip_commands_url { return $_[0]{properties}{ip_commands_url} }
Subroutine ip_commands_url: called CC=1 SCAR=0.0
178 4 ▶sub network_access_profile_sid { return $_[0]{properties}{network_access_profile_sid} }
Subroutine network_access_profile_sid: 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 sms_commands_enabled { return $_[0]{properties}{sms_commands_enabled} }
Subroutine sms_commands_enabled: called CC=1 SCAR=0.0
181 4 ▶sub sms_commands_method { return $_[0]{properties}{sms_commands_method} }
Subroutine sms_commands_method: called CC=1 SCAR=0.0
182 4 ▶sub sms_commands_url { return $_[0]{properties}{sms_commands_url} }
Subroutine sms_commands_url: called CC=1 SCAR=0.0
183 4 ▶sub unique_name { return $_[0]{properties}{unique_name} }
Subroutine unique_name: called CC=1 SCAR=0.0
184 4 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
185  
186 2 1;
187  
188 __END__
« Twilio/Rest/Wireless/V1/RatePlan.pm ↑ Summary Twilio/Rest/Serverless/V1/Service/Environment/Deployment.pm »