| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::FlexApi::V1::FlexFlow; | ||||||||||||||||||||
| 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::FlexFlowList; | ||||||||||||||||||||
| 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} = '/FlexFlows'; | |||||||||||||||||||
| 20 | 5 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 24 | 1 | my ($self, $friendly_name, $chat_service_sid, $channel_type, $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 | FriendlyName => $friendly_name, | ||||||||||||||||||||
| 29 | ChatServiceSid => $chat_service_sid, | ||||||||||||||||||||
| 30 | ChannelType => $channel_type, | ||||||||||||||||||||
| 31 | ContactIdentity => $options->{contact_identity}, | ||||||||||||||||||||
| 32 | Enabled => Twilio::Serialize::boolean_to_string($options->{enabled}), | ||||||||||||||||||||
| 33 | 'Integration.Channel' => $options->{integration_channel}, | ||||||||||||||||||||
| 34 | 'Integration.CreationOnMessage' => | ||||||||||||||||||||
| 35 | Twilio::Serialize::boolean_to_string($options->{integration_creation_on_message}), | ||||||||||||||||||||
| 36 | 'Integration.FlowSid' => $options->{integration_flow_sid}, | ||||||||||||||||||||
| 37 | 'Integration.Priority' => $options->{integration_priority}, | ||||||||||||||||||||
| 38 | 'Integration.RetryCount' => $options->{integration_retry_count}, | ||||||||||||||||||||
| 39 | 'Integration.Timeout' => $options->{integration_timeout}, | ||||||||||||||||||||
| 40 | 'Integration.Url' => $options->{integration_url}, | ||||||||||||||||||||
| 41 | 'Integration.WorkflowSid' => $options->{integration_workflow_sid}, | ||||||||||||||||||||
| 42 | 'Integration.WorkspaceSid' => $options->{integration_workspace_sid}, | ||||||||||||||||||||
| 43 | IntegrationType => $options->{integration_type}, | ||||||||||||||||||||
| 44 | JanitorEnabled => Twilio::Serialize::boolean_to_string($options->{janitor_enabled}), | ||||||||||||||||||||
| 45 | 1 | LongLived => Twilio::Serialize::boolean_to_string($options->{long_lived}), | |||||||||||||||||||
| 46 | }; | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | my $response = | ||||||||||||||||||||
| 49 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 50 | 1 | return Twilio::Rest::FlexApi::V1::FlexFlowInstance->new($self->{version}, $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 | 1 | PageToken => $page_token, | |||||||||||||||||||
| 70 | Page => $page_number, | ||||||||||||||||||||
| 71 | PageSize => $page_size, | ||||||||||||||||||||
| 72 | }; | ||||||||||||||||||||
| 73 | |||||||||||||||||||||
| 74 | 1 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||||||||||
| 75 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 76 | } | ||||||||||||||||||||
| 77 | |||||||||||||||||||||
| 78 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 79 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 80 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 81 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 82 | } | ||||||||||||||||||||
| 83 | |||||||||||||||||||||
| 84 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 85 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 86 | return Twilio::Rest::FlexApi::V1::FlexFlowPage->new($self->{version}, $response, | ||||||||||||||||||||
| 87 | 1 | $self->{solution}); | |||||||||||||||||||
| 88 | } | ||||||||||||||||||||
| 89 | |||||||||||||||||||||
| 90 | 3 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 91 | 3 | my ($self, $sid) = @_; | |||||||||||||||||||
| 92 | 3 | return Twilio::Rest::FlexApi::V1::FlexFlowContext->new($self->{version}, $sid); | |||||||||||||||||||
| 93 | } | ||||||||||||||||||||
| 94 | |||||||||||||||||||||
| 95 | package Twilio::Rest::FlexApi::V1::FlexFlowPage; | ||||||||||||||||||||
| 96 | |||||||||||||||||||||
| 97 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 98 | |||||||||||||||||||||
| 99 | 1 | ▶ | sub records_key { return 'flex_flows' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 100 | |||||||||||||||||||||
| 101 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 102 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 103 | 1 | return Twilio::Rest::FlexApi::V1::FlexFlowInstance->new($self->{version}, $payload); | |||||||||||||||||||
| 104 | } | ||||||||||||||||||||
| 105 | |||||||||||||||||||||
| 106 | package Twilio::Rest::FlexApi::V1::FlexFlowContext; | ||||||||||||||||||||
| 107 | |||||||||||||||||||||
| 108 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 109 | |||||||||||||||||||||
| 110 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 111 | |||||||||||||||||||||
| 112 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 113 | 3 | my ($class, $version, $sid) = @_; | |||||||||||||||||||
| 114 | 3 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 115 | 3 | $self->{solution} = { sid => $sid }; | |||||||||||||||||||
| 116 | 3 | $self->{uri} = join q{}, '/FlexFlows/', Twilio::Serialize::path_segment($sid); | |||||||||||||||||||
| 117 | 3 | return $self; | |||||||||||||||||||
| 118 | } | ||||||||||||||||||||
| 119 | |||||||||||||||||||||
| 120 | 1 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 121 | 1 | my ($self) = @_; | |||||||||||||||||||
| 122 | 1 | $self->{version}->handle_request('DELETE', $self->{uri}, 'delete'); | |||||||||||||||||||
| 123 | 1 | return 1; | |||||||||||||||||||
| 124 | } | ||||||||||||||||||||
| 125 | |||||||||||||||||||||
| 126 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 127 | 1 | my ($self) = @_; | |||||||||||||||||||
| 128 | |||||||||||||||||||||
| 129 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 130 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 131 | } | ||||||||||||||||||||
| 132 | |||||||||||||||||||||
| 133 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 134 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 135 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 136 | |||||||||||||||||||||
| 137 | my $data = { | ||||||||||||||||||||
| 138 | ChannelType => $options->{channel_type}, | ||||||||||||||||||||
| 139 | ChatServiceSid => $options->{chat_service_sid}, | ||||||||||||||||||||
| 140 | ContactIdentity => $options->{contact_identity}, | ||||||||||||||||||||
| 141 | Enabled => Twilio::Serialize::boolean_to_string($options->{enabled}), | ||||||||||||||||||||
| 142 | FriendlyName => $options->{friendly_name}, | ||||||||||||||||||||
| 143 | 'Integration.Channel' => $options->{integration_channel}, | ||||||||||||||||||||
| 144 | 'Integration.CreationOnMessage' => | ||||||||||||||||||||
| 145 | Twilio::Serialize::boolean_to_string($options->{integration_creation_on_message}), | ||||||||||||||||||||
| 146 | 'Integration.FlowSid' => $options->{integration_flow_sid}, | ||||||||||||||||||||
| 147 | 'Integration.Priority' => $options->{integration_priority}, | ||||||||||||||||||||
| 148 | 'Integration.RetryCount' => $options->{integration_retry_count}, | ||||||||||||||||||||
| 149 | 'Integration.Timeout' => $options->{integration_timeout}, | ||||||||||||||||||||
| 150 | 'Integration.Url' => $options->{integration_url}, | ||||||||||||||||||||
| 151 | 'Integration.WorkflowSid' => $options->{integration_workflow_sid}, | ||||||||||||||||||||
| 152 | 'Integration.WorkspaceSid' => $options->{integration_workspace_sid}, | ||||||||||||||||||||
| 153 | IntegrationType => $options->{integration_type}, | ||||||||||||||||||||
| 154 | JanitorEnabled => Twilio::Serialize::boolean_to_string($options->{janitor_enabled}), | ||||||||||||||||||||
| 155 | 1 | LongLived => Twilio::Serialize::boolean_to_string($options->{long_lived}), | |||||||||||||||||||
| 156 | }; | ||||||||||||||||||||
| 157 | |||||||||||||||||||||
| 158 | my $response = | ||||||||||||||||||||
| 159 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data }); | |||||||||||||||||||
| 160 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 161 | } | ||||||||||||||||||||
| 162 | |||||||||||||||||||||
| 163 | 2 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 164 | 2 | my ($self, $response) = @_; | |||||||||||||||||||
| 165 | return Twilio::Rest::FlexApi::V1::FlexFlowInstance->new($self->{version}, $response->get_content, | ||||||||||||||||||||
| 166 | 2 | $self->{solution}{sid}); | |||||||||||||||||||
| 167 | } | ||||||||||||||||||||
| 168 | |||||||||||||||||||||
| 169 | package Twilio::Rest::FlexApi::V1::FlexFlowInstance; | ||||||||||||||||||||
| 170 | |||||||||||||||||||||
| 171 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 172 | |||||||||||||||||||||
| 173 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 174 | |||||||||||||||||||||
| 175 | 4 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 176 | 4 | my ($class, $version, $payload, $sid) = @_; | |||||||||||||||||||
| 177 | 4 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 178 | 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"}
| |||||||||||||||||||||
| 179 | 4 | return $self; | |||||||||||||||||||
| 180 | } | ||||||||||||||||||||
| 181 | |||||||||||||||||||||
| 182 | 0 | ▶ | sub delete { | ||||||||||||||||||
|
Subroutine
delete: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 183 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 184 | 0 | return $self->_context->delete(@arguments); | |||||||||||||||||||
| 185 | } | ||||||||||||||||||||
| 186 | |||||||||||||||||||||
| 187 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 188 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 189 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 190 | } | ||||||||||||||||||||
| 191 | |||||||||||||||||||||
| 192 | 0 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 193 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 194 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 195 | } | ||||||||||||||||||||
| 196 | |||||||||||||||||||||
| 197 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 198 | 0 | my ($self) = @_; | |||||||||||||||||||
| 199 | 0 | return Twilio::Rest::FlexApi::V1::FlexFlowContext->new($self->{version}, $self->{solution}{sid}); | |||||||||||||||||||
| 200 | } | ||||||||||||||||||||
| 201 | |||||||||||||||||||||
| 202 | 4 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 203 | 4 | ▶ | sub channel_type { return $_[0]{properties}{channel_type} } | ||||||||||||||||||
|
Subroutine
channel_type: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 204 | 4 | ▶ | sub chat_service_sid { return $_[0]{properties}{chat_service_sid} } | ||||||||||||||||||
|
Subroutine
chat_service_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 205 | 4 | ▶ | sub contact_identity { return $_[0]{properties}{contact_identity} } | ||||||||||||||||||
|
Subroutine
contact_identity: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 206 | 4 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 207 | 4 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 208 | 4 | ▶ | sub enabled { return $_[0]{properties}{enabled} } | ||||||||||||||||||
|
Subroutine
enabled: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 209 | 4 | ▶ | sub friendly_name { return $_[0]{properties}{friendly_name} } | ||||||||||||||||||
|
Subroutine
friendly_name: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 210 | 4 | ▶ | sub integration { return $_[0]{properties}{integration} } | ||||||||||||||||||
|
Subroutine
integration: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 211 | 4 | ▶ | sub integration_type { return $_[0]{properties}{integration_type} } | ||||||||||||||||||
|
Subroutine
integration_type: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 212 | 4 | ▶ | sub janitor_enabled { return $_[0]{properties}{janitor_enabled} } | ||||||||||||||||||
|
Subroutine
janitor_enabled: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 213 | 4 | ▶ | sub long_lived { return $_[0]{properties}{long_lived} } | ||||||||||||||||||
|
Subroutine
long_lived: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 214 | 4 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 215 | 4 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 216 | |||||||||||||||||||||
| 217 | 2 | 1; | |||||||||||||||||||
| 218 | |||||||||||||||||||||
| 219 | __END__ | ||||||||||||||||||||