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

org.opensearch.action.search.GetSearchPipelineRequest Maven / Gradle / Ivy

There is a newer version: 2.18.0
Show newest version
/*
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 */

package org.opensearch.action.search;

import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.action.support.clustermanager.ClusterManagerNodeReadRequest;
import org.opensearch.common.annotation.PublicApi;
import org.opensearch.core.common.Strings;
import org.opensearch.core.common.io.stream.StreamInput;
import org.opensearch.core.common.io.stream.StreamOutput;

import java.io.IOException;
import java.util.Objects;

/**
 * Request to get search pipelines
 *
 * @opensearch.api
 */
@PublicApi(since = "2.7.0")
public class GetSearchPipelineRequest extends ClusterManagerNodeReadRequest {
    private final String[] ids;

    public GetSearchPipelineRequest(String... ids) {
        this.ids = Objects.requireNonNull(ids);
    }

    public GetSearchPipelineRequest() {
        ids = Strings.EMPTY_ARRAY;
    }

    public GetSearchPipelineRequest(StreamInput in) throws IOException {
        super(in);
        ids = in.readStringArray();
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        super.writeTo(out);
        out.writeStringArray(ids);
    }

    public String[] getIds() {
        return ids;
    }

    @Override
    public ActionRequestValidationException validate() {
        return null;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy