/* 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.
*/
/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*
* 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.
*/
using System.Threading;
using System.Threading.Tasks;
using static OpenSearch.Net.HttpMethod;
namespace OpenSearch.Net
{
// Introduced for BWC for body introduced in https://github.com/elastic/elasticsearch/pull/57276
public partial class OpenSearchLowLevelClient
{
///POST on /_field_caps
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse FieldCapabilities(FieldCapabilitiesRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(POST, "_field_caps", null, RequestParams(requestParameters));
///POST on /_field_caps
///Request specific configuration such as querystring parameters & request specific connection settings.
public Task FieldCapabilitiesAsync(FieldCapabilitiesRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(POST, "_field_caps", ctx, null, RequestParams(requestParameters));
///POST on /{index}/_field_caps
///A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse FieldCapabilities(string index, FieldCapabilitiesRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(POST, Url($"{index:index}/_field_caps"), null, RequestParams(requestParameters));
///POST on /{index}/_field_caps
///A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices
///Request specific configuration such as querystring parameters & request specific connection settings.
public Task FieldCapabilitiesAsync(string index, FieldCapabilitiesRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(POST, Url($"{index:index}/_field_caps"), ctx, null, RequestParams(requestParameters));
}
}