/* 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.
*/
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
// -----------------------------------------------
//
// This file is automatically generated
// Please do not edit these files manually
// Run the following in the root of the repos:
//
// *NIX : ./build.sh codegen
// Windows : build.bat codegen
//
// -----------------------------------------------
// ReSharper disable RedundantUsingDirective
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using OpenSearch.Net;
using OpenSearch.Net.Utf8Json;
// ReSharper disable RedundantBaseConstructorCall
// ReSharper disable UnusedTypeParameter
// ReSharper disable PartialMethodWithSinglePart
// ReSharper disable RedundantNameQualifier
namespace OpenSearch.Client
{
///Descriptor for Bulk https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/bulk/
public partial class BulkDescriptor : RequestDescriptorBase, IBulkRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceBulk;
////_bulk
public BulkDescriptor(): base()
{
}
////{index}/_bulk
///Optional, accepts null
public BulkDescriptor(IndexName index): base(r => r.Optional("index", index))
{
}
// values part of the url path
IndexName IBulkRequest.Index => Self.RouteValues.Get("index");
///Default index for items which don't provide one
public BulkDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v));
///a shortcut into calling Index(typeof(TOther))
public BulkDescriptor Index()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (IndexName)v));
// Request parameters
///The pipeline id to preprocess incoming documents with
public BulkDescriptor Pipeline(string pipeline) => Qs("pipeline", pipeline);
///If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
public BulkDescriptor Refresh(Refresh? refresh) => Qs("refresh", refresh);
///Sets require_alias for all incoming documents. Defaults to unset (false)
public BulkDescriptor RequireAlias(bool? requirealias = true) => Qs("require_alias", requirealias);
///
/// A document is routed to a particular shard in an index using the following formula
/// shard_num = hash(_routing) % num_primary_shards
/// OpenSearch will use the document id if not provided.
/// For requests that are constructed from/for a document OpenSearch.Client will automatically infer the routing key
/// if that document has a or a routing mapping on for its type exists on
///
public BulkDescriptor Routing(Routing routing) => Qs("routing", routing);
///Whether the _source should be included in the response.
public BulkDescriptor SourceEnabled(bool? sourceenabled = true) => Qs("_source", sourceenabled);
///Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
public BulkDescriptor SourceExcludes(Fields sourceexcludes) => Qs("_source_excludes", sourceexcludes);
///Default list of fields to exclude from the returned _source field, can be overridden on each sub-request
public BulkDescriptor SourceExcludes(params Expression>[] fields)
where T : class => Qs("_source_excludes", fields?.Select(e => (Field)e));
///Default list of fields to extract and return from the _source field, can be overridden on each sub-request
public BulkDescriptor SourceIncludes(Fields sourceincludes) => Qs("_source_includes", sourceincludes);
///Default list of fields to extract and return from the _source field, can be overridden on each sub-request
public BulkDescriptor SourceIncludes(params Expression>[] fields)
where T : class => Qs("_source_includes", fields?.Select(e => (Field)e));
///Explicit operation timeout
public BulkDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
///Default document type for items which don't provide one
public BulkDescriptor TypeQueryString(string typequerystring) => Qs("type", typequerystring);
///Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
public BulkDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards);
}
///Descriptor for ClearScroll https://opensearch.org/docs/latest/opensearch/rest-api/scroll/
public partial class ClearScrollDescriptor : RequestDescriptorBase, IClearScrollRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceClearScroll;
// values part of the url path
// Request parameters
}
///Descriptor for Count https://opensearch.org/docs/latest/opensearch/rest-api/count/
public partial class CountDescriptor : RequestDescriptorBase, CountRequestParameters, ICountRequest>, ICountRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceCount;
////{index}/_count
public CountDescriptor(): this(typeof(TDocument))
{
}
////{index}/_count
///Optional, accepts null
public CountDescriptor(Indices index): base(r => r.Optional("index", index))
{
}
// values part of the url path
Indices ICountRequest.Index => Self.RouteValues.Get("index");
///A comma-separated list of indices to restrict the results
public CountDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v));
///a shortcut into calling Index(typeof(TOther))
public CountDescriptor Index()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v));
///A shortcut into calling Index(Indices.All)
public CountDescriptor AllIndices() => Index(Indices.All);
// Request parameters
///Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
public CountDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices);
///Specify whether wildcard and prefix queries should be analyzed (default: false)
public CountDescriptor AnalyzeWildcard(bool? analyzewildcard = true) => Qs("analyze_wildcard", analyzewildcard);
///The analyzer to use for the query string
public CountDescriptor Analyzer(string analyzer) => Qs("analyzer", analyzer);
///The default operator for query string query (AND or OR)
public CountDescriptor DefaultOperator(DefaultOperator? defaultoperator) => Qs("default_operator", defaultoperator);
///The field to use as default where no field prefix is given in the query string
public CountDescriptor Df(string df) => Qs("df", df);
///Whether to expand wildcard expression to concrete indices that are open, closed or both.
public CountDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
///Whether specified concrete, expanded or aliased indices should be ignored when throttled
public CountDescriptor IgnoreThrottled(bool? ignorethrottled = true) => Qs("ignore_throttled", ignorethrottled);
///Whether specified concrete indices should be ignored when unavailable (missing or closed)
public CountDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable);
///Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
public CountDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient);
///Include only documents with a specific `_score` value in the result
public CountDescriptor MinScore(double? minscore) => Qs("min_score", minscore);
///Specify the node or shard the operation should be performed on (default: random)
public CountDescriptor Preference(string preference) => Qs("preference", preference);
///Query in the Lucene query string syntax
public CountDescriptor QueryOnQueryString(string queryonquerystring) => Qs("q", queryonquerystring);
///
/// A document is routed to a particular shard in an index using the following formula
/// shard_num = hash(_routing) % num_primary_shards
/// OpenSearch will use the document id if not provided.
/// For requests that are constructed from/for a document OpenSearch.Client will automatically infer the routing key
/// if that document has a or a routing mapping on for its type exists on
///
public CountDescriptor Routing(Routing routing) => Qs("routing", routing);
///The maximum count for each shard, upon reaching which the query execution will terminate early
public CountDescriptor TerminateAfter(long? terminateafter) => Qs("terminate_after", terminateafter);
}
///Descriptor for Create https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/
public partial class CreateDescriptor : RequestDescriptorBase, CreateRequestParameters, ICreateRequest>, ICreateRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceCreate;
////{index}/_create/{id}
///this parameter is required
///this parameter is required
public CreateDescriptor(IndexName index, Id id): base(r => r.Required("index", index).Required("id", id))
{
}
////{index}/_create/{id}
///this parameter is required
public CreateDescriptor(Id id): this(typeof(TDocument), id)
{
}
////{index}/_create/{id}
///The document used to resolve the path from
public CreateDescriptor(TDocument documentWithId, IndexName index = null, Id id = null): this(index ?? typeof(TDocument), id ?? Client.Id.From(documentWithId)) => DocumentFromPath(documentWithId);
partial void DocumentFromPath(TDocument document);
///Used for serialization purposes, making sure we have a parameterless constructor
[SerializationConstructor]
protected CreateDescriptor(): base()
{
}
// values part of the url path
IndexName ICreateRequest.Index => Self.RouteValues.Get("index");
Id ICreateRequest.Id => Self.RouteValues.Get("id");
///The name of the index
public CreateDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v));
///a shortcut into calling Index(typeof(TOther))
public CreateDescriptor Index()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v));
// Request parameters
///The pipeline id to preprocess incoming documents with
public CreateDescriptor Pipeline(string pipeline) => Qs("pipeline", pipeline);
///If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
public CreateDescriptor Refresh(Refresh? refresh) => Qs("refresh", refresh);
///
/// A document is routed to a particular shard in an index using the following formula
/// shard_num = hash(_routing) % num_primary_shards
/// OpenSearch will use the document id if not provided.
/// For requests that are constructed from/for a document OpenSearch.Client will automatically infer the routing key
/// if that document has a or a routing mapping on for its type exists on
///
public CreateDescriptor Routing(Routing routing) => Qs("routing", routing);
///Explicit operation timeout
public CreateDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
///Explicit version number for concurrency control
public CreateDescriptor Version(long? version) => Qs("version", version);
///Specific version type
public CreateDescriptor VersionType(VersionType? versiontype) => Qs("version_type", versiontype);
///Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
public CreateDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards);
}
///Descriptor for Delete https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-document/
public partial class DeleteDescriptor : RequestDescriptorBase, DeleteRequestParameters, IDeleteRequest>, IDeleteRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceDelete;
////{index}/_doc/{id}
///this parameter is required
///this parameter is required
public DeleteDescriptor(IndexName index, Id id): base(r => r.Required("index", index).Required("id", id))
{
}
////{index}/_doc/{id}
///this parameter is required
public DeleteDescriptor(Id id): this(typeof(TDocument), id)
{
}
////{index}/_doc/{id}
///The document used to resolve the path from
public DeleteDescriptor(TDocument documentWithId, IndexName index = null, Id id = null): this(index ?? typeof(TDocument), id ?? Id.From(documentWithId)) => DocumentFromPath(documentWithId);
partial void DocumentFromPath(TDocument document);
///Used for serialization purposes, making sure we have a parameterless constructor
[SerializationConstructor]
protected DeleteDescriptor(): base()
{
}
// values part of the url path
IndexName IDeleteRequest.Index => Self.RouteValues.Get("index");
Id IDeleteRequest.Id => Self.RouteValues.Get("id");
///The name of the index
public DeleteDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v));
///a shortcut into calling Index(typeof(TOther))
public DeleteDescriptor Index()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v));
// Request parameters
///only perform the delete operation if the last operation that has changed the document has the specified primary term
public DeleteDescriptor IfPrimaryTerm(long? ifprimaryterm) => Qs("if_primary_term", ifprimaryterm);
///only perform the delete operation if the last operation that has changed the document has the specified sequence number
public DeleteDescriptor IfSequenceNumber(long? ifsequencenumber) => Qs("if_seq_no", ifsequencenumber);
///If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes.
public DeleteDescriptor Refresh(Refresh? refresh) => Qs("refresh", refresh);
///
/// A document is routed to a particular shard in an index using the following formula
/// shard_num = hash(_routing) % num_primary_shards
/// OpenSearch will use the document id if not provided.
/// For requests that are constructed from/for a document OpenSearch.Client will automatically infer the routing key
/// if that document has a or a routing mapping on for its type exists on
///
public DeleteDescriptor Routing(Routing routing) => Qs("routing", routing);
///Explicit operation timeout
public DeleteDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
///Explicit version number for concurrency control
public DeleteDescriptor Version(long? version) => Qs("version", version);
///Specific version type
public DeleteDescriptor VersionType(VersionType? versiontype) => Qs("version_type", versiontype);
///Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
public DeleteDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards);
}
///Descriptor for DeleteByQuery https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/
public partial class DeleteByQueryDescriptor : RequestDescriptorBase, DeleteByQueryRequestParameters, IDeleteByQueryRequest>, IDeleteByQueryRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceDeleteByQuery;
////{index}/_delete_by_query
///this parameter is required
public DeleteByQueryDescriptor(Indices index): base(r => r.Required("index", index))
{
}
////{index}/_delete_by_query
public DeleteByQueryDescriptor(): this(typeof(TDocument))
{
}
// values part of the url path
Indices IDeleteByQueryRequest.Index => Self.RouteValues.Get("index");
///A comma-separated list of index names to search; use the special string `_all` or Indices.All to perform the operation on all indices
public DeleteByQueryDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v));
///a shortcut into calling Index(typeof(TOther))
public DeleteByQueryDescriptor Index()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v));
///A shortcut into calling Index(Indices.All)
public DeleteByQueryDescriptor AllIndices() => Index(Indices.All);
// Request parameters
///Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
public DeleteByQueryDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices);
///Specify whether wildcard and prefix queries should be analyzed (default: false)
public DeleteByQueryDescriptor AnalyzeWildcard(bool? analyzewildcard = true) => Qs("analyze_wildcard", analyzewildcard);
///The analyzer to use for the query string
public DeleteByQueryDescriptor Analyzer(string analyzer) => Qs("analyzer", analyzer);
///What to do when the delete by query hits version conflicts?
public DeleteByQueryDescriptor Conflicts(Conflicts? conflicts) => Qs("conflicts", conflicts);
///The default operator for query string query (AND or OR)
public DeleteByQueryDescriptor DefaultOperator(DefaultOperator? defaultoperator) => Qs("default_operator", defaultoperator);
///The field to use as default where no field prefix is given in the query string
public DeleteByQueryDescriptor Df(string df) => Qs("df", df);
///Whether to expand wildcard expression to concrete indices that are open, closed or both.
public DeleteByQueryDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
///Starting offset (default: 0)
public DeleteByQueryDescriptor From(long? from) => Qs("from", from);
///Whether specified concrete indices should be ignored when unavailable (missing or closed)
public DeleteByQueryDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable);
///Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
public DeleteByQueryDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient);
///Specify the node or shard the operation should be performed on (default: random)
public DeleteByQueryDescriptor Preference(string preference) => Qs("preference", preference);
///Query in the Lucene query string syntax
public DeleteByQueryDescriptor QueryOnQueryString(string queryonquerystring) => Qs("q", queryonquerystring);
///Should the effected indexes be refreshed?
public DeleteByQueryDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh);
///Specify if request cache should be used for this request or not, defaults to index level setting
public DeleteByQueryDescriptor RequestCache(bool? requestcache = true) => Qs("request_cache", requestcache);
///The throttle for this request in sub-requests per second. -1 means no throttle.
public DeleteByQueryDescriptor RequestsPerSecond(long? requestspersecond) => Qs("requests_per_second", requestspersecond);
///
/// A document is routed to a particular shard in an index using the following formula
/// shard_num = hash(_routing) % num_primary_shards
/// OpenSearch will use the document id if not provided.
/// For requests that are constructed from/for a document OpenSearch.Client will automatically infer the routing key
/// if that document has a or a routing mapping on for its type exists on
///
public DeleteByQueryDescriptor Routing(Routing routing) => Qs("routing", routing);
///Specify how long a consistent view of the index should be maintained for scrolled search
public DeleteByQueryDescriptor Scroll(Time scroll) => Qs("scroll", scroll);
///Size on the scroll request powering the delete by query
public DeleteByQueryDescriptor ScrollSize(long? scrollsize) => Qs("scroll_size", scrollsize);
///Explicit timeout for each search request. Defaults to no timeout.
public DeleteByQueryDescriptor SearchTimeout(Time searchtimeout) => Qs("search_timeout", searchtimeout);
///Search operation type
public DeleteByQueryDescriptor SearchType(SearchType? searchtype) => Qs("search_type", searchtype);
///The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks.
public DeleteByQueryDescriptor Slices(long? slices) => Qs("slices", slices);
///A comma-separated list of <field>:<direction> pairs
public DeleteByQueryDescriptor Sort(params string[] sort) => Qs("sort", sort);
///Whether the _source should be included in the response.
public DeleteByQueryDescriptor SourceEnabled(bool? sourceenabled = true) => Qs("_source", sourceenabled);
///A list of fields to exclude from the returned _source field
public DeleteByQueryDescriptor SourceExcludes(Fields sourceexcludes) => Qs("_source_excludes", sourceexcludes);
///A list of fields to exclude from the returned _source field
public DeleteByQueryDescriptor SourceExcludes(params Expression>[] fields) => Qs("_source_excludes", fields?.Select(e => (Field)e));
///A list of fields to extract and return from the _source field
public DeleteByQueryDescriptor SourceIncludes(Fields sourceincludes) => Qs("_source_includes", sourceincludes);
///A list of fields to extract and return from the _source field
public DeleteByQueryDescriptor SourceIncludes(params Expression>[] fields) => Qs("_source_includes", fields?.Select(e => (Field)e));
///Specific 'tag' of the request for logging and statistical purposes
public DeleteByQueryDescriptor Stats(params string[] stats) => Qs("stats", stats);
///The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
public DeleteByQueryDescriptor TerminateAfter(long? terminateafter) => Qs("terminate_after", terminateafter);
///Time each individual bulk request should wait for shards that are unavailable.
public DeleteByQueryDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
///Specify whether to return document version as part of a hit
public DeleteByQueryDescriptor Version(bool? version = true) => Qs("version", version);
///Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
public DeleteByQueryDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards);
///Should the request should block until the delete by query is complete.
public DeleteByQueryDescriptor WaitForCompletion(bool? waitforcompletion = true) => Qs("wait_for_completion", waitforcompletion);
}
///Descriptor for DeleteByQueryRethrottle https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/
public partial class DeleteByQueryRethrottleDescriptor : RequestDescriptorBase, IDeleteByQueryRethrottleRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceDeleteByQueryRethrottle;
////_delete_by_query/{task_id}/_rethrottle
///this parameter is required
public DeleteByQueryRethrottleDescriptor(TaskId taskId): base(r => r.Required("task_id", taskId))
{
}
///Used for serialization purposes, making sure we have a parameterless constructor
[SerializationConstructor]
protected DeleteByQueryRethrottleDescriptor(): base()
{
}
// values part of the url path
TaskId IDeleteByQueryRethrottleRequest.TaskId => Self.RouteValues.Get("task_id");
// Request parameters
///The throttle to set on this request in floating sub-requests per second. -1 means set no throttle.
public DeleteByQueryRethrottleDescriptor RequestsPerSecond(long? requestspersecond) => Qs("requests_per_second", requestspersecond);
}
///Descriptor for DeleteScript
public partial class DeleteScriptDescriptor : RequestDescriptorBase, IDeleteScriptRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceDeleteScript;
////_scripts/{id}
///this parameter is required
public DeleteScriptDescriptor(Id id): base(r => r.Required("id", id))
{
}
///Used for serialization purposes, making sure we have a parameterless constructor
[SerializationConstructor]
protected DeleteScriptDescriptor(): base()
{
}
// values part of the url path
Id IDeleteScriptRequest.Id => Self.RouteValues.Get("id");
// Request parameters
///Specify timeout for connection to master node
///Deprecated as of OpenSearch 2.0, use instead
public DeleteScriptDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
///Specify timeout for connection to cluster_manager node
///Introduced in OpenSearch 2.0 instead of
public DeleteScriptDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout);
///Explicit operation timeout
public DeleteScriptDescriptor Timeout(Time timeout) => Qs("timeout", timeout);
}
///Descriptor for DocumentExists https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/
public partial class DocumentExistsDescriptor : RequestDescriptorBase, DocumentExistsRequestParameters, IDocumentExistsRequest>, IDocumentExistsRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceDocumentExists;
////{index}/_doc/{id}
///this parameter is required
///this parameter is required
public DocumentExistsDescriptor(IndexName index, Id id): base(r => r.Required("index", index).Required("id", id))
{
}
////{index}/_doc/{id}
///this parameter is required
public DocumentExistsDescriptor(Id id): this(typeof(TDocument), id)
{
}
////{index}/_doc/{id}
///The document used to resolve the path from
public DocumentExistsDescriptor(TDocument documentWithId, IndexName index = null, Id id = null): this(index ?? typeof(TDocument), id ?? Id.From(documentWithId)) => DocumentFromPath(documentWithId);
partial void DocumentFromPath(TDocument document);
///Used for serialization purposes, making sure we have a parameterless constructor
[SerializationConstructor]
protected DocumentExistsDescriptor(): base()
{
}
// values part of the url path
IndexName IDocumentExistsRequest.Index => Self.RouteValues.Get("index");
Id IDocumentExistsRequest.Id => Self.RouteValues.Get("id");
///The name of the index
public DocumentExistsDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v));
///a shortcut into calling Index(typeof(TOther))
public DocumentExistsDescriptor Index()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v));
// Request parameters
///Specify the node or shard the operation should be performed on (default: random)
public DocumentExistsDescriptor Preference(string preference) => Qs("preference", preference);
///Specify whether to perform the operation in realtime or search mode
public DocumentExistsDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime);
///Refresh the shard containing the document before performing the operation
public DocumentExistsDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh);
///
/// A document is routed to a particular shard in an index using the following formula
/// shard_num = hash(_routing) % num_primary_shards
/// OpenSearch will use the document id if not provided.
/// For requests that are constructed from/for a document OpenSearch.Client will automatically infer the routing key
/// if that document has a or a routing mapping on for its type exists on
///
public DocumentExistsDescriptor Routing(Routing routing) => Qs("routing", routing);
///Whether the _source should be included in the response.
public DocumentExistsDescriptor SourceEnabled(bool? sourceenabled = true) => Qs("_source", sourceenabled);
///A list of fields to exclude from the returned _source field
public DocumentExistsDescriptor SourceExcludes(Fields sourceexcludes) => Qs("_source_excludes", sourceexcludes);
///A list of fields to exclude from the returned _source field
public DocumentExistsDescriptor SourceExcludes(params Expression>[] fields) => Qs("_source_excludes", fields?.Select(e => (Field)e));
///A list of fields to extract and return from the _source field
public DocumentExistsDescriptor SourceIncludes(Fields sourceincludes) => Qs("_source_includes", sourceincludes);
///A list of fields to extract and return from the _source field
public DocumentExistsDescriptor SourceIncludes(params Expression>[] fields) => Qs("_source_includes", fields?.Select(e => (Field)e));
///A comma-separated list of stored fields to return in the response
public DocumentExistsDescriptor StoredFields(Fields storedfields) => Qs("stored_fields", storedfields);
///A comma-separated list of stored fields to return in the response
public DocumentExistsDescriptor StoredFields(params Expression>[] fields) => Qs("stored_fields", fields?.Select(e => (Field)e));
///Explicit version number for concurrency control
public DocumentExistsDescriptor Version(long? version) => Qs("version", version);
///Specific version type
public DocumentExistsDescriptor VersionType(VersionType? versiontype) => Qs("version_type", versiontype);
}
///Descriptor for SourceExists https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/
public partial class SourceExistsDescriptor : RequestDescriptorBase, SourceExistsRequestParameters, ISourceExistsRequest>, ISourceExistsRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceSourceExists;
////{index}/_source/{id}
///this parameter is required
///this parameter is required
public SourceExistsDescriptor(IndexName index, Id id): base(r => r.Required("index", index).Required("id", id))
{
}
////{index}/_source/{id}
///this parameter is required
public SourceExistsDescriptor(Id id): this(typeof(TDocument), id)
{
}
////{index}/_source/{id}
///The document used to resolve the path from
public SourceExistsDescriptor(TDocument documentWithId, IndexName index = null, Id id = null): this(index ?? typeof(TDocument), id ?? Id.From(documentWithId)) => DocumentFromPath(documentWithId);
partial void DocumentFromPath(TDocument document);
///Used for serialization purposes, making sure we have a parameterless constructor
[SerializationConstructor]
protected SourceExistsDescriptor(): base()
{
}
// values part of the url path
IndexName ISourceExistsRequest.Index => Self.RouteValues.Get("index");
Id ISourceExistsRequest.Id => Self.RouteValues.Get("id");
///The name of the index
public SourceExistsDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v));
///a shortcut into calling Index(typeof(TOther))
public SourceExistsDescriptor Index()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v));
// Request parameters
///Specify the node or shard the operation should be performed on (default: random)
public SourceExistsDescriptor Preference(string preference) => Qs("preference", preference);
///Specify whether to perform the operation in realtime or search mode
public SourceExistsDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime);
///Refresh the shard containing the document before performing the operation
public SourceExistsDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh);
///
/// A document is routed to a particular shard in an index using the following formula
/// shard_num = hash(_routing) % num_primary_shards
/// OpenSearch will use the document id if not provided.
/// For requests that are constructed from/for a document OSC will automatically infer the routing key
/// if that document has a or a routing mapping on for its type exists on
///
public SourceExistsDescriptor Routing(Routing routing) => Qs("routing", routing);
///Whether the _source should be included in the response.
public SourceExistsDescriptor SourceEnabled(bool? sourceenabled = true) => Qs("_source", sourceenabled);
///A list of fields to exclude from the returned _source field
public SourceExistsDescriptor SourceExcludes(Fields sourceexcludes) => Qs("_source_excludes", sourceexcludes);
///A list of fields to exclude from the returned _source field
public SourceExistsDescriptor SourceExcludes(params Expression>[] fields) => Qs("_source_excludes", fields?.Select(e => (Field)e));
///A list of fields to extract and return from the _source field
public SourceExistsDescriptor SourceIncludes(Fields sourceincludes) => Qs("_source_includes", sourceincludes);
///A list of fields to extract and return from the _source field
public SourceExistsDescriptor SourceIncludes(params Expression>[] fields) => Qs("_source_includes", fields?.Select(e => (Field)e));
///Explicit version number for concurrency control
public SourceExistsDescriptor Version(long? version) => Qs("version", version);
///Specific version type
public SourceExistsDescriptor VersionType(VersionType? versiontype) => Qs("version_type", versiontype);
}
///Descriptor for Explain https://opensearch.org/docs/latest/opensearch/rest-api/explain/
public partial class ExplainDescriptor : RequestDescriptorBase, ExplainRequestParameters, IExplainRequest>, IExplainRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceExplain;
////{index}/_explain/{id}
///this parameter is required
///this parameter is required
public ExplainDescriptor(IndexName index, Id id): base(r => r.Required("index", index).Required("id", id))
{
}
////{index}/_explain/{id}
///this parameter is required
public ExplainDescriptor(Id id): this(typeof(TDocument), id)
{
}
////{index}/_explain/{id}
///The document used to resolve the path from
public ExplainDescriptor(TDocument documentWithId, IndexName index = null, Id id = null): this(index ?? typeof(TDocument), id ?? Id.From(documentWithId)) => DocumentFromPath(documentWithId);
partial void DocumentFromPath(TDocument document);
///Used for serialization purposes, making sure we have a parameterless constructor
[SerializationConstructor]
protected ExplainDescriptor(): base()
{
}
// values part of the url path
IndexName IExplainRequest.Index => Self.RouteValues.Get("index");
Id IExplainRequest.Id => Self.RouteValues.Get("id");
///The name of the index
public ExplainDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v));
///a shortcut into calling Index(typeof(TOther))
public ExplainDescriptor Index()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v));
// Request parameters
///Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false)
public ExplainDescriptor AnalyzeWildcard(bool? analyzewildcard = true) => Qs("analyze_wildcard", analyzewildcard);
///The analyzer for the query string query
public ExplainDescriptor Analyzer(string analyzer) => Qs("analyzer", analyzer);
///The default operator for query string query (AND or OR)
public ExplainDescriptor DefaultOperator(DefaultOperator? defaultoperator) => Qs("default_operator", defaultoperator);
///The default field for query string query (default: _all)
public ExplainDescriptor Df(string df) => Qs("df", df);
///Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
public ExplainDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient);
///Specify the node or shard the operation should be performed on (default: random)
public ExplainDescriptor Preference(string preference) => Qs("preference", preference);
///Query in the Lucene query string syntax
public ExplainDescriptor QueryOnQueryString(string queryonquerystring) => Qs("q", queryonquerystring);
///
/// A document is routed to a particular shard in an index using the following formula
/// shard_num = hash(_routing) % num_primary_shards
/// OpenSearch will use the document id if not provided.
/// For requests that are constructed from/for a document OSC will automatically infer the routing key
/// if that document has a or a routing mapping on for its type exists on
///
public ExplainDescriptor Routing(Routing routing) => Qs("routing", routing);
///Whether the _source should be included in the response.
public ExplainDescriptor SourceEnabled(bool? sourceenabled = true) => Qs("_source", sourceenabled);
///A list of fields to exclude from the returned _source field
public ExplainDescriptor SourceExcludes(Fields sourceexcludes) => Qs("_source_excludes", sourceexcludes);
///A list of fields to exclude from the returned _source field
public ExplainDescriptor SourceExcludes(params Expression>[] fields) => Qs("_source_excludes", fields?.Select(e => (Field)e));
///A list of fields to extract and return from the _source field
public ExplainDescriptor SourceIncludes(Fields sourceincludes) => Qs("_source_includes", sourceincludes);
///A list of fields to extract and return from the _source field
public ExplainDescriptor SourceIncludes(params Expression>[] fields) => Qs("_source_includes", fields?.Select(e => (Field)e));
}
///Descriptor for FieldCapabilities
public partial class FieldCapabilitiesDescriptor : RequestDescriptorBase, IFieldCapabilitiesRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceFieldCapabilities;
////_field_caps
public FieldCapabilitiesDescriptor(): base()
{
}
////{index}/_field_caps
///Optional, accepts null
public FieldCapabilitiesDescriptor(Indices index): base(r => r.Optional("index", index))
{
}
// values part of the url path
Indices IFieldCapabilitiesRequest.Index => Self.RouteValues.Get("index");
///A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices
public FieldCapabilitiesDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v));
///a shortcut into calling Index(typeof(TOther))
public FieldCapabilitiesDescriptor Index()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v));
///A shortcut into calling Index(Indices.All)
public FieldCapabilitiesDescriptor AllIndices() => Index(Indices.All);
// Request parameters
///Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
public FieldCapabilitiesDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices);
///Whether to expand wildcard expression to concrete indices that are open, closed or both.
public FieldCapabilitiesDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
///A comma-separated list of field names
public FieldCapabilitiesDescriptor Fields(Fields fields) => Qs("fields", fields);
///A comma-separated list of field names
public FieldCapabilitiesDescriptor Fields(params Expression>[] fields)
where T : class => Qs("fields", fields?.Select(e => (Field)e));
///Whether specified concrete indices should be ignored when unavailable (missing or closed)
public FieldCapabilitiesDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable);
///Indicates whether unmapped fields should be included in the response.
public FieldCapabilitiesDescriptor IncludeUnmapped(bool? includeunmapped = true) => Qs("include_unmapped", includeunmapped);
}
///Descriptor for Get https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/
public partial class GetDescriptor : RequestDescriptorBase, GetRequestParameters, IGetRequest>, IGetRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceGet;
////{index}/_doc/{id}
///this parameter is required
///this parameter is required
public GetDescriptor(IndexName index, Id id): base(r => r.Required("index", index).Required("id", id))
{
}
////{index}/_doc/{id}
///this parameter is required
public GetDescriptor(Id id): this(typeof(TDocument), id)
{
}
////{index}/_doc/{id}
///The document used to resolve the path from
public GetDescriptor(TDocument documentWithId, IndexName index = null, Id id = null): this(index ?? typeof(TDocument), id ?? Id.From(documentWithId)) => DocumentFromPath(documentWithId);
partial void DocumentFromPath(TDocument document);
///Used for serialization purposes, making sure we have a parameterless constructor
[SerializationConstructor]
protected GetDescriptor(): base()
{
}
// values part of the url path
IndexName IGetRequest.Index => Self.RouteValues.Get("index");
Id IGetRequest.Id => Self.RouteValues.Get("id");
///The name of the index
public GetDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v));
///a shortcut into calling Index(typeof(TOther))
public GetDescriptor Index()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v));
// Request parameters
///Specify the node or shard the operation should be performed on (default: random)
public GetDescriptor Preference(string preference) => Qs("preference", preference);
///Specify whether to perform the operation in realtime or search mode
public GetDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime);
///Refresh the shard containing the document before performing the operation
public GetDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh);
///
/// A document is routed to a particular shard in an index using the following formula
/// shard_num = hash(_routing) % num_primary_shards
/// OpenSearch will use the document id if not provided.
/// For requests that are constructed from/for a document OSC will automatically infer the routing key
/// if that document has a or a routing mapping on for its type exists on
///
public GetDescriptor Routing(Routing routing) => Qs("routing", routing);
///Whether the _source should be included in the response.
public GetDescriptor SourceEnabled(bool? sourceenabled = true) => Qs("_source", sourceenabled);
///A list of fields to exclude from the returned _source field
public GetDescriptor SourceExcludes(Fields sourceexcludes) => Qs("_source_excludes", sourceexcludes);
///A list of fields to exclude from the returned _source field
public GetDescriptor SourceExcludes(params Expression>[] fields) => Qs("_source_excludes", fields?.Select(e => (Field)e));
///A list of fields to extract and return from the _source field
public GetDescriptor SourceIncludes(Fields sourceincludes) => Qs("_source_includes", sourceincludes);
///A list of fields to extract and return from the _source field
public GetDescriptor SourceIncludes(params Expression>[] fields) => Qs("_source_includes", fields?.Select(e => (Field)e));
///A comma-separated list of stored fields to return in the response
public GetDescriptor StoredFields(Fields storedfields) => Qs("stored_fields", storedfields);
///A comma-separated list of stored fields to return in the response
public GetDescriptor StoredFields(params Expression>[] fields) => Qs("stored_fields", fields?.Select(e => (Field)e));
///Explicit version number for concurrency control
public GetDescriptor Version(long? version) => Qs("version", version);
///Specific version type
public GetDescriptor VersionType(VersionType? versiontype) => Qs("version_type", versiontype);
}
///Descriptor for GetScript
public partial class GetScriptDescriptor : RequestDescriptorBase, IGetScriptRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceGetScript;
////_scripts/{id}
///this parameter is required
public GetScriptDescriptor(Id id): base(r => r.Required("id", id))
{
}
///Used for serialization purposes, making sure we have a parameterless constructor
[SerializationConstructor]
protected GetScriptDescriptor(): base()
{
}
// values part of the url path
Id IGetScriptRequest.Id => Self.RouteValues.Get("id");
// Request parameters
///Specify timeout for connection to master node
///Deprecated as of OpenSearch 2.0, use instead
public GetScriptDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout);
///Specify timeout for connection to cluster_manager node
///Introduced in OpenSearch 2.0 instead of
public GetScriptDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout);
}
///Descriptor for Source https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/
public partial class SourceDescriptor : RequestDescriptorBase, SourceRequestParameters, ISourceRequest>, ISourceRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceSource;
////{index}/_source/{id}
///this parameter is required
///this parameter is required
public SourceDescriptor(IndexName index, Id id): base(r => r.Required("index", index).Required("id", id))
{
}
////{index}/_source/{id}
///this parameter is required
public SourceDescriptor(Id id): this(typeof(TDocument), id)
{
}
////{index}/_source/{id}
///The document used to resolve the path from
public SourceDescriptor(TDocument documentWithId, IndexName index = null, Id id = null): this(index ?? typeof(TDocument), id ?? Id.From(documentWithId)) => DocumentFromPath(documentWithId);
partial void DocumentFromPath(TDocument document);
///Used for serialization purposes, making sure we have a parameterless constructor
[SerializationConstructor]
protected SourceDescriptor(): base()
{
}
// values part of the url path
IndexName ISourceRequest.Index => Self.RouteValues.Get("index");
Id ISourceRequest.Id => Self.RouteValues.Get("id");
///The name of the index
public SourceDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v));
///a shortcut into calling Index(typeof(TOther))
public SourceDescriptor Index()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v));
// Request parameters
///Specify the node or shard the operation should be performed on (default: random)
public SourceDescriptor Preference(string preference) => Qs("preference", preference);
///Specify whether to perform the operation in realtime or search mode
public SourceDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime);
///Refresh the shard containing the document before performing the operation
public SourceDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh);
///
/// A document is routed to a particular shard in an index using the following formula
/// shard_num = hash(_routing) % num_primary_shards
/// OpenSearch will use the document id if not provided.
/// For requests that are constructed from/for a document OSC will automatically infer the routing key
/// if that document has a or a routing mapping on for its type exists on
///
public SourceDescriptor Routing(Routing routing) => Qs("routing", routing);
///Whether the _source should be included in the response.
public SourceDescriptor SourceEnabled(bool? sourceenabled = true) => Qs("_source", sourceenabled);
///A list of fields to exclude from the returned _source field
public SourceDescriptor SourceExcludes(Fields sourceexcludes) => Qs("_source_excludes", sourceexcludes);
///A list of fields to exclude from the returned _source field
public SourceDescriptor SourceExcludes(params Expression>[] fields) => Qs("_source_excludes", fields?.Select(e => (Field)e));
///A list of fields to extract and return from the _source field
public SourceDescriptor SourceIncludes(Fields sourceincludes) => Qs("_source_includes", sourceincludes);
///A list of fields to extract and return from the _source field
public SourceDescriptor SourceIncludes(params Expression>[] fields) => Qs("_source_includes", fields?.Select(e => (Field)e));
///Explicit version number for concurrency control
public SourceDescriptor Version(long? version) => Qs("version", version);
///Specific version type
public SourceDescriptor VersionType(VersionType? versiontype) => Qs("version_type", versiontype);
}
///Descriptor for Index https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/
public partial class IndexDescriptor : RequestDescriptorBase, IndexRequestParameters, IIndexRequest>, IIndexRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceIndex;
////{index}/_doc/{id}
///this parameter is required
///Optional, accepts null
public IndexDescriptor(IndexName index, Id id): base(r => r.Required("index", index).Optional("id", id))
{
}
////{index}/_doc
///this parameter is required
public IndexDescriptor(IndexName index): base(r => r.Required("index", index))
{
}
////{index}/_doc/{id}
///Optional, accepts null
public IndexDescriptor(Id id): this(typeof(TDocument), id)
{
}
////{index}/_doc
public IndexDescriptor(): this(typeof(TDocument))
{
}
////{index}/_doc/{id}
///The document used to resolve the path from
public IndexDescriptor(TDocument documentWithId, IndexName index = null, Id id = null): this(index ?? typeof(TDocument), id ?? Client.Id.From(documentWithId)) => DocumentFromPath(documentWithId);
partial void DocumentFromPath(TDocument document);
// values part of the url path
IndexName IIndexRequest.Index => Self.RouteValues.Get("index");
Id IIndexRequest.Id => Self.RouteValues.Get("id");
///The name of the index
public IndexDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v));
///a shortcut into calling Index(typeof(TOther))
public IndexDescriptor Index()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v));
///Document ID
public IndexDescriptor Id(Id id) => Assign(id, (a, v) => a.RouteValues.Optional("id", v));
// Request parameters
///only perform the index operation if the last operation that has changed the document has the specified primary term
public IndexDescriptor IfPrimaryTerm(long? ifprimaryterm) => Qs("if_primary_term", ifprimaryterm);
///only perform the index operation if the last operation that has changed the document has the specified sequence number
public IndexDescriptor IfSequenceNumber(long? ifsequencenumber) => Qs("if_seq_no", ifsequencenumber);
///Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID
public IndexDescriptor OpType(OpType? optype) => Qs("op_type", optype);
///