File Coverage

blib/lib/WebService/Mattermost/V4/API/Resource/Compliance.pm
Criterion Covered Total %
statement 6 11 54.5
branch n/a
condition n/a
subroutine 2 4 50.0
pod 2 2 100.0
total 10 17 58.8


line stmt bran cond sub pod time code
1             package WebService::Mattermost::V4::API::Resource::Compliance;
2:

3: # ABSTRACT: Wrapped API methods for the compliance API endpoints. 4:
5: use Moo;
6: use Types::Standard 'Str';
7:
8: extends 'WebService::Mattermost::V4::API::Resource';
9:
10: ################################################################################
11:
12: has view_name => (is => 'ro', isa => Str, default => 'Compliance::Report');
13:
14: ################################################################################
15:
16: sub create_report {
17: my $self = shift;
18:
19: return $self->_post({ endpoint => 'reports' });
20: }
21:
22: sub get_reports {
23: my $self = shift;
24: my $args = shift;
25:
26: return $self->_get({
27: view => 'Compliance::Report',
28: endpoint => 'reports',
29: parameters => $args,
30: });
31: }
32:
33: ################################################################################
34:
35: 1;
36:
37: __END__
38:
39: =pod
40:
41: =encoding UTF-8
42:
43: =head1 NAME
44:
45: WebService::Mattermost::V4::API::Resource::Compliance - Wrapped API methods for the compliance 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->compliance;
65:
66: =head2 METHODS
67:
68: =over 4
69:
70: =item C<create_report()>
71:
72: Create a new compliance report.
73:
74: my $response = $resource->create_report();
75:
76: =item C<get_reports()>
77:
78: Get all compliance reports.
79:
80: my $response = $resource->get_reports({
81: # Optional parameters
82: page => 0, # default values
83: per_page => 60,
84: });
85:
86: =back
87:
88: =head1 SEE ALSO
89:
90: =over 4
91:
92: =item L<Official compliance documentation|https://api.mattermost.com/#tag/compliance>
93:
94: =back
95:
96: =head1 AUTHOR
97:
98: Mike Jones <mike@netsplit.org.uk>
99:
100: =head1 COPYRIGHT AND LICENSE
101:
102: This software is Copyright (c) 2020 by Mike Jones.
103:
104: This is free software, licensed under:
105:
106: The MIT (X11) License
107:
108: =cut
109: