MailboxOrg/API/Videochat.pm

filter: Statementstmt 50.0% 19 / 38 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 5 / 10 Podpod 100% 4 / 4 totaltotal 45.1% 28 / 62 CC 6 SCAR 14.7
CC
6
Cov
40%
_rpc
6.0
status
6.0
create_room
6.0
CRAP 4.3
« MailboxOrg/API/Backup.pm ↑ Summary MailboxOrg/API/Blacklist.pm »
1 package WWW::MailboxOrg::API::Videochat;
2  
3 # ABSTRACT: Video chat API
4  
5 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use MooX::Singleton;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Params::ValidationCompiler qw(validation_for);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Types::Standard qw(Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 our $VERSION = '0.001';
12  
13 1 has client => (
14 is => 'ro',
15 required => 1,
16 weak_ref => 1,
17 );
18  
19 sub _rpc {
20 0 ▶ my ($self, $method, @params) = @_;
Subroutine _rpc: not called CC=2 SCAR=17.9
21 0 ▶ my $client = $self->client or croak "No client set";
Branch: 1 branch
BranchTrueFalseTotal
my $client = $self->client or croak("No client set") 0 0 0
22 0 return $client->call($method, @params);
23 }
24  
25 1 my %validators = (
26 status => validation_for(
27 params => {
28 account => { type => Str, optional => 0 },
29 },
30 ),
31 create_room => validation_for(
32 params => {
33 account => { type => Str, optional => 0 },
34 name => { type => Str, optional => 0 },
35 },
36 ),
37 list_rooms => validation_for(
38 params => {
39 account => { type => Str, optional => 0 },
40 },
41 ),
42 delete_room => validation_for(
43 params => {
44 account => { type => Str, optional => 0 },
45 name => { type => Str, optional => 0 },
46 },
47 ),
48 );
49  
50 sub status {
51 0 ▶ my ($self, %params) = @_;
Subroutine status: not called CC=2 SCAR=17.9
Pod documented
52 0 my $v = $validators{'status'};
53 0 ▶ %params = $v->(%params) if $v;
Branch: 1 branch
BranchTrueFalseTotal
if $v 0 0 0
54 0 return $self->_rpc('videochat.status', \%params);
55 }
56  
57 sub create_room {
58 0 ▶ my ($self, %params) = @_;
Subroutine create_room: not called CC=2 SCAR=17.9
Pod documented
59 0 my $v = $validators{'create_room'};
60 0 ▶ %params = $v->(%params) if $v;
Branch: 1 branch
BranchTrueFalseTotal
if $v 0 0 0
61 0 return $self->_rpc('videochat.create_room', \%params);
62 }
63  
64 sub list_rooms {
65 0 ▶ my ($self, %params) = @_;
Subroutine list_rooms: not called CC=2 SCAR=17.9
Pod documented
66 0 my $v = $validators{'list_rooms'};
67 0 ▶ %params = $v->(%params) if $v;
Branch: 1 branch
BranchTrueFalseTotal
if $v 0 0 0
68 0 return $self->_rpc('videochat.list_rooms', \%params);
69 }
70  
71 sub delete_room {
72 0 ▶ my ($self, %params) = @_;
Subroutine delete_room: not called CC=2 SCAR=17.9
Pod documented
73 0 my $v = $validators{'delete_room'};
74 0 ▶ %params = $v->(%params) if $v;
Branch: 1 branch
BranchTrueFalseTotal
if $v 0 0 0
75 0 return $self->_rpc('videochat.delete_room', \%params);
76 }
77  
78 1 1;
79  
80 __END__
81  
82 =pod
83  
84 =encoding UTF-8
85  
86 =head1 NAME
87  
88 WWW::MailboxOrg::API::Videochat - Video chat API
89  
90 =head1 VERSION
91  
92 version 0.001
93  
94 =head1 NAME
95  
96 WWW::MailboxOrg::API::Videochat - Video chat API
97  
98 =head2 status
99  
100 my $status = $api->videochat->status(account => 'admin@example.com');
101  
102 Get video chat status. Required: C<account>.
103  
104 =head2 create_room
105  
106 $api->videochat->create_room(
107 account => 'admin@example.com',
108 name => 'My Room',
109 );
110  
111 Create a video chat room. Required: C<account>, C<name>.
112  
113 =head2 list_rooms
114  
115 $api->videochat->list_rooms(account => 'admin@example.com');
116  
117 List video chat rooms. Required: C<account>.
118  
119 =head2 delete_room
120  
121 $api->videochat->delete_room(
122 account => 'admin@example.com',
123 name => 'My Room',
124 );
125  
126 Delete a video chat room. Required: C<account>, C<name>.
127  
128 =cut
129  
130 =head1 SUPPORT
131  
132 =head2 Issues
133  
134 Please report bugs and feature requests on GitHub at
135 L<https://github.com/getty/p5-www-mailboxorg/issues>.
136  
137 =head2 IRC
138  
139 Join C<#perl-help> on C<irc.perl.org> or message Getty directly.
140  
141 =head1 CONTRIBUTING
142  
143 Contributions are welcome! Please fork the repository and submit a pull request.
144  
145 =head1 AUTHOR
146  
147 Torsten Raudssus <getty@cpan.org>
148  
149 =head1 COPYRIGHT AND LICENSE
150  
151 This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> L<https://raudssus.de/>.
152  
153 This is free software; you can redistribute it and/or modify it under
154 the same terms as the Perl 5 programming language system itself.
155  
156 =cut
« MailboxOrg/API/Backup.pm ↑ Summary MailboxOrg/API/Blacklist.pm »