Etcd/Auth/Role.pm

filter: Statementstmt 62.2% 33 / 53 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 69.2% 9 / 13 Podpod 100% 4 / 4 totaltotal 60.5% 46 / 76 CC 4 SCAR 10.8
CC
4
Cov
56%
add
6.0
delete
6.0
get
6.0
CRAP 2.9
« Etcd/Lease.pm ↑ Summary Etcd/KV/Compare.pm »
1 9 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package Net::Etcd::Auth::Role;
3  
4 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 9 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 9 ▶use Types::Standard qw(Str Int Bool HashRef ArrayRef);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 9 ▶use MIME::Base64;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 9 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 9 ▶use JSON;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 9 with 'Net::Etcd::Role::Actions';
14  
15 9 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 =head1 NAME
18  
19 Net::Etcd::Auth::Role
20  
21 =cut
22  
23 9 our $VERSION = '0.022';
24  
25 =head1 DESCRIPTION
26  
27 Role
28  
29 =head2 endpoint
30  
31 =cut
32  
33 9 has endpoint => (
34 is => 'rwp',
35 isa => Str,
36 );
37  
38 =head2 name
39  
40 name of role
41  
42 =cut
43  
44 9 has name => (
45 is => 'ro',
46 isa => Str,
47 );
48  
49 =head2 role
50  
51 name of role
52  
53 =cut
54  
55 9 has role => (
56 is => 'ro',
57 isa => Str,
58 );
59  
60 =head2 add
61  
62 Add role
63  
64 =cut
65  
66 0 ▶sub add {
Subroutine add: not called CC=2 SCAR=17.9
Pod documented
67 0 my ($self) = @_;
68 confess 'name required for ' . __PACKAGE__ . '->add'
69 0 ▶ unless $self->{name};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"name"} 0 0 0
70 0 $self->{endpoint} = '/auth/role/add';
71 0 $self->request;
72 0 return $self;
73 }
74  
75 =head2 delete
76  
77 Delete role
78  
79 =cut
80  
81 0 ▶sub delete {
Subroutine delete: not called CC=2 SCAR=17.9
Pod documented
82 0 my ($self) = @_;
83 confess 'role required for ' . __PACKAGE__ . '->delete'
84 0 ▶ unless $self->{role};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"role"} 0 0 0
85 0 $self->{endpoint} = '/auth/role/delete';
86 0 $self->request;
87 0 return $self;
88 }
89  
90 =head2 get
91  
92 Get role
93  
94 =cut
95  
96 0 ▶sub get {
Subroutine get: not called CC=2 SCAR=17.9
Pod documented
97 0 my ($self) = @_;
98 confess 'name required for ' . __PACKAGE__ . '->get'
99 0 ▶ unless $self->{role};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"role"} 0 0 0
100 0 $self->{endpoint} = '/auth/role/get';
101 0 $self->request;
102 0 return $self;
103 }
104  
105 =head2 list
106  
107 List roles
108  
109 =cut
110  
111 0 ▶sub list {
Subroutine list: not called CC=1 SCAR=6.9
Pod documented
112 0 my ($self) = @_;
113 0 $self->{endpoint} = '/auth/role/list';
114 0 $self->{json_args} = '{}';
115 0 $self->request;
116 0 return $self;
117 }
118 9 1;
« Etcd/Lease.pm ↑ Summary Etcd/KV/Compare.pm »