| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Preview::HostedNumbers::HostedNumberOrder; | ||||||||||||||||||||
| 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::Preview::HostedNumbers::HostedNumberOrderList; | ||||||||||||||||||||
| 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 | 5 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 5 | my ($class, $version) = @_; | |||||||||||||||||||
| 17 | 5 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 5 | $self->{solution} = {}; | |||||||||||||||||||
| 19 | 5 | $self->{uri} = '/HostedNumberOrders'; | |||||||||||||||||||
| 20 | 5 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 24 | 1 | my ($self, $phone_number, $sms_capability, $options) = @_; | |||||||||||||||||||
| 25 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | my $data = { | ||||||||||||||||||||
| 28 | PhoneNumber => $phone_number, | ||||||||||||||||||||
| 29 | SmsCapability => Twilio::Serialize::boolean_to_string($sms_capability), | ||||||||||||||||||||
| 30 | AccountSid => $options->{account_sid}, | ||||||||||||||||||||
| 31 | AddressSid => $options->{address_sid}, | ||||||||||||||||||||
| 32 | CcEmails => $options->{cc_emails}, | ||||||||||||||||||||
| 33 | Email => $options->{email}, | ||||||||||||||||||||
| 34 | FriendlyName => $options->{friendly_name}, | ||||||||||||||||||||
| 35 | SmsApplicationSid => $options->{sms_application_sid}, | ||||||||||||||||||||
| 36 | SmsFallbackMethod => $options->{sms_fallback_method}, | ||||||||||||||||||||
| 37 | SmsFallbackUrl => $options->{sms_fallback_url}, | ||||||||||||||||||||
| 38 | SmsMethod => $options->{sms_method}, | ||||||||||||||||||||
| 39 | SmsUrl => $options->{sms_url}, | ||||||||||||||||||||
| 40 | StatusCallbackMethod => $options->{status_callback_method}, | ||||||||||||||||||||
| 41 | StatusCallbackUrl => $options->{status_callback_url}, | ||||||||||||||||||||
| 42 | UniqueName => $options->{unique_name}, | ||||||||||||||||||||
| 43 | VerificationDocumentSid => $options->{verification_document_sid}, | ||||||||||||||||||||
| 44 | VerificationType => $options->{verification_type}, | ||||||||||||||||||||
| 45 | 1 | }; | |||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | my $response = | ||||||||||||||||||||
| 48 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 49 | return Twilio::Rest::Preview::HostedNumbers::HostedNumberOrderInstance->new($self->{version}, | ||||||||||||||||||||
| 50 | 1 | $response->get_content); | |||||||||||||||||||
| 51 | } | ||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | 0 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 54 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 55 | 0 | return $self->read_records(@arguments); | |||||||||||||||||||
| 56 | } | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | 0 | ▶ | sub stream { | ||||||||||||||||||
|
Subroutine
stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 59 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 60 | 0 | return $self->stream_records(@arguments); | |||||||||||||||||||
| 61 | } | ||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | 1 | ▶ | sub page { | ||||||||||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 64 | 1 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||||||||||
| 65 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 66 | |||||||||||||||||||||
| 67 | my $params = { | ||||||||||||||||||||
| 68 | FriendlyName => $options->{friendly_name}, | ||||||||||||||||||||
| 69 | IncomingPhoneNumberSid => $options->{incoming_phone_number_sid}, | ||||||||||||||||||||
| 70 | PhoneNumber => $options->{phone_number}, | ||||||||||||||||||||
| 71 | Status => $options->{status}, | ||||||||||||||||||||
| 72 | UniqueName => $options->{unique_name}, | ||||||||||||||||||||
| 73 | 1 | PageToken => $page_token, | |||||||||||||||||||
| 74 | Page => $page_number, | ||||||||||||||||||||
| 75 | PageSize => $page_size, | ||||||||||||||||||||
| 76 | }; | ||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | 1 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||||||||||
| 79 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 80 | } | ||||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 83 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 84 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 85 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 86 | } | ||||||||||||||||||||
| 87 | |||||||||||||||||||||
| 88 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 89 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 90 | return Twilio::Rest::Preview::HostedNumbers::HostedNumberOrderPage->new($self->{version}, | ||||||||||||||||||||
| 91 | 1 | $response, $self->{solution}); | |||||||||||||||||||
| 92 | } | ||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | 3 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 95 | 3 | my ($self, $sid) = @_; | |||||||||||||||||||
| 96 | return Twilio::Rest::Preview::HostedNumbers::HostedNumberOrderContext->new($self->{version}, | ||||||||||||||||||||
| 97 | 3 | $sid); | |||||||||||||||||||
| 98 | } | ||||||||||||||||||||
| 99 | |||||||||||||||||||||
| 100 | package Twilio::Rest::Preview::HostedNumbers::HostedNumberOrderPage; | ||||||||||||||||||||
| 101 | |||||||||||||||||||||
| 102 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | 1 | ▶ | sub records_key { return 'items' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 105 | |||||||||||||||||||||
| 106 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 107 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 108 | return Twilio::Rest::Preview::HostedNumbers::HostedNumberOrderInstance->new($self->{version}, | ||||||||||||||||||||
| 109 | 1 | $payload); | |||||||||||||||||||
| 110 | } | ||||||||||||||||||||
| 111 | |||||||||||||||||||||
| 112 | package Twilio::Rest::Preview::HostedNumbers::HostedNumberOrderContext; | ||||||||||||||||||||
| 113 | |||||||||||||||||||||
| 114 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 115 | |||||||||||||||||||||
| 116 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 117 | |||||||||||||||||||||
| 118 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 119 | 3 | my ($class, $version, $sid) = @_; | |||||||||||||||||||
| 120 | 3 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 121 | 3 | $self->{solution} = { sid => $sid }; | |||||||||||||||||||
| 122 | 3 | $self->{uri} = join q{}, '/HostedNumberOrders/', Twilio::Serialize::path_segment($sid); | |||||||||||||||||||
| 123 | 3 | return $self; | |||||||||||||||||||
| 124 | } | ||||||||||||||||||||
| 125 | |||||||||||||||||||||
| 126 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 127 | 1 | my ($self) = @_; | |||||||||||||||||||
| 128 | 1 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete'); | |||||||||||||||||||
| 129 | 1 | return 1; | |||||||||||||||||||
| 130 | } | ||||||||||||||||||||
| 131 | |||||||||||||||||||||
| 132 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 133 | 1 | my ($self) = @_; | |||||||||||||||||||
| 134 | |||||||||||||||||||||
| 135 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 136 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 137 | } | ||||||||||||||||||||
| 138 | |||||||||||||||||||||
| 139 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 140 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 141 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 142 | |||||||||||||||||||||
| 143 | my $data = { | ||||||||||||||||||||
| 144 | CallDelay => $options->{call_delay}, | ||||||||||||||||||||
| 145 | CcEmails => $options->{cc_emails}, | ||||||||||||||||||||
| 146 | Email => $options->{email}, | ||||||||||||||||||||
| 147 | Extension => $options->{extension}, | ||||||||||||||||||||
| 148 | FriendlyName => $options->{friendly_name}, | ||||||||||||||||||||
| 149 | Status => $options->{status}, | ||||||||||||||||||||
| 150 | UniqueName => $options->{unique_name}, | ||||||||||||||||||||
| 151 | VerificationCode => $options->{verification_code}, | ||||||||||||||||||||
| 152 | VerificationDocumentSid => $options->{verification_document_sid}, | ||||||||||||||||||||
| 153 | VerificationType => $options->{verification_type}, | ||||||||||||||||||||
| 154 | 1 | }; | |||||||||||||||||||
| 155 | |||||||||||||||||||||
| 156 | my $response = | ||||||||||||||||||||
| 157 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data }); | |||||||||||||||||||
| 158 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 159 | } | ||||||||||||||||||||
| 160 | |||||||||||||||||||||
| 161 | 2 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 162 | 2 | my ($self, $response) = @_; | |||||||||||||||||||
| 163 | return Twilio::Rest::Preview::HostedNumbers::HostedNumberOrderInstance->new($self->{version}, | ||||||||||||||||||||
| 164 | 2 | $response->get_content, $self->{solution}{sid}); | |||||||||||||||||||
| 165 | } | ||||||||||||||||||||
| 166 | |||||||||||||||||||||
| 167 | package Twilio::Rest::Preview::HostedNumbers::HostedNumberOrderInstance; | ||||||||||||||||||||
| 168 | |||||||||||||||||||||
| 169 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 170 | |||||||||||||||||||||
| 171 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 172 | |||||||||||||||||||||
| 173 | 4 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 174 | 4 | my ($class, $version, $payload, $sid) = @_; | |||||||||||||||||||
| 175 | 4 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 176 | 4 | ▶ | $self->{solution} = { sid => $sid // $self->{properties}{sid} }; | ||||||||||||||||||
|
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
MC/DC0%0/2
$sid // $self->{"properties"}{"sid"}
$sid
$self->{"properties"}{"sid"}
Truth table66%2/3
A // B
A= $sidB= $self->{"properties"}{"sid"}
| |||||||||||||||||||||
| 177 | 4 | return $self; | |||||||||||||||||||
| 178 | } | ||||||||||||||||||||
| 179 | |||||||||||||||||||||
| 180 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 181 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 182 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 183 | } | ||||||||||||||||||||
| 184 | |||||||||||||||||||||
| 185 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 186 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 187 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 188 | } | ||||||||||||||||||||
| 189 | |||||||||||||||||||||
| 190 | 0 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 191 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 192 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 193 | } | ||||||||||||||||||||
| 194 | |||||||||||||||||||||
| 195 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 196 | 0 | my ($self) = @_; | |||||||||||||||||||
| 197 | return Twilio::Rest::Preview::HostedNumbers::HostedNumberOrderContext->new($self->{version}, | ||||||||||||||||||||
| 198 | 0 | $self->{solution}{sid}); | |||||||||||||||||||
| 199 | } | ||||||||||||||||||||
| 200 | |||||||||||||||||||||
| 201 | 4 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 202 | 4 | ▶ | sub address_sid { return $_[0]{properties}{address_sid} } | ||||||||||||||||||
|
Subroutine
address_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 203 | 4 | ▶ | sub call_delay { return $_[0]{properties}{call_delay} } | ||||||||||||||||||
|
Subroutine
call_delay: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 204 | |||||||||||||||||||||
| 205 | 4 | ▶ | sub capabilities { | ||||||||||||||||||
|
Subroutine
capabilities: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 206 | 4 | return Twilio::Deserialize::phone_number_capabilities($_[0]{properties}{capabilities}); | |||||||||||||||||||
| 207 | } | ||||||||||||||||||||
| 208 | 4 | ▶ | sub cc_emails { return $_[0]{properties}{cc_emails} } | ||||||||||||||||||
|
Subroutine
cc_emails: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 209 | 4 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 210 | 4 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 211 | 4 | ▶ | sub email { return $_[0]{properties}{email} } | ||||||||||||||||||
|
Subroutine
email: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 212 | 4 | ▶ | sub extension { return $_[0]{properties}{extension} } | ||||||||||||||||||
|
Subroutine
extension: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 213 | 4 | ▶ | sub failure_reason { return $_[0]{properties}{failure_reason} } | ||||||||||||||||||
|
Subroutine
failure_reason: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 214 | 4 | ▶ | sub friendly_name { return $_[0]{properties}{friendly_name} } | ||||||||||||||||||
|
Subroutine
friendly_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 215 | 4 | ▶ | sub incoming_phone_number_sid { return $_[0]{properties}{incoming_phone_number_sid} } | ||||||||||||||||||
|
Subroutine
incoming_phone_number_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 216 | 4 | ▶ | sub phone_number { return $_[0]{properties}{phone_number} } | ||||||||||||||||||
|
Subroutine
phone_number: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 217 | 4 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 218 | 4 | ▶ | sub signing_document_sid { return $_[0]{properties}{signing_document_sid} } | ||||||||||||||||||
|
Subroutine
signing_document_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 219 | 4 | ▶ | sub status { return $_[0]{properties}{status} } | ||||||||||||||||||
|
Subroutine
status: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 220 | 4 | ▶ | sub unique_name { return $_[0]{properties}{unique_name} } | ||||||||||||||||||
|
Subroutine
unique_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 221 | 4 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 222 | 4 | ▶ | sub verification_attempts { return $_[0]{properties}{verification_attempts} } | ||||||||||||||||||
|
Subroutine
verification_attempts: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 223 | 4 | ▶ | sub verification_call_sids { return $_[0]{properties}{verification_call_sids} } | ||||||||||||||||||
|
Subroutine
verification_call_sids: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 224 | 4 | ▶ | sub verification_code { return $_[0]{properties}{verification_code} } | ||||||||||||||||||
|
Subroutine
verification_code: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 225 | 4 | ▶ | sub verification_document_sid { return $_[0]{properties}{verification_document_sid} } | ||||||||||||||||||
|
Subroutine
verification_document_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 226 | 4 | ▶ | sub verification_type { return $_[0]{properties}{verification_type} } | ||||||||||||||||||
|
Subroutine
verification_type: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 227 | |||||||||||||||||||||
| 228 | 2 | 1; | |||||||||||||||||||
| 229 | |||||||||||||||||||||
| 230 | __END__ | ||||||||||||||||||||