File Coverage

blib/lib/OpenSearch/Parameters/Cluster/SetRoutingAwareness.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::Cluster::SetRoutingAwareness;
2 4     4   2509 use strict;
  4         10  
  4         167  
3 4     4   21 use warnings;
  4         9  
  4         218  
4 4     4   23 use feature qw(state);
  4         9  
  4         473  
5 4     4   42 use Types::Standard qw(Str HashRef);
  4         11  
  4         33  
6 4     4   7728 use Moo::Role;
  4         10  
  4         34  
7              
8             with 'OpenSearch::Parameters';
9              
10             has 'attribute' => (
11             is => 'rw',
12             isa => Str,
13             );
14              
15             has '_version' => (
16             is => 'rw',
17             isa => Str,
18             );
19              
20             has 'weights' => (
21             is => 'rw',
22             isa => HashRef,
23             );
24              
25             around [qw/attribute weights _version/] => sub {
26             my $orig = shift;
27             my $self = shift;
28              
29             if (@_) {
30             $self->$orig(@_);
31             return ($self);
32             }
33             return ( $self->$orig );
34             };
35              
36             sub api_spec {
37 0     0 0   state $s = +{
38             attribute => {
39             encode_func => 'as_is',
40             type => 'path',
41             },
42             _version => {
43             encode_func => 'as_is',
44             type => 'body',
45             },
46             weights => {
47             encode_func => 'as_is',
48             type => 'body',
49             }
50             };
51             }
52              
53             1;