| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Messaging::V1::BrandRegistration::BrandVetting; | ||||||||||||||||||||
| 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::BrandRegistration::BrandVettingList; | ||||||||||||||||||||
| 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, $brand_sid) = @_; | |||||||||||||||||||
| 17 | 4 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 4 | $self->{solution} = { brand_sid => $brand_sid }; | |||||||||||||||||||
| 19 | 4 | $self->{uri} = join q{}, '/a2p/BrandRegistrations/', Twilio::Serialize::path_segment($brand_sid), | |||||||||||||||||||
| 20 | '/Vettings'; | ||||||||||||||||||||
| 21 | 4 | return $self; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 2 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 25 | 2 | my ($self, $vetting_provider, $options) = @_; | |||||||||||||||||||
| 26 | 2 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | my $data = { | ||||||||||||||||||||
| 29 | VettingProvider => $vetting_provider, | ||||||||||||||||||||
| 30 | VettingId => $options->{vetting_id}, | ||||||||||||||||||||
| 31 | 2 | }; | |||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | my $response = | ||||||||||||||||||||
| 34 | 2 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 35 | return Twilio::Rest::Messaging::V1::BrandRegistration::BrandVettingInstance->new($self->{version}, | ||||||||||||||||||||
| 36 | 2 | $response->get_content, $self->{solution}{brand_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 //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | my $params = { | ||||||||||||||||||||
| 54 | VettingProvider => $options->{vetting_provider}, | ||||||||||||||||||||
| 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::BrandRegistration::BrandVettingPage->new($self->{version}, | ||||||||||||||||||||
| 73 | 1 | $response, $self->{solution}); | |||||||||||||||||||
| 74 | } | ||||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | 1 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 77 | 1 | my ($self, $brand_vetting_sid) = @_; | |||||||||||||||||||
| 78 | return Twilio::Rest::Messaging::V1::BrandRegistration::BrandVettingContext->new($self->{version}, | ||||||||||||||||||||
| 79 | $self->{solution}{brand_sid}, | ||||||||||||||||||||
| 80 | 1 | $brand_vetting_sid); | |||||||||||||||||||
| 81 | } | ||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | package Twilio::Rest::Messaging::V1::BrandRegistration::BrandVettingPage; | ||||||||||||||||||||
| 84 | |||||||||||||||||||||
| 85 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | 1 | ▶ | sub records_key { return 'data' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 90 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 91 | return Twilio::Rest::Messaging::V1::BrandRegistration::BrandVettingInstance->new($self->{version}, | ||||||||||||||||||||
| 92 | 1 | $payload, $self->{solution}{brand_sid}); | |||||||||||||||||||
| 93 | } | ||||||||||||||||||||
| 94 | |||||||||||||||||||||
| 95 | package Twilio::Rest::Messaging::V1::BrandRegistration::BrandVettingContext; | ||||||||||||||||||||
| 96 | |||||||||||||||||||||
| 97 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 98 | |||||||||||||||||||||
| 99 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 100 | |||||||||||||||||||||
| 101 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 102 | 1 | my ($class, $version, $brand_sid, $brand_vetting_sid) = @_; | |||||||||||||||||||
| 103 | 1 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 104 | 1 | $self->{solution} = { brand_sid => $brand_sid, brand_vetting_sid => $brand_vetting_sid }; | |||||||||||||||||||
| 105 | 1 | $self->{uri} = join q{}, '/a2p/BrandRegistrations/', Twilio::Serialize::path_segment($brand_sid), | |||||||||||||||||||
| 106 | '/Vettings/', Twilio::Serialize::path_segment($brand_vetting_sid); | ||||||||||||||||||||
| 107 | 1 | return $self; | |||||||||||||||||||
| 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::BrandRegistration::BrandVettingInstance->new( | ||||||||||||||||||||
| 120 | $self->{version}, $response->get_content, | ||||||||||||||||||||
| 121 | $self->{solution}{brand_sid}, | ||||||||||||||||||||
| 122 | $self->{solution}{brand_vetting_sid} | ||||||||||||||||||||
| 123 | 1 | ); | |||||||||||||||||||
| 124 | } | ||||||||||||||||||||
| 125 | |||||||||||||||||||||
| 126 | package Twilio::Rest::Messaging::V1::BrandRegistration::BrandVettingInstance; | ||||||||||||||||||||
| 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 | 4 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 133 | 4 | my ($class, $version, $payload, $brand_sid, $brand_vetting_sid) = @_; | |||||||||||||||||||
| 134 | 4 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 135 | $self->{solution} = { | ||||||||||||||||||||
| 136 | brand_sid => $brand_sid, | ||||||||||||||||||||
| 137 | brand_vetting_sid => $brand_vetting_sid // $self->{properties}{brand_vetting_sid} | ||||||||||||||||||||
| 138 | 4 | ▶ | }; | ||||||||||||||||||
|
Condition66%2/3
$brand_vetting_sid // $self->{"properties"}{"brand_vetting_sid"}
MC/DC0%0/2
$brand_vetting_sid // $self->{"properties"}{"brand_vetting_sid"}
$brand_vetting_sid
$self->{"properties"}{"brand_vetting_sid"}
Truth table66%2/3
A // B
A= $brand_vetting_sidB= $self->{"properties"}{"brand_vetting_sid"}
| |||||||||||||||||||||
| 139 | 4 | return $self; | |||||||||||||||||||
| 140 | } | ||||||||||||||||||||
| 141 | |||||||||||||||||||||
| 142 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 143 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 144 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 145 | } | ||||||||||||||||||||
| 146 | |||||||||||||||||||||
| 147 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 148 | 0 | my ($self) = @_; | |||||||||||||||||||
| 149 | return Twilio::Rest::Messaging::V1::BrandRegistration::BrandVettingContext->new( | ||||||||||||||||||||
| 150 | $self->{version}, | ||||||||||||||||||||
| 151 | $self->{solution}{brand_sid}, | ||||||||||||||||||||
| 152 | $self->{solution}{brand_vetting_sid} | ||||||||||||||||||||
| 153 | 0 | ); | |||||||||||||||||||
| 154 | } | ||||||||||||||||||||
| 155 | |||||||||||||||||||||
| 156 | 4 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 157 | 4 | ▶ | sub brand_sid { return $_[0]{properties}{brand_sid} } | ||||||||||||||||||
|
Subroutine
brand_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 158 | 4 | ▶ | sub brand_vetting_sid { return $_[0]{properties}{brand_vetting_sid} } | ||||||||||||||||||
|
Subroutine
brand_vetting_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 159 | 4 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 160 | 4 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 161 | 4 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 162 | 4 | ▶ | sub vetting_class { return $_[0]{properties}{vetting_class} } | ||||||||||||||||||
|
Subroutine
vetting_class: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 163 | 4 | ▶ | sub vetting_id { return $_[0]{properties}{vetting_id} } | ||||||||||||||||||
|
Subroutine
vetting_id: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 164 | 4 | ▶ | sub vetting_provider { return $_[0]{properties}{vetting_provider} } | ||||||||||||||||||
|
Subroutine
vetting_provider: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 165 | 4 | ▶ | sub vetting_status { return $_[0]{properties}{vetting_status} } | ||||||||||||||||||
|
Subroutine
vetting_status: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 166 | |||||||||||||||||||||
| 167 | 2 | 1; | |||||||||||||||||||
| 168 | |||||||||||||||||||||
| 169 | __END__ | ||||||||||||||||||||