File Coverage

blib/lib/Etcd3/Auth/RoleDelete.pm
Criterion Covered Total %
statement 24 35 68.5
branch 0 4 0.0
condition n/a
subroutine 8 10 80.0
pod 1 1 100.0
total 33 50 66.0


line stmt bran cond sub pod time code
1 3     3   10 use utf8;
  3         3  
  3         15  
2             package Etcd3::Auth::RoleDelete;
3              
4 3     3   144 use strict;
  3         5  
  3         58  
5 3     3   9 use warnings;
  3         3  
  3         68  
6              
7 3     3   10 use Moo;
  3         4  
  3         11  
8 3     3   621 use Types::Standard qw(Str Int Bool HashRef ArrayRef);
  3         4  
  3         20  
9 3     3   1584 use MIME::Base64;
  3         6  
  3         146  
10 3     3   15 use JSON;
  3         4  
  3         21  
11              
12             with 'Etcd3::Role::Actions';
13              
14 3     3   280 use namespace::clean;
  3         3  
  3         16  
15              
16             =head1 NAME
17              
18             Etcd3::Auth::RoleDelete
19              
20             =cut
21              
22             our $VERSION = '0.001';
23              
24             =head1 DESCRIPTION
25              
26             Add user
27              
28             =head2 endpoint
29              
30             =cut
31              
32             has endpoint => (
33             is => 'ro',
34             isa => Str,
35             default => '/auth/role/delete'
36             );
37              
38             =head2 role
39              
40             name of role to delete
41              
42             =cut
43              
44             has role => (
45             is => 'ro',
46             isa => Str,
47             required => 1,
48             );
49              
50             =head2 json_args
51              
52             arguments that will be sent to the api
53              
54             =cut
55              
56             has json_args => (
57             is => 'lazy',
58             );
59              
60             sub _build_json_args {
61 0     0     my ($self) = @_;
62 0           my $args;
63 0           for my $key ( keys %{ $self }) {
  0            
64 0 0         unless ( $key =~ /(?:_client|json_args|endpoint)$/ ) {
65 0           $args->{$key} = $self->{$key};
66             }
67             }
68 0           return to_json($args);
69             }
70              
71             =head2 init
72              
73             =cut
74              
75             sub init {
76 0     0 1   my ($self) = @_;
77 0           my $init = $self->json_args;
78 0 0         $init or return;
79 0           return $self;
80             }
81              
82             1;