Twilio/Rest/Api/V2010/Account/OutgoingCallerId.pm

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