« Twilio/Rest/Verify/V2/Service/Entity/NewFactor.pm
↑ Summary
Twilio/Rest/Verify/V2/Service/NewChallenge.pm »
| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||
| 2 | package Twilio::Rest::Notify::V1::Service::Notification; | ||||||||||||
| 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::Notify::V1::Service::NotificationList; | ||||||||||||
| 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 | 1 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||
| 16 | 1 | my ($class, $version, $service_sid) = @_; | |||||||||||
| 17 | 1 | my $self = $class->SUPER::new($version); | |||||||||||
| 18 | 1 | $self->{solution} = { service_sid => $service_sid }; | |||||||||||
| 19 | 1 | $self->{uri} = join q{}, '/Services/', Twilio::Serialize::path_segment($service_sid), | |||||||||||
| 20 | '/Notifications'; | ||||||||||||
| 21 | 1 | 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 | Action => $options->{action}, | ||||||||||||
| 30 | Alexa => Twilio::Serialize::json_object($options->{alexa}), | ||||||||||||
| 31 | Apn => Twilio::Serialize::json_object($options->{apn}), | ||||||||||||
| 32 | Body => $options->{body}, | ||||||||||||
| 33 | Data => Twilio::Serialize::json_object($options->{data}), | ||||||||||||
| 34 | DeliveryCallbackUrl => $options->{delivery_callback_url}, | ||||||||||||
| 35 | FacebookMessenger => Twilio::Serialize::json_object($options->{facebook_messenger}), | ||||||||||||
| 36 | Fcm => Twilio::Serialize::json_object($options->{fcm}), | ||||||||||||
| 37 | Gcm => Twilio::Serialize::json_object($options->{gcm}), | ||||||||||||
| 38 | Identity => $options->{identity}, | ||||||||||||
| 39 | Priority => $options->{priority}, | ||||||||||||
| 40 | Segment => $options->{segment}, | ||||||||||||
| 41 | Sms => Twilio::Serialize::json_object($options->{sms}), | ||||||||||||
| 42 | Sound => $options->{sound}, | ||||||||||||
| 43 | Tag => $options->{tag}, | ||||||||||||
| 44 | Title => $options->{title}, | ||||||||||||
| 45 | ToBinding => $options->{to_binding}, | ||||||||||||
| 46 | Ttl => $options->{ttl}, | ||||||||||||
| 47 | 1 | }; | |||||||||||
| 48 | |||||||||||||
| 49 | my $response = | ||||||||||||
| 50 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'create', { data => $data }); | |||||||||||
| 51 | return Twilio::Rest::Notify::V1::Service::NotificationInstance->new($self->{version}, | ||||||||||||
| 52 | 1 | $response->get_content, $self->{solution}{service_sid}); | |||||||||||
| 53 | } | ||||||||||||
| 54 | |||||||||||||
| 55 | package Twilio::Rest::Notify::V1::Service::NotificationInstance; | ||||||||||||
| 56 | |||||||||||||
| 57 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 58 | |||||||||||||
| 59 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 60 | |||||||||||||
| 61 | 1 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||
| 62 | 1 | my ($class, $version, $payload, $service_sid) = @_; | |||||||||||
| 63 | 1 | my $self = $class->SUPER::new($version, $payload); | |||||||||||
| 64 | 1 | $self->{solution} = { service_sid => $service_sid }; | |||||||||||
| 65 | 1 | return $self; | |||||||||||
| 66 | } | ||||||||||||
| 67 | |||||||||||||
| 68 | 1 | ▶ | sub account_sid { return $_[0]{properties}{account_sid} } | ||||||||||
|
Subroutine
account_sid: called CC=1 SCAR=0.0
| |||||||||||||
| 69 | 1 | ▶ | sub action { return $_[0]{properties}{action} } | ||||||||||
|
Subroutine
action: called CC=1 SCAR=0.0
| |||||||||||||
| 70 | 1 | ▶ | sub alexa { return $_[0]{properties}{alexa} } | ||||||||||
|
Subroutine
alexa: called CC=1 SCAR=0.0
| |||||||||||||
| 71 | 1 | ▶ | sub apn { return $_[0]{properties}{apn} } | ||||||||||
|
Subroutine
apn: called CC=1 SCAR=0.0
| |||||||||||||
| 72 | 1 | ▶ | sub body { return $_[0]{properties}{body} } | ||||||||||
|
Subroutine
body: called CC=1 SCAR=0.0
| |||||||||||||
| 73 | 1 | ▶ | sub data { return $_[0]{properties}{data} } | ||||||||||
|
Subroutine
data: called CC=1 SCAR=0.0
| |||||||||||||
| 74 | 1 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||
| 75 | 1 | ▶ | sub facebook_messenger { return $_[0]{properties}{facebook_messenger} } | ||||||||||
|
Subroutine
facebook_messenger: called CC=1 SCAR=0.0
| |||||||||||||
| 76 | 1 | ▶ | sub fcm { return $_[0]{properties}{fcm} } | ||||||||||
|
Subroutine
fcm: called CC=1 SCAR=0.0
| |||||||||||||
| 77 | 1 | ▶ | sub gcm { return $_[0]{properties}{gcm} } | ||||||||||
|
Subroutine
gcm: called CC=1 SCAR=0.0
| |||||||||||||
| 78 | 1 | ▶ | sub identities { return $_[0]{properties}{identities} } | ||||||||||
|
Subroutine
identities: called CC=1 SCAR=0.0
| |||||||||||||
| 79 | 1 | ▶ | sub priority { return $_[0]{properties}{priority} } | ||||||||||
|
Subroutine
priority: called CC=1 SCAR=0.0
| |||||||||||||
| 80 | 1 | ▶ | sub segments { return $_[0]{properties}{segments} } | ||||||||||
|
Subroutine
segments: called CC=1 SCAR=0.0
| |||||||||||||
| 81 | 1 | ▶ | sub service_sid { return $_[0]{properties}{service_sid} } | ||||||||||
|
Subroutine
service_sid: called CC=1 SCAR=0.0
| |||||||||||||
| 82 | 1 | ▶ | sub sid { return $_[0]{properties}{sid} } | ||||||||||
|
Subroutine
sid: called CC=1 SCAR=0.0
| |||||||||||||
| 83 | 1 | ▶ | sub sms { return $_[0]{properties}{sms} } | ||||||||||
|
Subroutine
sms: called CC=1 SCAR=0.0
| |||||||||||||
| 84 | 1 | ▶ | sub sound { return $_[0]{properties}{sound} } | ||||||||||
|
Subroutine
sound: called CC=1 SCAR=0.0
| |||||||||||||
| 85 | 1 | ▶ | sub tags { return $_[0]{properties}{tags} } | ||||||||||
|
Subroutine
tags: called CC=1 SCAR=0.0
| |||||||||||||
| 86 | 1 | ▶ | sub title { return $_[0]{properties}{title} } | ||||||||||
|
Subroutine
title: called CC=1 SCAR=0.0
| |||||||||||||
| 87 | 1 | ▶ | sub ttl { return $_[0]{properties}{ttl} } | ||||||||||
|
Subroutine
ttl: called CC=1 SCAR=0.0
| |||||||||||||
| 88 | |||||||||||||
| 89 | 2 | 1; | |||||||||||
| 90 | |||||||||||||
| 91 | __END__ | ||||||||||||