All Downloads are FREE. Search and download functionalities are using the official Maven repository.

co.elastic.clients.elasticsearch.connector.ElasticsearchConnectorAsyncClient Maven / Gradle / Ivy

/*
 * 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.
 */

package co.elastic.clients.elasticsearch.connector;

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;

//----------------------------------------------------------------
//       THIS CODE IS GENERATED. MANUAL EDITS WILL BE LOST.
//----------------------------------------------------------------
//
// This code is generated from the Elasticsearch API specification
// at https://github.com/elastic/elasticsearch-specification
//
// Manual updates to this file will be lost when the code is
// re-generated.
//
// If you find a property that is missing or wrongly typed, please
// open an issue or a PR on the API specification repository.
//
//----------------------------------------------------------------

/**
 * Client for the connector namespace.
 */
public class ElasticsearchConnectorAsyncClient
		extends
			ApiClient {

	public ElasticsearchConnectorAsyncClient(ElasticsearchTransport transport) {
		super(transport, null);
	}

	public ElasticsearchConnectorAsyncClient(ElasticsearchTransport transport,
			@Nullable TransportOptions transportOptions) {
		super(transport, transportOptions);
	}

	@Override
	public ElasticsearchConnectorAsyncClient withTransportOptions(@Nullable TransportOptions transportOptions) {
		return new ElasticsearchConnectorAsyncClient(this.transport, transportOptions);
	}

	// ----- Endpoint: connector.check_in

	/**
	 * Updates the last_seen field in the connector, and sets it to current
	 * timestamp
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture checkIn(CheckInRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) CheckInRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the last_seen field in the connector, and sets it to current
	 * timestamp
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link CheckInRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture checkIn(
			Function> fn) {
		return checkIn(fn.apply(new CheckInRequest.Builder()).build());
	}

	// ----- Endpoint: connector.delete

	/**
	 * Deletes a connector.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture delete(DeleteConnectorRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) DeleteConnectorRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Deletes a connector.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link DeleteConnectorRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture delete(
			Function> fn) {
		return delete(fn.apply(new DeleteConnectorRequest.Builder()).build());
	}

	// ----- Endpoint: connector.get

	/**
	 * Retrieves a connector.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture get(GetConnectorRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) GetConnectorRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Retrieves a connector.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link GetConnectorRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture get(
			Function> fn) {
		return get(fn.apply(new GetConnectorRequest.Builder()).build());
	}

	// ----- Endpoint: connector.list

	/**
	 * Returns existing connectors.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture list(ListRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) ListRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Returns existing connectors.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link ListRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture list(Function> fn) {
		return list(fn.apply(new ListRequest.Builder()).build());
	}

	/**
	 * Returns existing connectors.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture list() {
		return this.transport.performRequestAsync(new ListRequest.Builder().build(), ListRequest._ENDPOINT,
				this.transportOptions);
	}

	// ----- Endpoint: connector.post

	/**
	 * Creates a connector.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture post(PostRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) PostRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Creates a connector.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link PostRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture post(Function> fn) {
		return post(fn.apply(new PostRequest.Builder()).build());
	}

	/**
	 * Creates a connector.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture post() {
		return this.transport.performRequestAsync(new PostRequest.Builder().build(), PostRequest._ENDPOINT,
				this.transportOptions);
	}

	// ----- Endpoint: connector.put

	/**
	 * Creates or updates a connector.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture put(PutRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) PutRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Creates or updates a connector.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link PutRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture put(Function> fn) {
		return put(fn.apply(new PutRequest.Builder()).build());
	}

	/**
	 * Creates or updates a connector.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture put() {
		return this.transport.performRequestAsync(new PutRequest.Builder().build(), PutRequest._ENDPOINT,
				this.transportOptions);
	}

	// ----- Endpoint: connector.sync_job_cancel

	/**
	 * Cancels a connector sync job.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture syncJobCancel(SyncJobCancelRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) SyncJobCancelRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Cancels a connector sync job.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link SyncJobCancelRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture syncJobCancel(
			Function> fn) {
		return syncJobCancel(fn.apply(new SyncJobCancelRequest.Builder()).build());
	}

	// ----- Endpoint: connector.sync_job_delete

	/**
	 * Deletes a connector sync job.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture syncJobDelete(SyncJobDeleteRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) SyncJobDeleteRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Deletes a connector sync job.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link SyncJobDeleteRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture syncJobDelete(
			Function> fn) {
		return syncJobDelete(fn.apply(new SyncJobDeleteRequest.Builder()).build());
	}

	// ----- Endpoint: connector.sync_job_get

	/**
	 * Retrieves a connector sync job.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture syncJobGet(SyncJobGetRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) SyncJobGetRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Retrieves a connector sync job.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link SyncJobGetRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture syncJobGet(
			Function> fn) {
		return syncJobGet(fn.apply(new SyncJobGetRequest.Builder()).build());
	}

	// ----- Endpoint: connector.sync_job_list

	/**
	 * Lists connector sync jobs.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture syncJobList(SyncJobListRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) SyncJobListRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Lists connector sync jobs.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link SyncJobListRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture syncJobList(
			Function> fn) {
		return syncJobList(fn.apply(new SyncJobListRequest.Builder()).build());
	}

	/**
	 * Lists connector sync jobs.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture syncJobList() {
		return this.transport.performRequestAsync(new SyncJobListRequest.Builder().build(),
				SyncJobListRequest._ENDPOINT, this.transportOptions);
	}

	// ----- Endpoint: connector.sync_job_post

	/**
	 * Creates a connector sync job.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture syncJobPost(SyncJobPostRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) SyncJobPostRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Creates a connector sync job.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link SyncJobPostRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture syncJobPost(
			Function> fn) {
		return syncJobPost(fn.apply(new SyncJobPostRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_active_filtering

	/**
	 * Activates the valid draft filtering for a connector.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updateActiveFiltering(
			UpdateActiveFilteringRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdateActiveFilteringRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Activates the valid draft filtering for a connector.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdateActiveFilteringRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updateActiveFiltering(
			Function> fn) {
		return updateActiveFiltering(fn.apply(new UpdateActiveFilteringRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_api_key_id

	/**
	 * Updates the API key id in the connector document
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updateApiKeyId(UpdateApiKeyIdRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdateApiKeyIdRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the API key id in the connector document
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdateApiKeyIdRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updateApiKeyId(
			Function> fn) {
		return updateApiKeyId(fn.apply(new UpdateApiKeyIdRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_configuration

	/**
	 * Updates the configuration field in the connector document
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updateConfiguration(UpdateConfigurationRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdateConfigurationRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the configuration field in the connector document
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdateConfigurationRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updateConfiguration(
			Function> fn) {
		return updateConfiguration(fn.apply(new UpdateConfigurationRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_error

	/**
	 * Updates the filtering field in the connector document
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updateError(UpdateErrorRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdateErrorRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the filtering field in the connector document
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdateErrorRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updateError(
			Function> fn) {
		return updateError(fn.apply(new UpdateErrorRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_filtering

	/**
	 * Updates the filtering field in the connector document
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updateFiltering(UpdateFilteringRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdateFilteringRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the filtering field in the connector document
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdateFilteringRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updateFiltering(
			Function> fn) {
		return updateFiltering(fn.apply(new UpdateFilteringRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_filtering_validation

	/**
	 * Updates the draft filtering validation info for a connector.
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updateFilteringValidation(
			UpdateFilteringValidationRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdateFilteringValidationRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the draft filtering validation info for a connector.
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdateFilteringValidationRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updateFilteringValidation(
			Function> fn) {
		return updateFilteringValidation(fn.apply(new UpdateFilteringValidationRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_index_name

	/**
	 * Updates the index_name in the connector document
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updateIndexName(UpdateIndexNameRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdateIndexNameRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the index_name in the connector document
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdateIndexNameRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updateIndexName(
			Function> fn) {
		return updateIndexName(fn.apply(new UpdateIndexNameRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_name

	/**
	 * Updates the name and description fields in the connector document
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updateName(UpdateNameRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdateNameRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the name and description fields in the connector document
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdateNameRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updateName(
			Function> fn) {
		return updateName(fn.apply(new UpdateNameRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_native

	/**
	 * Updates the is_native flag in the connector document
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updateNative(UpdateNativeRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdateNativeRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the is_native flag in the connector document
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdateNativeRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updateNative(
			Function> fn) {
		return updateNative(fn.apply(new UpdateNativeRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_pipeline

	/**
	 * Updates the pipeline field in the connector document
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updatePipeline(UpdatePipelineRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdatePipelineRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the pipeline field in the connector document
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdatePipelineRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updatePipeline(
			Function> fn) {
		return updatePipeline(fn.apply(new UpdatePipelineRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_scheduling

	/**
	 * Updates the scheduling field in the connector document
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updateScheduling(UpdateSchedulingRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdateSchedulingRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the scheduling field in the connector document
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdateSchedulingRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updateScheduling(
			Function> fn) {
		return updateScheduling(fn.apply(new UpdateSchedulingRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_service_type

	/**
	 * Updates the service type of the connector
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updateServiceType(UpdateServiceTypeRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdateServiceTypeRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the service type of the connector
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdateServiceTypeRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updateServiceType(
			Function> fn) {
		return updateServiceType(fn.apply(new UpdateServiceTypeRequest.Builder()).build());
	}

	// ----- Endpoint: connector.update_status

	/**
	 * Updates the status of the connector
	 * 
	 * @see Documentation
	 *      on elastic.co
	 */

	public CompletableFuture updateStatus(UpdateStatusRequest request) {
		@SuppressWarnings("unchecked")
		JsonEndpoint endpoint = (JsonEndpoint) UpdateStatusRequest._ENDPOINT;

		return this.transport.performRequestAsync(request, endpoint, this.transportOptions);
	}

	/**
	 * Updates the status of the connector
	 * 
	 * @param fn
	 *            a function that initializes a builder to create the
	 *            {@link UpdateStatusRequest}
	 * @see Documentation
	 *      on elastic.co
	 */

	public final CompletableFuture updateStatus(
			Function> fn) {
		return updateStatus(fn.apply(new UpdateStatusRequest.Builder()).build());
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy