| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Serverless::V1::Service::Environment::Deployment; | ||||||||||||||||||||
| 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::Serverless::V1::Service::Environment::DeploymentList; | ||||||||||||||||||||
| 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, $service_sid, $environment_sid) = @_; | |||||||||||||||||||
| 17 | 3 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 3 | $self->{solution} = { service_sid => $service_sid, environment_sid => $environment_sid }; | |||||||||||||||||||
| 19 | 3 | $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid), | |||||||||||||||||||
| 20 | '/Environments/', Twilio::Serialize::path_segment($environment_sid), '/Deployments'; | ||||||||||||||||||||
| 21 | 3 | return $self; | |||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 25 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 26 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | my $data = { | ||||||||||||||||||||
| 29 | BuildSid => $options->{build_sid}, | ||||||||||||||||||||
| 30 | 1 | IsPlugin => Twilio::Serialize::boolean_to_string($options->{is_plugin}), | |||||||||||||||||||
| 31 | }; | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | my $response = | ||||||||||||||||||||
| 34 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 35 | return Twilio::Rest::Serverless::V1::Service::Environment::DeploymentInstance->new( | ||||||||||||||||||||
| 36 | $self->{version}, $response->get_content, | ||||||||||||||||||||
| 37 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 38 | $self->{solution}{environment_sid} | ||||||||||||||||||||
| 39 | 1 | ); | |||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | 0 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 43 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 44 | 0 | return $self->read_records(@arguments); | |||||||||||||||||||
| 45 | } | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 0 | ▶ | sub stream { | ||||||||||||||||||
|
Subroutine
stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 48 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 49 | 0 | return $self->stream_records(@arguments); | |||||||||||||||||||
| 50 | } | ||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 1 | ▶ | sub page { | ||||||||||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 53 | 1 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||||||||||
| 54 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | 1 | my $params = { | |||||||||||||||||||
| 57 | PageToken => $page_token, | ||||||||||||||||||||
| 58 | Page => $page_number, | ||||||||||||||||||||
| 59 | PageSize => $page_size, | ||||||||||||||||||||
| 60 | }; | ||||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | 1 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||||||||||
| 63 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 64 | } | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 67 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 68 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 69 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 70 | } | ||||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 73 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 74 | return Twilio::Rest::Serverless::V1::Service::Environment::DeploymentPage->new($self->{version}, | ||||||||||||||||||||
| 75 | 1 | $response, $self->{solution}); | |||||||||||||||||||
| 76 | } | ||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | 1 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 79 | 1 | my ($self, $sid) = @_; | |||||||||||||||||||
| 80 | return Twilio::Rest::Serverless::V1::Service::Environment::DeploymentContext->new( | ||||||||||||||||||||
| 81 | $self->{version}, | ||||||||||||||||||||
| 82 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 83 | 1 | $self->{solution}{environment_sid}, $sid | |||||||||||||||||||
| 84 | ); | ||||||||||||||||||||
| 85 | } | ||||||||||||||||||||
| 86 | |||||||||||||||||||||
| 87 | package Twilio::Rest::Serverless::V1::Service::Environment::DeploymentPage; | ||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 90 | |||||||||||||||||||||
| 91 | 1 | ▶ | sub records_key { return 'deployments' } | ||||||||||||||||||
|
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 | return Twilio::Rest::Serverless::V1::Service::Environment::DeploymentInstance->new( | ||||||||||||||||||||
| 96 | $self->{version}, $payload, | ||||||||||||||||||||
| 97 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 98 | $self->{solution}{environment_sid} | ||||||||||||||||||||
| 99 | 1 | ); | |||||||||||||||||||
| 100 | } | ||||||||||||||||||||
| 101 | |||||||||||||||||||||
| 102 | package Twilio::Rest::Serverless::V1::Service::Environment::DeploymentContext; | ||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 105 | |||||||||||||||||||||
| 106 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 107 | |||||||||||||||||||||
| 108 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 109 | 1 | my ($class, $version, $service_sid, $environment_sid, $sid) = @_; | |||||||||||||||||||
| 110 | 1 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 111 | $self->{solution} = | ||||||||||||||||||||
| 112 | 1 | { service_sid => $service_sid, environment_sid => $environment_sid, sid => $sid }; | |||||||||||||||||||
| 113 | 1 | $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid), | |||||||||||||||||||
| 114 | '/Environments/', Twilio::Serialize::path_segment($environment_sid), '/Deployments/', | ||||||||||||||||||||
| 115 | Twilio::Serialize::path_segment($sid); | ||||||||||||||||||||
| 116 | 1 | return $self; | |||||||||||||||||||
| 117 | } | ||||||||||||||||||||
| 118 | |||||||||||||||||||||
| 119 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 120 | 1 | my ($self) = @_; | |||||||||||||||||||
| 121 | |||||||||||||||||||||
| 122 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 123 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 124 | } | ||||||||||||||||||||
| 125 | |||||||||||||||||||||
| 126 | 1 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 127 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 128 | return Twilio::Rest::Serverless::V1::Service::Environment::DeploymentInstance->new( | ||||||||||||||||||||
| 129 | $self->{version}, $response->get_content, | ||||||||||||||||||||
| 130 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 131 | $self->{solution}{environment_sid}, | ||||||||||||||||||||
| 132 | $self->{solution}{sid} | ||||||||||||||||||||
| 133 | 1 | ); | |||||||||||||||||||
| 134 | } | ||||||||||||||||||||
| 135 | |||||||||||||||||||||
| 136 | package Twilio::Rest::Serverless::V1::Service::Environment::DeploymentInstance; | ||||||||||||||||||||
| 137 | |||||||||||||||||||||
| 138 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 139 | |||||||||||||||||||||
| 140 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 141 | |||||||||||||||||||||
| 142 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 143 | 3 | my ($class, $version, $payload, $service_sid, $environment_sid, $sid) = @_; | |||||||||||||||||||
| 144 | 3 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 145 | $self->{solution} = { | ||||||||||||||||||||
| 146 | service_sid => $service_sid, | ||||||||||||||||||||
| 147 | environment_sid => $environment_sid, | ||||||||||||||||||||
| 148 | sid => $sid // $self->{properties}{sid} | ||||||||||||||||||||
| 149 | 3 | ▶ | }; | ||||||||||||||||||
|
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"}
| |||||||||||||||||||||
| 150 | 3 | return $self; | |||||||||||||||||||
| 151 | } | ||||||||||||||||||||
| 152 | |||||||||||||||||||||
| 153 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 154 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 155 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 156 | } | ||||||||||||||||||||
| 157 | |||||||||||||||||||||
| 158 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 159 | 0 | my ($self) = @_; | |||||||||||||||||||
| 160 | return Twilio::Rest::Serverless::V1::Service::Environment::DeploymentContext->new( | ||||||||||||||||||||
| 161 | $self->{version}, | ||||||||||||||||||||
| 162 | $self->{solution}{service_sid}, | ||||||||||||||||||||
| 163 | $self->{solution}{environment_sid}, | ||||||||||||||||||||
| 164 | $self->{solution}{sid} | ||||||||||||||||||||
| 165 | 0 | ); | |||||||||||||||||||
| 166 | } | ||||||||||||||||||||
| 167 | |||||||||||||||||||||
| 168 | 3 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 169 | 3 | ▶ | sub build_sid { return $_[0]{properties}{build_sid} } | ||||||||||||||||||
|
Subroutine
build_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 170 | 3 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 171 | 3 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 172 | 3 | ▶ | sub environment_sid { return $_[0]{properties}{environment_sid} } | ||||||||||||||||||
|
Subroutine
environment_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 173 | 3 | ▶ | sub service_sid { return $_[0]{properties}{service_sid} } | ||||||||||||||||||
|
Subroutine
service_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 174 | 3 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 175 | 3 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 176 | |||||||||||||||||||||
| 177 | 2 | 1; | |||||||||||||||||||
| 178 | |||||||||||||||||||||
| 179 | __END__ | ||||||||||||||||||||