| 1 | # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file. | ||||||||||||
| 2 | package Twilio::Rest::Video::V1::Room::Participant::SubscribeRules; | ||||||||||||
| 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::Video::V1::Room::Participant::SubscribeRulesList; | ||||||||||||
| 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, $room_sid, $participant_sid) = @_; | |||||||||||
| 17 | 2 | my $self = $class->SUPER::new($version); | |||||||||||
| 18 | 2 | $self->{solution} = { room_sid => $room_sid, participant_sid => $participant_sid }; | |||||||||||
| 19 | 2 | $self->{uri} = join q{}, '/Rooms/', Twilio::Serialize::path_segment($room_sid), '/Participants/', | |||||||||||
| 20 | Twilio::Serialize::path_segment($participant_sid), '/SubscribeRules'; | ||||||||||||
| 21 | 2 | return $self; | |||||||||||
| 22 | } | ||||||||||||
| 23 | |||||||||||||
| 24 | 1 | ▶ | sub fetch { | ||||||||||
|
Subroutine
fetch: called CC=1 SCAR=0.0
| |||||||||||||
| 25 | 1 | my ($self) = @_; | |||||||||||
| 26 | |||||||||||||
| 27 | 1 | my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch'); | |||||||||||
| 28 | return Twilio::Rest::Video::V1::Room::Participant::SubscribeRulesInstance->new( | ||||||||||||
| 29 | $self->{version}, $response->get_content, | ||||||||||||
| 30 | $self->{solution}{room_sid}, | ||||||||||||
| 31 | $self->{solution}{participant_sid} | ||||||||||||
| 32 | 1 | ); | |||||||||||
| 33 | } | ||||||||||||
| 34 | |||||||||||||
| 35 | 1 | ▶ | sub update { | ||||||||||
|
Subroutine
update: called CC=2 SCAR=7.0
| |||||||||||||
| 36 | 1 | my ($self, $options) = @_; | |||||||||||
| 37 | 1 | ▶ | $options //= {}; | ||||||||||
|
Condition50%1/2
$options //= {}
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
| |||||||||||||
| 38 | |||||||||||||
| 39 | 1 | my $data = { Rules => Twilio::Serialize::json_object($options->{rules}), }; | |||||||||||
| 40 | |||||||||||||
| 41 | my $response = | ||||||||||||
| 42 | 1 | $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data }); | |||||||||||
| 43 | return Twilio::Rest::Video::V1::Room::Participant::SubscribeRulesInstance->new( | ||||||||||||
| 44 | $self->{version}, $response->get_content, | ||||||||||||
| 45 | $self->{solution}{room_sid}, | ||||||||||||
| 46 | $self->{solution}{participant_sid} | ||||||||||||
| 47 | 1 | ); | |||||||||||
| 48 | } | ||||||||||||
| 49 | |||||||||||||
| 50 | package Twilio::Rest::Video::V1::Room::Participant::SubscribeRulesInstance; | ||||||||||||
| 51 | |||||||||||||
| 52 | 2 | ▶ | use parent 'Twilio::InstanceResource'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 53 | |||||||||||||
| 54 | 2 | ▶ | use Twilio::Deserialize; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 55 | |||||||||||||
| 56 | 2 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
| |||||||||||||
| 57 | 2 | my ($class, $version, $payload, $room_sid, $participant_sid) = @_; | |||||||||||
| 58 | 2 | my $self = $class->SUPER::new($version, $payload); | |||||||||||
| 59 | 2 | $self->{solution} = { room_sid => $room_sid, participant_sid => $participant_sid }; | |||||||||||
| 60 | 2 | return $self; | |||||||||||
| 61 | } | ||||||||||||
| 62 | |||||||||||||
| 63 | 2 | ▶ | sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) } | ||||||||||
|
Subroutine
date_created: called CC=1 SCAR=0.0
| |||||||||||||
| 64 | 2 | ▶ | sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) } | ||||||||||
|
Subroutine
date_updated: called CC=1 SCAR=0.0
| |||||||||||||
| 65 | 2 | ▶ | sub participant_sid { return $_[0]{properties}{participant_sid} } | ||||||||||
|
Subroutine
participant_sid: called CC=1 SCAR=0.0
| |||||||||||||
| 66 | 2 | ▶ | sub room_sid { return $_[0]{properties}{room_sid} } | ||||||||||
|
Subroutine
room_sid: called CC=1 SCAR=0.0
| |||||||||||||
| 67 | 2 | ▶ | sub rules { return $_[0]{properties}{rules} } | ||||||||||
|
Subroutine
rules: called CC=1 SCAR=0.0
| |||||||||||||
| 68 | |||||||||||||
| 69 | 2 | 1; | |||||||||||
| 70 | |||||||||||||
| 71 | __END__ | ||||||||||||