line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Zabbix2::API::UserGroup;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
570
|
use strict;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
33
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
24
|
use 5.010;
|
|
1
|
|
|
|
|
4
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
63
|
|
7
|
1
|
|
|
1
|
|
501
|
use autodie;
|
|
1
|
|
|
|
|
14975
|
|
|
1
|
|
|
|
|
6
|
|
8
|
1
|
|
|
1
|
|
7396
|
use utf8;
|
|
1
|
|
|
|
|
16
|
|
|
1
|
|
|
|
|
6
|
|
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
35
|
use Moo;
|
|
1
|
|
|
|
|
16
|
|
|
1
|
|
|
|
|
7
|
|
11
|
|
|
|
|
|
|
extends qw/Zabbix2::API::CRUDE/;
|
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
955
|
use Zabbix2::API::User;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
388
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has 'users' => (is => 'ro',
|
16
|
|
|
|
|
|
|
lazy => 1,
|
17
|
|
|
|
|
|
|
builder => '_fetch_users');
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub id {
|
20
|
|
|
|
|
|
|
## mutator for id
|
21
|
0
|
|
|
0
|
1
|
|
my ($self, $value) = @_;
|
22
|
0
|
0
|
|
|
|
|
if (defined $value) {
|
23
|
0
|
|
|
|
|
|
$self->data->{usrgrpid} = $value;
|
24
|
0
|
|
|
|
|
|
return $self->data->{usrgrpid};
|
25
|
|
|
|
|
|
|
} else {
|
26
|
0
|
|
|
|
|
|
return $self->data->{usrgrpid};
|
27
|
|
|
|
|
|
|
}
|
28
|
|
|
|
|
|
|
}
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _prefix {
|
31
|
0
|
|
|
0
|
|
|
my (undef, $suffix) = @_;
|
32
|
0
|
0
|
0
|
|
|
|
if ($suffix and $suffix =~ m/ids?/) {
|
|
|
0
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
return 'usrgrp'.$suffix;
|
34
|
|
|
|
|
|
|
} elsif ($suffix) {
|
35
|
0
|
|
|
|
|
|
return 'usergroup'.$suffix;
|
36
|
|
|
|
|
|
|
} else {
|
37
|
0
|
|
|
|
|
|
return 'usergroup';
|
38
|
|
|
|
|
|
|
}
|
39
|
|
|
|
|
|
|
}
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub _extension {
|
42
|
0
|
|
|
0
|
|
|
return (output => 'extend');
|
43
|
|
|
|
|
|
|
}
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub name {
|
46
|
0
|
|
|
0
|
1
|
|
my $self = shift;
|
47
|
0
|
|
0
|
|
|
|
return $self->data->{name} || '???';
|
48
|
|
|
|
|
|
|
}
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub _fetch_users {
|
51
|
0
|
|
|
0
|
|
|
my $self = shift;
|
52
|
0
|
|
|
|
|
|
my $users = $self->{root}->fetch('User', params => { usrgrpids => [ $self->id ] });
|
53
|
0
|
|
|
|
|
|
return $users;
|
54
|
|
|
|
|
|
|
}
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1;
|
57
|
|
|
|
|
|
|
__END__
|