| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Routes::V2::SipDomain; | ||||||||||||||||||||
| 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::Routes::V2::SipDomainList; | ||||||||||||||||||||
| 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 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 2 | my ($class, $version) = @_; | |||||||||||||||||||
| 17 | 2 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 2 | $self->{solution} = {}; | |||||||||||||||||||
| 19 | 2 | $self->{uri} = '/SipDomains'; | |||||||||||||||||||
| 20 | 2 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 2 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 24 | 2 | my ($self, $sip_domain) = @_; | |||||||||||||||||||
| 25 | 2 | return Twilio::Rest::Routes::V2::SipDomainContext->new($self->{version}, $sip_domain); | |||||||||||||||||||
| 26 | } | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | package Twilio::Rest::Routes::V2::SipDomainContext; | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 35 | 2 | my ($class, $version, $sip_domain) = @_; | |||||||||||||||||||
| 36 | 2 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 37 | 2 | $self->{solution} = { sip_domain => $sip_domain }; | |||||||||||||||||||
| 38 | 2 | $self->{uri} = join q{}, '/SipDomains/', Twilio::Serialize::path_segment($sip_domain); | |||||||||||||||||||
| 39 | 2 | return $self; | |||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 43 | 1 | my ($self) = @_; | |||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 46 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 47 | } | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 50 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 51 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | my $data = { | ||||||||||||||||||||
| 54 | FriendlyName => $options->{friendly_name}, | ||||||||||||||||||||
| 55 | VoiceRegion => $options->{voice_region}, | ||||||||||||||||||||
| 56 | 1 | }; | |||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | my $response = | ||||||||||||||||||||
| 59 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data }); | |||||||||||||||||||
| 60 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 61 | } | ||||||||||||||||||||
| 62 | |||||||||||||||||||||
| 63 | 2 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 64 | 2 | my ($self, $response) = @_; | |||||||||||||||||||
| 65 | return Twilio::Rest::Routes::V2::SipDomainInstance->new($self->{version}, $response->get_content, | ||||||||||||||||||||
| 66 | 2 | $self->{solution}{sip_domain}); | |||||||||||||||||||
| 67 | } | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | package Twilio::Rest::Routes::V2::SipDomainInstance; | ||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 72 | |||||||||||||||||||||
| 73 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.4
| |||||||||||||||||||||
| 76 | 2 | my ($class, $version, $payload, $sip_domain) = @_; | |||||||||||||||||||
| 77 | 2 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 78 | 2 | ▶ | $self->{solution} = { sip_domain => $sip_domain // $self->{properties}{sip_domain} }; | ||||||||||||||||||
|
Condition33%1/3
$sip_domain // $self->{"properties"}{"sip_domain"}
MC/DC0%0/2
$sip_domain // $self->{"properties"}{"sip_domain"}
$sip_domain
$self->{"properties"}{"sip_domain"}
Truth table33%1/3
A // B
A= $sip_domainB= $self->{"properties"}{"sip_domain"}
| |||||||||||||||||||||
| 79 | 2 | return $self; | |||||||||||||||||||
| 80 | } | ||||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 83 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 84 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 85 | } | ||||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | 0 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 88 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 89 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 90 | } | ||||||||||||||||||||
| 91 | |||||||||||||||||||||
| 92 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 93 | 0 | my ($self) = @_; | |||||||||||||||||||
| 94 | return Twilio::Rest::Routes::V2::SipDomainContext->new($self->{version}, | ||||||||||||||||||||
| 95 | 0 | $self->{solution}{sip_domain}); | |||||||||||||||||||
| 96 | } | ||||||||||||||||||||
| 97 | |||||||||||||||||||||
| 98 | 2 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 99 | 2 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 100 | 2 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 101 | 2 | ▶ | sub friendly_name { return $_[0]{properties}{friendly_name} } | ||||||||||||||||||
|
Subroutine
friendly_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 102 | 2 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 103 | 2 | ▶ | sub sip_domain { return $_[0]{properties}{sip_domain} } | ||||||||||||||||||
|
Subroutine
sip_domain: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 104 | 2 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 105 | 2 | ▶ | sub voice_region { return $_[0]{properties}{voice_region} } | ||||||||||||||||||
|
Subroutine
voice_region: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 106 | |||||||||||||||||||||
| 107 | 2 | 1; | |||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | __END__ | ||||||||||||||||||||