Twilio/Rest/Knowledge/V2/Chunk.pm

filter: Statementstmt 87.0% 47 / 54 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 86.3% 19 / 22 Podpod n/a totaltotal 84.8% 67 / 79 CC 2 SCAR 2.0
CC
2
Cov
86%
page
2.0
read
2.0
stream
2.0
CRAP 1.2
« Twilio/Rest/Iam/V1/RolePermission.pm ↑ Summary Twilio/Rest/Numbers/V1/PortingAllPortIn.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Knowledge::V2::Chunk;
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::Knowledge::V2::ChunkList;
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 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 1 my ($class, $version, $kb_id, $knowledge_id) = @_;
17 1 my $self = $class->SUPER::new($version);
18 1 $self->{solution} = { kb_id => $kb_id, knowledge_id => $knowledge_id };
19 1 $self->{uri} = join q{}, '/KnowledgeBases/', Twilio::Serialize::path_segment($kb_id),
20 '/Knowledge/', Twilio::Serialize::path_segment($knowledge_id), '/Chunks';
21 1 return $self;
22 }
23  
24 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
25 0 my ($self, @arguments) = @_;
26 0 return $self->read_records(@arguments);
27 }
28  
29 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
30 0 my ($self, @arguments) = @_;
31 0 return $self->stream_records(@arguments);
32 }
33  
34 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
35 1 my ($self, $options, $page_size, $page_token) = @_;
36 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
37  
38 1 my $params = {
39 pageSize => $page_size,
40 pageToken => $page_token,
41 };
42  
43 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
44 1 return $self->_build_page($response);
45 }
46  
47 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
48 0 my ($self, $target_url) = @_;
49 0 my $client = $self->{version}->get_domain->get_client;
50 0 return $self->_build_page($client->request('GET', $target_url));
51 }
52  
53 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
54 1 my ($self, $response) = @_;
55 return Twilio::Rest::Knowledge::V2::ChunkPage->new($self->{version}, $response,
56 1 $self->{solution});
57 }
58  
59 package Twilio::Rest::Knowledge::V2::ChunkPage;
60  
61 2 ▶use parent 'Twilio::TokenPaginationPage';
Subroutine BEGIN: called CC=1 SCAR=0.0
62  
63 1 ▶sub records_key { return 'chunks' }
Subroutine records_key: called CC=1 SCAR=0.0
64  
65 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
66 1 my ($self, $payload) = @_;
67 return Twilio::Rest::Knowledge::V2::ChunkInstance->new(
68 $self->{version}, $payload,
69 $self->{solution}{kb_id},
70 $self->{solution}{knowledge_id}
71 1 );
72 }
73  
74 package Twilio::Rest::Knowledge::V2::ChunkInstance;
75  
76 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
77  
78 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
79  
80 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
81 1 my ($class, $version, $payload, $kb_id, $knowledge_id) = @_;
82 1 my $self = $class->SUPER::new($version, $payload);
83 1 $self->{solution} = { kb_id => $kb_id, knowledge_id => $knowledge_id };
84 1 return $self;
85 }
86  
87 1 ▶sub chunk_index { return $_[0]{properties}{chunkIndex} }
Subroutine chunk_index: called CC=1 SCAR=0.0
88 1 ▶sub content { return $_[0]{properties}{content} }
Subroutine content: called CC=1 SCAR=0.0
89 1 ▶sub created_at { return Twilio::Deserialize::date_time($_[0]{properties}{createdAt}) }
Subroutine created_at: called CC=1 SCAR=0.0
90 1 ▶sub document_number { return $_[0]{properties}{documentNumber} }
Subroutine document_number: called CC=1 SCAR=0.0
91 1 ▶sub document_title { return $_[0]{properties}{documentTitle} }
Subroutine document_title: called CC=1 SCAR=0.0
92 1 ▶sub document_url { return $_[0]{properties}{documentUrl} }
Subroutine document_url: called CC=1 SCAR=0.0
93  
94 2 1;
95  
96 __END__
« Twilio/Rest/Iam/V1/RolePermission.pm ↑ Summary Twilio/Rest/Numbers/V1/PortingAllPortIn.pm »