| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::FlexApi::V1::PluginConfiguration; | ||||||||||||||||||||
| 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::FlexApi::V1::PluginConfigurationList; | ||||||||||||||||||||
| 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} = '/PluginService/Configurations'; | |||||||||||||||||||
| 20 | 5 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 24 | 1 | my ($self, $name, $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 | Name => $name, | ||||||||||||||||||||
| 29 | Description => $options->{description}, | ||||||||||||||||||||
| 30 | 1 | Plugins => Twilio::Serialize::map_values($options->{plugins}, \&Twilio::Serialize::json_object), | |||||||||||||||||||
| 31 | }; | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | my $response = $self->{version}->handle_request( | ||||||||||||||||||||
| 34 | 'POST', | ||||||||||||||||||||
| 35 | $self->{uri}, | ||||||||||||||||||||
| 36 | 'create', | ||||||||||||||||||||
| 37 | { | ||||||||||||||||||||
| 38 | data => $data, | ||||||||||||||||||||
| 39 | headers => { 'Flex-Metadata' => $options->{flex_metadata}, } | ||||||||||||||||||||
| 40 | } | ||||||||||||||||||||
| 41 | 1 | ); | |||||||||||||||||||
| 42 | return Twilio::Rest::FlexApi::V1::PluginConfigurationInstance->new($self->{version}, | ||||||||||||||||||||
| 43 | 1 | $response->get_content); | |||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | 0 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 47 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 48 | 0 | return $self->read_records(@arguments); | |||||||||||||||||||
| 49 | } | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 0 | ▶ | sub stream { | ||||||||||||||||||
|
Subroutine
stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 52 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 53 | 0 | return $self->stream_records(@arguments); | |||||||||||||||||||
| 54 | } | ||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | 1 | ▶ | sub page { | ||||||||||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 57 | 1 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||||||||||
| 58 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 59 | |||||||||||||||||||||
| 60 | 1 | my $params = { | |||||||||||||||||||
| 61 | PageToken => $page_token, | ||||||||||||||||||||
| 62 | Page => $page_number, | ||||||||||||||||||||
| 63 | PageSize => $page_size, | ||||||||||||||||||||
| 64 | }; | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | my $response = $self->{version}->page( | ||||||||||||||||||||
| 67 | 'GET', | ||||||||||||||||||||
| 68 | $self->{uri}, | ||||||||||||||||||||
| 69 | { | ||||||||||||||||||||
| 70 | params => $params, | ||||||||||||||||||||
| 71 | headers => { 'Flex-Metadata' => $options->{flex_metadata}, } | ||||||||||||||||||||
| 72 | } | ||||||||||||||||||||
| 73 | 1 | ); | |||||||||||||||||||
| 74 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 75 | } | ||||||||||||||||||||
| 76 | |||||||||||||||||||||
| 77 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 78 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 79 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 80 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 81 | } | ||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 84 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 85 | return Twilio::Rest::FlexApi::V1::PluginConfigurationPage->new($self->{version}, $response, | ||||||||||||||||||||
| 86 | 1 | $self->{solution}); | |||||||||||||||||||
| 87 | } | ||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | 3 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 90 | 3 | my ($self, $sid) = @_; | |||||||||||||||||||
| 91 | 3 | return Twilio::Rest::FlexApi::V1::PluginConfigurationContext->new($self->{version}, $sid); | |||||||||||||||||||
| 92 | } | ||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | package Twilio::Rest::FlexApi::V1::PluginConfigurationPage; | ||||||||||||||||||||
| 95 | |||||||||||||||||||||
| 96 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 97 | |||||||||||||||||||||
| 98 | 1 | ▶ | sub records_key { return 'configurations' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 99 | |||||||||||||||||||||
| 100 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 101 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 102 | 1 | return Twilio::Rest::FlexApi::V1::PluginConfigurationInstance->new($self->{version}, $payload); | |||||||||||||||||||
| 103 | } | ||||||||||||||||||||
| 104 | |||||||||||||||||||||
| 105 | package Twilio::Rest::FlexApi::V1::PluginConfigurationContext; | ||||||||||||||||||||
| 106 | |||||||||||||||||||||
| 107 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 110 | |||||||||||||||||||||
| 111 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 112 | 3 | my ($class, $version, $sid) = @_; | |||||||||||||||||||
| 113 | 3 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 114 | 3 | $self->{solution} = { sid => $sid }; | |||||||||||||||||||
| 115 | 3 | $self->{uri} = join q{}, '/PluginService/Configurations/', Twilio::Serialize::path_segment($sid); | |||||||||||||||||||
| 116 | 3 | return $self; | |||||||||||||||||||
| 117 | } | ||||||||||||||||||||
| 118 | |||||||||||||||||||||
| 119 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 120 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 121 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 122 | |||||||||||||||||||||
| 123 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch', | ||||||||||||||||||||
| 124 | 1 | { headers => { 'Flex-Metadata' => $options->{flex_metadata}, } }); | |||||||||||||||||||
| 125 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 126 | } | ||||||||||||||||||||
| 127 | |||||||||||||||||||||
| 128 | 1 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 129 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 130 | return Twilio::Rest::FlexApi::V1::PluginConfigurationInstance->new($self->{version}, | ||||||||||||||||||||
| 131 | 1 | $response->get_content, $self->{solution}{sid}); | |||||||||||||||||||
| 132 | } | ||||||||||||||||||||
| 133 | |||||||||||||||||||||
| 134 | 2 | ▶ | sub plugins { | ||||||||||||||||||
|
Subroutine
plugins: called CC=2 SCAR=6.9
| |||||||||||||||||||||
| 135 | 2 | my ($self, $plugin_sid) = @_; | |||||||||||||||||||
| 136 | 2 | require Twilio::Rest::FlexApi::V1::PluginConfiguration::ConfiguredPlugin; | |||||||||||||||||||
| 137 | my $list = | ||||||||||||||||||||
| 138 | Twilio::Rest::FlexApi::V1::PluginConfiguration::ConfiguredPluginList->new($self->{version}, | ||||||||||||||||||||
| 139 | 2 | $self->{solution}{sid}); | |||||||||||||||||||
| 140 | 2 | ▶ | return defined $plugin_sid ? $list->get_context($plugin_sid) : $list; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 141 | } | ||||||||||||||||||||
| 142 | |||||||||||||||||||||
| 143 | package Twilio::Rest::FlexApi::V1::PluginConfigurationInstance; | ||||||||||||||||||||
| 144 | |||||||||||||||||||||
| 145 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 146 | |||||||||||||||||||||
| 147 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 148 | |||||||||||||||||||||
| 149 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 150 | 3 | my ($class, $version, $payload, $sid) = @_; | |||||||||||||||||||
| 151 | 3 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 152 | 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"}
| |||||||||||||||||||||
| 153 | 3 | return $self; | |||||||||||||||||||
| 154 | } | ||||||||||||||||||||
| 155 | |||||||||||||||||||||
| 156 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 157 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 158 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 159 | } | ||||||||||||||||||||
| 160 | |||||||||||||||||||||
| 161 | 0 | ▶ | sub plugins { | ||||||||||||||||||
|
Subroutine
plugins: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 162 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 163 | 0 | return $self->_context->plugins(@arguments); | |||||||||||||||||||
| 164 | } | ||||||||||||||||||||
| 165 | |||||||||||||||||||||
| 166 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 167 | 0 | my ($self) = @_; | |||||||||||||||||||
| 168 | return Twilio::Rest::FlexApi::V1::PluginConfigurationContext->new($self->{version}, | ||||||||||||||||||||
| 169 | 0 | $self->{solution}{sid}); | |||||||||||||||||||
| 170 | } | ||||||||||||||||||||
| 171 | |||||||||||||||||||||
| 172 | 3 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 173 | 3 | ▶ | sub archived { return $_[0]{properties}{archived} } | ||||||||||||||||||
|
Subroutine
archived: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 174 | 3 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 175 | 3 | ▶ | sub description { return $_[0]{properties}{description} } | ||||||||||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 176 | 3 | ▶ | sub links { return $_[0]{properties}{links} } | ||||||||||||||||||
|
Subroutine
links: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 177 | 3 | ▶ | sub name { return $_[0]{properties}{name} } | ||||||||||||||||||
|
Subroutine
name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 178 | 3 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 179 | 3 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 180 | |||||||||||||||||||||
| 181 | 2 | 1; | |||||||||||||||||||
| 182 | |||||||||||||||||||||
| 183 | __END__ | ||||||||||||||||||||