File Coverage

blib/lib/OpenSearch/Client/Core/3_0/Direct.pm
Criterion Covered Total %
statement 9 57 15.7
branch n/a
condition 0 12 0.0
subroutine 3 43 6.9
pod 2 2 100.0
total 14 114 12.2


line stmt bran cond sub pod time code
1             # OpenSearch::Client is an unofficial client for OpenSearch.
2             # It is derived from Search::Elasticsearch version 7.714
3             # License details from the original work are contained in the
4             # NOTICE file distributed with this work.
5             #
6             #-----------------------------------------------------------------------
7             # OpenSearch::Client
8             #-----------------------------------------------------------------------
9             # Copyright 2026 Mark Dootson
10             #
11             # Licensed under the Apache License, Version 2.0 (the "License");
12             # you may not use this file except in compliance with the License.
13             # You may obtain a copy of the License at
14             #
15             # http://www.apache.org/licenses/LICENSE-2.0
16             #
17             # Unless required by applicable law or agreed to in writing, software
18             # distributed under the License is distributed on an "AS IS" BASIS,
19             # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20             # See the License for the specific language governing permissions and
21             # limitations under the License.
22              
23             package OpenSearch::Client::Core::3_0::Direct;
24             $OpenSearch::Client::Core::3_0::Direct::VERSION = '3.007002';
25 55     55   36855 use Moo;
  55         102  
  55         329  
26             with 'OpenSearch::Client::Core::3_0::Role::API';
27             with 'OpenSearch::Client::Role::Client::Direct';
28              
29 55     55   19259 use OpenSearch::Client::Util qw(parse_params is_compat);
  55         1796  
  55         433  
30 55     55   16946 use namespace::clean;
  55         86  
  55         281  
31              
32 0     0     sub _namespace {__PACKAGE__}
33              
34              
35             has 'asynchronous_search' => ( is => 'lazy', init_arg => undef );
36             has 'cat' => ( is => 'lazy', init_arg => undef );
37             has 'cluster' => ( is => 'lazy', init_arg => undef );
38             has 'dangling_indices' => ( is => 'lazy', init_arg => undef );
39             has 'flow_framework' => ( is => 'lazy', init_arg => undef );
40             has 'geospatial' => ( is => 'lazy', init_arg => undef );
41             has 'indices' => ( is => 'lazy', init_arg => undef );
42             has 'ingest' => ( is => 'lazy', init_arg => undef );
43             has 'ingestion' => ( is => 'lazy', init_arg => undef );
44             has 'insights' => ( is => 'lazy', init_arg => undef );
45             has 'ism' => ( is => 'lazy', init_arg => undef );
46             has 'knn' => ( is => 'lazy', init_arg => undef );
47             has 'list' => ( is => 'lazy', init_arg => undef );
48             has 'ltr' => ( is => 'lazy', init_arg => undef );
49             has 'ml' => ( is => 'lazy', init_arg => undef );
50             has 'neural' => ( is => 'lazy', init_arg => undef );
51             has 'nodes' => ( is => 'lazy', init_arg => undef );
52             has 'notifications' => ( is => 'lazy', init_arg => undef );
53             has 'observability' => ( is => 'lazy', init_arg => undef );
54             has 'ppl' => ( is => 'lazy', init_arg => undef );
55             has 'query' => ( is => 'lazy', init_arg => undef );
56             has 'remote_store' => ( is => 'lazy', init_arg => undef );
57             has 'replication' => ( is => 'lazy', init_arg => undef );
58             has 'rollups' => ( is => 'lazy', init_arg => undef );
59             has 'search_pipeline' => ( is => 'lazy', init_arg => undef );
60             has 'search_relevance' => ( is => 'lazy', init_arg => undef );
61             has 'security' => ( is => 'lazy', init_arg => undef );
62             has 'security_analytics' => ( is => 'lazy', init_arg => undef );
63             has 'sm' => ( is => 'lazy', init_arg => undef );
64             has 'snapshot' => ( is => 'lazy', init_arg => undef );
65             has 'sql' => ( is => 'lazy', init_arg => undef );
66             has 'tasks' => ( is => 'lazy', init_arg => undef );
67             has 'transforms' => ( is => 'lazy', init_arg => undef );
68             has 'ubi' => ( is => 'lazy', init_arg => undef );
69             has 'wlm' => ( is => 'lazy', init_arg => undef );
70             has 'bulk_helper_class' => ( is => 'rw' );
71             has 'scroll_helper_class' => ( is => 'rw' );
72             has '_bulk_class' => ( is => 'lazy' );
73             has '_scroll_class' => ( is => 'lazy' );
74              
75             #===================================
76             sub _build__bulk_class {
77             #===================================
78 0     0     my $self = shift;
79 0   0       my $bulk_class = $self->bulk_helper_class
80             || 'Core::' . $self->api_version . '::Helper::Bulk';
81 0           $self->_build_helper( 'bulk', $bulk_class );
82             }
83              
84             #===================================
85             sub _build__scroll_class {
86             #===================================
87 0     0     my $self = shift;
88 0   0       my $scroll_class = $self->scroll_helper_class
89             || 'Core::' . $self->api_version . '::Helper::Scroll';
90 0           $self->_build_helper( 'scroll', $scroll_class );
91             }
92              
93             #===================================
94             sub bulk_helper {
95             #===================================
96 0     0 1   my ( $self, $params ) = parse_params(@_);
97 0   0       $params->{os} ||= $self;
98 0           $self->_bulk_class->new($params);
99             }
100              
101             #===================================
102             sub scroll_helper {
103             #===================================
104 0     0 1   my ( $self, $params ) = parse_params(@_);
105 0   0       $params->{os} ||= $self;
106 0           $self->_scroll_class->new($params);
107             }
108              
109              
110 0     0     sub _build_asynchronous_search { shift->_build_namespace('AsyncSearch') }
111 0     0     sub _build_cat { shift->_build_namespace('Cat') }
112 0     0     sub _build_cluster { shift->_build_namespace('Cluster') }
113 0     0     sub _build_dangling_indices { shift->_build_namespace('DanglingIndices') }
114 0     0     sub _build_flow_framework { shift->_build_namespace('FlowFramework') }
115 0     0     sub _build_geospatial { shift->_build_namespace('GeoSpatial') }
116 0     0     sub _build_indices { shift->_build_namespace('Indices') }
117 0     0     sub _build_ingest { shift->_build_namespace('Ingest') }
118 0     0     sub _build_ingestion { shift->_build_namespace('Ingestion') }
119 0     0     sub _build_insights { shift->_build_namespace('Insights') }
120 0     0     sub _build_ism { shift->_build_namespace('ISM') }
121 0     0     sub _build_knn { shift->_build_namespace('KNN') }
122 0     0     sub _build_list { shift->_build_namespace('List') }
123 0     0     sub _build_ltr { shift->_build_namespace('LTR') }
124 0     0     sub _build_ml { shift->_build_namespace('ML') }
125 0     0     sub _build_neural { shift->_build_namespace('Neural') }
126 0     0     sub _build_nodes { shift->_build_namespace('Nodes') }
127 0     0     sub _build_notifications { shift->_build_namespace('Notifications') }
128 0     0     sub _build_observability { shift->_build_namespace('Observability') }
129 0     0     sub _build_ppl { shift->_build_namespace('PPL') }
130 0     0     sub _build_query { shift->_build_namespace('Query') }
131 0     0     sub _build_remote_store { shift->_build_namespace('RemoteStore') }
132 0     0     sub _build_replication { shift->_build_namespace('Replication') }
133 0     0     sub _build_rollups { shift->_build_namespace('Rollups') }
134 0     0     sub _build_search_pipeline { shift->_build_namespace('SearchPipeline') }
135 0     0     sub _build_search_relevance { shift->_build_namespace('SearchRelevance') }
136 0     0     sub _build_security { shift->_build_namespace('Security') }
137 0     0     sub _build_security_analytics { shift->_build_namespace('SecurityAnalytics') }
138 0     0     sub _build_sm { shift->_build_namespace('SnapshotManagement') }
139 0     0     sub _build_snapshot { shift->_build_namespace('Snapshot') }
140 0     0     sub _build_sql { shift->_build_namespace('SQL') }
141 0     0     sub _build_tasks { shift->_build_namespace('Tasks') }
142 0     0     sub _build_transforms { shift->_build_namespace('Transforms') }
143 0     0     sub _build_ubi { shift->_build_namespace('UBI') }
144 0     0     sub _build_wlm { shift->_build_namespace('WLM') }
145              
146             __PACKAGE__->_install_api('_core');
147              
148             1;
149              
150             __END__