Twilio/Rest/Events/V1/Schema/SchemaVersion.pm

filter: Statementstmt 85.3% 64 / 75 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 82.7% 24 / 29 Podpod n/a totaltotal 81.2% 91 / 112 CC 3 SCAR 2.6
CC
3
Cov
84%
page
2.0
new
2.0
read
2.0
CRAP 1.3
« Twilio/Rest/IpMessaging/V2/Service/Channel/Invite.pm ↑ Summary Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserType.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Events::V1::Schema::SchemaVersion;
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::Schema::SchemaVersionList;
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, $id) = @_;
17 2 my $self = $class->SUPER::new($version);
18 2 $self->{solution} = { id => $id };
19 2 $self->{uri} = join q{}, '/Schemas/', Twilio::Serialize::path_segment($id), '/Versions';
20 2 return $self;
21 }
22  
23 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
24 0 my ($self, @arguments) = @_;
25 0 return $self->read_records(@arguments);
26 }
27  
28 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
29 0 my ($self, @arguments) = @_;
30 0 return $self->stream_records(@arguments);
31 }
32  
33 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
34 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
35 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
01
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
36  
37 1 my $params = {
38 PageToken => $page_token,
39 Page => $page_number,
40 PageSize => $page_size,
41 };
42  
43 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
44 1 return $self->_build_page($response);
45 }
46  
47 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
48 0 my ($self, $target_url) = @_;
49 0 my $client = $self->{version}->get_domain->get_client;
50 0 return $self->_build_page($client->request('GET', $target_url));
51 }
52  
53 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
54 1 my ($self, $response) = @_;
55 return Twilio::Rest::Events::V1::Schema::SchemaVersionPage->new($self->{version}, $response,
56 1 $self->{solution});
57 }
58  
59 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
60 1 my ($self, $schema_version) = @_;
61 return Twilio::Rest::Events::V1::Schema::SchemaVersionContext->new($self->{version},
62 $self->{solution}{id},
63 1 $schema_version);
64 }
65  
66 package Twilio::Rest::Events::V1::Schema::SchemaVersionPage;
67  
68 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
69  
70 1 ▶sub records_key { return 'schema_versions' }
Subroutine records_key: called CC=1 SCAR=0.0
71  
72 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
73 1 my ($self, $payload) = @_;
74 return Twilio::Rest::Events::V1::Schema::SchemaVersionInstance->new($self->{version}, $payload,
75 1 $self->{solution}{id});
76 }
77  
78 package Twilio::Rest::Events::V1::Schema::SchemaVersionContext;
79  
80 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
81  
82 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
83  
84 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
85 1 my ($class, $version, $id, $schema_version) = @_;
86 1 my $self = $class->SUPER::new($version);
87 1 $self->{solution} = { id => $id, schema_version => $schema_version };
88 1 $self->{uri} = join q{}, '/Schemas/', Twilio::Serialize::path_segment($id), '/Versions/',
89 Twilio::Serialize::path_segment($schema_version);
90 1 return $self;
91 }
92  
93 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
94 1 my ($self) = @_;
95  
96 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
97 1 return $self->_build_instance($response);
98 }
99  
100 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
101 1 my ($self, $response) = @_;
102 return Twilio::Rest::Events::V1::Schema::SchemaVersionInstance->new(
103 $self->{version}, $response->get_content,
104 $self->{solution}{id}, $self->{solution}{schema_version}
105 1 );
106 }
107  
108 package Twilio::Rest::Events::V1::Schema::SchemaVersionInstance;
109  
110 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
111  
112 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
113  
114 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
115 2 my ($class, $version, $payload, $id, $schema_version) = @_;
116 2 my $self = $class->SUPER::new($version, $payload);
117 $self->{solution} =
118 2 ▶ { id => $id, schema_version => $schema_version // $self->{properties}{schema_version} };
Condition66%2/3
$schema_version // $self->{"properties"}{"schema_version"}
l!l&&r!l&&!r
110
MC/DC0%0/2
$schema_version // $self->{"properties"}{"schema_version"}
$schema_version $self->{"properties"}{"schema_version"}
Truth table66%2/3
A // B
A= $schema_versionB= $self->{"properties"}{"schema_version"}
ABresult
1X1
011
000
119 2 return $self;
120 }
121  
122 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
123 0 my ($self, @arguments) = @_;
124 0 return $self->_context->fetch(@arguments);
125 }
126  
127 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
128 0 my ($self) = @_;
129 return Twilio::Rest::Events::V1::Schema::SchemaVersionContext->new(
130 $self->{version},
131 $self->{solution}{id},
132 $self->{solution}{schema_version}
133 0 );
134 }
135  
136 2 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
137 2 ▶sub id { return $_[0]{properties}{id} }
Subroutine id: called CC=1 SCAR=0.0
138 2 ▶sub raw { return $_[0]{properties}{raw} }
Subroutine raw: called CC=1 SCAR=0.0
139 2 ▶sub schema_version { return $_[0]{properties}{schema_version} }
Subroutine schema_version: called CC=1 SCAR=0.0
140 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
141  
142 2 1;
143  
144 __END__
« Twilio/Rest/IpMessaging/V2/Service/Channel/Invite.pm ↑ Summary Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserType.pm »