« Twilio/Rest/Intelligence/V2/OperatorType.pm
↑ Summary
Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/Payload.pm »
| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||||||||||
| 2 | package Twilio::Rest::Monitor::V1::Event; | ||||||||||||||||||||
| 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::Monitor::V1::EventList; | ||||||||||||||||||||
| 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} = '/Events'; | |||||||||||||||||||
| 20 | 2 | return $self; | |||||||||||||||||||
| 21 | } | ||||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 0 | ▶ | sub read { | ||||||||||||||||||
|
Subroutine
read: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 24 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 25 | 0 | return $self->read_records(@arguments); | |||||||||||||||||||
| 26 | } | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | 0 | ▶ | sub stream { | ||||||||||||||||||
|
Subroutine
stream: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 29 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 30 | 0 | return $self->stream_records(@arguments); | |||||||||||||||||||
| 31 | } | ||||||||||||||||||||
| 32 | |||||||||||||||||||||
| 33 | 1 | ▶ | sub page { | ||||||||||||||||||
|
Subroutine
page: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 34 | 1 | my ($self, $options, $page_size, $page_token, $page_number) = @_; | |||||||||||||||||||
| 35 | 1 | ▶ | $options //= {}; | ||||||||||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | my $params = { | ||||||||||||||||||||
| 38 | ActorSid => $options->{actor_sid}, | ||||||||||||||||||||
| 39 | EndDate => Twilio::Serialize::iso8601_date_time($options->{end_date}), | ||||||||||||||||||||
| 40 | EventType => $options->{event_type}, | ||||||||||||||||||||
| 41 | ResourceSid => $options->{resource_sid}, | ||||||||||||||||||||
| 42 | SourceIpAddress => $options->{source_ip_address}, | ||||||||||||||||||||
| 43 | 1 | StartDate => Twilio::Serialize::iso8601_date_time($options->{start_date}), | |||||||||||||||||||
| 44 | PageToken => $page_token, | ||||||||||||||||||||
| 45 | Page => $page_number, | ||||||||||||||||||||
| 46 | PageSize => $page_size, | ||||||||||||||||||||
| 47 | }; | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | 1 | my $response = $self->{version}->page('GET', $self->{uri}, { params => $params }); | |||||||||||||||||||
| 50 | 1 | return $self->_build_page($response); | |||||||||||||||||||
| 51 | } | ||||||||||||||||||||
| 52 | |||||||||||||||||||||
| 53 | 0 | ▶ | sub get_page { | ||||||||||||||||||
|
Subroutine
get_page: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 54 | 0 | my ($self, $target_url) = @_; | |||||||||||||||||||
| 55 | 0 | my $client = $self->{version}->get_domain->get_client; | |||||||||||||||||||
| 56 | 0 | return $self->_build_page($client->request('GET', $target_url)); | |||||||||||||||||||
| 57 | } | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 1 | ▶ | sub _build_page { | ||||||||||||||||||
|
Subroutine
_build_page: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 60 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 61 | 1 | return Twilio::Rest::Monitor::V1::EventPage->new($self->{version}, $response, $self->{solution}); | |||||||||||||||||||
| 62 | } | ||||||||||||||||||||
| 63 | |||||||||||||||||||||
| 64 | 1 | ▶ | sub get_context { | ||||||||||||||||||
|
Subroutine
get_context: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 65 | 1 | my ($self, $sid) = @_; | |||||||||||||||||||
| 66 | 1 | return Twilio::Rest::Monitor::V1::EventContext->new($self->{version}, $sid); | |||||||||||||||||||
| 67 | } | ||||||||||||||||||||
| 68 | |||||||||||||||||||||
| 69 | package Twilio::Rest::Monitor::V1::EventPage; | ||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | 2 | ▶ | use parent 'Twilio::Page'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 72 | |||||||||||||||||||||
| 73 | 1 | ▶ | sub records_key { return 'events' } | ||||||||||||||||||
|
Subroutine
records_key: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | 1 | ▶ | sub build_instance { | ||||||||||||||||||
|
Subroutine
build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 76 | 1 | my ($self, $payload) = @_; | |||||||||||||||||||
| 77 | 1 | return Twilio::Rest::Monitor::V1::EventInstance->new($self->{version}, $payload); | |||||||||||||||||||
| 78 | } | ||||||||||||||||||||
| 79 | |||||||||||||||||||||
| 80 | package Twilio::Rest::Monitor::V1::EventContext; | ||||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | 2 | ▶ | use parent 'Twilio::InstanceContext'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 83 | |||||||||||||||||||||
| 84 | 2 | ▶ | use Twilio::Serialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 85 | |||||||||||||||||||||
| 86 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 87 | 1 | my ($class, $version, $sid) = @_; | |||||||||||||||||||
| 88 | 1 | my $self = $class->SUPER::new($version); | |||||||||||||||||||
| 89 | 1 | $self->{solution} = { sid => $sid }; | |||||||||||||||||||
| 90 | 1 | $self->{uri} = join q{}, '/Events/', Twilio::Serialize::path_segment($sid); | |||||||||||||||||||
| 91 | 1 | return $self; | |||||||||||||||||||
| 92 | } | ||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | 1 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 95 | 1 | my ($self) = @_; | |||||||||||||||||||
| 96 | |||||||||||||||||||||
| 97 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||||||||||
| 98 | 1 | return $self->_build_instance($response); | |||||||||||||||||||
| 99 | } | ||||||||||||||||||||
| 100 | |||||||||||||||||||||
| 101 | 1 | ▶ | sub _build_instance { | ||||||||||||||||||
|
Subroutine
_build_instance: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 102 | 1 | my ($self, $response) = @_; | |||||||||||||||||||
| 103 | return Twilio::Rest::Monitor::V1::EventInstance->new($self->{version}, $response->get_content, | ||||||||||||||||||||
| 104 | 1 | $self->{solution}{sid}); | |||||||||||||||||||
| 105 | } | ||||||||||||||||||||
| 106 | |||||||||||||||||||||
| 107 | package Twilio::Rest::Monitor::V1::EventInstance; | ||||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 110 | |||||||||||||||||||||
| 111 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 112 | |||||||||||||||||||||
| 113 | 2 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
| |||||||||||||||||||||
| 114 | 2 | my ($class, $version, $payload, $sid) = @_; | |||||||||||||||||||
| 115 | 2 | my $self = $class->SUPER::new($version, $payload); | |||||||||||||||||||
| 116 | 2 | ▶ | $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"}
| |||||||||||||||||||||
| 117 | 2 | return $self; | |||||||||||||||||||
| 118 | } | ||||||||||||||||||||
| 119 | |||||||||||||||||||||
| 120 | 0 | ▶ | sub fetch { | ||||||||||||||||||
|
Subroutine
fetch: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 121 | 0 | my ($self, @arguments) = @_; | |||||||||||||||||||
| 122 | 0 | return $self->_context->fetch(@arguments); | |||||||||||||||||||
| 123 | } | ||||||||||||||||||||
| 124 | |||||||||||||||||||||
| 125 | 0 | ▶ | sub _context { | ||||||||||||||||||
|
Subroutine
_context: not called CC=1 SCAR=6.9
| |||||||||||||||||||||
| 126 | 0 | my ($self) = @_; | |||||||||||||||||||
| 127 | 0 | return Twilio::Rest::Monitor::V1::EventContext->new($self->{version}, $self->{solution}{sid}); | |||||||||||||||||||
| 128 | } | ||||||||||||||||||||
| 129 | |||||||||||||||||||||
| 130 | 2 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 131 | 2 | ▶ | sub actor_sid { return $_[0]{properties}{actor_sid} } | ||||||||||||||||||
|
Subroutine
actor_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 132 | 2 | ▶ | sub actor_type { return $_[0]{properties}{actor_type} } | ||||||||||||||||||
|
Subroutine
actor_type: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 133 | 2 | ▶ | sub description { return $_[0]{properties}{description} } | ||||||||||||||||||
|
Subroutine
description: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 134 | 2 | ▶ | sub event_data { return $_[0]{properties}{event_data} } | ||||||||||||||||||
|
Subroutine
event_data: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 135 | 2 | ▶ | sub event_date { return Twilio::Deserialize::date_time($_[0]{properties}{event_date}) } | ||||||||||||||||||
|
Subroutine
event_date: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 136 | 2 | ▶ | sub event_type { return $_[0]{properties}{event_type} } | ||||||||||||||||||
|
Subroutine
event_type: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 137 | 2 | ▶ | sub links { return $_[0]{properties}{links} } | ||||||||||||||||||
|
Subroutine
links: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 138 | 2 | ▶ | sub resource_sid { return $_[0]{properties}{resource_sid} } | ||||||||||||||||||
|
Subroutine
resource_sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 139 | 2 | ▶ | sub resource_type { return $_[0]{properties}{resource_type} } | ||||||||||||||||||
|
Subroutine
resource_type: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 140 | 2 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 141 | 2 | ▶ | sub source { return $_[0]{properties}{source} } | ||||||||||||||||||
|
Subroutine
source: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 142 | 2 | ▶ | sub source_ip_address { return $_[0]{properties}{source_ip_address} } | ||||||||||||||||||
|
Subroutine
source_ip_address: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 143 | 2 | ▶ | sub url { return $_[0]{properties}{url} } | ||||||||||||||||||
|
Subroutine
url: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 144 | |||||||||||||||||||||
| 145 | 2 | 1; | |||||||||||||||||||
| 146 | |||||||||||||||||||||
| 147 | __END__ | ||||||||||||||||||||