Twilio/Rest/Messaging/V1/BrandRegistration.pm

filter: Statementstmt 84.9% 96 / 113 Branchbran 100% 2 / 2 Conditioncond 57.1% 4 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 84.6% 44 / 52 Podpod n/a totaltotal 82.0% 146 / 178 CC 5 SCAR 2.5
CC
5
Cov
84%
create
2.0
page
2.0
new
2.0
CRAP 1.3
« Twilio/Rest/Api/V2010/Account/Application.pm ↑ Summary Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefix.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Messaging::V1::BrandRegistration;
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::BrandRegistrationList;
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 9 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 9 my ($class, $version) = @_;
17 9 my $self = $class->SUPER::new($version);
18 9 $self->{solution} = {};
19 9 $self->{uri} = '/a2p/BrandRegistrations';
20 9 return $self;
21 }
22  
23 1 ▶sub create {
Subroutine create: called CC=2 SCAR=7.0
24 1 my ($self, $customer_profile_bundle_sid, $a2p_profile_bundle_sid, $options) = @_;
25 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
26  
27 my $data = {
28 CustomerProfileBundleSid => $customer_profile_bundle_sid,
29 A2PProfileBundleSid => $a2p_profile_bundle_sid,
30 BrandType => $options->{brand_type},
31 Mock => Twilio::Serialize::boolean_to_string($options->{mock}),
32 1 SkipAutomaticSecVet => Twilio::Serialize::boolean_to_string($options->{skip_automatic_sec_vet}),
33 };
34  
35 my $response =
36 1 $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data });
37 return Twilio::Rest::Messaging::V1::BrandRegistrationInstance->new($self->{version},
38 1 $response->get_content);
39 }
40  
41 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
42 0 my ($self, @arguments) = @_;
43 0 return $self->read_records(@arguments);
44 }
45  
46 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
47 0 my ($self, @arguments) = @_;
48 0 return $self->stream_records(@arguments);
49 }
50  
51 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
52 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
53 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
54  
55 1 my $params = {
56 PageToken => $page_token,
57 Page => $page_number,
58 PageSize => $page_size,
59 };
60  
61 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
62 1 return $self->_build_page($response);
63 }
64  
65 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
66 0 my ($self, $target_url) = @_;
67 0 my $client = $self->{version}->get_domain->get_client;
68 0 return $self->_build_page($client->request('GET', $target_url));
69 }
70  
71 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
72 1 my ($self, $response) = @_;
73 return Twilio::Rest::Messaging::V1::BrandRegistrationPage->new($self->{version}, $response,
74 1 $self->{solution});
75 }
76  
77 7 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
78 7 my ($self, $sid) = @_;
79 7 return Twilio::Rest::Messaging::V1::BrandRegistrationContext->new($self->{version}, $sid);
80 }
81  
82 package Twilio::Rest::Messaging::V1::BrandRegistrationPage;
83  
84 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
85  
86 1 ▶sub records_key { return 'data' }
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 1 return Twilio::Rest::Messaging::V1::BrandRegistrationInstance->new($self->{version}, $payload);
91 }
92  
93 package Twilio::Rest::Messaging::V1::BrandRegistrationContext;
94  
95 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
96  
97 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
98  
99 7 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
100 7 my ($class, $version, $sid) = @_;
101 7 my $self = $class->SUPER::new($version);
102 7 $self->{solution} = { sid => $sid };
103 7 $self->{uri} = join q{}, '/a2p/BrandRegistrations/', Twilio::Serialize::path_segment($sid);
104 7 return $self;
105 }
106  
107 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
108 1 my ($self) = @_;
109  
110 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
111 1 return $self->_build_instance($response);
112 }
113  
114 1 ▶sub update {
Subroutine update: called CC=1 SCAR=0.0
115 1 my ($self) = @_;
116  
117 1 my $data = {};
118  
119 my $response =
120 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
121 1 return $self->_build_instance($response);
122 }
123  
124 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
125 2 my ($self, $response) = @_;
126 return Twilio::Rest::Messaging::V1::BrandRegistrationInstance->new($self->{version},
127 2 $response->get_content, $self->{solution}{sid});
128 }
129  
130 1 ▶sub brand_registration_otps {
Subroutine brand_registration_otps: called CC=1 SCAR=0.0
131 1 my ($self) = @_;
132 1 require Twilio::Rest::Messaging::V1::BrandRegistration::BrandRegistrationOtp;
133 return Twilio::Rest::Messaging::V1::BrandRegistration::BrandRegistrationOtpList->new(
134 1 $self->{version}, $self->{solution}{sid});
135 }
136  
137 4 ▶sub brand_vettings {
Subroutine brand_vettings: called CC=2 SCAR=6.9
138 4 my ($self, $brand_vetting_sid) = @_;
139 4 require Twilio::Rest::Messaging::V1::BrandRegistration::BrandVetting;
140 my $list = Twilio::Rest::Messaging::V1::BrandRegistration::BrandVettingList->new($self->{version},
141 4 $self->{solution}{sid});
142 4 ▶ return defined $brand_vetting_sid ? $list->get_context($brand_vetting_sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $brand_vetting_sid ? : 1 3 4
143 }
144  
145 package Twilio::Rest::Messaging::V1::BrandRegistrationInstance;
146  
147 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
148  
149 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
150  
151 4 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
152 4 my ($class, $version, $payload, $sid) = @_;
153 4 my $self = $class->SUPER::new($version, $payload);
154 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
155 4 return $self;
156 }
157  
158 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
159 0 my ($self, @arguments) = @_;
160 0 return $self->_context->fetch(@arguments);
161 }
162  
163 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
164 0 my ($self, @arguments) = @_;
165 0 return $self->_context->update(@arguments);
166 }
167  
168 0 ▶sub brand_registration_otps {
Subroutine brand_registration_otps: not called CC=1 SCAR=6.9
169 0 my ($self, @arguments) = @_;
170 0 return $self->_context->brand_registration_otps(@arguments);
171 }
172  
173 0 ▶sub brand_vettings {
Subroutine brand_vettings: not called CC=1 SCAR=6.9
174 0 my ($self, @arguments) = @_;
175 0 return $self->_context->brand_vettings(@arguments);
176 }
177  
178 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
179 0 my ($self) = @_;
180 return Twilio::Rest::Messaging::V1::BrandRegistrationContext->new($self->{version},
181 0 $self->{solution}{sid});
182 }
183  
184 4 ▶sub a2p_profile_bundle_sid { return $_[0]{properties}{a2p_profile_bundle_sid} }
Subroutine a2p_profile_bundle_sid: called CC=1 SCAR=0.0
185 4 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
186 4 ▶sub brand_feedback { return $_[0]{properties}{brand_feedback} }
Subroutine brand_feedback: called CC=1 SCAR=0.0
187 4 ▶sub brand_score { return $_[0]{properties}{brand_score} }
Subroutine brand_score: called CC=1 SCAR=0.0
188 4 ▶sub brand_type { return $_[0]{properties}{brand_type} }
Subroutine brand_type: called CC=1 SCAR=0.0
189 4 ▶sub customer_profile_bundle_sid { return $_[0]{properties}{customer_profile_bundle_sid} }
Subroutine customer_profile_bundle_sid: called CC=1 SCAR=0.0
190 4 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
191 4 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
192 4 ▶sub errors { return $_[0]{properties}{errors} }
Subroutine errors: called CC=1 SCAR=0.0
193 4 ▶sub failure_reason { return $_[0]{properties}{failure_reason} }
Subroutine failure_reason: called CC=1 SCAR=0.0
194 4 ▶sub government_entity { return $_[0]{properties}{government_entity} }
Subroutine government_entity: called CC=1 SCAR=0.0
195 4 ▶sub identity_status { return $_[0]{properties}{identity_status} }
Subroutine identity_status: called CC=1 SCAR=0.0
196 4 ▶sub links { return $_[0]{properties}{links} }
Subroutine links: called CC=1 SCAR=0.0
197 4 ▶sub mock { return $_[0]{properties}{mock} }
Subroutine mock: called CC=1 SCAR=0.0
198 4 ▶sub russell_3000 { return $_[0]{properties}{russell_3000} }
Subroutine russell_3000: called CC=1 SCAR=0.0
199 4 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
200 4 ▶sub skip_automatic_sec_vet { return $_[0]{properties}{skip_automatic_sec_vet} }
Subroutine skip_automatic_sec_vet: called CC=1 SCAR=0.0
201 4 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
202 4 ▶sub tax_exempt_status { return $_[0]{properties}{tax_exempt_status} }
Subroutine tax_exempt_status: called CC=1 SCAR=0.0
203 4 ▶sub tcr_id { return $_[0]{properties}{tcr_id} }
Subroutine tcr_id: called CC=1 SCAR=0.0
204 4 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
205  
206 2 1;
207  
208 __END__
« Twilio/Rest/Api/V2010/Account/Application.pm ↑ Summary Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefix.pm »