File Coverage

blib/lib/OpenSearch/Parameters/Index/Get.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::Get;
2 4     4   2754 use strict;
  4         12  
  4         160  
3 4     4   21 use warnings;
  4         7  
  4         244  
4 4     4   26 use feature qw(state);
  4         10  
  4         424  
5 4     4   24 use Types::Standard qw(Str Bool);
  4         6  
  4         35  
6 4     4   7780 use Types::Common::String qw(NonEmptyStr);
  4         11  
  4         35  
7 4     4   5567 use Moo::Role;
  4         11  
  4         42  
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             has 'cluster_manager_timeout' => (
48             is => 'rw',
49             isa => Str,
50             );
51              
52             around [
53             qw/index allow_no_indices expand_wildcards flat_settings include_defaults ignore_unavailable local cluster_manager_timeout/
54             ] => sub {
55             my $orig = shift;
56             my $self = shift;
57              
58             if (@_) {
59             $self->$orig(@_);
60             return ($self);
61             }
62             return ( $self->$orig );
63             };
64              
65             sub api_spec {
66 0     0 0   state $s = +{
67             index => {
68             encode_func => 'as_is',
69             type => 'path',
70             },
71             allow_no_indices => {
72             encode_func => 'encode_bool',
73             type => 'url',
74             },
75             expand_wildcards => {
76             encode_func => 'as_is',
77             type => 'url',
78             },
79             flat_settings => {
80             encode_func => 'encode_bool',
81             type => 'url',
82             },
83             include_defaults => {
84             encode_func => 'encode_bool',
85             type => 'url',
86             },
87             ignore_unavailable => {
88             encode_func => 'encode_bool',
89             type => 'url',
90             },
91             local => {
92             encode_func => 'encode_bool',
93             type => 'url',
94             },
95             cluster_manager_timeout => {
96             encode_func => 'as_is',
97             type => 'url',
98             }
99             };
100             }
101              
102             1;