File Coverage

blib/lib/OpenSearch/Parameters/Index/Refresh.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::Index::Refresh;
2 4     4   2918 use strict;
  4         12  
  4         166  
3 4     4   24 use warnings;
  4         9  
  4         254  
4 4     4   31 use feature qw(state);
  4         10  
  4         478  
5 4     4   31 use Types::Standard qw(Str Bool);
  4         10  
  4         50  
6 4     4   7923 use Moo::Role;
  4         13  
  4         42  
7              
8             with 'OpenSearch::Parameters';
9              
10             has 'index' => (
11             is => 'rw',
12             isa => Str,
13             );
14              
15             has 'ignore_unavailable' => (
16             is => 'rw',
17             isa => Bool,
18             );
19              
20             has 'allow_no_indices' => (
21             is => 'rw',
22             isa => Bool,
23             );
24              
25             has 'expand_wildcards' => (
26             is => 'rw',
27             isa => Str,
28             );
29              
30             around [qw/index ignore_unavailable allow_no_indices expand_wildcards/] => sub {
31             my $orig = shift;
32             my $self = shift;
33              
34             if (@_) {
35             $self->$orig(@_);
36             return ($self);
37             }
38             return ( $self->$orig );
39             };
40              
41             sub api_spec {
42 0     0 0   state $s = +{
43             index => {
44             encode_func => 'as_is',
45             type => 'path',
46             },
47             ignore_unavailable => {
48             encode_func => 'encode_bool',
49             type => 'url',
50             },
51             allow_no_indices => {
52             encode_func => 'encode_bool',
53             type => 'url',
54             },
55             expand_wildcards => {
56             encode_func => 'as_is',
57             type => 'url',
58             }
59             };
60             }
61              
62             1;