File Coverage

blib/lib/OpenSearch/Parameters/Index/Clone.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::Clone;
2 4     4   2789 use strict;
  4         11  
  4         190  
3 4     4   24 use warnings;
  4         10  
  4         303  
4 4     4   34 use feature qw(state);
  4         8  
  4         544  
5 4     4   30 use Types::Standard qw(Str Bool HashRef);
  4         11  
  4         39  
6 4     4   8832 use Types::Common::String qw(NonEmptyStr);
  4         10  
  4         36  
7 4     4   5056 use Moo::Role;
  4         12  
  4         46  
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 'settings' => (
24             is => 'rw',
25             isa => HashRef,
26             );
27              
28             has 'aliases' => (
29             is => 'rw',
30             isa => HashRef,
31             );
32              
33             has 'wait_for_active_shards' => (
34             is => 'rw',
35             isa => Str,
36             );
37              
38             has 'cluster_manager_timeout' => (
39             is => 'rw',
40             isa => Str,
41             );
42              
43             has 'timeout' => (
44             is => 'rw',
45             isa => Str,
46             );
47              
48             has 'wait_for_completion' => (
49             is => 'rw',
50             isa => Bool,
51             );
52              
53             has 'task_execution_timeout' => (
54             is => 'rw',
55             isa => Str,
56             );
57              
58             around [
59             qw/index target settings aliases wait_for_active_shards cluster_manager_timeout timeout wait_for_completion task_execution_timeout/
60             ] => sub {
61             my $orig = shift;
62             my $self = shift;
63              
64             if (@_) {
65             $self->$orig(@_);
66             return ($self);
67             }
68             return ( $self->$orig );
69             };
70              
71             sub api_spec {
72 0     0 0   state $s = +{
73             index => {
74             encode_func => 'as_is',
75             type => 'path',
76             },
77             target => {
78             encode_func => 'as_is',
79             type => 'path',
80             },
81             settings => {
82             encode_func => 'as_is',
83             type => 'body',
84             },
85             aliases => {
86             encode_func => 'as_is',
87             type => 'body',
88             },
89             wait_for_active_shards => {
90             encode_func => 'as_is',
91             type => 'url',
92             },
93             cluster_manager_timeout => {
94             encode_func => 'as_is',
95             type => 'url',
96             },
97             timeout => {
98             encode_func => 'as_is',
99             type => 'url',
100             },
101             wait_for_completion => {
102             encode_func => 'encode_bool',
103             type => 'url',
104             },
105             task_execution_timeout => {
106             encode_func => 'as_is',
107             type => 'url',
108             }
109             };
110             }
111              
112             1;