| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Numbers::V2::Application; | ||||||||||||||||||||
| 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::Numbers::V2::ApplicationList; | ||||||||||||||||||||
| 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 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 3 | my ($class, $version) = @_; | |||||||||||||||||||
| 17 | 3 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 3 | $self->{solution} = {}; | |||||||||||||||||||
| 19 | 3 | $self->{uri} = '/ShortCodes/Applications'; | |||||||||||||||||||
| 20 | 3 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 24 | 1 | my ($self, $body) = @_; | |||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 1 | my $data = Twilio::Serialize::json_body($body, {}); | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | my $response = $self->{version}->handle_request( | ||||||||||||||||||||
| 29 | 'POST', | ||||||||||||||||||||
| 30 | $self->{uri}, | ||||||||||||||||||||
| 31 | 1 | 'create', | |||||||||||||||||||
| 32 | { | ||||||||||||||||||||
| 33 | data => $data, | ||||||||||||||||||||
| 34 | headers => { 'Content-Type' => 'application/json', } | ||||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | ); | ||||||||||||||||||||
| 37 | return Twilio::Rest::Numbers::V2::ApplicationInstance->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 //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 54 | |||||||||||||||||||||
| 55 | my $params = { | ||||||||||||||||||||
| 56 | AccountSid => $options->{account_sid}, | ||||||||||||||||||||
| 57 | FriendlyName => $options->{friendly_name}, | ||||||||||||||||||||
| 58 | IsoCountry => $options->{iso_country}, | ||||||||||||||||||||
| 59 | Sid => $options->{sid}, | ||||||||||||||||||||
| 60 | Status => $options->{status}, | ||||||||||||||||||||
| 61 | 1 | PageToken => $page_token, | |||||||||||||||||||
| 62 | Page => $page_number, | ||||||||||||||||||||
| 63 | PageSize => $page_size, | ||||||||||||||||||||
| 64 | }; | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | 1 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||||||||||
| 67 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 68 | } | ||||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 71 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 72 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 73 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 74 | } | ||||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 77 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 78 | return Twilio::Rest::Numbers::V2::ApplicationPage->new($self->{version}, $response, | ||||||||||||||||||||
| 79 | 1 | $self->{solution}); | |||||||||||||||||||
| 80 | } | ||||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | 1 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 83 | 1 | my ($self, $sid) = @_; | |||||||||||||||||||
| 84 | 1 | return Twilio::Rest::Numbers::V2::ApplicationContext->new($self->{version}, $sid); | |||||||||||||||||||
| 85 | } | ||||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | package Twilio::Rest::Numbers::V2::ApplicationPage; | ||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 90 | |||||||||||||||||||||
| 91 | 1 | ▶ | sub records_key { return 'results' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 94 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 95 | 1 | return Twilio::Rest::Numbers::V2::ApplicationInstance->new($self->{version}, $payload); | |||||||||||||||||||
| 96 | } | ||||||||||||||||||||
| 97 | |||||||||||||||||||||
| 98 | package Twilio::Rest::Numbers::V2::ApplicationContext; | ||||||||||||||||||||
| 99 | |||||||||||||||||||||
| 100 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 101 | |||||||||||||||||||||
| 102 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 105 | 1 | my ($class, $version, $sid) = @_; | |||||||||||||||||||
| 106 | 1 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 107 | 1 | $self->{solution} = { sid => $sid }; | |||||||||||||||||||
| 108 | 1 | $self->{uri} = join q{}, '/ShortCodes/Applications/', Twilio::Serialize::path_segment($sid); | |||||||||||||||||||
| 109 | 1 | return $self; | |||||||||||||||||||
| 110 | } | ||||||||||||||||||||
| 111 | |||||||||||||||||||||
| 112 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 113 | 1 | my ($self) = @_; | |||||||||||||||||||
| 114 | |||||||||||||||||||||
| 115 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 116 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 117 | } | ||||||||||||||||||||
| 118 | |||||||||||||||||||||
| 119 | 1 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 120 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 121 | return Twilio::Rest::Numbers::V2::ApplicationInstance->new($self->{version}, | ||||||||||||||||||||
| 122 | 1 | $response->get_content, $self->{solution}{sid}); | |||||||||||||||||||
| 123 | } | ||||||||||||||||||||
| 124 | |||||||||||||||||||||
| 125 | package Twilio::Rest::Numbers::V2::ApplicationInstance; | ||||||||||||||||||||
| 126 | |||||||||||||||||||||
| 127 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 128 | |||||||||||||||||||||
| 129 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 130 | |||||||||||||||||||||
| 131 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 132 | 3 | my ($class, $version, $payload, $sid) = @_; | |||||||||||||||||||
| 133 | 3 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 134 | 3 | ▶ | $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"}
| |||||||||||||||||||||
| 135 | 3 | return $self; | |||||||||||||||||||
| 136 | } | ||||||||||||||||||||
| 137 | |||||||||||||||||||||
| 138 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 139 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 140 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 141 | } | ||||||||||||||||||||
| 142 | |||||||||||||||||||||
| 143 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 144 | 0 | my ($self) = @_; | |||||||||||||||||||
| 145 | return Twilio::Rest::Numbers::V2::ApplicationContext->new($self->{version}, | ||||||||||||||||||||
| 146 | 0 | $self->{solution}{sid}); | |||||||||||||||||||
| 147 | } | ||||||||||||||||||||
| 148 | |||||||||||||||||||||
| 149 | 3 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 150 | 3 | ▶ | sub application_requirements_sid { return $_[0]{properties}{application_requirements_sid} } | ||||||||||||||||||
|
Subroutine
application_requirements_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 151 | 3 | ▶ | sub application_requirements_version { return $_[0]{properties}{application_requirements_version} } | ||||||||||||||||||
|
Subroutine
application_requirements_version: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 152 | 3 | ▶ | sub bundle_sid { return $_[0]{properties}{bundle_sid} } | ||||||||||||||||||
|
Subroutine
bundle_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 153 | 3 | ▶ | sub business_information { return $_[0]{properties}{business_information} } | ||||||||||||||||||
|
Subroutine
business_information: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 154 | 3 | ▶ | sub compliance_keywords { return $_[0]{properties}{compliance_keywords} } | ||||||||||||||||||
|
Subroutine
compliance_keywords: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 155 | 3 | ▶ | sub content_examples { return $_[0]{properties}{content_examples} } | ||||||||||||||||||
|
Subroutine
content_examples: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 156 | 3 | ▶ | sub created_by { return $_[0]{properties}{created_by} } | ||||||||||||||||||
|
Subroutine
created_by: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 157 | 3 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 158 | 3 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 159 | 3 | ▶ | sub friendly_name { return $_[0]{properties}{friendly_name} } | ||||||||||||||||||
|
Subroutine
friendly_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 160 | 3 | ▶ | sub iso_country { return $_[0]{properties}{iso_country} } | ||||||||||||||||||
|
Subroutine
iso_country: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 161 | 3 | ▶ | sub notification_emails { return $_[0]{properties}{notification_emails} } | ||||||||||||||||||
|
Subroutine
notification_emails: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 162 | 3 | ▶ | sub reviewer { return $_[0]{properties}{reviewer} } | ||||||||||||||||||
|
Subroutine
reviewer: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 163 | 3 | ▶ | sub setup { return $_[0]{properties}{setup} } | ||||||||||||||||||
|
Subroutine
setup: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 164 | 3 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 165 | 3 | ▶ | sub sms_campaign_details { return $_[0]{properties}{sms_campaign_details} } | ||||||||||||||||||
|
Subroutine
sms_campaign_details: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 166 | 3 | ▶ | sub state { return $_[0]{properties}{state} } | ||||||||||||||||||
|
Subroutine
state: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 167 | 3 | ▶ | sub updated_by { return $_[0]{properties}{updated_by} } | ||||||||||||||||||
|
Subroutine
updated_by: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 168 | 3 | ▶ | sub user_sign_up { return $_[0]{properties}{user_sign_up} } | ||||||||||||||||||
|
Subroutine
user_sign_up: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 169 | 3 | ▶ | sub zendesk_ticket_id { return $_[0]{properties}{zendesk_ticket_id} } | ||||||||||||||||||
|
Subroutine
zendesk_ticket_id: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 170 | |||||||||||||||||||||
| 171 | 2 | 1; | |||||||||||||||||||
| 172 | |||||||||||||||||||||
| 173 | __END__ | ||||||||||||||||||||