File Coverage

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