Twilio/Rest/Messaging/V1/Service/ChannelSender.pm

filter: Statementstmt 85.2% 75 / 88 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 83.3% 30 / 36 Podpod n/a totaltotal 81.8% 108 / 132 CC 3 SCAR 2.3
CC
3
Cov
84%
page
2.0
new
2.0
read
2.0
CRAP 1.3
« Twilio/Rest/Intelligence/V3/OperatorResult.pm ↑ Summary Twilio/Rest/Messaging/V1/Service/PhoneNumber.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Messaging::V1::Service::ChannelSender;
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::Messaging::V1::Service::ChannelSenderList;
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, $messaging_service_sid) = @_;
17 4 my $self = $class->SUPER::new($version);
18 4 $self->{solution} = { messaging_service_sid => $messaging_service_sid };
19 4 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($messaging_service_sid),
20 '/ChannelSenders';
21 4 return $self;
22 }
23  
24 1 ▶sub create {
Subroutine create: called CC=1 SCAR=0.0
25 1 my ($self, $sid) = @_;
26  
27 1 my $data = { Sid => $sid, };
28  
29 my $response =
30 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
31 return Twilio::Rest::Messaging::V1::Service::ChannelSenderInstance->new($self->{version},
32 1 $response->get_content, $self->{solution}{messaging_service_sid});
33 }
34  
35 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
36 0 my ($self, @arguments) = @_;
37 0 return $self->read_records(@arguments);
38 }
39  
40 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
41 0 my ($self, @arguments) = @_;
42 0 return $self->stream_records(@arguments);
43 }
44  
45 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
46 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
47 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
48  
49 1 my $params = {
50 PageToken => $page_token,
51 Page => $page_number,
52 PageSize => $page_size,
53 };
54  
55 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
56 1 return $self->_build_page($response);
57 }
58  
59 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
60 0 my ($self, $target_url) = @_;
61 0 my $client = $self->{version}->get_domain->get_client;
62 0 return $self->_build_page($client->request('GET', $target_url));
63 }
64  
65 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
66 1 my ($self, $response) = @_;
67 return Twilio::Rest::Messaging::V1::Service::ChannelSenderPage->new($self->{version}, $response,
68 1 $self->{solution});
69 }
70  
71 2 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
72 2 my ($self, $sid) = @_;
73 return Twilio::Rest::Messaging::V1::Service::ChannelSenderContext->new($self->{version},
74 2 $self->{solution}{messaging_service_sid}, $sid);
75 }
76  
77 package Twilio::Rest::Messaging::V1::Service::ChannelSenderPage;
78  
79 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
80  
81 1 ▶sub records_key { return 'senders' }
Subroutine records_key: called CC=1 SCAR=0.0
82  
83 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
84 1 my ($self, $payload) = @_;
85 return Twilio::Rest::Messaging::V1::Service::ChannelSenderInstance->new($self->{version},
86 1 $payload, $self->{solution}{messaging_service_sid});
87 }
88  
89 package Twilio::Rest::Messaging::V1::Service::ChannelSenderContext;
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 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
96 2 my ($class, $version, $messaging_service_sid, $sid) = @_;
97 2 my $self = $class->SUPER::new($version);
98 2 $self->{solution} = { messaging_service_sid => $messaging_service_sid, sid => $sid };
99 2 $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($messaging_service_sid),
100 '/ChannelSenders/', Twilio::Serialize::path_segment($sid);
101 2 return $self;
102 }
103  
104 1 ▶sub delete {
Subroutine delete: called CC=1 SCAR=0.0
105 1 my ($self) = @_;
106 1 $self->{version}->handle_request('DELETE', $self->{uri}, 'delete');
107 1 return 1;
108 }
109  
110 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
111 1 my ($self) = @_;
112  
113 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
114 1 return $self->_build_instance($response);
115 }
116  
117 1 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
118 1 my ($self, $response) = @_;
119 return Twilio::Rest::Messaging::V1::Service::ChannelSenderInstance->new(
120 $self->{version}, $response->get_content,
121 $self->{solution}{messaging_service_sid},
122 $self->{solution}{sid}
123 1 );
124 }
125  
126 package Twilio::Rest::Messaging::V1::Service::ChannelSenderInstance;
127  
128 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
129  
130 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
131  
132 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
133 3 my ($class, $version, $payload, $messaging_service_sid, $sid) = @_;
134 3 my $self = $class->SUPER::new($version, $payload);
135 $self->{solution} =
136 3 ▶ { messaging_service_sid => $messaging_service_sid, sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
120
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 _context {
Subroutine _context: not called CC=1 SCAR=6.9
151 0 my ($self) = @_;
152 return Twilio::Rest::Messaging::V1::Service::ChannelSenderContext->new(
153 $self->{version},
154 $self->{solution}{messaging_service_sid},
155 $self->{solution}{sid}
156 0 );
157 }
158  
159 3 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
160 3 ▶sub country_code { return $_[0]{properties}{country_code} }
Subroutine country_code: called CC=1 SCAR=0.0
161 3 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
162 3 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
163 3 ▶sub messaging_service_sid { return $_[0]{properties}{messaging_service_sid} }
Subroutine messaging_service_sid: called CC=1 SCAR=0.0
164 3 ▶sub sender { return $_[0]{properties}{sender} }
Subroutine sender: called CC=1 SCAR=0.0
165 3 ▶sub sender_type { return $_[0]{properties}{sender_type} }
Subroutine sender_type: called CC=1 SCAR=0.0
166 3 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
167 3 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
168  
169 2 1;
170  
171 __END__
« Twilio/Rest/Intelligence/V3/OperatorResult.pm ↑ Summary Twilio/Rest/Messaging/V1/Service/PhoneNumber.pm »