| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::FlexApi::V1::Interaction; | ||||||||||||||||||||
| 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::InteractionList; | ||||||||||||||||||||
| 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 | 14 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 14 | my ($class, $version) = @_; | |||||||||||||||||||
| 17 | 14 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 18 | 14 | $self->{solution} = {}; | |||||||||||||||||||
| 19 | 14 | $self->{uri} = '/Interactions'; | |||||||||||||||||||
| 20 | 14 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 1 | ▶ | sub create { | ||||||||||||||||||
|
Subroutine
create: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 24 | 1 | my ($self, $channel, $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 | Channel => Twilio::Serialize::json_object($channel), | ||||||||||||||||||||
| 29 | InteractionContextSid => $options->{interaction_context_sid}, | ||||||||||||||||||||
| 30 | Routing => Twilio::Serialize::json_object($options->{routing}), | ||||||||||||||||||||
| 31 | WebhookTtid => $options->{webhook_ttid}, | ||||||||||||||||||||
| 32 | 1 | }; | |||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | my $response = | ||||||||||||||||||||
| 35 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||||||||||
| 36 | return Twilio::Rest::FlexApi::V1::InteractionInstance->new($self->{version}, | ||||||||||||||||||||
| 37 | 1 | $response->get_content); | |||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 13 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 41 | 13 | my ($self, $sid) = @_; | |||||||||||||||||||
| 42 | 13 | return Twilio::Rest::FlexApi::V1::InteractionContext->new($self->{version}, $sid); | |||||||||||||||||||
| 43 | } | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | package Twilio::Rest::FlexApi::V1::InteractionContext; | ||||||||||||||||||||
| 46 | |||||||||||||||||||||
| 47 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | 13 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 52 | 13 | my ($class, $version, $sid) = @_; | |||||||||||||||||||
| 53 | 13 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 54 | 13 | $self->{solution} = { sid => $sid }; | |||||||||||||||||||
| 55 | 13 | $self->{uri} = join q{}, '/Interactions/', Twilio::Serialize::path_segment($sid); | |||||||||||||||||||
| 56 | 13 | return $self; | |||||||||||||||||||
| 57 | } | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 60 | 1 | my ($self) = @_; | |||||||||||||||||||
| 61 | |||||||||||||||||||||
| 62 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 63 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 64 | } | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | 1 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 67 | 1 | my ($self, $options) = @_; | |||||||||||||||||||
| 68 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 69 | |||||||||||||||||||||
| 70 | 1 | my $data = { WebhookTtid => $options->{webhook_ttid}, }; | |||||||||||||||||||
| 71 | |||||||||||||||||||||
| 72 | my $response = | ||||||||||||||||||||
| 73 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data }); | |||||||||||||||||||
| 74 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 75 | } | ||||||||||||||||||||
| 76 | |||||||||||||||||||||
| 77 | 2 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 78 | 2 | my ($self, $response) = @_; | |||||||||||||||||||
| 79 | return Twilio::Rest::FlexApi::V1::InteractionInstance->new($self->{version}, | ||||||||||||||||||||
| 80 | 2 | $response->get_content, $self->{solution}{sid}); | |||||||||||||||||||
| 81 | } | ||||||||||||||||||||
| 82 | |||||||||||||||||||||
| 83 | 11 | ▶ | sub channels { | ||||||||||||||||||
|
Subroutine
channels: called CC=2 SCAR=6.9
| |||||||||||||||||||||
| 84 | 11 | my ($self, $sid) = @_; | |||||||||||||||||||
| 85 | 11 | require Twilio::Rest::FlexApi::V1::Interaction::InteractionChannel; | |||||||||||||||||||
| 86 | my $list = Twilio::Rest::FlexApi::V1::Interaction::InteractionChannelList->new($self->{version}, | ||||||||||||||||||||
| 87 | 11 | $self->{solution}{sid}); | |||||||||||||||||||
| 88 | 11 | ▶ | return defined $sid ? $list->get_context($sid) : $list; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 89 | } | ||||||||||||||||||||
| 90 | |||||||||||||||||||||
| 91 | package Twilio::Rest::FlexApi::V1::InteractionInstance; | ||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 94 | |||||||||||||||||||||
| 95 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 96 | |||||||||||||||||||||
| 97 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 98 | 3 | my ($class, $version, $payload, $sid) = @_; | |||||||||||||||||||
| 99 | 3 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 100 | 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"}
| |||||||||||||||||||||
| 101 | 3 | return $self; | |||||||||||||||||||
| 102 | } | ||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 105 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 106 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 107 | } | ||||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | 0 | ▶ | sub update { | ||||||||||||||||||
|
Subroutine
update: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 110 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 111 | 0 | return $self->_context->update(@arguments); | |||||||||||||||||||
| 112 | } | ||||||||||||||||||||
| 113 | |||||||||||||||||||||
| 114 | 0 | ▶ | sub channels { | ||||||||||||||||||
|
Subroutine
channels: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 115 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 116 | 0 | return $self->_context->channels(@arguments); | |||||||||||||||||||
| 117 | } | ||||||||||||||||||||
| 118 | |||||||||||||||||||||
| 119 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 120 | 0 | my ($self) = @_; | |||||||||||||||||||
| 121 | return Twilio::Rest::FlexApi::V1::InteractionContext->new($self->{version}, | ||||||||||||||||||||
| 122 | 0 | $self->{solution}{sid}); | |||||||||||||||||||
| 123 | } | ||||||||||||||||||||
| 124 | |||||||||||||||||||||
| 125 | 3 | ▶ | sub channel { return $_[0]{properties}{channel} } | ||||||||||||||||||
|
Subroutine
channel: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 126 | 3 | ▶ | sub interaction_context_sid { return $_[0]{properties}{interaction_context_sid} } | ||||||||||||||||||
|
Subroutine
interaction_context_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 127 | 3 | ▶ | sub links { return $_[0]{properties}{links} } | ||||||||||||||||||
|
Subroutine
links: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 128 | 3 | ▶ | sub routing { return $_[0]{properties}{routing} } | ||||||||||||||||||
|
Subroutine
routing: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 129 | 3 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 130 | 3 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 131 | 3 | ▶ | sub webhook_ttid { return $_[0]{properties}{webhook_ttid} } | ||||||||||||||||||
|
Subroutine
webhook_ttid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 132 | |||||||||||||||||||||
| 133 | 2 | 1; | |||||||||||||||||||
| 134 | |||||||||||||||||||||
| 135 | __END__ | ||||||||||||||||||||