File Coverage

blib/lib/WebService/Mattermost/V4/API/Resource/Compliance/Report.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


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

3: # ABSTRACT: Wrapped API methods for the compliance report 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: around [ qw(get download) ] => sub {
17: my $orig = shift;
18: my $self = shift;
19: my $id = shift;
20:
21: return $self->validate_id($orig, $id, @_);
22: };
23:
24: sub get {
25: my $self = shift;
26: my $id = shift;
27:
28: return $self->_single_view_get({
29: endpoint => 'reports/%s',
30: ids => [ $id ],
31: });
32: }
33:
34: sub download {
35: my $self = shift;
36: my $id = shift;
37:
38: return $self->_single_view_get({
39: view => 'Binary',
40: endpoint => 'reports/%s/download',
41: ids => [ $id ],
42: });
43: }
44:
45: ################################################################################
46:
47: 1;
48:
49: __END__
50:
51: =pod
52:
53: =encoding UTF-8
54:
55: =head1 NAME
56:
57: WebService::Mattermost::V4::API::Resource::Compliance::Report - Wrapped API methods for the compliance report API endpoints.
58:
59: =head1 VERSION
60:
61: version 0.28
62:
63: =head1 DESCRIPTION
64:
65: =head2 USAGE
66:
67: use WebService::Mattermost;
68:
69: my $mm = WebService::Mattermost->new({
70: authenticate => 1,
71: username => 'me@somewhere.com',
72: password => 'hunter2',
73: base_url => 'https://my.mattermost.server.com/api/v4/',
74: });
75:
76: my $resource = $mm->api->compliance_report;
77:
78: =head2 METHODS
79:
80: =over 4
81:
82: =item C<get()>
83:
84: Get a compliance report by its ID.
85:
86: my $response = $resource->get('REPORT-ID-HERE');
87:
88: =item C<download()>
89:
90: Download a compliance report by its ID.
91:
92: my $response = $resource->download('REPORT-ID-HERE');
93:
94: =back
95:
96: =head1 SEE ALSO
97:
98: =over 4
99:
100: =item L<Official compliance documentation|https://api.mattermost.com/#tag/compliance>
101:
102: =back
103:
104: =head1 AUTHOR
105:
106: Mike Jones <mike@netsplit.org.uk>
107:
108: =head1 COPYRIGHT AND LICENSE
109:
110: This software is Copyright (c) 2020 by Mike Jones.
111:
112: This is free software, licensed under:
113:
114: The MIT (X11) License
115:
116: =cut
117: