File Coverage

blib/lib/OpenSearch/Parameters/Index/ForceMerge.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::ForceMerge;
2 4     4   2602 use strict;
  4         9  
  4         162  
3 4     4   21 use warnings;
  4         11  
  4         286  
4 4     4   33 use feature qw(state);
  4         12  
  4         519  
5 4     4   27 use Types::Standard qw(Str Bool Int);
  4         9  
  4         35  
6 4     4   8742 use Moo::Role;
  4         11  
  4         40  
7              
8             with 'OpenSearch::Parameters';
9              
10             has 'index' => (
11             is => 'rw',
12             isa => Str,
13             );
14              
15             has 'allow_no_indices' => (
16             is => 'rw',
17             isa => Bool,
18             );
19              
20             has 'expand_wildcards' => (
21             is => 'rw',
22             isa => Str,
23             );
24              
25             has 'flush' => (
26             is => 'rw',
27             isa => Bool,
28             );
29              
30             has 'ignore_unavailable' => (
31             is => 'rw',
32             isa => Bool,
33             );
34              
35             has 'max_num_segments' => (
36             is => 'rw',
37             isa => Int,
38             );
39              
40             has 'only_expunge_deletes' => (
41             is => 'rw',
42             isa => Bool,
43             );
44              
45             has 'primary_only' => (
46             is => 'rw',
47             isa => Bool,
48             );
49              
50             around [
51             qw/index allow_no_indices expand_wildcards flush ignore_unavailable max_num_segments only_expunge_deletes primary_only/
52             ] => sub {
53             my $orig = shift;
54             my $self = shift;
55              
56             if (@_) {
57             $self->$orig(@_);
58             return ($self);
59             }
60             return ( $self->$orig );
61             };
62              
63             sub api_spec {
64 0     0 0   state $s = +{
65             index => {
66             encode_func => 'as_is',
67             type => 'path',
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             flush => {
78             encode_func => 'encode_bool',
79             type => 'url',
80             },
81             ignore_unavailable => {
82             encode_func => 'encode_bool',
83             type => 'url',
84             },
85             max_num_segments => {
86             encode_func => 'as_is',
87             type => 'url',
88             },
89             only_expunge_deletes => {
90             encode_func => 'encode_bool',
91             type => 'url',
92             },
93             primary_only => {
94             encode_func => 'encode_bool',
95             type => 'url',
96             }
97             };
98             }
99              
100             1;