Twilio/Rest/Api/V2010/Account/Call/Recording.pm

filter: Statementstmt 87.6% 92 / 105 Branchbran n/a Conditioncond 55.5% 5 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 87.2% 41 / 47 Podpod n/a totaltotal 83.1% 138 / 166 CC 5 SCAR 2.4
CC
5
Cov
85%
create
2.0
page
2.0
update
2.0
CRAP 1.3
« Twilio/Rest/Preview/HostedNumbers/HostedNumberOrder.pm ↑ Summary Twilio/Rest/Supersim/V1/IpCommand.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Api::V2010::Account::Call::Recording;
3  
4 3 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '2.001';
8  
9 package Twilio::Rest::Api::V2010::Account::Call::RecordingList;
10  
11 3 ▶use parent 'Twilio::ListResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 3 ▶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, $call_sid) = @_;
17 8 my $self = $class->SUPER::new($version);
18 8 $self->{solution} = { account_sid => $account_sid, call_sid => $call_sid };
19 8 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid), '/Calls/',
20 Twilio::Serialize::path_segment($call_sid), '/Recordings.json';
21 8 return $self;
22 }
23  
24 2 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
25 2 my ($self, $options) = @_;
26 2 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
20
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
27  
28 my $data = {
29 RecordingChannels => $options->{recording_channels},
30 RecordingConfigurationId => $options->{recording_configuration_id},
31 RecordingStatusCallback => $options->{recording_status_callback},
32 RecordingStatusCallbackEvent => $options->{recording_status_callback_event},
33 RecordingStatusCallbackMethod => $options->{recording_status_callback_method},
34 RecordingTrack => $options->{recording_track},
35 Trim => $options->{trim},
36 2 };
37  
38 my $response =
39 2 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
40 return Twilio::Rest::Api::V2010::Account::Call::RecordingInstance->new(
41 $self->{version}, $response->get_content,
42 $self->{solution}{account_sid},
43 $self->{solution}{call_sid}
44 2 );
45 }
46  
47 1 ▶sub read {
Subroutine read: called CC=1 SCAR=0.0
48 1 my ($self, @arguments) = @_;
49 1 return $self->read_records(@arguments);
50 }
51  
52 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
53 0 my ($self, @arguments) = @_;
54 0 return $self->stream_records(@arguments);
55 }
56  
57 2 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
58 2 my ($self, $options, $page_size, $page_token, $page_number) = @_;
59 2 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
20
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
60  
61 my $params = {
62 DateCreated => Twilio::Serialize::iso8601_date($options->{date_created}),
63 'DateCreated<' => Twilio::Serialize::iso8601_date($options->{date_created_before}),
64 2 'DateCreated>' => Twilio::Serialize::iso8601_date($options->{date_created_after}),
65 PageToken => $page_token,
66 Page => $page_number,
67 PageSize => $page_size,
68 };
69  
70 2 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
71 2 return $self->_build_page($response);
72 }
73  
74 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
75 0 my ($self, $target_url) = @_;
76 0 my $client = $self->{version}->get_domain->get_client;
77 0 return $self->_build_page($client->request('GET', $target_url));
78 }
79  
80 2 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
81 2 my ($self, $response) = @_;
82 return Twilio::Rest::Api::V2010::Account::Call::RecordingPage->new($self->{version}, $response,
83 2 $self->{solution});
84 }
85  
86 4 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
87 4 my ($self, $sid) = @_;
88 return Twilio::Rest::Api::V2010::Account::Call::RecordingContext->new(
89 $self->{version},
90 $self->{solution}{account_sid},
91 4 $self->{solution}{call_sid}, $sid
92 );
93 }
94  
95 package Twilio::Rest::Api::V2010::Account::Call::RecordingPage;
96  
97 3 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
98  
99 2 ▶sub records_key { return 'recordings' }
Subroutine records_key: called CC=1 SCAR=0.0
100  
101 2 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
102 2 my ($self, $payload) = @_;
103 return Twilio::Rest::Api::V2010::Account::Call::RecordingInstance->new(
104 $self->{version}, $payload,
105 $self->{solution}{account_sid},
106 $self->{solution}{call_sid}
107 2 );
108 }
109  
110 package Twilio::Rest::Api::V2010::Account::Call::RecordingContext;
111  
112 3 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
113  
114 3 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
115  
116 4 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
117 4 my ($class, $version, $account_sid, $call_sid, $sid) = @_;
118 4 my $self = $class->SUPER::new($version);
119 4 $self->{solution} = { account_sid => $account_sid, call_sid => $call_sid, sid => $sid };
120 4 $self->{uri} = join q{}, '/Accounts/', Twilio::Serialize::path_segment($account_sid), '/Calls/',
121 Twilio::Serialize::path_segment($call_sid), '/Recordings/',
122 Twilio::Serialize::path_segment($sid), '.json';
123 4 return $self;
124 }
125  
126 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
127 1 my ($self) = @_;
128 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
129 1 return 1;
130 }
131  
132 2 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
133 2 my ($self) = @_;
134  
135 2 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
136 2 return $self->_build_instance($response);
137 }
138  
139 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
140 1 my ($self, $status, $options) = @_;
141 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
142  
143 my $data = {
144 Status => $status,
145 PauseBehavior => $options->{pause_behavior},
146 1 };
147  
148 my $response =
149 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
150 1 return $self->_build_instance($response);
151 }
152  
153 3 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
154 3 my ($self, $response) = @_;
155 return Twilio::Rest::Api::V2010::Account::Call::RecordingInstance->new(
156 $self->{version}, $response->get_content,
157 $self->{solution}{account_sid},
158 $self->{solution}{call_sid},
159 $self->{solution}{sid}
160 3 );
161 }
162  
163 package Twilio::Rest::Api::V2010::Account::Call::RecordingInstance;
164  
165 3 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
166  
167 3 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
168  
169 7 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
170 7 my ($class, $version, $payload, $account_sid, $call_sid, $sid) = @_;
171 7 my $self = $class->SUPER::new($version, $payload);
172 $self->{solution} =
173 7 ▶ { account_sid => $account_sid, call_sid => $call_sid, sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
340
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
174 7 return $self;
175 }
176  
177 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
178 0 my ($self, @arguments) = @_;
179 0 return $self->_context->delete(@arguments);
180 }
181  
182 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
183 0 my ($self, @arguments) = @_;
184 0 return $self->_context->fetch(@arguments);
185 }
186  
187 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
188 0 my ($self, @arguments) = @_;
189 0 return $self->_context->update(@arguments);
190 }
191  
192 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
193 0 my ($self) = @_;
194 return Twilio::Rest::Api::V2010::Account::Call::RecordingContext->new(
195 $self->{version},
196 $self->{solution}{account_sid},
197 $self->{solution}{call_sid},
198 $self->{solution}{sid}
199 0 );
200 }
201  
202 5 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
203 5 ▶sub api_version { return $_[0]{properties}{api_version} }
Subroutine api_version: called CC=1 SCAR=0.0
204 5 ▶sub call_sid { return $_[0]{properties}{call_sid} }
Subroutine call_sid: called CC=1 SCAR=0.0
205 5 ▶sub channels { return $_[0]{properties}{channels} }
Subroutine channels: called CC=1 SCAR=0.0
206 5 ▶sub conference_sid { return $_[0]{properties}{conference_sid} }
Subroutine conference_sid: called CC=1 SCAR=0.0
207 5 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
208 5 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
209 5 ▶sub duration { return $_[0]{properties}{duration} }
Subroutine duration: called CC=1 SCAR=0.0
210 5 ▶sub encryption_details { return $_[0]{properties}{encryption_details} }
Subroutine encryption_details: called CC=1 SCAR=0.0
211 5 ▶sub error_code { return $_[0]{properties}{error_code} }
Subroutine error_code: called CC=1 SCAR=0.0
212 5 ▶sub price { return $_[0]{properties}{price} }
Subroutine price: called CC=1 SCAR=0.0
213 5 ▶sub price_unit { return $_[0]{properties}{price_unit} }
Subroutine price_unit: called CC=1 SCAR=0.0
214 6 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
215 5 ▶sub source { return $_[0]{properties}{source} }
Subroutine source: called CC=1 SCAR=0.0
216 5 ▶sub start_time { return Twilio::Deserialize::date_time($_[0]{properties}{start_time}) }
Subroutine start_time: called CC=1 SCAR=0.0
217 5 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
218 5 ▶sub track { return $_[0]{properties}{track} }
Subroutine track: called CC=1 SCAR=0.0
219 5 ▶sub uri { return $_[0]{properties}{uri} }
Subroutine uri: called CC=1 SCAR=0.0
220  
221 3 1;
222  
223 __END__
« Twilio/Rest/Preview/HostedNumbers/HostedNumberOrder.pm ↑ Summary Twilio/Rest/Supersim/V1/IpCommand.pm »