Mattermost/V4/API/Resource/Logs.pm

filter: Statementstmt 64.2% 9 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 100% 2 / 2 totaltotal 65.0% 13 / 20 CC 1 SCAR 4.1
CC
1
Cov
64%
get
2.0
add_message
2.0
BEGIN
1.0
CRAP 1.5
« Mattermost/V4/API/Resource/Compliance.pm ↑ Summary Mattermost/V4/API/Resource/Cache.pm »
1 package WebService::Mattermost::V4::API::Resource::Logs;
2  
3 # ABSTRACT: Wrapped API methods for the logs API endpoints.
4  
5 12 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use Types::Standard 'Str';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 12 extends 'WebService::Mattermost::V4::API::Resource';
9  
10 ################################################################################
11  
12 12 has view_name => (is => 'ro', isa => Str, default => 'Log');
13  
14 ################################################################################
15  
16 sub get {
17 0 ▶ my $self = shift;
Subroutine get: not called CC=1 SCAR=6.9
Pod documented
18  
19 0 return $self->_get();
20 }
21  
22 sub add_message {
23 0 ▶ my $self = shift;
Subroutine add_message: not called CC=1 SCAR=6.9
Pod documented
24 0 my $args = shift;
25  
26 0 return $self->_post({
27 parameters => $args,
28 required => [ qw(level message) ],
29 view => 'NewLogEntry',
30 });
31 }
32  
33 ################################################################################
34  
35 12 1;
36  
37 __END__
38  
39 =pod
40  
41 =encoding UTF-8
42  
43 =head1 NAME
44  
45 WebService::Mattermost::V4::API::Resource::Logs - Wrapped API methods for the logs API endpoints.
46  
47 =head1 VERSION
48  
49 version 0.28
50  
51 =head1 DESCRIPTION
52  
53 =head2 USAGE
54  
55 use WebService::Mattermost;
56  
57 my $mm = WebService::Mattermost->new({
58 authenticate => 1,
59 username => 'me@somewhere.com',
60 password => 'hunter2',
61 base_url => 'https://my.mattermost.server.com/api/v4/',
62 });
63  
64 my $resource = $mm->api->logs;
65  
66 =head2 METHODS
67  
68 =over 4
69  
70 =item C<get()>
71  
72 L<Get logs|https://api.mattermost.com/#tag/system%2Fpaths%2F~1logs%2Fget>
73  
74 my $response = $resource->get();
75  
76 =item C<add_message()>
77  
78 L<Add log message|https://api.mattermost.com/#tag/system%2Fpaths%2F~1logs%2Fpost>
79  
80 my $response = $resource->add_message({
81 # Required parameters:
82 level => 'ERROR', # or DEBUG
83 message => '...',
84 });
85  
86 =back
87  
88 =head1 AUTHOR
89  
90 Mike Jones <mike@netsplit.org.uk>
91  
92 =head1 COPYRIGHT AND LICENSE
93  
94 This software is Copyright (c) 2020 by Mike Jones.
95  
96 This is free software, licensed under:
97  
98 The MIT (X11) License
99  
100 =cut
« Mattermost/V4/API/Resource/Compliance.pm ↑ Summary Mattermost/V4/API/Resource/Cache.pm »