File Coverage

blib/lib/OpenSearch/Parameters/Index/ClearCache.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::ClearCache;
2 4     4   3075 use strict;
  4         11  
  4         179  
3 4     4   25 use warnings;
  4         11  
  4         254  
4 4     4   41 use feature qw(state);
  4         11  
  4         585  
5 4     4   31 use Types::Standard qw(Str Bool);
  4         28  
  4         42  
6 4     4   8215 use Moo::Role;
  4         9  
  4         41  
7              
8             with 'OpenSearch::Parameters';
9              
10             has 'index' => (
11             is => 'rw',
12             isa => Str,
13             );
14              
15             has 'allow_no_indices' => (
16             is => 'rw',
17             isa => Bool,
18             );
19              
20             has 'expand_wildcards' => (
21             is => 'rw',
22             isa => Str,
23             );
24              
25             has 'fielddata' => (
26             is => 'rw',
27             isa => Bool,
28             );
29              
30             has 'fields' => (
31             is => 'rw',
32             isa => Str,
33             );
34              
35             has 'file' => (
36             is => 'rw',
37             isa => Bool,
38             );
39              
40             has 'ignore_unavailable' => (
41             is => 'rw',
42             isa => Bool,
43             );
44              
45             has 'query' => (
46             is => 'rw',
47             isa => Bool,
48             );
49              
50             has 'request' => (
51             is => 'rw',
52             isa => Bool,
53             );
54              
55             around [qw/index allow_no_indices expand_wildcards fielddata fields file ignore_unavailable query request/] => sub {
56             my $orig = shift;
57             my $self = shift;
58              
59             if (@_) {
60             $self->$orig(@_);
61             return ($self);
62             }
63             return ( $self->$orig );
64             };
65              
66             sub api_spec {
67 0     0 0   state $s = +{
68             index => {
69             encode_func => 'as_is',
70             type => 'path',
71             },
72             allow_no_indices => {
73             encode_func => 'encode_bool',
74             type => 'url',
75             },
76             expand_wildcards => {
77             encode_func => 'as_is',
78             type => 'url',
79             },
80             fielddata => {
81             encode_func => 'as_is',
82             type => 'url',
83             },
84             fields => {
85             encode_func => 'as_is',
86             type => 'url',
87             },
88             file => {
89             encode_func => 'encode_bool',
90             type => 'url',
91             },
92             ignore_unavailable => {
93             encode_func => 'encode_bool',
94             type => 'url',
95             },
96             query => {
97             encode_func => 'encode_bool',
98             type => 'url',
99             },
100             request => {
101             encode_func => 'encode_bool',
102             type => 'url',
103             }
104             };
105             }
106              
107             1;