Twilio/Rest/Webhooks/V1/Setting.pm

filter: Statementstmt 84.3% 81 / 96 Branchbran n/a Conditioncond 57.1% 4 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 82.0% 32 / 39 Podpod n/a totaltotal 80.1% 117 / 146 CC 4 SCAR 2.7
CC
4
Cov
83%
create
2.0
page
2.0
new
2.0
CRAP 1.3
« Twilio/Rest/Api/V2010/Account/Address.pm ↑ Summary Twilio/Rest/Intelligence/V3/Operator.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Webhooks::V1::Setting;
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::Webhooks::V1::SettingList;
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} = '/Webhooks/Settings';
20 5 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 1 my ($self, $body, $options) = @_;
25 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
10
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
26  
27 1 my $data = Twilio::Serialize::json_body($body, {});
28  
29 my $response = $self->{version}->handle_request(
30 'POST',
31 $self->{uri},
32 'create',
33 {
34 data => $data,
35 headers => {
36 'Content-Type' => 'application/json',
37 'Idempotency-Key' => $options->{idempotency_key},
38 }
39 }
40 1 );
41 1 return Twilio::Rest::Webhooks::V1::SettingInstance->new($self->{version}, $response->get_content);
42 }
43  
44 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
45 0 my ($self, @arguments) = @_;
46 0 return $self->read_records(@arguments);
47 }
48  
49 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
50 0 my ($self, @arguments) = @_;
51 0 return $self->stream_records(@arguments);
52 }
53  
54 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
55 1 my ($self, $options, $page_size, $page_token) = @_;
56 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
10
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
57  
58 my $params = {
59 authProfileId => $options->{auth_profile_id},
60 sharedKeyId => $options->{shared_key_id},
61 type => $options->{type},
62 1 pageSize => $page_size,
63 pageToken => $page_token,
64 };
65  
66 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
67 1 return $self->_build_page($response);
68 }
69  
70 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
71 0 my ($self, $target_url) = @_;
72 0 my $client = $self->{version}->get_domain->get_client;
73 0 return $self->_build_page($client->request('GET', $target_url));
74 }
75  
76 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
77 1 my ($self, $response) = @_;
78 return Twilio::Rest::Webhooks::V1::SettingPage->new($self->{version}, $response,
79 1 $self->{solution});
80 }
81  
82 3 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
83 3 my ($self, $setting_id) = @_;
84 3 return Twilio::Rest::Webhooks::V1::SettingContext->new($self->{version}, $setting_id);
85 }
86  
87 package Twilio::Rest::Webhooks::V1::SettingPage;
88  
89 2 ▶use parent 'Twilio::TokenPaginationPage';
Subroutine BEGIN: called CC=1 SCAR=0.0
90  
91 1 ▶sub records_key { return 'settings' }
Subroutine records_key: called CC=1 SCAR=0.0
92  
93 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
94 1 my ($self, $payload) = @_;
95 1 return Twilio::Rest::Webhooks::V1::SettingInstance->new($self->{version}, $payload);
96 }
97  
98 package Twilio::Rest::Webhooks::V1::SettingContext;
99  
100 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
101  
102 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
103  
104 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
105 3 my ($class, $version, $setting_id) = @_;
106 3 my $self = $class->SUPER::new($version);
107 3 $self->{solution} = { setting_id => $setting_id };
108 3 $self->{uri} = join q{}, '/Webhooks/Settings/', Twilio::Serialize::path_segment($setting_id);
109 3 return $self;
110 }
111  
112 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
113 1 my ($self) = @_;
114 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
115 1 return 1;
116 }
117  
118 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
119 1 my ($self) = @_;
120  
121 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
122 1 return $self->_build_instance($response);
123 }
124  
125 1 ▶sub patch {
Subroutine patch: called CC=1 SCAR=0.0
126 1 my ($self, $body) = @_;
127  
128 1 my $data = Twilio::Serialize::json_body($body, {});
129  
130 my $response = $self->{version}->handle_request(
131 'PATCH',
132 $self->{uri},
133 1 'patch',
134 {
135 data => $data,
136 headers => { 'Content-Type' => 'application/json', }
137 }
138 );
139 1 return $self->_build_instance($response);
140 }
141  
142 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
143 2 my ($self, $response) = @_;
144 return Twilio::Rest::Webhooks::V1::SettingInstance->new($self->{version}, $response->get_content,
145 2 $self->{solution}{setting_id});
146 }
147  
148 package Twilio::Rest::Webhooks::V1::SettingInstance;
149  
150 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
151  
152 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
153  
154 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
155 4 my ($class, $version, $payload, $setting_id) = @_;
156 4 my $self = $class->SUPER::new($version, $payload);
157 4 ▶ $self->{solution} = { setting_id => $setting_id // $self->{properties}{id} };
Condition66%2/3
$setting_id // $self->{"properties"}{"id"}
l!l&&r!l&&!r
220
MC/DC0%0/2
$setting_id // $self->{"properties"}{"id"}
$setting_id $self->{"properties"}{"id"}
Truth table66%2/3
A // B
A= $setting_idB= $self->{"properties"}{"id"}
ABresult
1X1
011
000
158 4 return $self;
159 }
160  
161 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
162 0 my ($self, @arguments) = @_;
163 0 return $self->_context->delete(@arguments);
164 }
165  
166 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
167 0 my ($self, @arguments) = @_;
168 0 return $self->_context->fetch(@arguments);
169 }
170  
171 0 ▶sub patch {
Subroutine patch: not called CC=1 SCAR=6.9
172 0 my ($self, @arguments) = @_;
173 0 return $self->_context->patch(@arguments);
174 }
175  
176 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
177 0 my ($self) = @_;
178 return Twilio::Rest::Webhooks::V1::SettingContext->new($self->{version},
179 0 $self->{solution}{setting_id});
180 }
181  
182 4 ▶sub auth { return $_[0]{properties}{auth} }
Subroutine auth: called CC=1 SCAR=0.0
183 4 ▶sub connection { return $_[0]{properties}{connection} }
Subroutine connection: called CC=1 SCAR=0.0
184 4 ▶sub created_at { return Twilio::Deserialize::date_time($_[0]{properties}{createdAt}) }
Subroutine created_at: called CC=1 SCAR=0.0
185 4 ▶sub description { return $_[0]{properties}{description} }
Subroutine description: called CC=1 SCAR=0.0
186 4 ▶sub edge_zones { return $_[0]{properties}{edgeZones} }
Subroutine edge_zones: called CC=1 SCAR=0.0
187 4 ▶sub friendly_name { return $_[0]{properties}{friendlyName} }
Subroutine friendly_name: called CC=1 SCAR=0.0
188 4 ▶sub id { return $_[0]{properties}{id} }
Subroutine id: called CC=1 SCAR=0.0
189 4 ▶sub signature { return $_[0]{properties}{signature} }
Subroutine signature: called CC=1 SCAR=0.0
190 4 ▶sub type { return $_[0]{properties}{type} }
Subroutine type: called CC=1 SCAR=0.0
191 4 ▶sub updated_at { return Twilio::Deserialize::date_time($_[0]{properties}{updatedAt}) }
Subroutine updated_at: called CC=1 SCAR=0.0
192  
193 2 1;
194  
195 __END__
« Twilio/Rest/Api/V2010/Account/Address.pm ↑ Summary Twilio/Rest/Intelligence/V3/Operator.pm »