Twilio/Rest/Intelligence/V2/Operator.pm

filter: Statementstmt 86.5% 71 / 82 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 86.1% 31 / 36 Podpod n/a totaltotal 83.3% 105 / 126 CC 3 SCAR 2.1
CC
3
Cov
85%
page
2.0
new
2.0
read
2.0
CRAP 1.2
« Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceipt.pm ↑ Summary Twilio/Rest/Intelligence/V2/PrebuiltOperator.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Intelligence::V2::Operator;
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::OperatorList;
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 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 2 my ($class, $version) = @_;
17 2 my $self = $class->SUPER::new($version);
18 2 $self->{solution} = {};
19 2 $self->{uri} = '/Operators';
20 2 return $self;
21 }
22  
23 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
24 0 my ($self, @arguments) = @_;
25 0 return $self->read_records(@arguments);
26 }
27  
28 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
29 0 my ($self, @arguments) = @_;
30 0 return $self->stream_records(@arguments);
31 }
32  
33 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
34 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
35 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
36  
37 my $params = {
38 Availability => $options->{availability},
39 LanguageCode => $options->{language_code},
40 1 PageToken => $page_token,
41 Page => $page_number,
42 PageSize => $page_size,
43 };
44  
45 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
46 1 return $self->_build_page($response);
47 }
48  
49 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
50 0 my ($self, $target_url) = @_;
51 0 my $client = $self->{version}->get_domain->get_client;
52 0 return $self->_build_page($client->request('GET', $target_url));
53 }
54  
55 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
56 1 my ($self, $response) = @_;
57 return Twilio::Rest::Intelligence::V2::OperatorPage->new($self->{version}, $response,
58 1 $self->{solution});
59 }
60  
61 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
62 1 my ($self, $sid) = @_;
63 1 return Twilio::Rest::Intelligence::V2::OperatorContext->new($self->{version}, $sid);
64 }
65  
66 package Twilio::Rest::Intelligence::V2::OperatorPage;
67  
68 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
69  
70 1 ▶sub records_key { return 'operators' }
Subroutine records_key: called CC=1 SCAR=0.0
71  
72 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
73 1 my ($self, $payload) = @_;
74 1 return Twilio::Rest::Intelligence::V2::OperatorInstance->new($self->{version}, $payload);
75 }
76  
77 package Twilio::Rest::Intelligence::V2::OperatorContext;
78  
79 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
80  
81 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
82  
83 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
84 1 my ($class, $version, $sid) = @_;
85 1 my $self = $class->SUPER::new($version);
86 1 $self->{solution} = { sid => $sid };
87 1 $self->{uri} = join q{}, '/Operators/', Twilio::Serialize::path_segment($sid);
88 1 return $self;
89 }
90  
91 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
92 1 my ($self) = @_;
93  
94 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
95 1 return $self->_build_instance($response);
96 }
97  
98 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
99 1 my ($self, $response) = @_;
100 return Twilio::Rest::Intelligence::V2::OperatorInstance->new($self->{version},
101 1 $response->get_content, $self->{solution}{sid});
102 }
103  
104 package Twilio::Rest::Intelligence::V2::OperatorInstance;
105  
106 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
107  
108 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
109  
110 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
111 2 my ($class, $version, $payload, $sid) = @_;
112 2 my $self = $class->SUPER::new($version, $payload);
113 2 ▶ $self->{solution} = { sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
110
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
114 2 return $self;
115 }
116  
117 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
118 0 my ($self, @arguments) = @_;
119 0 return $self->_context->fetch(@arguments);
120 }
121  
122 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
123 0 my ($self) = @_;
124 return Twilio::Rest::Intelligence::V2::OperatorContext->new($self->{version},
125 0 $self->{solution}{sid});
126 }
127  
128 2 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
129 2 ▶sub author { return $_[0]{properties}{author} }
Subroutine author: called CC=1 SCAR=0.0
130 2 ▶sub availability { return $_[0]{properties}{availability} }
Subroutine availability: called CC=1 SCAR=0.0
131 2 ▶sub config { return $_[0]{properties}{config} }
Subroutine config: called CC=1 SCAR=0.0
132 2 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
133 2 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
134 2 ▶sub description { return $_[0]{properties}{description} }
Subroutine description: called CC=1 SCAR=0.0
135 2 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
136 2 ▶sub operator_type { return $_[0]{properties}{operator_type} }
Subroutine operator_type: called CC=1 SCAR=0.0
137 2 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
138 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
139 2 ▶sub version { return $_[0]{properties}{version} }
Subroutine version: called CC=1 SCAR=0.0
140  
141 2 1;
142  
143 __END__
« Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceipt.pm ↑ Summary Twilio/Rest/Intelligence/V2/PrebuiltOperator.pm »