File Coverage

blib/lib/OpenSearch/Parameters/Index/Close.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::Close;
2 4     4   2589 use strict;
  4         11  
  4         161  
3 4     4   25 use warnings;
  4         10  
  4         275  
4 4     4   32 use feature qw(state);
  4         8  
  4         439  
5 4     4   24 use Types::Standard qw(Str Bool);
  4         37  
  4         39  
6 4     4   7525 use Types::Common::String qw(NonEmptyStr);
  4         12  
  4         38  
7 4     4   4596 use Moo::Role;
  4         13  
  4         60  
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 'ignore_unavailable' => (
28             is => 'rw',
29             isa => Bool,
30             );
31              
32             has 'wait_for_active_shards' => (
33             is => 'rw',
34             isa => Str,
35             );
36              
37             has 'cluster_manager_timeout' => (
38             is => 'rw',
39             isa => Str,
40             );
41              
42             has 'timeout' => (
43             is => 'rw',
44             isa => Str,
45             );
46              
47             around [
48             qw/index allow_no_indices expand_wildcards ignore_unavailable wait_for_active_shards cluster_manager_timeout timeout/
49             ] => sub {
50             my $orig = shift;
51             my $self = shift;
52              
53             if (@_) {
54             $self->$orig(@_);
55             return ($self);
56             }
57             return ( $self->$orig );
58             };
59              
60             sub api_spec {
61 0     0 0   state $s = +{
62             index => {
63             encode_func => 'as_is',
64             type => 'path',
65             },
66             allow_no_indices => {
67             encode_func => 'encode_bool',
68             type => 'url',
69             },
70             expand_wildcards => {
71             encode_func => 'as_is',
72             type => 'url',
73             },
74             ignore_unavailable => {
75             encode_func => 'encode_bool',
76             type => 'url',
77             },
78             wait_for_active_shards => {
79             encode_func => 'as_is',
80             type => 'url',
81             },
82             cluster_manager_timeout => {
83             encode_func => 'as_is',
84             type => 'url',
85             },
86             timeout => {
87             encode_func => 'as_is',
88             type => 'url',
89             }
90             };
91             }
92              
93             1;