Twilio/Rest/Intelligence/V2/Transcript.pm

filter: Statementstmt 81.1% 99 / 122 Branchbran 100% 2 / 2 Conditioncond 57.1% 4 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 79.2% 42 / 53 Podpod n/a totaltotal 78.1% 147 / 188 CC 5 SCAR 2.9
CC
5
Cov
80%
create
2.0
page
2.0
new
2.0
CRAP 1.3
« Twilio/Rest/Insights/V1/Setting.pm ↑ Summary Twilio/Rest/Api/V2010/Account/Sip/CredentialList/Credential.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Intelligence::V2::Transcript;
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::V2::TranscriptList;
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 10 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 10 my ($class, $version) = @_;
17 10 my $self = $class->SUPER::new($version);
18 10 $self->{solution} = {};
19 10 $self->{uri} = '/Transcripts';
20 10 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 1 my ($self, $service_sid, $channel, $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 ServiceSid => $service_sid,
29 Channel => Twilio::Serialize::json_object($channel),
30 CustomerKey => $options->{customer_key},
31 1 MediaStartTime => Twilio::Serialize::iso8601_date_time($options->{media_start_time}),
32 };
33  
34 my $response =
35 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
36 return Twilio::Rest::Intelligence::V2::TranscriptInstance->new($self->{version},
37 1 $response->get_content);
38 }
39  
40 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
41 0 my ($self, @arguments) = @_;
42 0 return $self->read_records(@arguments);
43 }
44  
45 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
46 0 my ($self, @arguments) = @_;
47 0 return $self->stream_records(@arguments);
48 }
49  
50 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
51 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
52 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
53  
54 my $params = {
55 AfterDateCreated => $options->{after_date_created},
56 AfterStartTime => $options->{after_start_time},
57 BeforeDateCreated => $options->{before_date_created},
58 BeforeStartTime => $options->{before_start_time},
59 LanguageCode => $options->{language_code},
60 ServiceSid => $options->{service_sid},
61 SourceSid => $options->{source_sid},
62 Status => $options->{status},
63 1 PageToken => $page_token,
64 Page => $page_number,
65 PageSize => $page_size,
66 };
67  
68 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
69 1 return $self->_build_page($response);
70 }
71  
72 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
73 0 my ($self, $target_url) = @_;
74 0 my $client = $self->{version}->get_domain->get_client;
75 0 return $self->_build_page($client->request('GET', $target_url));
76 }
77  
78 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
79 1 my ($self, $response) = @_;
80 return Twilio::Rest::Intelligence::V2::TranscriptPage->new($self->{version}, $response,
81 1 $self->{solution});
82 }
83  
84 8 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
85 8 my ($self, $sid) = @_;
86 8 return Twilio::Rest::Intelligence::V2::TranscriptContext->new($self->{version}, $sid);
87 }
88  
89 package Twilio::Rest::Intelligence::V2::TranscriptPage;
90  
91 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
92  
93 1 ▶sub records_key { return 'transcripts' }
Subroutine records_key: called CC=1 SCAR=0.0
94  
95 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
96 1 my ($self, $payload) = @_;
97 1 return Twilio::Rest::Intelligence::V2::TranscriptInstance->new($self->{version}, $payload);
98 }
99  
100 package Twilio::Rest::Intelligence::V2::TranscriptContext;
101  
102 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
103  
104 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
105  
106 8 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
107 8 my ($class, $version, $sid) = @_;
108 8 my $self = $class->SUPER::new($version);
109 8 $self->{solution} = { sid => $sid };
110 8 $self->{uri} = join q{}, '/Transcripts/', Twilio::Serialize::path_segment($sid);
111 8 return $self;
112 }
113  
114 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
115 1 my ($self) = @_;
116 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
117 1 return 1;
118 }
119  
120 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
121 1 my ($self) = @_;
122  
123 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
124 1 return $self->_build_instance($response);
125 }
126  
127 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
128 1 my ($self, $response) = @_;
129 return Twilio::Rest::Intelligence::V2::TranscriptInstance->new($self->{version},
130 1 $response->get_content, $self->{solution}{sid});
131 }
132  
133 1 ▶sub encrypted_operator_results {
Subroutine encrypted_operator_results: called CC=1 SCAR=0.0
134 1 my ($self) = @_;
135 1 require Twilio::Rest::Intelligence::V2::Transcript::EncryptedOperatorResults;
136 return Twilio::Rest::Intelligence::V2::Transcript::EncryptedOperatorResultsContext->new(
137 1 $self->{version}, $self->{solution}{sid});
138 }
139  
140 1 ▶sub encrypted_sentences {
Subroutine encrypted_sentences: called CC=1 SCAR=0.0
141 1 my ($self) = @_;
142 1 require Twilio::Rest::Intelligence::V2::Transcript::EncryptedSentences;
143 return Twilio::Rest::Intelligence::V2::Transcript::EncryptedSentencesContext->new(
144 1 $self->{version}, $self->{solution}{sid});
145 }
146  
147 1 ▶sub media {
Subroutine media: called CC=1 SCAR=0.0
148 1 my ($self) = @_;
149 1 require Twilio::Rest::Intelligence::V2::Transcript::Media;
150 return Twilio::Rest::Intelligence::V2::Transcript::MediaContext->new($self->{version},
151 1 $self->{solution}{sid});
152 }
153  
154 2 ▶sub operator_results {
Subroutine operator_results: called CC=2 SCAR=6.9
155 2 my ($self, $operator_sid) = @_;
156 2 require Twilio::Rest::Intelligence::V2::Transcript::OperatorResult;
157 my $list = Twilio::Rest::Intelligence::V2::Transcript::OperatorResultList->new($self->{version},
158 2 $self->{solution}{sid});
159 2 ▶ return defined $operator_sid ? $list->get_context($operator_sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $operator_sid ? : 1 1 2
160 }
161  
162 1 ▶sub sentences {
Subroutine sentences: called CC=1 SCAR=0.0
163 1 my ($self) = @_;
164 1 require Twilio::Rest::Intelligence::V2::Transcript::Sentence;
165 return Twilio::Rest::Intelligence::V2::Transcript::SentenceList->new($self->{version},
166 1 $self->{solution}{sid});
167 }
168  
169 package Twilio::Rest::Intelligence::V2::TranscriptInstance;
170  
171 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
172  
173 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
174  
175 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
176 3 my ($class, $version, $payload, $sid) = @_;
177 3 my $self = $class->SUPER::new($version, $payload);
178 3 ▶ $self->{solution} = { sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
120
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
179 3 return $self;
180 }
181  
182 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
183 0 my ($self, @arguments) = @_;
184 0 return $self->_context->delete(@arguments);
185 }
186  
187 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
188 0 my ($self, @arguments) = @_;
189 0 return $self->_context->fetch(@arguments);
190 }
191  
192 0 ▶sub encrypted_operator_results {
Subroutine encrypted_operator_results: not called CC=1 SCAR=6.9
193 0 my ($self, @arguments) = @_;
194 0 return $self->_context->encrypted_operator_results(@arguments);
195 }
196  
197 0 ▶sub encrypted_sentences {
Subroutine encrypted_sentences: not called CC=1 SCAR=6.9
198 0 my ($self, @arguments) = @_;
199 0 return $self->_context->encrypted_sentences(@arguments);
200 }
201  
202 0 ▶sub media {
Subroutine media: not called CC=1 SCAR=6.9
203 0 my ($self, @arguments) = @_;
204 0 return $self->_context->media(@arguments);
205 }
206  
207 0 ▶sub operator_results {
Subroutine operator_results: not called CC=1 SCAR=6.9
208 0 my ($self, @arguments) = @_;
209 0 return $self->_context->operator_results(@arguments);
210 }
211  
212 0 ▶sub sentences {
Subroutine sentences: not called CC=1 SCAR=6.9
213 0 my ($self, @arguments) = @_;
214 0 return $self->_context->sentences(@arguments);
215 }
216  
217 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
218 0 my ($self) = @_;
219 return Twilio::Rest::Intelligence::V2::TranscriptContext->new($self->{version},
220 0 $self->{solution}{sid});
221 }
222  
223 3 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
224 3 ▶sub channel { return $_[0]{properties}{channel} }
Subroutine channel: called CC=1 SCAR=0.0
225 3 ▶sub customer_key { return $_[0]{properties}{customer_key} }
Subroutine customer_key: called CC=1 SCAR=0.0
226 3 ▶sub data_logging { return $_[0]{properties}{data_logging} }
Subroutine data_logging: called CC=1 SCAR=0.0
227 3 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
228 3 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
229 3 ▶sub duration { return $_[0]{properties}{duration} }
Subroutine duration: called CC=1 SCAR=0.0
230 3 ▶sub encryption_credential_sid { return $_[0]{properties}{encryption_credential_sid} }
Subroutine encryption_credential_sid: called CC=1 SCAR=0.0
231 3 ▶sub language_code { return $_[0]{properties}{language_code} }
Subroutine language_code: called CC=1 SCAR=0.0
232 3 ▶sub links { return $_[0]{properties}{links} }
Subroutine links: called CC=1 SCAR=0.0
233 3 ▶sub media_start_time { return Twilio::Deserialize::date_time($_[0]{properties}{media_start_time}) }
Subroutine media_start_time: called CC=1 SCAR=0.0
234 3 ▶sub redaction { return $_[0]{properties}{redaction} }
Subroutine redaction: called CC=1 SCAR=0.0
235 3 ▶sub service_sid { return $_[0]{properties}{service_sid} }
Subroutine service_sid: called CC=1 SCAR=0.0
236 3 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
237 3 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
238 3 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
239  
240 2 1;
241  
242 __END__
« Twilio/Rest/Insights/V1/Setting.pm ↑ Summary Twilio/Rest/Api/V2010/Account/Sip/CredentialList/Credential.pm »