File Coverage

blib/lib/OpenSearch/Parameters/Cluster/AllocationExplain.pm
Criterion Covered Total %
statement 15 16 93.7
branch n/a
condition n/a
subroutine 5 6 83.3
pod 0 1 0.0
total 20 23 86.9


line stmt bran cond sub pod time code
1             package OpenSearch::Parameters::Cluster::AllocationExplain;
2 4     4   3538 use strict;
  4         16  
  4         217  
3 4     4   27 use warnings;
  4         11  
  4         332  
4 4     4   35 use feature qw(state);
  4         10  
  4         651  
5 4     4   33 use Types::Standard qw(Str Bool Int);
  4         10  
  4         53  
6 4     4   8980 use Moo::Role;
  4         8  
  4         38  
7              
8             with 'OpenSearch::Parameters';
9              
10             has 'current_node' => (
11             is => 'rw',
12             isa => Str,
13             );
14              
15             has 'index' => (
16             is => 'rw',
17             isa => Str,
18             );
19              
20             has 'primary' => (
21             is => 'rw',
22             isa => Bool,
23             );
24              
25             has 'shard' => (
26             is => 'rw',
27             isa => Int,
28             );
29              
30             has 'include_disk_info' => (
31             is => 'rw',
32             isa => Bool,
33             );
34              
35             has 'include_yes_decisions' => (
36             is => 'rw',
37             isa => Bool,
38             );
39              
40             around [qw/current_node index primary shard include_disk_info include_yes_decisions/] => sub {
41             my $orig = shift;
42             my $self = shift;
43              
44             if (@_) {
45             $self->$orig(@_);
46             return ($self);
47             }
48             return ( $self->$orig );
49             };
50              
51             sub api_spec {
52 0     0 0   state $s = +{
53             current_node => {
54             encode_func => 'as_is',
55             type => 'body',
56             },
57             index => {
58             encode_func => 'as_is',
59             type => 'body',
60             },
61             primary => {
62             encode_func => 'encode_bool',
63             type => 'body',
64             },
65             shard => {
66             encode_func => 'as_is',
67             type => 'body',
68             },
69             include_disk_info => {
70             encode_func => 'encode_bool',
71             type => 'url',
72             },
73             include_yes_decisions => {
74             encode_func => 'encode_bool',
75             type => 'url',
76             }
77             };
78             }
79              
80             1;