Twilio/Rest/Intelligence/V3/Configuration.pm

filter: Statementstmt 83.8% 78 / 93 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 81.0% 30 / 37 Podpod n/a totaltotal 80.4% 111 / 138 CC 3 SCAR 2.5
CC
3
Cov
83%
page
2.0
new
2.0
read
2.0
CRAP 1.3
« Twilio/Rest/Knowledge/V1/Knowledge.pm ↑ Summary Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtension.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Intelligence::V3::Configuration;
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::Intelligence::V3::ConfigurationList;
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 5 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 5 my ($class, $version) = @_;
17 5 my $self = $class->SUPER::new($version);
18 5 $self->{solution} = {};
19 5 $self->{uri} = '/ControlPlane/Configurations';
20 5 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 return Twilio::Rest::Intelligence::V3::ConfigurationInstance->new($self->{version},
38 1 $response->get_content);
39 }
40  
41 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
42 0 my ($self, @arguments) = @_;
43 0 return $self->read_records(@arguments);
44 }
45  
46 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
47 0 my ($self, @arguments) = @_;
48 0 return $self->stream_records(@arguments);
49 }
50  
51 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
52 1 my ($self, $options, $page_size, $page_token) = @_;
53 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
54  
55 1 my $params = {
56 pageSize => $page_size,
57 pageToken => $page_token,
58 };
59  
60 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
61 1 return $self->_build_page($response);
62 }
63  
64 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
65 0 my ($self, $target_url) = @_;
66 0 my $client = $self->{version}->get_domain->get_client;
67 0 return $self->_build_page($client->request('GET', $target_url));
68 }
69  
70 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
71 1 my ($self, $response) = @_;
72 return Twilio::Rest::Intelligence::V3::ConfigurationPage->new($self->{version}, $response,
73 1 $self->{solution});
74 }
75  
76 3 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
77 3 my ($self, $id) = @_;
78 3 return Twilio::Rest::Intelligence::V3::ConfigurationContext->new($self->{version}, $id);
79 }
80  
81 package Twilio::Rest::Intelligence::V3::ConfigurationPage;
82  
83 2 ▶use parent 'Twilio::TokenPaginationPage';
Subroutine BEGIN: called CC=1 SCAR=0.0
84  
85 1 ▶sub records_key { return 'items' }
Subroutine records_key: called CC=1 SCAR=0.0
86  
87 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
88 1 my ($self, $payload) = @_;
89 1 return Twilio::Rest::Intelligence::V3::ConfigurationInstance->new($self->{version}, $payload);
90 }
91  
92 package Twilio::Rest::Intelligence::V3::ConfigurationContext;
93  
94 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
95  
96 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
97  
98 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
99 3 my ($class, $version, $id) = @_;
100 3 my $self = $class->SUPER::new($version);
101 3 $self->{solution} = { id => $id };
102 3 $self->{uri} = join q{}, '/ControlPlane/Configurations/', Twilio::Serialize::path_segment($id);
103 3 return $self;
104 }
105  
106 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
107 1 my ($self) = @_;
108 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
109 1 return 1;
110 }
111  
112 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
113 1 my ($self) = @_;
114  
115 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
116 1 return $self->_build_instance($response);
117 }
118  
119 1 ▶sub update {
Subroutine update: called CC=1 SCAR=0.0
120 1 my ($self, $body) = @_;
121  
122 1 my $data = Twilio::Serialize::json_body($body, {});
123  
124 my $response = $self->{version}->handle_request(
125 'PUT',
126 $self->{uri},
127 1 'update',
128 {
129 data => $data,
130 headers => { 'Content-Type' => 'application/json', }
131 }
132 );
133 1 return $self->_build_instance($response);
134 }
135  
136 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
137 2 my ($self, $response) = @_;
138 return Twilio::Rest::Intelligence::V3::ConfigurationInstance->new($self->{version},
139 2 $response->get_content, $self->{solution}{id});
140 }
141  
142 package Twilio::Rest::Intelligence::V3::ConfigurationInstance;
143  
144 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
145  
146 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
147  
148 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
149 4 my ($class, $version, $payload, $id) = @_;
150 4 my $self = $class->SUPER::new($version, $payload);
151 4 ▶ $self->{solution} = { id => $id // $self->{properties}{id} };
Condition66%2/3
$id // $self->{"properties"}{"id"}
l!l&&r!l&&!r
220
MC/DC0%0/2
$id // $self->{"properties"}{"id"}
$id $self->{"properties"}{"id"}
Truth table66%2/3
A // B
A= $idB= $self->{"properties"}{"id"}
ABresult
1X1
011
000
152 4 return $self;
153 }
154  
155 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
156 0 my ($self, @arguments) = @_;
157 0 return $self->_context->delete(@arguments);
158 }
159  
160 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
161 0 my ($self, @arguments) = @_;
162 0 return $self->_context->fetch(@arguments);
163 }
164  
165 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
166 0 my ($self, @arguments) = @_;
167 0 return $self->_context->update(@arguments);
168 }
169  
170 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
171 0 my ($self) = @_;
172 return Twilio::Rest::Intelligence::V3::ConfigurationContext->new($self->{version},
173 0 $self->{solution}{id});
174 }
175  
176 4 ▶sub account_id { return $_[0]{properties}{accountId} }
Subroutine account_id: called CC=1 SCAR=0.0
177 4 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{dateCreated}) }
Subroutine date_created: called CC=1 SCAR=0.0
178 4 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{dateUpdated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
179 4 ▶sub description { return $_[0]{properties}{description} }
Subroutine description: called CC=1 SCAR=0.0
180 4 ▶sub display_name { return $_[0]{properties}{displayName} }
Subroutine display_name: called CC=1 SCAR=0.0
181 4 ▶sub id { return $_[0]{properties}{id} }
Subroutine id: called CC=1 SCAR=0.0
182 4 ▶sub rules { return $_[0]{properties}{rules} }
Subroutine rules: called CC=1 SCAR=0.0
183 4 ▶sub version { return $_[0]{properties}{version} }
Subroutine version: called CC=1 SCAR=0.0
184  
185 2 1;
186  
187 __END__
« Twilio/Rest/Knowledge/V1/Knowledge.pm ↑ Summary Twilio/Rest/Marketplace/V1/InstalledAddOn/InstalledAddOnExtension.pm »