blib/lib/SignalWire/Agents/REST/Namespaces/Video.pm

filter: Statementstmt 55.4% 61 / 110 Branchbran 0.0% 0 / 18 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 20 / 40 Podpod 0.0% 0 / 20 totaltotal 43.0% 81 / 188 CC 10 SCAR 11.2
CC
10
Cov
48%
list_streams
6.0
list
6.0
list_events
6.0
CRAP 3.1
« blib/lib/SignalWire/Agents/REST/Namespaces/Logs.pm ↑ Summary blib/lib/SignalWire/Agents/Skills/Builtin/InfoGatherer.pm »
1 package SignalWire::Agents::REST::Namespaces::Video;
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 # --- VideoRooms ---
7 package SignalWire::Agents::REST::Namespaces::Video::Rooms;
8 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 4 extends 'SignalWire::Agents::REST::Namespaces::CrudResource';
10 2 ▶has '+_update_method' => ( default => sub { 'PUT' } );
Subroutine __ANON__: called CC=1 SCAR=0.0
11  
12 0 ▶sub list_streams {
Subroutine list_streams: not called CC=2 SCAR=17.9
Pod undocumented
13 0 my ($self, $room_id, %params) = @_;
14 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
15 0 return $self->_http->get($self->_path($room_id, 'streams'), params => $p);
16 }
17  
18 0 ▶sub create_stream {
Subroutine create_stream: not called CC=1 SCAR=6.9
Pod undocumented
19 0 my ($self, $room_id, %kwargs) = @_;
20 0 return $self->_http->post($self->_path($room_id, 'streams'), body => \%kwargs);
21 }
22  
23 # --- VideoRoomTokens ---
24 package SignalWire::Agents::REST::Namespaces::Video::RoomTokens;
25 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 4 extends 'SignalWire::Agents::REST::Namespaces::Base';
27  
28 0 ▶sub create {
Subroutine create: not called CC=1 SCAR=6.9
Pod undocumented
29 0 my ($self, %kwargs) = @_;
30 0 return $self->_http->post($self->_base_path, body => \%kwargs);
31 }
32  
33 # --- VideoRoomSessions ---
34 package SignalWire::Agents::REST::Namespaces::Video::RoomSessions;
35 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
36 4 extends 'SignalWire::Agents::REST::Namespaces::Base';
37  
38 0 ▶sub list {
Subroutine list: not called CC=2 SCAR=17.9
Pod undocumented
39 0 my ($self, %params) = @_;
40 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
41 0 return $self->_http->get($self->_base_path, params => $p);
42 }
43  
44 0 ▶sub get {
Subroutine get: not called CC=1 SCAR=6.9
Pod undocumented
45 0 my ($self, $session_id) = @_;
46 0 return $self->_http->get($self->_path($session_id));
47 }
48  
49 0 ▶sub list_events {
Subroutine list_events: not called CC=2 SCAR=17.9
Pod undocumented
50 0 my ($self, $session_id, %params) = @_;
51 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
52 0 return $self->_http->get($self->_path($session_id, 'events'), params => $p);
53 }
54  
55 0 ▶sub list_members {
Subroutine list_members: not called CC=2 SCAR=17.9
Pod undocumented
56 0 my ($self, $session_id, %params) = @_;
57 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
58 0 return $self->_http->get($self->_path($session_id, 'members'), params => $p);
59 }
60  
61 0 ▶sub list_recordings {
Subroutine list_recordings: not called CC=2 SCAR=17.9
Pod undocumented
62 0 my ($self, $session_id, %params) = @_;
63 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
64 0 return $self->_http->get($self->_path($session_id, 'recordings'), params => $p);
65 }
66  
67 # --- VideoRoomRecordings ---
68 package SignalWire::Agents::REST::Namespaces::Video::RoomRecordings;
69 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
70 4 extends 'SignalWire::Agents::REST::Namespaces::Base';
71  
72 0 ▶sub list {
Subroutine list: not called CC=2 SCAR=17.9
Pod undocumented
73 0 my ($self, %params) = @_;
74 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
75 0 return $self->_http->get($self->_base_path, params => $p);
76 }
77  
78 0 ▶sub get {
Subroutine get: not called CC=1 SCAR=6.9
Pod undocumented
79 0 my ($self, $recording_id) = @_;
80 0 return $self->_http->get($self->_path($recording_id));
81 }
82  
83 0 ▶sub delete_recording {
Subroutine delete_recording: not called CC=1 SCAR=6.9
Pod undocumented
84 0 my ($self, $recording_id) = @_;
85 0 return $self->_http->delete_request($self->_path($recording_id));
86 }
87  
88 0 ▶sub list_events {
Subroutine list_events: not called CC=2 SCAR=17.9
Pod undocumented
89 0 my ($self, $recording_id, %params) = @_;
90 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
91 0 return $self->_http->get($self->_path($recording_id, 'events'), params => $p);
92 }
93  
94 # --- VideoConferences ---
95 package SignalWire::Agents::REST::Namespaces::Video::Conferences;
96 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
97 4 extends 'SignalWire::Agents::REST::Namespaces::CrudResource';
98 2 ▶has '+_update_method' => ( default => sub { 'PUT' } );
Subroutine __ANON__: called CC=1 SCAR=0.0
99  
100 0 ▶sub list_conference_tokens {
Subroutine list_conference_tokens: not called CC=2 SCAR=17.9
Pod undocumented
101 0 my ($self, $conference_id, %params) = @_;
102 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
103 0 return $self->_http->get($self->_path($conference_id, 'conference_tokens'), params => $p);
104 }
105  
106 0 ▶sub list_streams {
Subroutine list_streams: not called CC=2 SCAR=17.9
Pod undocumented
107 0 my ($self, $conference_id, %params) = @_;
108 0 ▶ my $p = %params ? \%params : undef;
Branch: 1 branch
BranchTrueFalseTotal
%params ? : 0 0 0
109 0 return $self->_http->get($self->_path($conference_id, 'streams'), params => $p);
110 }
111  
112 0 ▶sub create_stream {
Subroutine create_stream: not called CC=1 SCAR=6.9
Pod undocumented
113 0 my ($self, $conference_id, %kwargs) = @_;
114 0 return $self->_http->post($self->_path($conference_id, 'streams'), body => \%kwargs);
115 }
116  
117 # --- VideoConferenceTokens ---
118 package SignalWire::Agents::REST::Namespaces::Video::ConferenceTokens;
119 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
120 4 extends 'SignalWire::Agents::REST::Namespaces::Base';
121  
122 0 ▶sub get {
Subroutine get: not called CC=1 SCAR=6.9
Pod undocumented
123 0 my ($self, $token_id) = @_;
124 0 return $self->_http->get($self->_path($token_id));
125 }
126  
127 0 ▶sub reset {
Subroutine reset: not called CC=1 SCAR=6.9
Pod undocumented
128 0 my ($self, $token_id) = @_;
129 0 return $self->_http->post($self->_path($token_id, 'reset'));
130 }
131  
132 # --- VideoStreams ---
133 package SignalWire::Agents::REST::Namespaces::Video::Streams;
134 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
135 4 extends 'SignalWire::Agents::REST::Namespaces::Base';
136  
137 0 ▶sub get {
Subroutine get: not called CC=1 SCAR=6.9
Pod undocumented
138 0 my ($self, $stream_id) = @_;
139 0 return $self->_http->get($self->_path($stream_id));
140 }
141  
142 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
Pod undocumented
143 0 my ($self, $stream_id, %kwargs) = @_;
144 0 return $self->_http->put($self->_path($stream_id), body => \%kwargs);
145 }
146  
147 0 ▶sub delete_stream {
Subroutine delete_stream: not called CC=1 SCAR=6.9
Pod undocumented
148 0 my ($self, $stream_id) = @_;
149 0 return $self->_http->delete_request($self->_path($stream_id));
150 }
151  
152 # --- VideoNamespace ---
153 package SignalWire::Agents::REST::Namespaces::Video;
154 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
155  
156 4 has '_http' => ( is => 'ro', required => 1 );
157 4 has 'rooms' => ( is => 'lazy' );
158 4 has 'room_tokens' => ( is => 'lazy' );
159 4 has 'room_sessions' => ( is => 'lazy' );
160 4 has 'room_recordings' => ( is => 'lazy' );
161 4 has 'conferences' => ( is => 'lazy' );
162 4 has 'conference_tokens' => ( is => 'lazy' );
163 4 has 'streams' => ( is => 'lazy' );
164  
165 4 my $base = '/api/video';
166  
167 2 ▶sub _build_rooms { SignalWire::Agents::REST::Namespaces::Video::Rooms->new(_http => $_[0]->_http, _base_path => "$base/rooms") }
Subroutine _build_rooms: called CC=1 SCAR=0.0
168 2 ▶sub _build_room_tokens { SignalWire::Agents::REST::Namespaces::Video::RoomTokens->new(_http => $_[0]->_http, _base_path => "$base/room_tokens") }
Subroutine _build_room_tokens: called CC=1 SCAR=0.0
169 2 ▶sub _build_room_sessions { SignalWire::Agents::REST::Namespaces::Video::RoomSessions->new(_http => $_[0]->_http, _base_path => "$base/room_sessions") }
Subroutine _build_room_sessions: called CC=1 SCAR=0.0
170 2 ▶sub _build_room_recordings { SignalWire::Agents::REST::Namespaces::Video::RoomRecordings->new(_http => $_[0]->_http, _base_path => "$base/room_recordings") }
Subroutine _build_room_recordings: called CC=1 SCAR=0.0
171 2 ▶sub _build_conferences { SignalWire::Agents::REST::Namespaces::Video::Conferences->new(_http => $_[0]->_http, _base_path => "$base/conferences") }
Subroutine _build_conferences: called CC=1 SCAR=0.0
172 2 ▶sub _build_conference_tokens { SignalWire::Agents::REST::Namespaces::Video::ConferenceTokens->new(_http => $_[0]->_http, _base_path => "$base/conference_tokens") }
Subroutine _build_conference_tokens: called CC=1 SCAR=0.0
173 2 ▶sub _build_streams { SignalWire::Agents::REST::Namespaces::Video::Streams->new(_http => $_[0]->_http, _base_path => "$base/streams") }
Subroutine _build_streams: called CC=1 SCAR=0.0
174  
175 4 1;
« blib/lib/SignalWire/Agents/REST/Namespaces/Logs.pm ↑ Summary blib/lib/SignalWire/Agents/Skills/Builtin/InfoGatherer.pm »