File Coverage

blib/lib/OpenSearch/Parameters/Index/Open.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::Open;
2 4     4   2964 use strict;
  4         13  
  4         181  
3 4     4   58 use warnings;
  4         40  
  4         296  
4 4     4   33 use feature qw(state);
  4         12  
  4         540  
5 4     4   32 use Types::Standard qw(Str Bool);
  4         10  
  4         39  
6 4     4   8764 use Types::Common::String qw(NonEmptyStr);
  4         11  
  4         41  
7 4     4   4867 use Moo::Role;
  4         11  
  4         46  
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             has 'wait_for_completion' => (
48             is => 'rw',
49             isa => Bool,
50             );
51              
52             has 'task_execution_timeout' => (
53             is => 'rw',
54             isa => Str,
55             );
56              
57             around [
58             qw/index allow_no_indices expand_wildcards ignore_unavailable wait_for_active_shards cluster_manager_timeout timeout wait_for_completion task_execution_timeout/
59             ] => sub {
60             my $orig = shift;
61             my $self = shift;
62              
63             if (@_) {
64             $self->$orig(@_);
65             return ($self);
66             }
67             return ( $self->$orig );
68             };
69              
70             sub api_spec {
71 0     0 0   state $s = +{
72             index => {
73             encode_func => 'as_is',
74             type => 'path',
75             },
76             allow_no_indices => {
77             encode_func => 'encode_bool',
78             type => 'url',
79             },
80             expand_wildcards => {
81             encode_func => 'as_is',
82             type => 'url',
83             },
84             ignore_unavailable => {
85             encode_func => 'encode_bool',
86             type => 'url',
87             },
88             wait_for_active_shards => {
89             encode_func => 'as_is',
90             type => 'url',
91             },
92             cluster_manager_timeout => {
93             encode_func => 'as_is',
94             type => 'url',
95             },
96             timeout => {
97             encode_func => 'as_is',
98             type => 'url',
99             },
100             wait_for_completion => {
101             encode_func => 'encode_bool',
102             type => 'url',
103             },
104             task_execution_timeout => {
105             encode_func => 'as_is',
106             type => 'url',
107             }
108             };
109             }
110              
111             1;