Twilio/Rest/Memory/V1/Operation.pm

filter: Statementstmt 93.1% 54 / 58 Branchbran n/a Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 91.6% 22 / 24 Podpod n/a totaltotal 88.5% 77 / 87 CC 2 SCAR 1.5
CC
2
Cov
90%
new
2.1
fetch
2.0
_context
2.0
CRAP 1.2
« Twilio/Rest/Knowledge/V2/Operation.pm ↑ Summary Twilio/Rest/Iam/V1/OAuthApp.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Memory::V1::Operation;
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::Memory::V1::OperationList;
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 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 1 my ($class, $version) = @_;
17 1 my $self = $class->SUPER::new($version);
18 1 $self->{solution} = {};
19 1 $self->{uri} = '/ControlPlane/Operations';
20 1 return $self;
21 }
22  
23 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
24 1 my ($self, $operation_id) = @_;
25 1 return Twilio::Rest::Memory::V1::OperationContext->new($self->{version}, $operation_id);
26 }
27  
28 package Twilio::Rest::Memory::V1::OperationContext;
29  
30 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
35 1 my ($class, $version, $operation_id) = @_;
36 1 my $self = $class->SUPER::new($version);
37 1 $self->{solution} = { operation_id => $operation_id };
38 1 $self->{uri} = join q{}, '/ControlPlane/Operations/',
39 Twilio::Serialize::path_segment($operation_id);
40 1 return $self;
41 }
42  
43 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
44 1 my ($self) = @_;
45  
46 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
47 1 return $self->_build_instance($response);
48 }
49  
50 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
51 1 my ($self, $response) = @_;
52 return Twilio::Rest::Memory::V1::OperationInstance->new($self->{version}, $response->get_content,
53 1 $self->{solution}{operation_id});
54 }
55  
56 package Twilio::Rest::Memory::V1::OperationInstance;
57  
58 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
59  
60 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
61  
62 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.4
63 1 my ($class, $version, $payload, $operation_id) = @_;
64 1 my $self = $class->SUPER::new($version, $payload);
65 1 ▶ $self->{solution} = { operation_id => $operation_id // $self->{properties}{operationId} };
Condition33%1/3
$operation_id // $self->{"properties"}{"operationId"}
l!l&&r!l&&!r
100
MC/DC0%0/2
$operation_id // $self->{"properties"}{"operationId"}
$operation_id $self->{"properties"}{"operationId"}
Truth table33%1/3
A // B
A= $operation_idB= $self->{"properties"}{"operationId"}
ABresult
1X1
011
000
66 1 return $self;
67 }
68  
69 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
70 0 my ($self, @arguments) = @_;
71 0 return $self->_context->fetch(@arguments);
72 }
73  
74 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
75 0 my ($self) = @_;
76 return Twilio::Rest::Memory::V1::OperationContext->new($self->{version},
77 0 $self->{solution}{operation_id});
78 }
79  
80 1 ▶sub completed_at { return Twilio::Deserialize::date_time($_[0]{properties}{completedAt}) }
Subroutine completed_at: called CC=1 SCAR=0.0
81 1 ▶sub created_at { return Twilio::Deserialize::date_time($_[0]{properties}{createdAt}) }
Subroutine created_at: called CC=1 SCAR=0.0
82 1 ▶sub error { return $_[0]{properties}{error} }
Subroutine error: called CC=1 SCAR=0.0
83 1 ▶sub operation_id { return $_[0]{properties}{operationId} }
Subroutine operation_id: called CC=1 SCAR=0.0
84 1 ▶sub result { return $_[0]{properties}{result} }
Subroutine result: called CC=1 SCAR=0.0
85 1 ▶sub result_url { return $_[0]{properties}{resultUrl} }
Subroutine result_url: called CC=1 SCAR=0.0
86 1 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
87 1 ▶sub status_url { return $_[0]{properties}{statusUrl} }
Subroutine status_url: called CC=1 SCAR=0.0
88  
89 2 1;
90  
91 __END__
« Twilio/Rest/Knowledge/V2/Operation.pm ↑ Summary Twilio/Rest/Iam/V1/OAuthApp.pm »