File Coverage

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