| 1 | package WebService::Mattermost::V4::API::Object::Plugins; | ||||||||||
| 2 | |||||||||||
| 3 | # ABSTRACT: Many plugin items. | ||||||||||
| 4 | |||||||||||
| 5 | 12 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 12 | ▶ | use Types::Standard qw(ArrayRef Maybe); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 12 | ▶ | use WebService::Mattermost::V4::API::Object::Plugin; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 12 | extends 'WebService::Mattermost::V4::API::Object'; | |||||||||
| 11 | |||||||||||
| 12 | ################################################################################ | ||||||||||
| 13 | |||||||||||
| 14 | 12 | has [ qw(active inactive) ] => (is => 'ro', isa => Maybe[ArrayRef], lazy => 1, builder => 1); | |||||||||
| 15 | |||||||||||
| 16 | ################################################################################ | ||||||||||
| 17 | |||||||||||
| 18 | sub _map_plugin_objs { | ||||||||||
| 19 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
_map_plugin_objs: not called CC=1 SCAR=6.9
| |||||||||||
| 20 | 0 | my $type = shift; | |||||||||
| 21 | |||||||||||
| 22 | return [ | ||||||||||
| 23 | map { | ||||||||||
| 24 | 0 | my $args = $_; | |||||||||
| 25 | |||||||||||
| 26 | 0 | $args->{base_url} = $self->base_url; | |||||||||
| 27 | 0 | $args->{auth_token} = $self->auth_token; | |||||||||
| 28 | 0 | $args->{raw_data} = {}; | |||||||||
| 29 | |||||||||||
| 30 | 0 | WebService::Mattermost::V4::API::Object::Plugin->new($_) | |||||||||
| 31 | 0 | } @{$self->raw_data->{$type}} | |||||||||
| 32 | ]; | ||||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | ################################################################################ | ||||||||||
| 36 | |||||||||||
| 37 | sub _build_active { | ||||||||||
| 38 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
_build_active: not called CC=2 SCAR=17.9
| |||||||||||
| 39 | |||||||||||
| 40 | 0 | ▶ | return unless $self->raw_data->{active}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 41 | 0 | return $self->_map_plugin_objs('active'); | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | sub _build_inactive { | ||||||||||
| 45 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
_build_inactive: not called CC=2 SCAR=17.9
| |||||||||||
| 46 | |||||||||||
| 47 | 0 | ▶ | return unless $self->raw_data->{inactive}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | 0 | return $self->_map_plugin_objs('inactive'); | |||||||||
| 49 | } | ||||||||||
| 50 | |||||||||||
| 51 | ################################################################################ | ||||||||||
| 52 | |||||||||||
| 53 | 12 | 1; | |||||||||
| 54 | |||||||||||
| 55 | __END__ | ||||||||||
| 56 | |||||||||||
| 57 | =pod | ||||||||||
| 58 | |||||||||||
| 59 | =encoding UTF-8 | ||||||||||
| 60 | |||||||||||
| 61 | =head1 NAME | ||||||||||
| 62 | |||||||||||
| 63 | WebService::Mattermost::V4::API::Object::Plugins - Many plugin items. | ||||||||||
| 64 | |||||||||||
| 65 | =head1 VERSION | ||||||||||
| 66 | |||||||||||
| 67 | version 0.28 | ||||||||||
| 68 | |||||||||||
| 69 | =head1 DESCRIPTION | ||||||||||
| 70 | |||||||||||
| 71 | Contains active and inactive plugins. | ||||||||||
| 72 | |||||||||||
| 73 | =head2 ATTRIBUTES | ||||||||||
| 74 | |||||||||||
| 75 | =over 4 | ||||||||||
| 76 | |||||||||||
| 77 | =item * C<active> | ||||||||||
| 78 | |||||||||||
| 79 | A list of enabled plugins. | ||||||||||
| 80 | |||||||||||
| 81 | =item * C<inactive> | ||||||||||
| 82 | |||||||||||
| 83 | A list of disabled plugins. | ||||||||||
| 84 | |||||||||||
| 85 | =back | ||||||||||
| 86 | |||||||||||
| 87 | =head1 SEE ALSO | ||||||||||
| 88 | |||||||||||
| 89 | =over 4 | ||||||||||
| 90 | |||||||||||
| 91 | =item * L<WebService::Mattermost::V4::API::Object::Plugin> | ||||||||||
| 92 | |||||||||||
| 93 | The "plugins" referred to in C<active> and C<inactive>. | ||||||||||
| 94 | |||||||||||
| 95 | =back | ||||||||||
| 96 | |||||||||||
| 97 | =head1 AUTHOR | ||||||||||
| 98 | |||||||||||
| 99 | Mike Jones <mike@netsplit.org.uk> | ||||||||||
| 100 | |||||||||||
| 101 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 102 | |||||||||||
| 103 | This software is Copyright (c) 2020 by Mike Jones. | ||||||||||
| 104 | |||||||||||
| 105 | This is free software, licensed under: | ||||||||||
| 106 | |||||||||||
| 107 | The MIT (X11) License | ||||||||||
| 108 | |||||||||||
| 109 | =cut | ||||||||||