co.elastic.clients.elasticsearch.enrich.ElasticsearchEnrichAsyncClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elasticsearch-java Show documentation
Show all versions of elasticsearch-java Show documentation
Elasticsearch Java API Client
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
//----------------------------------------------------
// THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------
package co.elastic.clients.elasticsearch.enrich;
import co.elastic.clients.ApiClient;
import co.elastic.clients.elasticsearch._types.ErrorResponse;
import co.elastic.clients.transport.ElasticsearchTransport;
import co.elastic.clients.transport.Endpoint;
import co.elastic.clients.transport.JsonEndpoint;
import co.elastic.clients.transport.Transport;
import co.elastic.clients.transport.TransportOptions;
import co.elastic.clients.util.ObjectBuilder;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import javax.annotation.Nullable;
/**
* Client for the enrich namespace.
*/
public class ElasticsearchEnrichAsyncClient extends ApiClient {
public ElasticsearchEnrichAsyncClient(ElasticsearchTransport transport) {
super(transport, null);
}
public ElasticsearchEnrichAsyncClient(ElasticsearchTransport transport,
@Nullable TransportOptions transportOptions) {
super(transport, transportOptions);
}
@Override
public ElasticsearchEnrichAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) {
return new ElasticsearchEnrichAsyncClient(this.transport, transportOptions);
}
// ----- Endpoint: enrich.delete_policy
/**
* Deletes an existing enrich policy and its enrich index.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture deletePolicy(DeletePolicyRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) DeletePolicyRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Deletes an existing enrich policy and its enrich index.
*
* @param fn
* a function that initializes a builder to create the
* {@link DeletePolicyRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture deletePolicy(
Function> fn) {
return deletePolicy(fn.apply(new DeletePolicyRequest.Builder()).build());
}
// ----- Endpoint: enrich.execute_policy
/**
* Creates the enrich index for an existing enrich policy.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture executePolicy(ExecutePolicyRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) ExecutePolicyRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Creates the enrich index for an existing enrich policy.
*
* @param fn
* a function that initializes a builder to create the
* {@link ExecutePolicyRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture executePolicy(
Function> fn) {
return executePolicy(fn.apply(new ExecutePolicyRequest.Builder()).build());
}
// ----- Endpoint: enrich.get_policy
/**
* Gets information about an enrich policy.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getPolicy(GetPolicyRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) GetPolicyRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Gets information about an enrich policy.
*
* @param fn
* a function that initializes a builder to create the
* {@link GetPolicyRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture getPolicy(
Function> fn) {
return getPolicy(fn.apply(new GetPolicyRequest.Builder()).build());
}
/**
* Gets information about an enrich policy.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture getPolicy() {
return this.transport.performRequestAsync(new GetPolicyRequest.Builder().build(), GetPolicyRequest._ENDPOINT,
this.transportOptions);
}
// ----- Endpoint: enrich.put_policy
/**
* Creates a new enrich policy.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture putPolicy(PutPolicyRequest request) {
@SuppressWarnings("unchecked")
JsonEndpoint endpoint = (JsonEndpoint) PutPolicyRequest._ENDPOINT;
return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
}
/**
* Creates a new enrich policy.
*
* @param fn
* a function that initializes a builder to create the
* {@link PutPolicyRequest}
* @see Documentation
* on elastic.co
*/
public final CompletableFuture putPolicy(
Function> fn) {
return putPolicy(fn.apply(new PutPolicyRequest.Builder()).build());
}
// ----- Endpoint: enrich.stats
/**
* Gets enrich coordinator statistics and information about enrich policies that
* are currently executing.
*
* @see Documentation
* on elastic.co
*/
public CompletableFuture stats() {
return this.transport.performRequestAsync(EnrichStatsRequest._INSTANCE, EnrichStatsRequest._ENDPOINT,
this.transportOptions);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy