Mattermost/V4/API/Object/Plugin.pm

filter: Statementstmt 62.5% 15 / 24 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod 0.0% 0 / 1 totaltotal 54.8% 17 / 31 CC 2 SCAR 11.6
CC
2
Cov
58%
__ANON__
6.0
BUILD
2.0
BEGIN
1.0
CRAP 3.2
« Mattermost/V4/API/Object/DataRetentionPolicy.pm ↑ Summary Mattermost/V4/API/Object/User/Session.pm »
1 package WebService::Mattermost::V4::API::Object::Plugin;
2  
3 # ABSTRACT: A plugin item.
4  
5 12 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 12 ▶use Types::Standard qw(Bool HashRef Maybe Str);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 12 extends 'WebService::Mattermost::V4::API::Object';
9 12 with qw(
10 WebService::Mattermost::V4::API::Object::Role::APIMethods
11 WebService::Mattermost::V4::API::Object::Role::Description
12 WebService::Mattermost::V4::API::Object::Role::Name
13 WebService::Mattermost::V4::API::Object::Role::ID
14 );
15  
16 ################################################################################
17  
18 12 has backend => (is => 'ro', isa => Maybe[HashRef]);
19 12 has prepackaged => (is => 'ro', isa => Maybe[Bool]);
20 12 has settings_schema => (is => 'ro', isa => Maybe[HashRef]);
21 12 has version => (is => 'ro', isa => Maybe[Str]);
22 12 has webapp => (is => 'ro', isa => Maybe[HashRef]);
23  
24 ################################################################################
25  
26 around BUILDARGS => sub {
27 0 ▶ my $orig = shift;
Subroutine __ANON__: not called CC=2 SCAR=17.9
28 0 my $self = shift;
29 0 my $args = shift;
30  
31 # Convert JSON::PP::Boolean into regular boolean
32 0 ▶ $args->{prepackaged} = $args->{prepackaged} ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$args->{'prepackaged'} ? : 0 0 0
33  
34 0 return $self->$orig($args);
35 12 };
36  
37 sub BUILD {
38 0 ▶ my $self = shift;
Subroutine BUILD: not called CC=1 SCAR=6.9
Pod undocumented
39  
40 0 $self->api_resource_name('plugin');
41 0 $self->set_available_api_methods([ qw(remove activate deactivate) ]);
42  
43 0 return 1;
44 }
45  
46 ################################################################################
47  
48 12 1;
49  
50 __END__
51  
52 =pod
53  
54 =encoding UTF-8
55  
56 =head1 NAME
57  
58 WebService::Mattermost::V4::API::Object::Plugin - A plugin item.
59  
60 =head1 VERSION
61  
62 version 0.28
63  
64 =head1 DESCRIPTION
65  
66 An active or inactive plugin.
67  
68 =head2 METHODS
69  
70 See matching methods in L<WebService::Mattermost::V4::API::Resource::Plugin>
71 for full documentation.
72  
73 ID parameters are not required:
74  
75 my @responses = map { $_->deactivate } @{$mattermost->api->plugins->all->item->active};
76  
77 Is the same as:
78  
79 my @responses = map { $mattermost->api->plugin->deactivate($_) } qw(PLUGIN-IDS-HERE);
80  
81 =over 4
82  
83 =item C<remove()>
84  
85 =item C<activate()>
86  
87 =item C<deactivate()>
88  
89 =back
90  
91 =head2 ATTRIBUTES
92  
93 =over 4
94  
95 =item C<backend>
96  
97 =item C<prepackaged>
98  
99 =item C<settings_schema>
100  
101 =item C<version>
102  
103 =item C<webapp>
104  
105 =back
106  
107 =head1 SEE ALSO
108  
109 =over 4
110  
111 =item L<WebService::Mattermost::V4::API::Resource::Plugin>
112  
113 =item L<WebService::Mattermost::V4::API::Resource::Plugins>
114  
115 =item L<WebService::Mattermost::V4::API::Object::Role::Description>
116  
117 =item L<WebService::Mattermost::V4::API::Object::Role::Name>
118  
119 =item L<WebService::Mattermost::V4::API::Object::Role::ID>
120  
121 =back
122  
123 =head1 AUTHOR
124  
125 Mike Jones <mike@netsplit.org.uk>
126  
127 =head1 COPYRIGHT AND LICENSE
128  
129 This software is Copyright (c) 2020 by Mike Jones.
130  
131 This is free software, licensed under:
132  
133 The MIT (X11) License
134  
135 =cut
« Mattermost/V4/API/Object/DataRetentionPolicy.pm ↑ Summary Mattermost/V4/API/Object/User/Session.pm »