Twilio/Rest/Video/V1/Room/Participant.pm

filter: Statementstmt 81.0% 90 / 111 Branchbran 100% 4 / 4 Conditioncond 57.1% 4 / 7 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 78.2% 36 / 46 Podpod n/a totaltotal 77.9% 134 / 172 CC 6 SCAR 3.3
CC
6
Cov
80%
page
2.0
update
2.0
new
2.0
CRAP 1.4
« Twilio/Rest/Marketplace/V1/InstalledAddOn.pm ↑ Summary Twilio/Rest/Accounts/V1/Credential/Aws.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Video::V1::Room::Participant;
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::ParticipantList;
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 10 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 10 my ($class, $version, $room_sid) = @_;
17 10 my $self = $class->SUPER::new($version);
18 10 $self->{solution} = { room_sid => $room_sid };
19 10 $self->{uri} = join q{}, '/Rooms/', Twilio::Serialize::path_segment($room_sid), '/Participants';
20 10 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 //= {}
l!l
10
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
36  
37 my $params = {
38 DateCreatedAfter => Twilio::Serialize::iso8601_date_time($options->{date_created_after}),
39 DateCreatedBefore => Twilio::Serialize::iso8601_date_time($options->{date_created_before}),
40 Identity => $options->{identity},
41 Status => $options->{status},
42 1 PageToken => $page_token,
43 Page => $page_number,
44 PageSize => $page_size,
45 };
46  
47 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
48 1 return $self->_build_page($response);
49 }
50  
51 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
52 0 my ($self, $target_url) = @_;
53 0 my $client = $self->{version}->get_domain->get_client;
54 0 return $self->_build_page($client->request('GET', $target_url));
55 }
56  
57 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
58 1 my ($self, $response) = @_;
59 return Twilio::Rest::Video::V1::Room::ParticipantPage->new($self->{version}, $response,
60 1 $self->{solution});
61 }
62  
63 9 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
64 9 my ($self, $sid) = @_;
65 return Twilio::Rest::Video::V1::Room::ParticipantContext->new($self->{version},
66 9 $self->{solution}{room_sid}, $sid);
67 }
68  
69 package Twilio::Rest::Video::V1::Room::ParticipantPage;
70  
71 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
72  
73 1 ▶sub records_key { return 'participants' }
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 return Twilio::Rest::Video::V1::Room::ParticipantInstance->new($self->{version}, $payload,
78 1 $self->{solution}{room_sid});
79 }
80  
81 package Twilio::Rest::Video::V1::Room::ParticipantContext;
82  
83 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
84  
85 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
86  
87 9 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
88 9 my ($class, $version, $room_sid, $sid) = @_;
89 9 my $self = $class->SUPER::new($version);
90 9 $self->{solution} = { room_sid => $room_sid, sid => $sid };
91 9 $self->{uri} = join q{}, '/Rooms/', Twilio::Serialize::path_segment($room_sid), '/Participants/',
92 Twilio::Serialize::path_segment($sid);
93 9 return $self;
94 }
95  
96 1 ▶sub fetch {
Subroutine fetch: called CC=1 SCAR=0.0
97 1 my ($self) = @_;
98  
99 1 my $response = $self->{version}->handle_request('GET', $self->{uri}, 'fetch');
100 1 return $self->_build_instance($response);
101 }
102  
103 1 ▶sub update {
Subroutine update: called CC=2 SCAR=7.0
104 1 my ($self, $options) = @_;
105 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
10
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
106  
107 1 my $data = { Status => $options->{status}, };
108  
109 my $response =
110 1 $self->{version}->handle_request('POST', $self->{uri}, 'update', { data => $data });
111 1 return $self->_build_instance($response);
112 }
113  
114 2 ▶sub _build_instance {
Subroutine _build_instance: called CC=1 SCAR=0.0
115 2 my ($self, $response) = @_;
116 return Twilio::Rest::Video::V1::Room::ParticipantInstance->new(
117 $self->{version}, $response->get_content,
118 $self->{solution}{room_sid}, $self->{solution}{sid}
119 2 );
120 }
121  
122 1 ▶sub anonymize {
Subroutine anonymize: called CC=1 SCAR=0.0
123 1 my ($self) = @_;
124 1 require Twilio::Rest::Video::V1::Room::Participant::Anonymize;
125 return Twilio::Rest::Video::V1::Room::Participant::AnonymizeContext->new(
126 $self->{version},
127 $self->{solution}{room_sid},
128 $self->{solution}{sid}
129 1 );
130 }
131  
132 2 ▶sub published_tracks {
Subroutine published_tracks: called CC=2 SCAR=6.9
133 2 my ($self, $sid) = @_;
134 2 require Twilio::Rest::Video::V1::Room::Participant::PublishedTrack;
135 my $list = Twilio::Rest::Video::V1::Room::Participant::PublishedTrackList->new(
136 $self->{version},
137 $self->{solution}{room_sid},
138 $self->{solution}{sid}
139 2 );
140 2 ▶ return defined $sid ? $list->get_context($sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $sid ? : 1 1 2
141 }
142  
143 2 ▶sub subscribe_rules {
Subroutine subscribe_rules: called CC=1 SCAR=0.0
144 2 my ($self) = @_;
145 2 require Twilio::Rest::Video::V1::Room::Participant::SubscribeRules;
146 return Twilio::Rest::Video::V1::Room::Participant::SubscribeRulesList->new(
147 $self->{version},
148 $self->{solution}{room_sid},
149 $self->{solution}{sid}
150 2 );
151 }
152  
153 2 ▶sub subscribed_tracks {
Subroutine subscribed_tracks: called CC=2 SCAR=6.9
154 2 my ($self, $sid) = @_;
155 2 require Twilio::Rest::Video::V1::Room::Participant::SubscribedTrack;
156 my $list = Twilio::Rest::Video::V1::Room::Participant::SubscribedTrackList->new(
157 $self->{version},
158 $self->{solution}{room_sid},
159 $self->{solution}{sid}
160 2 );
161 2 ▶ return defined $sid ? $list->get_context($sid) : $list;
Branch: 1 branch
BranchTrueFalseTotal
defined $sid ? : 1 1 2
162 }
163  
164 package Twilio::Rest::Video::V1::Room::ParticipantInstance;
165  
166 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
167  
168 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
169  
170 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
171 3 my ($class, $version, $payload, $room_sid, $sid) = @_;
172 3 my $self = $class->SUPER::new($version, $payload);
173 3 ▶ $self->{solution} = { room_sid => $room_sid, sid => $sid // $self->{properties}{sid} };
Condition66%2/3
$sid // $self->{"properties"}{"sid"}
l!l&&r!l&&!r
210
MC/DC0%0/2
$sid // $self->{"properties"}{"sid"}
$sid $self->{"properties"}{"sid"}
Truth table66%2/3
A // B
A= $sidB= $self->{"properties"}{"sid"}
ABresult
1X1
011
000
174 3 return $self;
175 }
176  
177 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
178 0 my ($self, @arguments) = @_;
179 0 return $self->_context->fetch(@arguments);
180 }
181  
182 0 ▶sub update {
Subroutine update: not called CC=1 SCAR=6.9
183 0 my ($self, @arguments) = @_;
184 0 return $self->_context->update(@arguments);
185 }
186  
187 0 ▶sub anonymize {
Subroutine anonymize: not called CC=1 SCAR=6.9
188 0 my ($self, @arguments) = @_;
189 0 return $self->_context->anonymize(@arguments);
190 }
191  
192 0 ▶sub published_tracks {
Subroutine published_tracks: not called CC=1 SCAR=6.9
193 0 my ($self, @arguments) = @_;
194 0 return $self->_context->published_tracks(@arguments);
195 }
196  
197 0 ▶sub subscribe_rules {
Subroutine subscribe_rules: not called CC=1 SCAR=6.9
198 0 my ($self, @arguments) = @_;
199 0 return $self->_context->subscribe_rules(@arguments);
200 }
201  
202 0 ▶sub subscribed_tracks {
Subroutine subscribed_tracks: not called CC=1 SCAR=6.9
203 0 my ($self, @arguments) = @_;
204 0 return $self->_context->subscribed_tracks(@arguments);
205 }
206  
207 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
208 0 my ($self) = @_;
209 return Twilio::Rest::Video::V1::Room::ParticipantContext->new(
210 $self->{version},
211 $self->{solution}{room_sid},
212 $self->{solution}{sid}
213 0 );
214 }
215  
216 3 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
217 3 ▶sub date_created { return Twilio::Deserialize::date_time($_[0]{properties}{date_created}) }
Subroutine date_created: called CC=1 SCAR=0.0
218 3 ▶sub date_updated { return Twilio::Deserialize::date_time($_[0]{properties}{date_updated}) }
Subroutine date_updated: called CC=1 SCAR=0.0
219 3 ▶sub duration { return $_[0]{properties}{duration} }
Subroutine duration: called CC=1 SCAR=0.0
220 3 ▶sub end_time { return Twilio::Deserialize::date_time($_[0]{properties}{end_time}) }
Subroutine end_time: called CC=1 SCAR=0.0
221 3 ▶sub identity { return $_[0]{properties}{identity} }
Subroutine identity: called CC=1 SCAR=0.0
222 3 ▶sub links { return $_[0]{properties}{links} }
Subroutine links: called CC=1 SCAR=0.0
223 3 ▶sub room_sid { return $_[0]{properties}{room_sid} }
Subroutine room_sid: called CC=1 SCAR=0.0
224 3 ▶sub sid { return $_[0]{properties}{sid} }
Subroutine sid: called CC=1 SCAR=0.0
225 3 ▶sub start_time { return Twilio::Deserialize::date_time($_[0]{properties}{start_time}) }
Subroutine start_time: called CC=1 SCAR=0.0
226 3 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
227 3 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
228  
229 2 1;
230  
231 __END__
« Twilio/Rest/Marketplace/V1/InstalledAddOn.pm ↑ Summary Twilio/Rest/Accounts/V1/Credential/Aws.pm »