Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle.pm

filter: Statementstmt 80.9% 98 / 121 Branchbran 100% 4 / 4 Conditioncond 55.5% 5 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 77.5% 38 / 49 Podpod n/a totaltotal 77.1% 145 / 188 CC 7 SCAR 3.5
CC
7
Cov
80%
create
2.0
page
2.0
update
2.0
CRAP 1.4
« Twilio/Rest/Api/V2010.pm ↑ Summary Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Numbers::V2::RegulatoryCompliance::Bundle;
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::Numbers::V2::RegulatoryCompliance::BundleList;
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 15 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 15 my ($class, $version) = @_;
17 15 my $self = $class->SUPER::new($version);
18 15 $self->{solution} = {};
19 15 $self->{uri} = '/RegulatoryCompliance/Bundles';
20 15 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 1 my ($self, $friendly_name, $email, $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 my $data = {
28 FriendlyName => $friendly_name,
29 Email => $email,
30 EndUserType => $options->{end_user_type},
31 IsTest => Twilio::Serialize::boolean_to_string($options->{is_test}),
32 IsoCountry => $options->{iso_country},
33 NumberType => $options->{number_type},
34 RegulationSid => $options->{regulation_sid},
35 StatusCallback => $options->{status_callback},
36 1 };
37  
38 my $response =
39 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
40 return Twilio::Rest::Numbers::V2::RegulatoryCompliance::BundleInstance->new($self->{version},
41 1 $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, $page_number) = @_;
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 BundleSids => $options->{bundle_sids},
60 EndUserType => $options->{end_user_type},
61 FriendlyName => $options->{friendly_name},
62 HasValidUntilDate => Twilio::Serialize::boolean_to_string($options->{has_valid_until_date}),
63 IsoCountry => $options->{iso_country},
64 NumberType => $options->{number_type},
65 RegulationSid => $options->{regulation_sid},
66 SortBy => $options->{sort_by},
67 SortDirection => $options->{sort_direction},
68 Status => $options->{status},
69 ValidUntilDate => Twilio::Serialize::iso8601_date_time($options->{valid_until_date}),
70 'ValidUntilDate<' => Twilio::Serialize::iso8601_date_time($options->{valid_until_date_before}),
71 1 'ValidUntilDate>' => Twilio::Serialize::iso8601_date_time($options->{valid_until_date_after}),
72 PageToken => $page_token,
73 Page => $page_number,
74 PageSize => $page_size,
75 };
76  
77 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
78 1 return $self->_build_page($response);
79 }
80  
81 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
82 0 my ($self, $target_url) = @_;
83 0 my $client = $self->{version}->get_domain->get_client;
84 0 return $self->_build_page($client->request('GET', $target_url));
85 }
86  
87 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
88 1 my ($self, $response) = @_;
89 return Twilio::Rest::Numbers::V2::RegulatoryCompliance::BundlePage->new($self->{version},
90 1 $response, $self->{solution});
91 }
92  
93 13 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
94 13 my ($self, $sid) = @_;
95 return Twilio::Rest::Numbers::V2::RegulatoryCompliance::BundleContext->new($self->{version},
96 13 $sid);
97 }
98  
99 package Twilio::Rest::Numbers::V2::RegulatoryCompliance::BundlePage;
100  
101 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
102  
103 1 ▶sub records_key { return 'results' }
Subroutine records_key: called CC=1 SCAR=0.0
104  
105 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
106 1 my ($self, $payload) = @_;
107 return Twilio::Rest::Numbers::V2::RegulatoryCompliance::BundleInstance->new($self->{version},
108 1 $payload);
109 }
110  
111 package Twilio::Rest::Numbers::V2::RegulatoryCompliance::BundleContext;
112  
113 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
114  
115 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
116  
117 13 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
118 13 my ($class, $version, $sid) = @_;
119 13 my $self = $class->SUPER::new($version);
120 13 $self->{solution} = { sid => $sid };
121 13 $self->{uri} = join q{}, '/RegulatoryCompliance/Bundles/', Twilio::Serialize::path_segment($sid);
122 13 return $self;
123 }
124  
125 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
126 1 my ($self) = @_;
127 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
128 1 return 1;
129 }
130  
131 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
132 1 my ($self) = @_;
133  
134 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
135 1 return $self->_build_instance($response);
136 }
137  
138 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
139 1 my ($self, $options) = @_;
140 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
141  
142 my $data = {
143 Email => $options->{email},
144 FriendlyName => $options->{friendly_name},
145 Status => $options->{status},
146 StatusCallback => $options->{status_callback},
147 1 };
148  
149 my $response =
150 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
151 1 return $self->_build_instance($response);
152 }
153  
154 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
155 2 my ($self, $response) = @_;
156 return Twilio::Rest::Numbers::V2::RegulatoryCompliance::BundleInstance->new($self->{version},
157 2 $response->get_content, $self->{solution}{sid});
158 }
159  
160 2 ▶sub bundle_copies {
Subroutine bundle_copies: called CC=1 SCAR=0.0
161 2 my ($self) = @_;
162 2 require Twilio::Rest::Numbers::V2::RegulatoryCompliance::Bundle::BundleCopy;
163 return Twilio::Rest::Numbers::V2::RegulatoryCompliance::Bundle::BundleCopyList->new(
164 2 $self->{version}, $self->{solution}{sid});
165 }
166  
167 3 ▶sub evaluations {
Subroutine evaluations: called CC=2 SCAR=6.9
168 3 my ($self, $sid) = @_;
169 3 require Twilio::Rest::Numbers::V2::RegulatoryCompliance::Bundle::Evaluation;
170 my $list =
171 Twilio::Rest::Numbers::V2::RegulatoryCompliance::Bundle::EvaluationList->new($self->{version},
172 3 $self->{solution}{sid});
173 3 ▶ return defined $sid ? $list->get_context($sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $sid ? : 1 2 3
174 }
175  
176 4 ▶sub item_assignments {
Subroutine item_assignments: called CC=2 SCAR=6.9
177 4 my ($self, $sid) = @_;
178 4 require Twilio::Rest::Numbers::V2::RegulatoryCompliance::Bundle::ItemAssignment;
179 my $list = Twilio::Rest::Numbers::V2::RegulatoryCompliance::Bundle::ItemAssignmentList->new(
180 4 $self->{version}, $self->{solution}{sid});
181 4 ▶ return defined $sid ? $list->get_context($sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $sid ? : 2 2 4
182 }
183  
184 1 ▶sub replace_items {
Subroutine replace_items: called CC=1 SCAR=0.0
185 1 my ($self) = @_;
186 1 require Twilio::Rest::Numbers::V2::RegulatoryCompliance::Bundle::ReplaceItems;
187 return Twilio::Rest::Numbers::V2::RegulatoryCompliance::Bundle::ReplaceItemsList->new(
188 1 $self->{version}, $self->{solution}{sid});
189 }
190  
191 package Twilio::Rest::Numbers::V2::RegulatoryCompliance::BundleInstance;
192  
193 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
194  
195 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
196  
197 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
198 4 my ($class, $version, $payload, $sid) = @_;
199 4 my $self = $class->SUPER::new($version, $payload);
200 4 ▶ $self->{solution} = { sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
220
MC/DC0%0/2
$sid // $self->{"properties"}{"sid"}
$sid $self->{"properties"}{"sid"}
Truth table66%2/3
A // B
A= $sidB= $self->{"properties"}{"sid"}
ABresult
1X1
011
000
201 4 return $self;
202 }
203  
204 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
205 0 my ($self, @arguments) = @_;
206 0 return $self->_context->delete(@arguments);
207 }
208  
209 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
210 0 my ($self, @arguments) = @_;
211 0 return $self->_context->fetch(@arguments);
212 }
213  
214 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
215 0 my ($self, @arguments) = @_;
216 0 return $self->_context->update(@arguments);
217 }
218  
219 0 ▶sub bundle_copies {
Subroutine bundle_copies: not called CC=1 SCAR=6.9
220 0 my ($self, @arguments) = @_;
221 0 return $self->_context->bundle_copies(@arguments);
222 }
223  
224 0 ▶sub evaluations {
Subroutine evaluations: not called CC=1 SCAR=6.9
225 0 my ($self, @arguments) = @_;
226 0 return $self->_context->evaluations(@arguments);
227 }
228  
229 0 ▶sub item_assignments {
Subroutine item_assignments: not called CC=1 SCAR=6.9
230 0 my ($self, @arguments) = @_;
231 0 return $self->_context->item_assignments(@arguments);
232 }
233  
234 0 ▶sub replace_items {
Subroutine replace_items: not called CC=1 SCAR=6.9
235 0 my ($self, @arguments) = @_;
236 0 return $self->_context->replace_items(@arguments);
237 }
238  
239 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
240 0 my ($self) = @_;
241 return Twilio::Rest::Numbers::V2::RegulatoryCompliance::BundleContext->new($self->{version},
242 0 $self->{solution}{sid});
243 }
244  
245 4 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
246 4 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
247 4 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
248 4 ▶sub email { return $_[0]{properties}{email} }
Subroutine email: called CC=1 SCAR=0.0
249 4 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
250 4 ▶sub links { return $_[0]{properties}{links} }
Subroutine links: called CC=1 SCAR=0.0
251 4 ▶sub regulation_sid { return $_[0]{properties}{regulation_sid} }
Subroutine regulation_sid: called CC=1 SCAR=0.0
252 4 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
253 4 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
254 4 ▶sub status_callback { return $_[0]{properties}{status_callback} }
Subroutine status_callback: called CC=1 SCAR=0.0
255 4 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
256 4 ▶sub valid_until { return Twilio::Deserialize::date_time($_[0]{properties}{valid_until}) }
Subroutine valid_until: called CC=1 SCAR=0.0
257  
258 2 1;
259  
260 __END__
« Twilio/Rest/Api/V2010.pm ↑ Summary Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel.pm »