Twilio/Rest/Api/V2010/Account/Queue.pm

filter: Statementstmt 83.3% 85 / 102 Branchbran 100% 2 / 2 Conditioncond 55.5% 5 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 80.0% 32 / 40 Podpod n/a totaltotal 78.4% 124 / 158 CC 6 SCAR 3.4
CC
6
Cov
81%
create
2.0
page
2.0
update
2.0
CRAP 1.4
« Twilio/Rest/Numbers/V1.pm ↑ Summary Twilio/Rest/Verify/V2/Service/RateLimit.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Api::V2010::Account::Queue;
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::Api::V2010::Account::QueueList;
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 8 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 8 my ($class, $version, $account_sid) = @_;
17 8 my $self = $class->SUPER::new($version);
18 8 $self->{solution} = { account_sid => $account_sid };
19 8 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid),
20 '/Queues.json';
21 8 return $self;
22 }
23  
24 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
25 1 my ($self, $friendly_name, $options) = @_;
26 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
27  
28 my $data = {
29 FriendlyName => $friendly_name,
30 MaxSize => $options->{max_size},
31 1 };
32  
33 my $response =
34 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
35 return Twilio::Rest::Api::V2010::Account::QueueInstance->new($self->{version},
36 1 $response->get_content, $self->{solution}{account_sid});
37 }
38  
39 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
40 0 my ($self, @arguments) = @_;
41 0 return $self->read_records(@arguments);
42 }
43  
44 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
45 0 my ($self, @arguments) = @_;
46 0 return $self->stream_records(@arguments);
47 }
48  
49 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
50 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
51 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
52  
53 1 my $params = {
54 PageToken => $page_token,
55 Page => $page_number,
56 PageSize => $page_size,
57 };
58  
59 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
60 1 return $self->_build_page($response);
61 }
62  
63 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
64 0 my ($self, $target_url) = @_;
65 0 my $client = $self->{version}->get_domain->get_client;
66 0 return $self->_build_page($client->request('GET', $target_url));
67 }
68  
69 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
70 1 my ($self, $response) = @_;
71 return Twilio::Rest::Api::V2010::Account::QueuePage->new($self->{version}, $response,
72 1 $self->{solution});
73 }
74  
75 6 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
76 6 my ($self, $sid) = @_;
77 return Twilio::Rest::Api::V2010::Account::QueueContext->new($self->{version},
78 6 $self->{solution}{account_sid}, $sid);
79 }
80  
81 package Twilio::Rest::Api::V2010::Account::QueuePage;
82  
83 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
84  
85 1 ▶sub records_key { return 'queues' }
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 return Twilio::Rest::Api::V2010::Account::QueueInstance->new($self->{version}, $payload,
90 1 $self->{solution}{account_sid});
91 }
92  
93 package Twilio::Rest::Api::V2010::Account::QueueContext;
94  
95 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
96  
97 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
98  
99 6 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
100 6 my ($class, $version, $account_sid, $sid) = @_;
101 6 my $self = $class->SUPER::new($version);
102 6 $self->{solution} = { account_sid => $account_sid, sid => $sid };
103 6 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid), '/Queues/',
104 Twilio::Serialize::path_segment($sid), '.json';
105 6 return $self;
106 }
107  
108 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
109 1 my ($self) = @_;
110 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
111 1 return 1;
112 }
113  
114 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
115 1 my ($self) = @_;
116  
117 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
118 1 return $self->_build_instance($response);
119 }
120  
121 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
122 1 my ($self, $options) = @_;
123 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
124  
125 my $data = {
126 FriendlyName => $options->{friendly_name},
127 MaxSize => $options->{max_size},
128 1 };
129  
130 my $response =
131 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
132 1 return $self->_build_instance($response);
133 }
134  
135 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
136 2 my ($self, $response) = @_;
137 return Twilio::Rest::Api::V2010::Account::QueueInstance->new(
138 $self->{version}, $response->get_content,
139 $self->{solution}{account_sid}, $self->{solution}{sid}
140 2 );
141 }
142  
143 3 ▶sub members {
Subroutine members: called CC=2 SCAR=6.9
144 3 my ($self, $call_sid) = @_;
145 3 require Twilio::Rest::Api::V2010::Account::Queue::Member;
146 my $list = Twilio::Rest::Api::V2010::Account::Queue::MemberList->new(
147 $self->{version},
148 $self->{solution}{account_sid},
149 $self->{solution}{sid}
150 3 );
151 3 ▶ return defined $call_sid ? $list->get_context($call_sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $call_sid ? : 2 1 3
152 }
153  
154 package Twilio::Rest::Api::V2010::Account::QueueInstance;
155  
156 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
157  
158 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
159  
160 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
161 4 my ($class, $version, $payload, $account_sid, $sid) = @_;
162 4 my $self = $class->SUPER::new($version, $payload);
163 4 ▶ $self->{solution} = { account_sid => $account_sid, 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
164 4 return $self;
165 }
166  
167 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
168 0 my ($self, @arguments) = @_;
169 0 return $self->_context->delete(@arguments);
170 }
171  
172 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
173 0 my ($self, @arguments) = @_;
174 0 return $self->_context->fetch(@arguments);
175 }
176  
177 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
178 0 my ($self, @arguments) = @_;
179 0 return $self->_context->update(@arguments);
180 }
181  
182 0 ▶sub members {
Subroutine members: not called CC=1 SCAR=6.9
183 0 my ($self, @arguments) = @_;
184 0 return $self->_context->members(@arguments);
185 }
186  
187 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
188 0 my ($self) = @_;
189 return Twilio::Rest::Api::V2010::Account::QueueContext->new(
190 $self->{version},
191 $self->{solution}{account_sid},
192 $self->{solution}{sid}
193 0 );
194 }
195  
196 4 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
197 4 ▶sub average_wait_time { return $_[0]{properties}{average_wait_time} }
Subroutine average_wait_time: called CC=1 SCAR=0.0
198 4 ▶sub current_size { return $_[0]{properties}{current_size} }
Subroutine current_size: called CC=1 SCAR=0.0
199 4 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
200 4 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
201 4 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
202 4 ▶sub max_size { return $_[0]{properties}{max_size} }
Subroutine max_size: called CC=1 SCAR=0.0
203 4 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
204 4 ▶sub uri { return $_[0]{properties}{uri} }
Subroutine uri: called CC=1 SCAR=0.0
205  
206 2 1;
207  
208 __END__
« Twilio/Rest/Numbers/V1.pm ↑ Summary Twilio/Rest/Verify/V2/Service/RateLimit.pm »