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

filter: Statementstmt 87.3% 76 / 87 Branchbran n/a Conditioncond 60.0% 3 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 87.8% 36 / 41 Podpod n/a totaltotal 84.5% 115 / 136 CC 3 SCAR 1.9
CC
3
Cov
86%
page
2.0
new
2.0
read
2.0
CRAP 1.2
« Twilio/Rest/Api/V2010/Account/Call/Notification.pm ↑ Summary Twilio/Rest/Taskrouter/V1/Workspace/Event.pm »
1 # Generated by tools/generate.pl from Twilio's OpenAPI specs. Do not edit this file.
2 package Twilio::Rest::Insights::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::Insights::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 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
16 2 my ($class, $version, $room_sid) = @_;
17 2 my $self = $class->SUPER::new($version);
18 2 $self->{solution} = { room_sid => $room_sid };
19 2 $self->{uri} = join q{}, '/Video/Rooms/', Twilio::Serialize::path_segment($room_sid),
20 '/Participants';
21 2 return $self;
22 }
23  
24 0 ▶sub read {
Subroutine read: not called CC=1 SCAR=6.9
25 0 my ($self, @arguments) = @_;
26 0 return $self->read_records(@arguments);
27 }
28  
29 0 ▶sub stream {
Subroutine stream: not called CC=1 SCAR=6.9
30 0 my ($self, @arguments) = @_;
31 0 return $self->stream_records(@arguments);
32 }
33  
34 1 ▶sub page {
Subroutine page: called CC=2 SCAR=7.0
35 1 my ($self, $options, $page_size, $page_token, $page_number) = @_;
36 1 ▶ $options //= {};
Condition50%1/2
$options //= {}
l!l
01
MC/DC0%0/1
$options //= {}
$options
Truth table50%1/2
A
A= $options
Aresult
11
00
37  
38 1 my $params = {
39 PageToken => $page_token,
40 Page => $page_number,
41 PageSize => $page_size,
42 };
43  
44 1 my $response = $self->{version}->page('GET', $self->{uri}, { params => $params });
45 1 return $self->_build_page($response);
46 }
47  
48 0 ▶sub get_page {
Subroutine get_page: not called CC=1 SCAR=6.9
49 0 my ($self, $target_url) = @_;
50 0 my $client = $self->{version}->get_domain->get_client;
51 0 return $self->_build_page($client->request('GET', $target_url));
52 }
53  
54 1 ▶sub _build_page {
Subroutine _build_page: called CC=1 SCAR=0.0
55 1 my ($self, $response) = @_;
56 return Twilio::Rest::Insights::V1::Room::ParticipantPage->new($self->{version}, $response,
57 1 $self->{solution});
58 }
59  
60 1 ▶sub get_context {
Subroutine get_context: called CC=1 SCAR=0.0
61 1 my ($self, $participant_sid) = @_;
62 return Twilio::Rest::Insights::V1::Room::ParticipantContext->new($self->{version},
63 $self->{solution}{room_sid},
64 1 $participant_sid);
65 }
66  
67 package Twilio::Rest::Insights::V1::Room::ParticipantPage;
68  
69 2 ▶use parent 'Twilio::Page';
Subroutine BEGIN: called CC=1 SCAR=0.0
70  
71 1 ▶sub records_key { return 'participants' }
Subroutine records_key: called CC=1 SCAR=0.0
72  
73 1 ▶sub build_instance {
Subroutine build_instance: called CC=1 SCAR=0.0
74 1 my ($self, $payload) = @_;
75 return Twilio::Rest::Insights::V1::Room::ParticipantInstance->new($self->{version}, $payload,
76 1 $self->{solution}{room_sid});
77 }
78  
79 package Twilio::Rest::Insights::V1::Room::ParticipantContext;
80  
81 2 ▶use parent 'Twilio::InstanceContext';
Subroutine BEGIN: called CC=1 SCAR=0.0
82  
83 2 ▶use Twilio::Serialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
84  
85 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
86 1 my ($class, $version, $room_sid, $participant_sid) = @_;
87 1 my $self = $class->SUPER::new($version);
88 1 $self->{solution} = { room_sid => $room_sid, participant_sid => $participant_sid };
89 1 $self->{uri} = join q{}, '/Video/Rooms/', Twilio::Serialize::path_segment($room_sid),
90 '/Participants/', Twilio::Serialize::path_segment($participant_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::Insights::V1::Room::ParticipantInstance->new(
104 $self->{version}, $response->get_content,
105 $self->{solution}{room_sid},
106 $self->{solution}{participant_sid}
107 1 );
108 }
109  
110 package Twilio::Rest::Insights::V1::Room::ParticipantInstance;
111  
112 2 ▶use parent 'Twilio::InstanceResource';
Subroutine BEGIN: called CC=1 SCAR=0.0
113  
114 2 ▶use Twilio::Deserialize;
Subroutine BEGIN: called CC=1 SCAR=0.0
115  
116 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
117 2 my ($class, $version, $payload, $room_sid, $participant_sid) = @_;
118 2 my $self = $class->SUPER::new($version, $payload);
119 $self->{solution} = {
120 room_sid => $room_sid,
121 participant_sid => $participant_sid // $self->{properties}{participant_sid}
122 2 ▶ };
Condition66%2/3
$participant_sid // $self->{"properties"}{"participant_sid"}
l!l&&r!l&&!r
110
MC/DC0%0/2
$participant_sid // $self->{"properties"}{"participant_sid"}
$participant_sid $self->{"properties"}{"participant_sid"}
Truth table66%2/3
A // B
A= $participant_sidB= $self->{"properties"}{"participant_sid"}
ABresult
1X1
011
000
123 2 return $self;
124 }
125  
126 0 ▶sub fetch {
Subroutine fetch: not called CC=1 SCAR=6.9
127 0 my ($self, @arguments) = @_;
128 0 return $self->_context->fetch(@arguments);
129 }
130  
131 0 ▶sub _context {
Subroutine _context: not called CC=1 SCAR=6.9
132 0 my ($self) = @_;
133 return Twilio::Rest::Insights::V1::Room::ParticipantContext->new(
134 $self->{version},
135 $self->{solution}{room_sid},
136 $self->{solution}{participant_sid}
137 0 );
138 }
139  
140 2 ▶sub account_sid { return $_[0]{properties}{account_sid} }
Subroutine account_sid: called CC=1 SCAR=0.0
141 2 ▶sub codecs { return $_[0]{properties}{codecs} }
Subroutine codecs: called CC=1 SCAR=0.0
142 2 ▶sub duration_sec { return $_[0]{properties}{duration_sec} }
Subroutine duration_sec: called CC=1 SCAR=0.0
143 2 ▶sub edge_location { return $_[0]{properties}{edge_location} }
Subroutine edge_location: called CC=1 SCAR=0.0
144 2 ▶sub end_reason { return $_[0]{properties}{end_reason} }
Subroutine end_reason: called CC=1 SCAR=0.0
145 2 ▶sub error_code { return $_[0]{properties}{error_code} }
Subroutine error_code: called CC=1 SCAR=0.0
146 2 ▶sub error_code_url { return $_[0]{properties}{error_code_url} }
Subroutine error_code_url: called CC=1 SCAR=0.0
147 2 ▶sub join_time { return Twilio::Deserialize::date_time($_[0]{properties}{join_time}) }
Subroutine join_time: called CC=1 SCAR=0.0
148 2 ▶sub leave_time { return Twilio::Deserialize::date_time($_[0]{properties}{leave_time}) }
Subroutine leave_time: called CC=1 SCAR=0.0
149 2 ▶sub media_region { return $_[0]{properties}{media_region} }
Subroutine media_region: called CC=1 SCAR=0.0
150 2 ▶sub participant_identity { return $_[0]{properties}{participant_identity} }
Subroutine participant_identity: called CC=1 SCAR=0.0
151 2 ▶sub participant_sid { return $_[0]{properties}{participant_sid} }
Subroutine participant_sid: called CC=1 SCAR=0.0
152 2 ▶sub properties { return $_[0]{properties}{properties} }
Subroutine properties: called CC=1 SCAR=0.0
153 2 ▶sub publisher_info { return $_[0]{properties}{publisher_info} }
Subroutine publisher_info: called CC=1 SCAR=0.0
154 2 ▶sub room_sid { return $_[0]{properties}{room_sid} }
Subroutine room_sid: called CC=1 SCAR=0.0
155 2 ▶sub status { return $_[0]{properties}{status} }
Subroutine status: called CC=1 SCAR=0.0
156 2 ▶sub url { return $_[0]{properties}{url} }
Subroutine url: called CC=1 SCAR=0.0
157  
158 2 1;
159  
160 __END__
« Twilio/Rest/Api/V2010/Account/Call/Notification.pm ↑ Summary Twilio/Rest/Taskrouter/V1/Workspace/Event.pm »