Mattermost/V4/API/Resource/Brand.pm

filter: Statementstmt 100% 10 / 10 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 2 / 2 totaltotal 100% 15 / 15 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
current
1.0
upload
1.0
CRAP 1.0
« Mattermost/V4/API/Resource/Bots.pm ↑ Summary Mattermost/V4/API/Resource/Role/Single.pm »
1 package WebService::Mattermost::V4::API::Resource::Brand;
2  
3 # ABSTRACT: Wrapped API methods for the brand API endpoints.
4  
5 12 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 12 extends 'WebService::Mattermost::V4::API::Resource';
8  
9 ################################################################################
10  
11 sub current {
12 1 ▶ my $self = shift;
Subroutine current: called CC=1 SCAR=0.0
Pod documented
13  
14 1 return $self->_get({ endpoint => 'image' });
15 }
16  
17 sub upload {
18 1 ▶ my $self = shift;
Subroutine upload: called CC=1 SCAR=0.0
Pod documented
19 1 my $filename = shift;
20  
21 1 return $self->_post({
22 endpoint => 'image',
23 override_data_type => 'form',
24 parameters => {
25 image => { file => $filename },
26 },
27 view => 'Status',
28 });
29 }
30  
31 ################################################################################
32  
33 12 1;
34  
35 __END__
36  
37 =pod
38  
39 =encoding UTF-8
40  
41 =head1 NAME
42  
43 WebService::Mattermost::V4::API::Resource::Brand - Wrapped API methods for the brand API endpoints.
44  
45 =head1 VERSION
46  
47 version 0.28
48  
49 =head1 DESCRIPTION
50  
51 =head2 USAGE
52  
53 use WebService::Mattermost;
54  
55 my $mm = WebService::Mattermost->new({
56 authenticate => 1,
57 username => 'email@address.com',
58 password => 'passwordhere',
59 base_url => 'https://my.mattermost.server.com/api/v4/',
60 });
61  
62 my $brand = $mm->api->brand;
63  
64 =head2 METHODS
65  
66 =over 4
67  
68 =item C<current()>
69  
70 L<Get brand image|https://api.mattermost.com/#tag/brand%2Fpaths%2F~1brand~1image%2Fget>
71  
72 Get the current brand image for your Mattermost server.
73  
74 my $response = $brand->current;
75  
76 =item C<upload()>
77  
78 L<Upload brand image|https://api.mattermost.com/#tag/brand%2Fpaths%2F~1brand~1image%2Fpost>
79  
80 Set a new brand image for your Mattermost server.
81  
82 my $response = $brand->upload('/path/to/image.jpg');
83  
84 =back
85  
86 =head1 SEE ALSO
87  
88 =over 4
89  
90 =item L<Official "brand" API documentation|https://api.mattermost.com/#tag/brand>
91  
92 =back
93  
94 =head1 AUTHOR
95  
96 Mike Jones <mike@netsplit.org.uk>
97  
98 =head1 COPYRIGHT AND LICENSE
99  
100 This software is Copyright (c) 2020 by Mike Jones.
101  
102 This is free software, licensed under:
103  
104 The MIT (X11) License
105  
106 =cut
« Mattermost/V4/API/Resource/Bots.pm ↑ Summary Mattermost/V4/API/Resource/Role/Single.pm »