Twilio/Rest/Marketplace/V1/AvailableAddOn.pm

filter: Statementstmt 84.3% 70 / 83 Branchbran 100% 2 / 2 Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 81.8% 27 / 33 Podpod n/a totaltotal 80.9% 102 / 126 CC 4 SCAR 2.9
CC
4
Cov
83%
page
2.0
new
2.0
read
2.0
CRAP 1.3
« Twilio/Rest/IpMessaging/V2/Service/Channel/Message.pm ↑ Summary Twilio/Rest/Preview/Marketplace/AvailableAddOn.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Marketplace::V1::AvailableAddOn;
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::Marketplace::V1::AvailableAddOnList;
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 4 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 4 my ($class, $version) = @_;
17 4 my $self = $class->SUPER::new($version);
18 4 $self->{solution} = {};
19 4 $self->{uri} = '/AvailableAddOns';
20 4 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
01
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
36  
37 1 my $params = {
38 PageToken => $page_token,
39 Page => $page_number,
40 PageSize => $page_size,
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::Marketplace::V1::AvailableAddOnPage->new($self->{version}, $response,
56 1 $self->{solution});
57 }
58  
59 3 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
60 3 my ($self, $sid) = @_;
61 3 return Twilio::Rest::Marketplace::V1::AvailableAddOnContext->new($self->{version}, $sid);
62 }
63  
64 package Twilio::Rest::Marketplace::V1::AvailableAddOnPage;
65  
66 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
67  
68 1 ▶sub records_key { return 'available_add_ons' }
Subroutine records_key: called CC=1 SCAR=0.0
69  
70 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
71 1 my ($self, $payload) = @_;
72 1 return Twilio::Rest::Marketplace::V1::AvailableAddOnInstance->new($self->{version}, $payload);
73 }
74  
75 package Twilio::Rest::Marketplace::V1::AvailableAddOnContext;
76  
77 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
78  
79 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
80  
81 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
82 3 my ($class, $version, $sid) = @_;
83 3 my $self = $class->SUPER::new($version);
84 3 $self->{solution} = { sid => $sid };
85 3 $self->{uri} = join q{}, '/AvailableAddOns/', Twilio::Serialize::path_segment($sid);
86 3 return $self;
87 }
88  
89 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
90 1 my ($self) = @_;
91  
92 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
93 1 return $self->_build_instance($response);
94 }
95  
96 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
97 1 my ($self, $response) = @_;
98 return Twilio::Rest::Marketplace::V1::AvailableAddOnInstance->new($self->{version},
99 1 $response->get_content, $self->{solution}{sid});
100 }
101  
102 2 ▶sub extensions {
Subroutine extensions: called CC=2 SCAR=6.9
103 2 my ($self, $sid) = @_;
104 2 require Twilio::Rest::Marketplace::V1::AvailableAddOn::AvailableAddOnExtension;
105 my $list = Twilio::Rest::Marketplace::V1::AvailableAddOn::AvailableAddOnExtensionList->new(
106 2 $self->{version}, $self->{solution}{sid});
107 2 ▶ return defined $sid ? $list->get_context($sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $sid ? : 1 1 2
108 }
109  
110 package Twilio::Rest::Marketplace::V1::AvailableAddOnInstance;
111  
112 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
113  
114 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
115  
116 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
117 2 my ($class, $version, $payload, $sid) = @_;
118 2 my $self = $class->SUPER::new($version, $payload);
119 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
120 2 return $self;
121 }
122  
123 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
124 0 my ($self, @arguments) = @_;
125 0 return $self->_context->fetch(@arguments);
126 }
127  
128 0 ▶sub extensions {
Subroutine extensions: not called CC=1 SCAR=6.9
129 0 my ($self, @arguments) = @_;
130 0 return $self->_context->extensions(@arguments);
131 }
132  
133 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
134 0 my ($self) = @_;
135 return Twilio::Rest::Marketplace::V1::AvailableAddOnContext->new($self->{version},
136 0 $self->{solution}{sid});
137 }
138  
139 2 ▶sub configuration_schema { return $_[0]{properties}{configuration_schema} }
Subroutine configuration_schema: called CC=1 SCAR=0.0
140 2 ▶sub description { return $_[0]{properties}{description} }
Subroutine description: called CC=1 SCAR=0.0
141 2 ▶sub friendly_name { return $_[0]{properties}{friendly_name} }
Subroutine friendly_name: called CC=1 SCAR=0.0
142 2 ▶sub links { return $_[0]{properties}{links} }
Subroutine links: called CC=1 SCAR=0.0
143 2 ▶sub pricing_type { return $_[0]{properties}{pricing_type} }
Subroutine pricing_type: called CC=1 SCAR=0.0
144 2 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
145 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
146  
147 2 1;
148  
149 __END__
« Twilio/Rest/IpMessaging/V2/Service/Channel/Message.pm ↑ Summary Twilio/Rest/Preview/Marketplace/AvailableAddOn.pm »