Twilio/Rest/Insights/V2/Report.pm

filter: Statementstmt 93.3% 56 / 60 Branchbran n/a Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 91.3% 21 / 23 Podpod n/a totaltotal 89.7% 79 / 88 CC 2 SCAR 1.5
CC
2
Cov
92%
new
2.0
fetch
2.0
_context
2.0
CRAP 1.2
« Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatistics.pm ↑ Summary Twilio/Rest/Numbers/V1/BulkEligibility.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Insights::V2::Report;
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::Insights::V2::ReportList;
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} = '/Voice/Reports';
20 2 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
24 1 my ($self, $body) = @_;
25  
26 1 my $data = Twilio::Serialize::json_body($body, {});
27  
28 my $response = $self->{version}->handle_request(
29 'POST',
30 $self->{uri},
31 1 'create',
32 {
33 data => $data,
34 headers => { 'Content-Type' => 'application/json', }
35 }
36 );
37 1 return Twilio::Rest::Insights::V2::ReportInstance->new($self->{version}, $response->get_content);
38 }
39  
40 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
41 1 my ($self, $report_id) = @_;
42 1 return Twilio::Rest::Insights::V2::ReportContext->new($self->{version}, $report_id);
43 }
44  
45 package Twilio::Rest::Insights::V2::ReportContext;
46  
47 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
48  
49 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
50  
51 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
52 1 my ($class, $version, $report_id) = @_;
53 1 my $self = $class->SUPER::new($version);
54 1 $self->{solution} = { report_id => $report_id };
55 1 $self->{uri} = join q{}, '/Voice/Reports/', Twilio::Serialize::path_segment($report_id);
56 1 return $self;
57 }
58  
59 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
60 1 my ($self) = @_;
61  
62 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
63 1 return $self->_build_instance($response);
64 }
65  
66 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
67 1 my ($self, $response) = @_;
68 return Twilio::Rest::Insights::V2::ReportInstance->new($self->{version}, $response->get_content,
69 1 $self->{solution}{report_id});
70 }
71  
72 package Twilio::Rest::Insights::V2::ReportInstance;
73  
74 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
75  
76 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
77  
78 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
79 2 my ($class, $version, $payload, $report_id) = @_;
80 2 my $self = $class->SUPER::new($version, $payload);
81 2 ▶ $self->{solution} = { report_id => $report_id // $self->{properties}{report_id} };
Condition66%2/3
$report_id // $self->{"properties"}{"report_id"}
l!l&&r!l&&!r
110
MC/DC0%0/2
$report_id // $self->{"properties"}{"report_id"}
$report_id $self->{"properties"}{"report_id"}
Truth table66%2/3
A // B
A= $report_idB= $self->{"properties"}{"report_id"}
ABresult
1X1
011
000
82 2 return $self;
83 }
84  
85 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
86 0 my ($self, @arguments) = @_;
87 0 return $self->_context->fetch(@arguments);
88 }
89  
90 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
91 0 my ($self) = @_;
92 return Twilio::Rest::Insights::V2::ReportContext->new($self->{version},
93 0 $self->{solution}{report_id});
94 }
95  
96 2 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
97 1 ▶sub report { return $_[0]{properties}{report} }
Subroutine report: called CC=1 SCAR=0.0
98 2 ▶sub report_id { return $_[0]{properties}{report_id} }
Subroutine report_id: called CC=1 SCAR=0.0
99 2 ▶sub request_meta { return $_[0]{properties}{request_meta} }
Subroutine request_meta: called CC=1 SCAR=0.0
100 2 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
101 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
102  
103 2 1;
104  
105 __END__
« Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatistics.pm ↑ Summary Twilio/Rest/Numbers/V1/BulkEligibility.pm »