Twilio/Rest/Voice/V1/SourceIpMapping.pm

filter: Statementstmt 83.5% 76 / 91 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 80.0% 28 / 35 Podpod n/a totaltotal 79.8% 107 / 134 CC 3 SCAR 2.6
CC
3
Cov
82%
page
2.0
new
2.0
read
2.0
CRAP 1.3
« Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermission.pm ↑ Summary Twilio/Rest/Verify/V2/Service/MessagingConfiguration.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Voice::V1::SourceIpMapping;
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::Voice::V1::SourceIpMappingList;
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 5 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 5 my ($class, $version) = @_;
17 5 my $self = $class->SUPER::new($version);
18 5 $self->{solution} = {};
19 5 $self->{uri} = '/SourceIpMappings';
20 5 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
24 1 my ($self, $ip_record_sid, $sip_domain_sid) = @_;
25  
26 1 my $data = {
27 IpRecordSid => $ip_record_sid,
28 SipDomainSid => $sip_domain_sid,
29 };
30  
31 my $response =
32 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
33 return Twilio::Rest::Voice::V1::SourceIpMappingInstance->new($self->{version},
34 1 $response->get_content);
35 }
36  
37 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
38 0 my ($self, @arguments) = @_;
39 0 return $self->read_records(@arguments);
40 }
41  
42 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
43 0 my ($self, @arguments) = @_;
44 0 return $self->stream_records(@arguments);
45 }
46  
47 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
48 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
49 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
50  
51 1 my $params = {
52 PageToken => $page_token,
53 Page => $page_number,
54 PageSize => $page_size,
55 };
56  
57 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
58 1 return $self->_build_page($response);
59 }
60  
61 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
62 0 my ($self, $target_url) = @_;
63 0 my $client = $self->{version}->get_domain->get_client;
64 0 return $self->_build_page($client->request('GET', $target_url));
65 }
66  
67 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
68 1 my ($self, $response) = @_;
69 return Twilio::Rest::Voice::V1::SourceIpMappingPage->new($self->{version}, $response,
70 1 $self->{solution});
71 }
72  
73 3 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
74 3 my ($self, $sid) = @_;
75 3 return Twilio::Rest::Voice::V1::SourceIpMappingContext->new($self->{version}, $sid);
76 }
77  
78 package Twilio::Rest::Voice::V1::SourceIpMappingPage;
79  
80 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
81  
82 1 ▶sub records_key { return 'source_ip_mappings' }
Subroutine records_key: called CC=1 SCAR=0.0
83  
84 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
85 1 my ($self, $payload) = @_;
86 1 return Twilio::Rest::Voice::V1::SourceIpMappingInstance->new($self->{version}, $payload);
87 }
88  
89 package Twilio::Rest::Voice::V1::SourceIpMappingContext;
90  
91 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
92  
93 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
94  
95 3 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
96 3 my ($class, $version, $sid) = @_;
97 3 my $self = $class->SUPER::new($version);
98 3 $self->{solution} = { sid => $sid };
99 3 $self->{uri} = join q{}, '/SourceIpMappings/', Twilio::Serialize::path_segment($sid);
100 3 return $self;
101 }
102  
103 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
104 1 my ($self) = @_;
105 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
106 1 return 1;
107 }
108  
109 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
110 1 my ($self) = @_;
111  
112 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
113 1 return $self->_build_instance($response);
114 }
115  
116 1 ▶sub update {
Subroutine update: called CC=1 SCAR=0.0
117 1 my ($self, $sip_domain_sid) = @_;
118  
119 1 my $data = { SipDomainSid => $sip_domain_sid, };
120  
121 my $response =
122 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
123 1 return $self->_build_instance($response);
124 }
125  
126 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
127 2 my ($self, $response) = @_;
128 return Twilio::Rest::Voice::V1::SourceIpMappingInstance->new($self->{version},
129 2 $response->get_content, $self->{solution}{sid});
130 }
131  
132 package Twilio::Rest::Voice::V1::SourceIpMappingInstance;
133  
134 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
135  
136 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
137  
138 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
139 4 my ($class, $version, $payload, $sid) = @_;
140 4 my $self = $class->SUPER::new($version, $payload);
141 4 ▶ $self->{solution} = { sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
220
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
142 4 return $self;
143 }
144  
145 0 ▶sub delete {
Subroutine delete: not called CC=1 SCAR=6.9
146 0 my ($self, @arguments) = @_;
147 0 return $self->_context->delete(@arguments);
148 }
149  
150 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
151 0 my ($self, @arguments) = @_;
152 0 return $self->_context->fetch(@arguments);
153 }
154  
155 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
156 0 my ($self, @arguments) = @_;
157 0 return $self->_context->update(@arguments);
158 }
159  
160 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
161 0 my ($self) = @_;
162 return Twilio::Rest::Voice::V1::SourceIpMappingContext->new($self->{version},
163 0 $self->{solution}{sid});
164 }
165  
166 4 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
167 4 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
168 4 ▶sub ip_record_sid { return $_[0]{properties}{ip_record_sid} }
Subroutine ip_record_sid: called CC=1 SCAR=0.0
169 4 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
170 4 ▶sub sip_domain_sid { return $_[0]{properties}{sip_domain_sid} }
Subroutine sip_domain_sid: called CC=1 SCAR=0.0
171 4 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
172  
173 2 1;
174  
175 __END__
« Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermission.pm ↑ Summary Twilio/Rest/Verify/V2/Service/MessagingConfiguration.pm »