File Coverage

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