Twilio/Rest/Events/V1/Schema.pm

filter: Statementstmt 90.1% 55 / 61 Branchbran 100% 2 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 86.9% 20 / 23 Podpod n/a totaltotal 85.7% 78 / 91 CC 3 SCAR 2.5
CC
3
Cov
88%
new
2.1
versions
2.0
fetch
2.0
CRAP 1.3
« Twilio/Rest/Messaging/V1/Deactivations.pm ↑ Summary Twilio/ListResource.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Events::V1::Schema;
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::Events::V1::SchemaList;
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} = '/Schemas';
20 3 return $self;
21 }
22  
23 3 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
24 3 my ($self, $id) = @_;
25 3 return Twilio::Rest::Events::V1::SchemaContext->new($self->{version}, $id);
26 }
27  
28 package Twilio::Rest::Events::V1::SchemaContext;
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 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
35 3 my ($class, $version, $id) = @_;
36 3 my $self = $class->SUPER::new($version);
37 3 $self->{solution} = { id => $id };
38 3 $self->{uri} = join q{}, '/Schemas/', Twilio::Serialize::path_segment($id);
39 3 return $self;
40 }
41  
42 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
43 1 my ($self) = @_;
44  
45 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
46 1 return $self->_build_instance($response);
47 }
48  
49 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
50 1 my ($self, $response) = @_;
51 return Twilio::Rest::Events::V1::SchemaInstance->new($self->{version}, $response->get_content,
52 1 $self->{solution}{id});
53 }
54  
55 2 ▶sub versions {
Subroutine versions: called CC=2 SCAR=6.9
56 2 my ($self, $schema_version) = @_;
57 2 require Twilio::Rest::Events::V1::Schema::SchemaVersion;
58 my $list = Twilio::Rest::Events::V1::Schema::SchemaVersionList->new($self->{version},
59 2 $self->{solution}{id});
60 2 ▶ return defined $schema_version ? $list->get_context($schema_version) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $schema_version ? : 1 1 2
61 }
62  
63 package Twilio::Rest::Events::V1::SchemaInstance;
64  
65 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
66  
67 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
68  
69 1 ▶sub new {
Subroutine new: called CC=2 SCAR=7.4
70 1 my ($class, $version, $payload, $id) = @_;
71 1 my $self = $class->SUPER::new($version, $payload);
72 1 ▶ $self->{solution} = { id => $id // $self->{properties}{id} };
Condition33%1/3
$id // $self->{"properties"}{"id"}
l!l&&r!l&&!r
100
MC/DC0%0/2
$id // $self->{"properties"}{"id"}
$id $self->{"properties"}{"id"}
Truth table33%1/3
A // B
A= $idB= $self->{"properties"}{"id"}
ABresult
1X1
011
000
73 1 return $self;
74 }
75  
76 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
77 0 my ($self, @arguments) = @_;
78 0 return $self->_context->fetch(@arguments);
79 }
80  
81 0 ▶sub versions {
Subroutine versions: not called CC=1 SCAR=6.9
82 0 my ($self, @arguments) = @_;
83 0 return $self->_context->versions(@arguments);
84 }
85  
86 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
87 0 my ($self) = @_;
88 0 return Twilio::Rest::Events::V1::SchemaContext->new($self->{version}, $self->{solution}{id});
89 }
90  
91 1 ▶sub id { return $_[0]{properties}{id} }
Subroutine id: called CC=1 SCAR=0.0
92 1 ▶sub latest_version { return $_[0]{properties}{latest_version} }
Subroutine latest_version: called CC=1 SCAR=0.0
93  
94 1 ▶sub latest_version_date_created {
Subroutine latest_version_date_created: called CC=1 SCAR=0.0
95 1 return Twilio::Deserialize::date_time($_[0]{properties}{latest_version_date_created});
96 }
97 1 ▶sub links { return $_[0]{properties}{links} }
Subroutine links: called CC=1 SCAR=0.0
98 1 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
99  
100 2 1;
101  
102 __END__
« Twilio/Rest/Messaging/V1/Deactivations.pm ↑ Summary Twilio/ListResource.pm »