Twilio/Rest/Supersim/V1/SmsCommand.pm

filter: Statementstmt 86.9% 73 / 84 Branchbran n/a Conditioncond 57.1% 4 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 85.2% 29 / 34 Podpod n/a totaltotal 82.1% 106 / 129 CC 4 SCAR 2.6
CC
4
Cov
85%
create
2.0
page
2.0
new
2.0
CRAP 1.3
« Twilio/Rest/Insights/V3/QueryJob.pm ↑ Summary Twilio/Rest/Messaging/V1/BrandRegistration/BrandVetting.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Supersim::V1::SmsCommand;
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::SmsCommandList;
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 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 3 my ($class, $version) = @_;
17 3 my $self = $class->SUPER::new($version);
18 3 $self->{solution} = {};
19 3 $self->{uri} = '/SmsCommands';
20 3 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 1 my ($self, $sim, $payload, $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 Sim => $sim,
29 Payload => $payload,
30 CallbackMethod => $options->{callback_method},
31 CallbackUrl => $options->{callback_url},
32 1 };
33  
34 my $response =
35 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
36 return Twilio::Rest::Supersim::V1::SmsCommandInstance->new($self->{version},
37 1 $response->get_content);
38 }
39  
40 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
41 0 my ($self, @arguments) = @_;
42 0 return $self->read_records(@arguments);
43 }
44  
45 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
46 0 my ($self, @arguments) = @_;
47 0 return $self->stream_records(@arguments);
48 }
49  
50 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
51 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
52 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
53  
54 my $params = {
55 Direction => $options->{direction},
56 Sim => $options->{sim},
57 Status => $options->{status},
58 1 PageToken => $page_token,
59 Page => $page_number,
60 PageSize => $page_size,
61 };
62  
63 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
64 1 return $self->_build_page($response);
65 }
66  
67 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
68 0 my ($self, $target_url) = @_;
69 0 my $client = $self->{version}->get_domain->get_client;
70 0 return $self->_build_page($client->request('GET', $target_url));
71 }
72  
73 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
74 1 my ($self, $response) = @_;
75 return Twilio::Rest::Supersim::V1::SmsCommandPage->new($self->{version}, $response,
76 1 $self->{solution});
77 }
78  
79 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
80 1 my ($self, $sid) = @_;
81 1 return Twilio::Rest::Supersim::V1::SmsCommandContext->new($self->{version}, $sid);
82 }
83  
84 package Twilio::Rest::Supersim::V1::SmsCommandPage;
85  
86 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
87  
88 1 ▶sub records_key { return 'sms_commands' }
Subroutine records_key: called CC=1 SCAR=0.0
89  
90 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
91 1 my ($self, $payload) = @_;
92 1 return Twilio::Rest::Supersim::V1::SmsCommandInstance->new($self->{version}, $payload);
93 }
94  
95 package Twilio::Rest::Supersim::V1::SmsCommandContext;
96  
97 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
98  
99 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
100  
101 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
102 1 my ($class, $version, $sid) = @_;
103 1 my $self = $class->SUPER::new($version);
104 1 $self->{solution} = { sid => $sid };
105 1 $self->{uri} = join q{}, '/SmsCommands/', Twilio::Serialize::path_segment($sid);
106 1 return $self;
107 }
108  
109 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
110 1 my ($self) = @_;
111  
112 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
113 1 return $self->_build_instance($response);
114 }
115  
116 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
117 1 my ($self, $response) = @_;
118 return Twilio::Rest::Supersim::V1::SmsCommandInstance->new($self->{version},
119 1 $response->get_content, $self->{solution}{sid});
120 }
121  
122 package Twilio::Rest::Supersim::V1::SmsCommandInstance;
123  
124 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
125  
126 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
127  
128 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
129 3 my ($class, $version, $payload, $sid) = @_;
130 3 my $self = $class->SUPER::new($version, $payload);
131 3 ▶ $self->{solution} = { sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
120
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
132 3 return $self;
133 }
134  
135 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
136 0 my ($self, @arguments) = @_;
137 0 return $self->_context->fetch(@arguments);
138 }
139  
140 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
141 0 my ($self) = @_;
142 return Twilio::Rest::Supersim::V1::SmsCommandContext->new($self->{version},
143 0 $self->{solution}{sid});
144 }
145  
146 3 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
147 3 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
148 3 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
149 3 ▶sub direction { return $_[0]{properties}{direction} }
Subroutine direction: called CC=1 SCAR=0.0
150 3 ▶sub payload { return $_[0]{properties}{payload} }
Subroutine payload: called CC=1 SCAR=0.0
151 3 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
152 3 ▶sub sim_sid { return $_[0]{properties}{sim_sid} }
Subroutine sim_sid: called CC=1 SCAR=0.0
153 3 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
154 3 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
155  
156 2 1;
157  
158 __END__
« Twilio/Rest/Insights/V3/QueryJob.pm ↑ Summary Twilio/Rest/Messaging/V1/BrandRegistration/BrandVetting.pm »