File Coverage

blib/lib/OpenSearch/Parameters/Index/Exists.pm
Criterion Covered Total %
statement 18 19 94.7
branch n/a
condition n/a
subroutine 6 7 85.7
pod 0 1 0.0
total 24 27 88.8


line stmt bran cond sub pod time code
1             package OpenSearch::Parameters::Index::Exists;
2 4     4   2568 use strict;
  4         11  
  4         210  
3 4     4   25 use warnings;
  4         10  
  4         213  
4 4     4   38 use feature qw(state);
  4         9  
  4         540  
5 4     4   29 use Types::Standard qw(Str Bool);
  4         8  
  4         33  
6 4     4   8113 use Types::Common::String qw(NonEmptyStr);
  4         10  
  4         41  
7 4     4   6634 use Moo::Role;
  4         11  
  4         40  
8              
9             with 'OpenSearch::Parameters';
10              
11             has 'index' => (
12             is => 'rw',
13             isa => NonEmptyStr,
14             required => 1,
15             );
16              
17             has 'allow_no_indices' => (
18             is => 'rw',
19             isa => Bool,
20             );
21              
22             has 'expand_wildcards' => (
23             is => 'rw',
24             isa => Str,
25             );
26              
27             has 'flat_settings' => (
28             is => 'rw',
29             isa => Bool,
30             );
31              
32             has 'include_defaults' => (
33             is => 'rw',
34             isa => Bool,
35             );
36              
37             has 'ignore_unavailable' => (
38             is => 'rw',
39             isa => Bool,
40             );
41              
42             has 'local' => (
43             is => 'rw',
44             isa => Bool,
45             );
46              
47             around [qw/index allow_no_indices expand_wildcards flat_settings include_defaults ignore_unavailable local/] => sub {
48             my $orig = shift;
49             my $self = shift;
50              
51             if (@_) {
52             $self->$orig(@_);
53             return ($self);
54             }
55             return ( $self->$orig );
56             };
57              
58             sub api_spec {
59 0     0 0   state $s = +{
60             index => {
61             encode_func => 'as_is',
62             type => 'path',
63             },
64             allow_no_indices => {
65             encode_func => 'encode_bool',
66             type => 'url',
67             },
68             expand_wildcards => {
69             encode_func => 'as_is',
70             type => 'url',
71             },
72             flat_settings => {
73             encode_func => 'encode_bool',
74             type => 'url',
75             },
76             include_defaults => {
77             encode_func => 'encode_bool',
78             type => 'url',
79             },
80             ignore_unavailable => {
81             encode_func => 'encode_bool',
82             type => 'url',
83             },
84             local => {
85             encode_func => 'encode_bool',
86             type => 'url',
87             }
88             };
89             }
90              
91             1;