File Coverage

blib/lib/OpenSearch/Parameters/Index/GetMappings.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::GetMappings;
2 4     4   2496 use strict;
  4         12  
  4         157  
3 4     4   23 use warnings;
  4         7  
  4         217  
4 4     4   51 use feature qw(state);
  4         12  
  4         449  
5 4     4   27 use Types::Standard qw(Str);
  4         10  
  4         31  
6 4     4   6786 use Types::Common::String qw(NonEmptyStr);
  4         13  
  4         35  
7 4     4   4305 use Moo::Role;
  4         10  
  4         37  
8              
9             with 'OpenSearch::Parameters';
10              
11             has 'index' => (
12             is => 'rw',
13             isa => NonEmptyStr,
14             required => 1,
15             );
16              
17             has 'field' => (
18             is => 'rw',
19             isa => Str,
20             );
21              
22             around [qw/index field/] => sub {
23             my $orig = shift;
24             my $self = shift;
25              
26             if (@_) {
27             $self->$orig(@_);
28             return ($self);
29             }
30             return ( $self->$orig );
31             };
32              
33             sub api_spec {
34 0     0 0   state $s = +{
35             index => {
36             encode_func => 'as_is',
37             type => 'path',
38             },
39             field => {
40             encode_func => 'as_is',
41             type => 'path',
42             }
43             };
44             }
45              
46             1;