File Coverage

blib/lib/OpenSearch/Parameters/Search/Count.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::Search::Count;
2 4     4   3056 use strict;
  4         11  
  4         169  
3 4     4   22 use warnings;
  4         10  
  4         294  
4 4     4   26 use feature qw(state);
  4         11  
  4         564  
5 4     4   35 use Types::Standard qw(Str Bool Int HashRef);
  4         26  
  4         46  
6 4     4   10099 use Moo::Role;
  4         10  
  4         42  
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 'analyzer' => (
21             is => 'rw',
22             isa => Str,
23             );
24              
25             has 'analyze_wildcard' => (
26             is => 'rw',
27             isa => Bool,
28             );
29              
30             has 'default_operator' => (
31             is => 'rw',
32             isa => Str,
33             );
34              
35             has 'df' => (
36             is => 'rw',
37             isa => Str,
38             );
39              
40             has 'expand_wildcards' => (
41             is => 'rw',
42             isa => Str,
43             );
44              
45             has 'ignore_unavailable' => (
46             is => 'rw',
47             isa => Bool,
48             );
49              
50             has 'lenient' => (
51             is => 'rw',
52             isa => Bool,
53             );
54              
55             has 'min_score' => (
56             is => 'rw',
57             isa => Int,
58             );
59              
60             has 'routing' => (
61             is => 'rw',
62             isa => Str,
63             );
64              
65             has 'preference' => (
66             is => 'rw',
67             isa => Str,
68             );
69              
70             has 'terminate_after' => (
71             is => 'rw',
72             isa => Int,
73             );
74              
75             has 'query' => (
76             is => 'rw',
77             isa => HashRef,
78             );
79              
80             around [
81             qw/
82             index allow_no_indices analyzer analyze_wildcard default_operator df
83             expand_wildcards ignore_unavailable lenient min_score routing preference
84             terminate_after query
85             /
86             ] => sub {
87             my $orig = shift;
88             my $self = shift;
89              
90             if (@_) {
91             $self->$orig(@_);
92             return ($self);
93             }
94             return ( $self->$orig );
95             };
96              
97             sub api_spec {
98 0     0 0   state $s = +{
99             index => {
100             encode_func => 'as_is',
101             type => 'path',
102             },
103             allow_no_indices => {
104             encode_func => 'encode_bool',
105             type => 'url',
106             },
107             analyzer => {
108             encode_func => 'as_is',
109             type => 'url',
110             },
111             analyze_wildcard => {
112             encode_func => 'encode_bool',
113             type => 'url',
114             },
115             default_operator => {
116             encode_func => 'as_is',
117             type => 'url',
118             },
119             df => {
120             encode_func => 'as_is',
121             type => 'url',
122             },
123             expand_wildcards => {
124             encode_func => 'as_is',
125             type => 'url',
126             },
127             ignore_unavailable => {
128             encode_func => 'encode_bool',
129             type => 'url',
130             },
131             lenient => {
132             encode_func => 'encode_bool',
133             type => 'url',
134             },
135             min_score => {
136             encode_func => 'as_is',
137             type => 'body',
138             },
139             routing => {
140             encode_func => 'as_is',
141             type => 'url',
142             },
143             preference => {
144             encode_func => 'as_is',
145             type => 'url',
146             },
147             terminate_after => {
148             encode_func => 'as_is',
149             type => 'body',
150             },
151             query => {
152             encode_func => 'as_is',
153             type => 'body',
154             }
155             };
156             }
157              
158             1;