/* 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); ///The pipeline id to preprocess incoming documents with public IndexDescriptor 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 IndexDescriptor Refresh(Refresh? refresh) => Qs("refresh", refresh); ///When true, requires destination to be an alias. Default is false public IndexDescriptor 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 OSC will automatically infer the routing key /// if that document has a or a routing mapping on for its type exists on /// public IndexDescriptor Routing(Routing routing) => Qs("routing", routing); ///Explicit operation timeout public IndexDescriptor Timeout(Time timeout) => Qs("timeout", timeout); ///Explicit version number for concurrency control public IndexDescriptor Version(long? version) => Qs("version", version); ///Specific version type public IndexDescriptor 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 IndexDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards); } ///Descriptor for RootNodeInfo https://opensearch.org/docs/latest/opensearch/index/ public partial class RootNodeInfoDescriptor : RequestDescriptorBase, IRootNodeInfoRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceRootNodeInfo; // values part of the url path // Request parameters } ///Descriptor for MultiGet https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/ public partial class MultiGetDescriptor : RequestDescriptorBase, IMultiGetRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceMultiGet; ////_mget public MultiGetDescriptor(): base() { } ////{index}/_mget ///Optional, accepts null public MultiGetDescriptor(IndexName index): base(r => r.Optional("index", index)) { } // values part of the url path IndexName IMultiGetRequest.Index => Self.RouteValues.Get("index"); ///The name of the index public MultiGetDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); ///a shortcut into calling Index(typeof(TOther)) public MultiGetDescriptor Index() where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (IndexName)v)); // Request parameters ///Specify the node or shard the operation should be performed on (default: random) public MultiGetDescriptor Preference(string preference) => Qs("preference", preference); ///Specify whether to perform the operation in realtime or search mode public MultiGetDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); ///Refresh the shard containing the document before performing the operation public MultiGetDescriptor 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 MultiGetDescriptor Routing(Routing routing) => Qs("routing", routing); ///Whether the _source should be included in the response. public MultiGetDescriptor SourceEnabled(bool? sourceenabled = true) => Qs("_source", sourceenabled); ///A list of fields to exclude from the returned _source field public MultiGetDescriptor SourceExcludes(Fields sourceexcludes) => Qs("_source_excludes", sourceexcludes); ///A list of fields to exclude from the returned _source field public MultiGetDescriptor SourceExcludes(params Expression>[] fields) where T : class => Qs("_source_excludes", fields?.Select(e => (Field)e)); ///A list of fields to extract and return from the _source field public MultiGetDescriptor SourceIncludes(Fields sourceincludes) => Qs("_source_includes", sourceincludes); ///A list of fields to extract and return from the _source field public MultiGetDescriptor SourceIncludes(params Expression>[] fields) where T : class => Qs("_source_includes", fields?.Select(e => (Field)e)); } ///Descriptor for MultiSearch https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ public partial class MultiSearchDescriptor : RequestDescriptorBase, IMultiSearchRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceMultiSearch; ////_msearch public MultiSearchDescriptor(): base() { } ////{index}/_msearch ///Optional, accepts null public MultiSearchDescriptor(Indices index): base(r => r.Optional("index", index)) { } // values part of the url path Indices IMultiSearchRequest.Index => Self.RouteValues.Get("index"); ///A comma-separated list of index names to use as default public MultiSearchDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); ///a shortcut into calling Index(typeof(TOther)) public MultiSearchDescriptor Index() where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); ///A shortcut into calling Index(Indices.All) public MultiSearchDescriptor AllIndices() => Index(Indices.All); // Request parameters ///Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution public MultiSearchDescriptor CcsMinimizeRoundtrips(bool? ccsminimizeroundtrips = true) => Qs("ccs_minimize_roundtrips", ccsminimizeroundtrips); ///Controls the maximum number of concurrent searches the multi search api will execute public MultiSearchDescriptor MaxConcurrentSearches(long? maxconcurrentsearches) => Qs("max_concurrent_searches", maxconcurrentsearches); ///The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests public MultiSearchDescriptor MaxConcurrentShardRequests(long? maxconcurrentshardrequests) => Qs("max_concurrent_shard_requests", maxconcurrentshardrequests); ///A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. public MultiSearchDescriptor PreFilterShardSize(long? prefiltershardsize) => Qs("pre_filter_shard_size", prefiltershardsize); ///Search operation type public MultiSearchDescriptor SearchType(SearchType? searchtype) => Qs("search_type", searchtype); ///Indicates whether hits.total should be rendered as an integer or an object in the rest search response public MultiSearchDescriptor TotalHitsAsInteger(bool? totalhitsasinteger = true) => Qs("rest_total_hits_as_int", totalhitsasinteger); ///Specify whether aggregation and suggester names should be prefixed by their respective types in the response public MultiSearchDescriptor TypedKeys(bool? typedkeys = true) => Qs("typed_keys", typedkeys); } ///Descriptor for MultiSearchTemplate https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ public partial class MultiSearchTemplateDescriptor : RequestDescriptorBase, IMultiSearchTemplateRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceMultiSearchTemplate; ////_msearch/template public MultiSearchTemplateDescriptor(): base() { } ////{index}/_msearch/template ///Optional, accepts null public MultiSearchTemplateDescriptor(Indices index): base(r => r.Optional("index", index)) { } // values part of the url path Indices IMultiSearchTemplateRequest.Index => Self.RouteValues.Get("index"); ///A comma-separated list of index names to use as default public MultiSearchTemplateDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); ///a shortcut into calling Index(typeof(TOther)) public MultiSearchTemplateDescriptor Index() where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); ///A shortcut into calling Index(Indices.All) public MultiSearchTemplateDescriptor AllIndices() => Index(Indices.All); // Request parameters ///Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution public MultiSearchTemplateDescriptor CcsMinimizeRoundtrips(bool? ccsminimizeroundtrips = true) => Qs("ccs_minimize_roundtrips", ccsminimizeroundtrips); ///Controls the maximum number of concurrent searches the multi search api will execute public MultiSearchTemplateDescriptor MaxConcurrentSearches(long? maxconcurrentsearches) => Qs("max_concurrent_searches", maxconcurrentsearches); ///Search operation type public MultiSearchTemplateDescriptor SearchType(SearchType? searchtype) => Qs("search_type", searchtype); ///Indicates whether hits.total should be rendered as an integer or an object in the rest search response public MultiSearchTemplateDescriptor TotalHitsAsInteger(bool? totalhitsasinteger = true) => Qs("rest_total_hits_as_int", totalhitsasinteger); ///Specify whether aggregation and suggester names should be prefixed by their respective types in the response public MultiSearchTemplateDescriptor TypedKeys(bool? typedkeys = true) => Qs("typed_keys", typedkeys); } ///Descriptor for MultiTermVectors public partial class MultiTermVectorsDescriptor : RequestDescriptorBase, IMultiTermVectorsRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceMultiTermVectors; ////_mtermvectors public MultiTermVectorsDescriptor(): base() { } ////{index}/_mtermvectors ///Optional, accepts null public MultiTermVectorsDescriptor(IndexName index): base(r => r.Optional("index", index)) { } // values part of the url path IndexName IMultiTermVectorsRequest.Index => Self.RouteValues.Get("index"); ///The index in which the document resides. public MultiTermVectorsDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); ///a shortcut into calling Index(typeof(TOther)) public MultiTermVectorsDescriptor Index() where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (IndexName)v)); // Request parameters ///Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". public MultiTermVectorsDescriptor FieldStatistics(bool? fieldstatistics = true) => Qs("field_statistics", fieldstatistics); ///A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". public MultiTermVectorsDescriptor Fields(Fields fields) => Qs("fields", fields); ///A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". public MultiTermVectorsDescriptor Fields(params Expression>[] fields) where T : class => Qs("fields", fields?.Select(e => (Field)e)); ///Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". public MultiTermVectorsDescriptor Offsets(bool? offsets = true) => Qs("offsets", offsets); ///Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". public MultiTermVectorsDescriptor Payloads(bool? payloads = true) => Qs("payloads", payloads); ///Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". public MultiTermVectorsDescriptor Positions(bool? positions = true) => Qs("positions", positions); ///Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". public MultiTermVectorsDescriptor Preference(string preference) => Qs("preference", preference); ///Specifies if requests are real-time as opposed to near-real-time (default: true). public MultiTermVectorsDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); /// /// 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 MultiTermVectorsDescriptor Routing(Routing routing) => Qs("routing", routing); ///Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". public MultiTermVectorsDescriptor TermStatistics(bool? termstatistics = true) => Qs("term_statistics", termstatistics); ///Explicit version number for concurrency control public MultiTermVectorsDescriptor Version(long? version) => Qs("version", version); ///Specific version type public MultiTermVectorsDescriptor VersionType(VersionType? versiontype) => Qs("version_type", versiontype); } ///Descriptor for Ping https://opensearch.org/docs/latest/opensearch/index/ public partial class PingDescriptor : RequestDescriptorBase, IPingRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespacePing; // values part of the url path // Request parameters } ///Descriptor for PutScript public partial class PutScriptDescriptor : RequestDescriptorBase, IPutScriptRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespacePutScript; ////_scripts/{id} ///this parameter is required public PutScriptDescriptor(Id id): base(r => r.Required("id", id)) { } ////_scripts/{id}/{context} ///this parameter is required ///Optional, accepts null public PutScriptDescriptor(Id id, Name context): base(r => r.Required("id", id).Optional("context", context)) { } ///Used for serialization purposes, making sure we have a parameterless constructor [SerializationConstructor] protected PutScriptDescriptor(): base() { } // values part of the url path Id IPutScriptRequest.Id => Self.RouteValues.Get("id"); Name IPutScriptRequest.Context => Self.RouteValues.Get("context"); ///Script context public PutScriptDescriptor Context(Name context) => Assign(context, (a, v) => a.RouteValues.Optional("context", v)); // Request parameters ///Specify timeout for connection to master node ///Deprecated as of OpenSearch 2.0, use instead public PutScriptDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); ///Specify timeout for connection to cluster_manager node ///Introduced in OpenSearch 2.0 instead of public PutScriptDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); ///Explicit operation timeout public PutScriptDescriptor Timeout(Time timeout) => Qs("timeout", timeout); } ///Descriptor for ReindexOnServer https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ public partial class ReindexOnServerDescriptor : RequestDescriptorBase, IReindexOnServerRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceReindexOnServer; // values part of the url path // Request parameters ///Should the affected indexes be refreshed? public ReindexOnServerDescriptor Refresh(bool? refresh = true) => Qs("refresh", refresh); ///The throttle to set on this request in sub-requests per second. -1 means no throttle. public ReindexOnServerDescriptor RequestsPerSecond(long? requestspersecond) => Qs("requests_per_second", requestspersecond); ///Control how long to keep the search context alive public ReindexOnServerDescriptor Scroll(Time scroll) => Qs("scroll", scroll); ///The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. public ReindexOnServerDescriptor Slices(long? slices) => Qs("slices", slices); ///Time each individual bulk request should wait for shards that are unavailable. public ReindexOnServerDescriptor Timeout(Time timeout) => Qs("timeout", timeout); ///Sets the number of shard copies that must be active before proceeding with the reindex 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 ReindexOnServerDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards); ///Should the request should block until the reindex is complete. public ReindexOnServerDescriptor WaitForCompletion(bool? waitforcompletion = true) => Qs("wait_for_completion", waitforcompletion); } ///Descriptor for ReindexRethrottle https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ public partial class ReindexRethrottleDescriptor : RequestDescriptorBase, IReindexRethrottleRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceReindexRethrottle; ////_reindex/{task_id}/_rethrottle ///this parameter is required public ReindexRethrottleDescriptor(TaskId taskId): base(r => r.Required("task_id", taskId)) { } ///Used for serialization purposes, making sure we have a parameterless constructor [SerializationConstructor] protected ReindexRethrottleDescriptor(): base() { } // values part of the url path TaskId IReindexRethrottleRequest.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 ReindexRethrottleDescriptor RequestsPerSecond(long? requestspersecond) => Qs("requests_per_second", requestspersecond); } ///Descriptor for RenderSearchTemplate https://opensearch.org/docs/latest/opensearch/search-template/ public partial class RenderSearchTemplateDescriptor : RequestDescriptorBase, IRenderSearchTemplateRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceRenderSearchTemplate; ////_render/template public RenderSearchTemplateDescriptor(): base() { } ////_render/template/{id} ///Optional, accepts null public RenderSearchTemplateDescriptor(Id id): base(r => r.Optional("id", id)) { } // values part of the url path Id IRenderSearchTemplateRequest.Id => Self.RouteValues.Get("id"); ///The id of the stored search template public RenderSearchTemplateDescriptor Id(Id id) => Assign(id, (a, v) => a.RouteValues.Optional("id", v)); // Request parameters } ///Descriptor for ExecutePainlessScript public partial class ExecutePainlessScriptDescriptor : RequestDescriptorBase, IExecutePainlessScriptRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceExecutePainlessScript; // values part of the url path // Request parameters } ///Descriptor for Scroll https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body public partial class ScrollDescriptor : RequestDescriptorBase, ScrollRequestParameters, IScrollRequest>, IScrollRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceScroll; // values part of the url path // Request parameters ///Indicates whether hits.total should be rendered as an integer or an object in the rest search response public ScrollDescriptor TotalHitsAsInteger(bool? totalhitsasinteger = true) => Qs("rest_total_hits_as_int", totalhitsasinteger); } ///Descriptor for Search https://opensearch.org/docs/latest/opensearch/rest-api/search/ public partial class SearchDescriptor : RequestDescriptorBase, SearchRequestParameters, ISearchRequest>, ISearchRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceSearch; ////{index}/_search public SearchDescriptor(): this(typeof(TInferDocument)) { } ////{index}/_search ///Optional, accepts null public SearchDescriptor(Indices index): base(r => r.Optional("index", index)) { } // values part of the url path Indices ISearchRequest.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 SearchDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); ///a shortcut into calling Index(typeof(TOther)) public SearchDescriptor Index() where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); ///A shortcut into calling Index(Indices.All) public SearchDescriptor 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 SearchDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); ///Indicate if an error should be returned if there is a partial search failure or timeout public SearchDescriptor AllowPartialSearchResults(bool? allowpartialsearchresults = true) => Qs("allow_partial_search_results", allowpartialsearchresults); ///Specify whether wildcard and prefix queries should be analyzed (default: false) public SearchDescriptor AnalyzeWildcard(bool? analyzewildcard = true) => Qs("analyze_wildcard", analyzewildcard); ///The analyzer to use for the query string public SearchDescriptor Analyzer(string analyzer) => Qs("analyzer", analyzer); ///The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. public SearchDescriptor BatchedReduceSize(long? batchedreducesize) => Qs("batched_reduce_size", batchedreducesize); ///Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution public SearchDescriptor CcsMinimizeRoundtrips(bool? ccsminimizeroundtrips = true) => Qs("ccs_minimize_roundtrips", ccsminimizeroundtrips); ///The default operator for query string query (AND or OR) public SearchDescriptor DefaultOperator(DefaultOperator? defaultoperator) => Qs("default_operator", defaultoperator); ///The field to use as default where no field prefix is given in the query string public SearchDescriptor Df(string df) => Qs("df", df); ///Whether to expand wildcard expression to concrete indices that are open, closed or both. public SearchDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); ///Whether specified concrete, expanded or aliased indices should be ignored when throttled public SearchDescriptor IgnoreThrottled(bool? ignorethrottled = true) => Qs("ignore_throttled", ignorethrottled); ///Whether specified concrete indices should be ignored when unavailable (missing or closed) public SearchDescriptor 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 SearchDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); ///The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests public SearchDescriptor MaxConcurrentShardRequests(long? maxconcurrentshardrequests) => Qs("max_concurrent_shard_requests", maxconcurrentshardrequests); ///A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. public SearchDescriptor PreFilterShardSize(long? prefiltershardsize) => Qs("pre_filter_shard_size", prefiltershardsize); ///Specify the node or shard the operation should be performed on (default: random) public SearchDescriptor Preference(string preference) => Qs("preference", preference); ///Query in the Lucene query string syntax public SearchDescriptor QueryOnQueryString(string queryonquerystring) => Qs("q", queryonquerystring); ///Specify if request cache should be used for this request or not, defaults to index level setting public SearchDescriptor RequestCache(bool? requestcache = true) => Qs("request_cache", requestcache); /// /// 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 SearchDescriptor Routing(Routing routing) => Qs("routing", routing); ///Specify how long a consistent view of the index should be maintained for scrolled search public SearchDescriptor Scroll(Time scroll) => Qs("scroll", scroll); ///Search operation type public SearchDescriptor SearchType(SearchType? searchtype) => Qs("search_type", searchtype); ///Specify whether to return sequence number and primary term of the last modification of each hit public SearchDescriptor SequenceNumberPrimaryTerm(bool? sequencenumberprimaryterm = true) => Qs("seq_no_primary_term", sequencenumberprimaryterm); ///Specific 'tag' of the request for logging and statistical purposes public SearchDescriptor Stats(params string[] stats) => Qs("stats", stats); ///Specify which field to use for suggestions public SearchDescriptor SuggestField(Field suggestfield) => Qs("suggest_field", suggestfield); ///Specify which field to use for suggestions public SearchDescriptor SuggestField(Expression> field) => Qs("suggest_field", (Field)field); ///Specify suggest mode public SearchDescriptor SuggestMode(SuggestMode? suggestmode) => Qs("suggest_mode", suggestmode); ///How many suggestions to return in response public SearchDescriptor SuggestSize(long? suggestsize) => Qs("suggest_size", suggestsize); ///The source text for which the suggestions should be returned public SearchDescriptor SuggestText(string suggesttext) => Qs("suggest_text", suggesttext); ///Indicates whether hits.total should be rendered as an integer or an object in the rest search response public SearchDescriptor TotalHitsAsInteger(bool? totalhitsasinteger = true) => Qs("rest_total_hits_as_int", totalhitsasinteger); ///Specify whether aggregation and suggester names should be prefixed by their respective types in the response public SearchDescriptor TypedKeys(bool? typedkeys = true) => Qs("typed_keys", typedkeys); } ///Descriptor for SearchShards https://opensearch.org/docs/latest/security-plugin/access-control/cross-cluster-search/ public partial class SearchShardsDescriptor : RequestDescriptorBase, SearchShardsRequestParameters, ISearchShardsRequest>, ISearchShardsRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceSearchShards; ////{index}/_search_shards public SearchShardsDescriptor(): this(typeof(TDocument)) { } ////{index}/_search_shards ///Optional, accepts null public SearchShardsDescriptor(Indices index): base(r => r.Optional("index", index)) { } // values part of the url path Indices ISearchShardsRequest.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 SearchShardsDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); ///a shortcut into calling Index(typeof(TOther)) public SearchShardsDescriptor Index() where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); ///A shortcut into calling Index(Indices.All) public SearchShardsDescriptor 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 SearchShardsDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); ///Whether to expand wildcard expression to concrete indices that are open, closed or both. public SearchShardsDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); ///Whether specified concrete indices should be ignored when unavailable (missing or closed) public SearchShardsDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); ///Return local information, do not retrieve the state from cluster_manager node (default: false) public SearchShardsDescriptor Local(bool? local = true) => Qs("local", local); ///Specify the node or shard the operation should be performed on (default: random) public SearchShardsDescriptor Preference(string preference) => Qs("preference", preference); /// /// 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 SearchShardsDescriptor Routing(Routing routing) => Qs("routing", routing); } ///Descriptor for SearchTemplate https://opensearch.org/docs/latest/opensearch/search-template/ public partial class SearchTemplateDescriptor : RequestDescriptorBase, SearchTemplateRequestParameters, ISearchTemplateRequest>, ISearchTemplateRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceSearchTemplate; ////{index}/_search/template public SearchTemplateDescriptor(): this(typeof(TDocument)) { } ////{index}/_search/template ///Optional, accepts null public SearchTemplateDescriptor(Indices index): base(r => r.Optional("index", index)) { } // values part of the url path Indices ISearchTemplateRequest.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 SearchTemplateDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); ///a shortcut into calling Index(typeof(TOther)) public SearchTemplateDescriptor Index() where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); ///A shortcut into calling Index(Indices.All) public SearchTemplateDescriptor 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 SearchTemplateDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); ///Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution public SearchTemplateDescriptor CcsMinimizeRoundtrips(bool? ccsminimizeroundtrips = true) => Qs("ccs_minimize_roundtrips", ccsminimizeroundtrips); ///Whether to expand wildcard expression to concrete indices that are open, closed or both. public SearchTemplateDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); ///Specify whether to return detailed information about score computation as part of a hit public SearchTemplateDescriptor Explain(bool? explain = true) => Qs("explain", explain); ///Whether specified concrete, expanded or aliased indices should be ignored when throttled public SearchTemplateDescriptor IgnoreThrottled(bool? ignorethrottled = true) => Qs("ignore_throttled", ignorethrottled); ///Whether specified concrete indices should be ignored when unavailable (missing or closed) public SearchTemplateDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); ///Specify the node or shard the operation should be performed on (default: random) public SearchTemplateDescriptor Preference(string preference) => Qs("preference", preference); ///Specify whether to profile the query execution public SearchTemplateDescriptor Profile(bool? profile = true) => Qs("profile", profile); /// /// 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 SearchTemplateDescriptor Routing(Routing routing) => Qs("routing", routing); ///Specify how long a consistent view of the index should be maintained for scrolled search public SearchTemplateDescriptor Scroll(Time scroll) => Qs("scroll", scroll); ///Search operation type public SearchTemplateDescriptor SearchType(SearchType? searchtype) => Qs("search_type", searchtype); ///Indicates whether hits.total should be rendered as an integer or an object in the rest search response public SearchTemplateDescriptor TotalHitsAsInteger(bool? totalhitsasinteger = true) => Qs("rest_total_hits_as_int", totalhitsasinteger); ///Specify whether aggregation and suggester names should be prefixed by their respective types in the response public SearchTemplateDescriptor TypedKeys(bool? typedkeys = true) => Qs("typed_keys", typedkeys); } ///Descriptor for TermVectors public partial class TermVectorsDescriptor : RequestDescriptorBase, TermVectorsRequestParameters, ITermVectorsRequest>, ITermVectorsRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceTermVectors; ////{index}/_termvectors/{id} ///this parameter is required ///Optional, accepts null public TermVectorsDescriptor(IndexName index, Id id): base(r => r.Required("index", index).Optional("id", id)) { } ////{index}/_termvectors ///this parameter is required public TermVectorsDescriptor(IndexName index): base(r => r.Required("index", index)) { } ////{index}/_termvectors/{id} ///Optional, accepts null public TermVectorsDescriptor(Id id): this(typeof(TDocument), id) { } ////{index}/_termvectors public TermVectorsDescriptor(): this(typeof(TDocument)) { } ////{index}/_termvectors/{id} ///The document used to resolve the path from public TermVectorsDescriptor(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 ITermVectorsRequest.Index => Self.RouteValues.Get("index"); Id ITermVectorsRequest.Id => Self.RouteValues.Get("id"); ///The index in which the document resides. public TermVectorsDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); ///a shortcut into calling Index(typeof(TOther)) public TermVectorsDescriptor Index() where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v)); ///The id of the document, when not specified a doc param should be supplied. public TermVectorsDescriptor Id(Id id) => Assign(id, (a, v) => a.RouteValues.Optional("id", v)); // Request parameters ///Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. public TermVectorsDescriptor FieldStatistics(bool? fieldstatistics = true) => Qs("field_statistics", fieldstatistics); ///A comma-separated list of fields to return. public TermVectorsDescriptor Fields(Fields fields) => Qs("fields", fields); ///A comma-separated list of fields to return. public TermVectorsDescriptor Fields(params Expression>[] fields) => Qs("fields", fields?.Select(e => (Field)e)); ///Specifies if term offsets should be returned. public TermVectorsDescriptor Offsets(bool? offsets = true) => Qs("offsets", offsets); ///Specifies if term payloads should be returned. public TermVectorsDescriptor Payloads(bool? payloads = true) => Qs("payloads", payloads); ///Specifies if term positions should be returned. public TermVectorsDescriptor Positions(bool? positions = true) => Qs("positions", positions); ///Specify the node or shard the operation should be performed on (default: random). public TermVectorsDescriptor Preference(string preference) => Qs("preference", preference); ///Specifies if request is real-time as opposed to near-real-time (default: true). public TermVectorsDescriptor Realtime(bool? realtime = true) => Qs("realtime", realtime); /// /// 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 TermVectorsDescriptor Routing(Routing routing) => Qs("routing", routing); ///Specifies if total term frequency and document frequency should be returned. public TermVectorsDescriptor TermStatistics(bool? termstatistics = true) => Qs("term_statistics", termstatistics); ///Explicit version number for concurrency control public TermVectorsDescriptor Version(long? version) => Qs("version", version); ///Specific version type public TermVectorsDescriptor VersionType(VersionType? versiontype) => Qs("version_type", versiontype); } ///Descriptor for Update https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ public partial class UpdateDescriptor : RequestDescriptorBase, UpdateRequestParameters, IUpdateRequest>, IUpdateRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceUpdate; ////{index}/_update/{id} ///this parameter is required ///this parameter is required public UpdateDescriptor(IndexName index, Id id): base(r => r.Required("index", index).Required("id", id)) { } ////{index}/_update/{id} ///this parameter is required public UpdateDescriptor(Id id): this(typeof(TDocument), id) { } ////{index}/_update/{id} ///The document used to resolve the path from public UpdateDescriptor(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 UpdateDescriptor(): base() { } // values part of the url path IndexName IUpdateRequest.Index => Self.RouteValues.Get("index"); Id IUpdateRequest.Id => Self.RouteValues.Get("id"); ///The name of the index public UpdateDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); ///a shortcut into calling Index(typeof(TOther)) public UpdateDescriptor Index() where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v)); // Request parameters ///only perform the update operation if the last operation that has changed the document has the specified primary term public UpdateDescriptor IfPrimaryTerm(long? ifprimaryterm) => Qs("if_primary_term", ifprimaryterm); ///only perform the update operation if the last operation that has changed the document has the specified sequence number public UpdateDescriptor IfSequenceNumber(long? ifsequencenumber) => Qs("if_seq_no", ifsequencenumber); ///The script language (default: painless) public UpdateDescriptor Lang(string lang) => Qs("lang", lang); ///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 UpdateDescriptor Refresh(Refresh? refresh) => Qs("refresh", refresh); ///When true, requires destination is an alias. Default is false public UpdateDescriptor RequireAlias(bool? requirealias = true) => Qs("require_alias", requirealias); ///Specify how many times should the operation be retried when a conflict occurs (default: 0) public UpdateDescriptor RetryOnConflict(long? retryonconflict) => Qs("retry_on_conflict", retryonconflict); /// /// 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 UpdateDescriptor Routing(Routing routing) => Qs("routing", routing); ///Whether the _source should be included in the response. public UpdateDescriptor SourceEnabled(bool? sourceenabled = true) => Qs("_source", sourceenabled); ///Explicit operation timeout public UpdateDescriptor Timeout(Time timeout) => Qs("timeout", timeout); ///Sets the number of shard copies that must be active before proceeding with the update 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 UpdateDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards); } ///Descriptor for UpdateByQuery https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ public partial class UpdateByQueryDescriptor : RequestDescriptorBase, UpdateByQueryRequestParameters, IUpdateByQueryRequest>, IUpdateByQueryRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceUpdateByQuery; ////{index}/_update_by_query ///this parameter is required public UpdateByQueryDescriptor(Indices index): base(r => r.Required("index", index)) { } ////{index}/_update_by_query public UpdateByQueryDescriptor(): this(typeof(TDocument)) { } // values part of the url path Indices IUpdateByQueryRequest.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 UpdateByQueryDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); ///a shortcut into calling Index(typeof(TOther)) public UpdateByQueryDescriptor Index() where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v)); ///A shortcut into calling Index(Indices.All) public UpdateByQueryDescriptor 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 UpdateByQueryDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); ///Specify whether wildcard and prefix queries should be analyzed (default: false) public UpdateByQueryDescriptor AnalyzeWildcard(bool? analyzewildcard = true) => Qs("analyze_wildcard", analyzewildcard); ///The analyzer to use for the query string public UpdateByQueryDescriptor Analyzer(string analyzer) => Qs("analyzer", analyzer); ///What to do when the update by query hits version conflicts? public UpdateByQueryDescriptor Conflicts(Conflicts? conflicts) => Qs("conflicts", conflicts); ///The default operator for query string query (AND or OR) public UpdateByQueryDescriptor DefaultOperator(DefaultOperator? defaultoperator) => Qs("default_operator", defaultoperator); ///The field to use as default where no field prefix is given in the query string public UpdateByQueryDescriptor Df(string df) => Qs("df", df); ///Whether to expand wildcard expression to concrete indices that are open, closed or both. public UpdateByQueryDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); ///Starting offset (default: 0) public UpdateByQueryDescriptor From(long? from) => Qs("from", from); ///Whether specified concrete indices should be ignored when unavailable (missing or closed) public UpdateByQueryDescriptor 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 UpdateByQueryDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); ///Ingest pipeline to set on index requests made by this action. (default: none) public UpdateByQueryDescriptor Pipeline(string pipeline) => Qs("pipeline", pipeline); ///Specify the node or shard the operation should be performed on (default: random) public UpdateByQueryDescriptor Preference(string preference) => Qs("preference", preference); ///Query in the Lucene query string syntax public UpdateByQueryDescriptor QueryOnQueryString(string queryonquerystring) => Qs("q", queryonquerystring); ///Should the affected indexes be refreshed? public UpdateByQueryDescriptor 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 UpdateByQueryDescriptor RequestCache(bool? requestcache = true) => Qs("request_cache", requestcache); ///The throttle to set on this request in sub-requests per second. -1 means no throttle. public UpdateByQueryDescriptor 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 OSC will automatically infer the routing key /// if that document has a or a routing mapping on for its type exists on /// public UpdateByQueryDescriptor Routing(Routing routing) => Qs("routing", routing); ///Specify how long a consistent view of the index should be maintained for scrolled search public UpdateByQueryDescriptor Scroll(Time scroll) => Qs("scroll", scroll); ///Size on the scroll request powering the update by query public UpdateByQueryDescriptor ScrollSize(long? scrollsize) => Qs("scroll_size", scrollsize); ///Explicit timeout for each search request. Defaults to no timeout. public UpdateByQueryDescriptor SearchTimeout(Time searchtimeout) => Qs("search_timeout", searchtimeout); ///Search operation type public UpdateByQueryDescriptor 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. Can be set to `auto`. public UpdateByQueryDescriptor Slices(long? slices) => Qs("slices", slices); ///A comma-separated list of <field>:<direction> pairs public UpdateByQueryDescriptor Sort(params string[] sort) => Qs("sort", sort); ///Whether the _source should be included in the response. public UpdateByQueryDescriptor SourceEnabled(bool? sourceenabled = true) => Qs("_source", sourceenabled); ///A list of fields to exclude from the returned _source field public UpdateByQueryDescriptor SourceExcludes(Fields sourceexcludes) => Qs("_source_excludes", sourceexcludes); ///A list of fields to exclude from the returned _source field public UpdateByQueryDescriptor 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 UpdateByQueryDescriptor SourceIncludes(Fields sourceincludes) => Qs("_source_includes", sourceincludes); ///A list of fields to extract and return from the _source field public UpdateByQueryDescriptor SourceIncludes(params Expression>[] fields) => Qs("_source_includes", fields?.Select(e => (Field)e)); ///Specific 'tag' of the request for logging and statistical purposes public UpdateByQueryDescriptor 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 UpdateByQueryDescriptor TerminateAfter(long? terminateafter) => Qs("terminate_after", terminateafter); ///Time each individual bulk request should wait for shards that are unavailable. public UpdateByQueryDescriptor Timeout(Time timeout) => Qs("timeout", timeout); ///Specify whether to return document version as part of a hit public UpdateByQueryDescriptor Version(bool? version = true) => Qs("version", version); ///Should the document increment the version number (internal) on hit or not (reindex) public UpdateByQueryDescriptor VersionType(bool? versiontype = true) => Qs("version_type", versiontype); ///Sets the number of shard copies that must be active before proceeding with the update 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 UpdateByQueryDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards); ///Should the request should block until the update by query operation is complete. public UpdateByQueryDescriptor WaitForCompletion(bool? waitforcompletion = true) => Qs("wait_for_completion", waitforcompletion); } ///Descriptor for UpdateByQueryRethrottle https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ public partial class UpdateByQueryRethrottleDescriptor : RequestDescriptorBase, IUpdateByQueryRethrottleRequest { internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceUpdateByQueryRethrottle; ////_update_by_query/{task_id}/_rethrottle ///this parameter is required public UpdateByQueryRethrottleDescriptor(TaskId taskId): base(r => r.Required("task_id", taskId)) { } ///Used for serialization purposes, making sure we have a parameterless constructor [SerializationConstructor] protected UpdateByQueryRethrottleDescriptor(): base() { } // values part of the url path TaskId IUpdateByQueryRethrottleRequest.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 UpdateByQueryRethrottleDescriptor RequestsPerSecond(long? requestspersecond) => Qs("requests_per_second", requestspersecond); } }