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

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