diff --git a/UPGRADING.md b/UPGRADING.md index d9afa1e55d..a90933b848 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -3,6 +3,11 @@ * [1.x.y to 2.0.0](#1xy-to-200) * [OpenSearch.Net](#opensearchnet) * [General](#general) + * [Bulk Action](#bulk-action) + * [DeleteByQuery Action](#deletebyquery-action) + * [ReindexOnServer Action](#reindexonserver-action) + * [Search Action](#search-action) + * [UpdateByQuery Action](#updatebyquery-action) * [Cat.Help Action](#cathelp-action) * [Cat.Indices Action](#catindices-action) * [Cat.Master Action](#catmaster-action) @@ -11,17 +16,25 @@ * [Cluster.ExistsComponentTemplate Action](#clusterexistscomponenttemplate-action) * [Cluster.Health Action](#clusterhealth-action) * [Cluster.PostVotingConfigExclusions Action](#clusterpostvotingconfigexclusions-action) + * [Cluster.Reroute Action](#clusterreroute-action) * [Features Namespace](#features-namespace) + * [Indices.AddBlock Action](#indicesaddblock-action) + * [Indices.Analyze Action](#indicesanalyze-action) + * [Indices.ClearCache Action](#indicesclearcache-action) * [Indices.DeleteTemplateV2 Action](#indicesdeletetemplatev2-action) * [Indices.ExistsTemplate Action](#indicesexiststemplate-action) * [Indices.GetTemplateV2 Action](#indicesgettemplatev2-action) * [Indices.PutTemplateV2 Action](#indicesputtemplatev2-action) + * [Indices.ShardStores Action](#indicesshardstores-action) + * [Indices.Stats Action](#indicesstats-action) * [Nodes.HotThreads Action](#nodeshotthreads-action) * [Nodes.Stats Action](#nodesstats-action) * [Snapshot.CleanupRepository Action](#snapshotcleanuprepository-action) * [Tasks.List Action](#taskslist-action) * [OpenSearch.Client](#opensearchclient) * [General](#general-1) + * [Bulk Action](#bulk-action-1) + * [UpdateByQuery Action](#updatebyquery-action-1) * [Cat.Help Action](#cathelp-action-1) * [Cat.Indices Action](#catindices-action-1) * [Cat.Master Action](#catmaster-action-1) @@ -29,6 +42,7 @@ * [Cluster.GetComponentTemplate Action](#clustergetcomponenttemplate-action) * [Cluster.Health Action](#clusterhealth-action-1) * [Cluster.PostVotingConfigExclusions Action](#clusterpostvotingconfigexclusions-action-1) + * [Cluster.Reroute Action](#clusterreroute-action-1) * [Cluster.Stats Action](#clusterstats-action) * [Indices.GetComposableTemplate Action](#indicesgetcomposabletemplate-action) * [Nodes.HotThreads Action](#nodeshotthreads-action-1) @@ -48,6 +62,23 @@ - The `MasterTimeout` parameters on all actions have been marked `[Obsolete]`, please migrate to using `ClusterManagerTimeout` if your OpenSearch cluster is at least version `2.0.0` as `MasterTimeout` may be removed in future major versions. - The `ExpandWildcards` enum is now attributed with `[Flags]` to allow combining of multiple values e.g. `ExpandWildcards.Open | ExpandWildcards.Closed` to match open and closed indexes but not hidden. - The `Bytes` enum has been renamed to `ByteUnit`. +- All instances of the `Routing` parameter now accept an array of strings instead of a single string to better represent the underlying API that accepts comma-separated lists. + +#### Bulk Action +- The `TypeQueryString` parameter has been renamed to simply `Type`. + +#### DeleteByQuery Action +- The `Slices` parameter now accepts a `string` instead of a `long` as the API can also accept the string `"auto"`. + +#### ReindexOnServer Action +- The `Slices` parameter now accepts a `string` instead of a `long` as the API can also accept the string `"auto"`. + +#### Search Action +- The `MinCompatibleShardNode` parameter has been removed as it was never supported by OpenSearch. + +#### UpdateByQuery Action +- The `Slices` parameter now accepts a `string` instead of a `long` as the API can also accept the string `"auto"`. +- The `VersionType` parameter has been removed as it was never supported by OpenSearch. #### Cat.Help Action - The `Help` and `SortByColumns` parameters have been removed as they are unsupported by OpenSearch. @@ -62,7 +93,7 @@ - The `IncludeBootstrap` parameter has been removed as it was never supported by OpenSearch. #### Cat.Recovery Action -- The `IndexQueryString` parameter has been renamed to simply `Index` +- The `IndexQueryString` parameter has been renamed to simply `Index`. #### Cluster.ExistsComponentTemplate Action - This action has been removed in favour of the correctly named `Cluster.ComponentTemplateExists` action. @@ -74,6 +105,9 @@ #### Cluster.PostVotingConfigExclusions Action - The `NodeIds` & `NodeNames` parameters now accept an array of strings instead of a single string to better represent the underlying API that accepts comma-separated lists. +#### Cluster.Reroute Action +- The `Metric` parameter has been changed from a `string` to an `ClusterRerouteMetric` enum. + #### Features Namespace - The entire `Features` API namespace has been removed, there is no migration path as it was never supported by OpenSearch. @@ -81,10 +115,10 @@ - The `block` parameter has been changed from a `string` to an `IndexApiBlock` enum. #### Indices.Analyze Action -- The `IndexQueryString` parameter has been renamed to simply `Index` +- The `IndexQueryString` parameter has been renamed to simply `Index`. #### Indices.ClearCache Action -- The `IndexQueryString` parameter has been renamed to simply `Index` +- The `IndexQueryString` parameter has been renamed to simply `Index`. #### Indices.DeleteTemplateV2 Action - This action has been removed in favour of the more descriptively named and typed `Indices.DeleteComposableTemplate` action. @@ -101,7 +135,10 @@ - This action has been removed in favour of the more descriptively named and typed `Indices.PutComposableTemplate` action. #### Indices.ShardStores Action -- The `Status` parameter now takes an `IndicesShardStoresShardStoreStatus` flag enum instead of a `string` array. +- The `Status` parameter now takes an `IndicesShardStoresStatus` flag enum instead of a `string` array. + +#### Indices.Stats Action +- The `metric` parameter has been changed from a `string` to an `IndicesStatsMetric` enum. #### Nodes.HotThreads Action - The `ThreadType` parameter has been renamed to just `Type` to match the query parameter it represents. Its corresponding `ThreadType` enum has been renamed to `NodesSampleType`. @@ -123,6 +160,12 @@ - The namespaced APIs exposed in `IOpenSearchClient` have each gained a corresponding interface and the types of the properties on `IOpenSearchClient` and `OpenSearchClient` have been changed from the concrete implementations to the matching interfaces. For example, `IOpenSearchClient.Cluster` was `ClusterNamespace` and now is `IClusterNamespace`. - The `Bytes` enum has been renamed to `ByteUnit`. +#### Bulk Action +- The `TypeQueryString` parameter has been renamed to simply `Type`. + +#### UpdateByQuery Action +- The `VersionType` parameter has been removed as it was never supported by OpenSearch. + #### Cat.Help Action - The `Help` and `SortByColumns` parameters have been removed as they are unsupported by OpenSearch. @@ -146,6 +189,9 @@ #### Cluster.PostVotingConfigExclusions Action - The `NodeIds` & `NodeNames` parameters now accept an array of strings instead of a single string to better represent the underlying API that accepts comma-separated lists. +#### Cluster.Reroute Action +- The `Metric` parameter has been changed from a `string` to an `ClusterRerouteMetric` enum. + #### Cluster.Stats Action - The `Nodes.OperatingSystem.PrettyNames` property in the response object's item type has been renamed from `ClusterOperatingSystemPrettyNane` to `ClusterOperatingSystemPrettyName` to correct a spelling mistake. diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 5bd360cb7a..98d1bed0ad 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -39,9 +39,6 @@ public static class CodeConfiguration { private static readonly Glob[] OperationsToInclude = [ - new("{create,delete}_pit"), - new("{delete,get}_all_pits"), - new("cat.*"), new("cluster.*"), new("dangling_indices.*"), @@ -52,7 +49,7 @@ public static class CodeConfiguration new("tasks.*") ]; - public static bool IncludeOperation(string name) => OperationsToInclude.Any(g => g.IsMatch(name)); + public static bool IncludeOperation(string name) => !name.Contains('.') || OperationsToInclude.Any(g => g.IsMatch(name)); /// /// Map API default names for API's we are only supporting on the low level client first diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/DeleteByQueryOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/DeleteByQueryOverrides.cs index a14ebe66e2..9974254760 100644 --- a/src/ApiGenerator/Configuration/Overrides/Endpoints/DeleteByQueryOverrides.cs +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/DeleteByQueryOverrides.cs @@ -32,6 +32,6 @@ namespace ApiGenerator.Configuration.Overrides.Endpoints { public class DeleteByQueryOverrides : EndpointOverridesBase { - public override IEnumerable SkipQueryStringParams => new[] { "max_docs", }; + public override IEnumerable SkipQueryStringParams => ["max_docs", "slices"]; } } diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/ReindexOnServerOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/ReindexOnServerOverrides.cs index ebdffd7dc8..32ad62938f 100644 --- a/src/ApiGenerator/Configuration/Overrides/Endpoints/ReindexOnServerOverrides.cs +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/ReindexOnServerOverrides.cs @@ -32,6 +32,6 @@ namespace ApiGenerator.Configuration.Overrides.Endpoints { public class ReindexOnServerOverrides : EndpointOverridesBase { - public override IEnumerable SkipQueryStringParams => new[] { "max_docs", }; + public override IEnumerable SkipQueryStringParams => ["max_docs", "slices"]; } } diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/SearchOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/SearchOverrides.cs index 2e728e4bfc..34d549c29c 100644 --- a/src/ApiGenerator/Configuration/Overrides/Endpoints/SearchOverrides.cs +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/SearchOverrides.cs @@ -33,8 +33,8 @@ namespace ApiGenerator.Configuration.Overrides.Endpoints // ReSharper disable once UnusedMember.Global public class SearchOverrides : EndpointOverridesBase { - public override IEnumerable SkipQueryStringParams => new[] - { + public override IEnumerable SkipQueryStringParams => + [ "size", "from", "timeout", @@ -45,12 +45,8 @@ public class SearchOverrides : EndpointOverridesBase "_source_includes", "_source_excludes", "track_scores", - "terminate_after", - }; - - public override IEnumerable RenderPartial => new[] - { - "track_total_hits" - }; + "track_total_hits", + "terminate_after" + ]; } } diff --git a/src/ApiGenerator/Configuration/Overrides/Endpoints/UpdateByQueryOverrides.cs b/src/ApiGenerator/Configuration/Overrides/Endpoints/UpdateByQueryOverrides.cs index 316231d1dd..866f5e086d 100644 --- a/src/ApiGenerator/Configuration/Overrides/Endpoints/UpdateByQueryOverrides.cs +++ b/src/ApiGenerator/Configuration/Overrides/Endpoints/UpdateByQueryOverrides.cs @@ -32,6 +32,6 @@ namespace ApiGenerator.Configuration.Overrides.Endpoints { public class UpdateByQueryOverrides : EndpointOverridesBase { - public override IEnumerable SkipQueryStringParams => new[] { "max_docs", }; + public override IEnumerable SkipQueryStringParams => ["max_docs", "slices"]; } } diff --git a/src/ApiGenerator/Domain/Code/HttpMethod.cs b/src/ApiGenerator/Domain/Code/HttpMethod.cs index 390aa1e7e1..c45c63f382 100644 --- a/src/ApiGenerator/Domain/Code/HttpMethod.cs +++ b/src/ApiGenerator/Domain/Code/HttpMethod.cs @@ -15,7 +15,7 @@ public class HttpMethod public static readonly HttpMethod Patch = new("Patch", true); public static readonly HttpMethod Post = new("Post", true); public static readonly HttpMethod Put = new("Put", true); - public static readonly HttpMethod[] All = { Delete, Get, Head, Patch, Post, Put }; + public static readonly HttpMethod[] All = [Delete, Get, Head, Patch, Post, Put]; private readonly string _method; diff --git a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs index f22c15731f..daf1edb31b 100644 --- a/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs +++ b/src/ApiGenerator/Domain/Specification/ApiEndpoint.cs @@ -39,7 +39,7 @@ namespace ApiGenerator.Domain.Specification { public class ApiEndpoint { - /// The original name as declared in the spec + /// The original name as declared in the spec public string Name { get; set; } /// The original namespace as declared in the spec @@ -63,102 +63,121 @@ public class ApiEndpoint public IEndpointOverrides Overrides { get; internal set; } - private IEnumerable ParamsToGenerate => Url.Params.Values.Where(p => !p.Skip).OrderBy(p => p.ClsName); - - public RequestInterface RequestInterface => new() - { - CsharpNames = CsharpNames, - UrlParts = Url.Parts, - PartialParameters = - Body == null ? Enumerable.Empty().ToList() : ParamsToGenerate.Where(p => p.RenderPartial).ToList(), - OfficialDocumentationLink = OfficialDocumentationLink?.Url - }; - - public RequestPartialImplementation RequestPartialImplementation => new() - { - CsharpNames = CsharpNames, - OfficialDocumentationLink = OfficialDocumentationLink?.Url, - Stability = Stability, - Paths = Url.Paths.ToList(), - Parts = Url.Parts, - Params = ParamsToGenerate.ToList(), - Constructors = Constructor.RequestConstructors(CsharpNames, Url, inheritsFromPlainRequestBase: true).ToList(), - GenericConstructors = Constructor.RequestConstructors(CsharpNames, Url, inheritsFromPlainRequestBase: false).ToList(), - HasBody = Body != null, - }; - - public DescriptorPartialImplementation DescriptorPartialImplementation => new() - { - CsharpNames = CsharpNames, - OfficialDocumentationLink = OfficialDocumentationLink?.Url, - Constructors = Constructor.DescriptorConstructors(CsharpNames, Url).ToList(), - Paths = Url.Paths.ToList(), - Parts = Url.Parts, - Params = ParamsToGenerate.ToList(), - HasBody = Body != null, - }; - - public RequestParameterImplementation RequestParameterImplementation => new() - { - CsharpNames = CsharpNames, - OfficialDocumentationLink = OfficialDocumentationLink?.Url, - Params = ParamsToGenerate.ToList(), - HttpMethod = PreferredHttpMethod - }; + private IEnumerable ParamsToGenerate => + Url.Params.Values.Where(p => !p.Skip).OrderBy(p => p.ClsName); - public string PreferredHttpMethod => - HttpMethods.OrderByDescending(m => m switch + public RequestInterface RequestInterface => + new() + { + CsharpNames = CsharpNames, + UrlParts = Url.Parts, + PartialParameters = + Body == null + ? Enumerable.Empty().ToList() + : ParamsToGenerate.Where(p => p.RenderPartial).ToList(), + OfficialDocumentationLink = OfficialDocumentationLink?.Url, + }; + + public RequestPartialImplementation RequestPartialImplementation => + new() + { + CsharpNames = CsharpNames, + OfficialDocumentationLink = OfficialDocumentationLink?.Url, + Stability = Stability, + Paths = Url.Paths.ToList(), + Parts = Url.Parts, + Params = ParamsToGenerate.ToList(), + Constructors = Constructor + .RequestConstructors(CsharpNames, Url, inheritsFromPlainRequestBase: true) + .ToList(), + GenericConstructors = Constructor + .RequestConstructors(CsharpNames, Url, inheritsFromPlainRequestBase: false) + .ToList(), + HasBody = Body != null, + }; + + public DescriptorPartialImplementation DescriptorPartialImplementation => + new() + { + CsharpNames = CsharpNames, + OfficialDocumentationLink = OfficialDocumentationLink?.Url, + Constructors = Constructor.DescriptorConstructors(CsharpNames, Url).ToList(), + Paths = Url.Paths.ToList(), + Parts = Url.Parts, + Params = ParamsToGenerate.ToList(), + HasBody = Body != null, + }; + + public RequestParameterImplementation RequestParameterImplementation => + new() { - "GET" => 0, - "POST" => 1, - "PUT" or "DELETE" or "PATCH" or "HEAD" => 2, // Prefer "resource" methods over GET/POST methods - _ => -1 - }).First(); + CsharpNames = CsharpNames, + OfficialDocumentationLink = OfficialDocumentationLink?.Url, + Params = ParamsToGenerate.ToList(), + HttpMethod = PreferredHttpMethod, + }; + + public string PreferredHttpMethod => + Name == "bulk" + ? "POST" + : HttpMethods + .OrderByDescending(m => + m switch + { + "GET" => 0, + "POST" => 1, + "PUT" or "DELETE" or "PATCH" or "HEAD" => 2, // Prefer "resource" methods over GET/POST methods + _ => -1, + } + ) + .First(); public string HighLevelMethodXmlDocDescription => $"{PreferredHttpMethod} request to the {Name} API, read more about this API online:"; - private bool BodyIsOptional => Body is not { Required: true } || HttpMethods.Contains("GET"); - - private Deprecation Deprecated => - !Url.Paths.Any() && Url.AllPaths.Count > 0 - ? Url.DeprecatedPaths - .Select(p => p.Deprecation) - .MaxBy(d => d.Version) - : null; - - private Version VersionAdded => - Url.AllPaths - .Select(p => p.VersionAdded) - .Where(v => v != null) - .Min(); - - public HighLevelModel HighLevelModel => new() - { - CsharpNames = CsharpNames, - Fluent = new FluentMethod(CsharpNames, Url.Parts, - selectorIsOptional: BodyIsOptional, - link: OfficialDocumentationLink?.Url, - summary: HighLevelMethodXmlDocDescription, - deprecated: Deprecated, - versionAdded: VersionAdded - ), - FluentBound = !CsharpNames.DescriptorBindsOverMultipleDocuments - ? null - : new BoundFluentMethod(CsharpNames, Url.Parts, + private bool BodyIsOptional => + Body is not { Required: true } || HttpMethods.Contains("GET"); + + private Deprecation Deprecated => + !Url.Paths.Any() && Url.AllPaths.Count > 0 + ? Url.DeprecatedPaths.Select(p => p.Deprecation).MaxBy(d => d.Version) + : null; + + private Version VersionAdded => + Url.AllPaths.Select(p => p.VersionAdded).Where(v => v != null).Min(); + + public HighLevelModel HighLevelModel => + new() + { + CsharpNames = CsharpNames, + Fluent = new FluentMethod( + CsharpNames, + Url.Parts, selectorIsOptional: BodyIsOptional, link: OfficialDocumentationLink?.Url, summary: HighLevelMethodXmlDocDescription, - deprecated: Deprecated, - versionAdded: VersionAdded + deprecated: Deprecated, + versionAdded: VersionAdded + ), + FluentBound = !CsharpNames.DescriptorBindsOverMultipleDocuments + ? null + : new BoundFluentMethod( + CsharpNames, + Url.Parts, + selectorIsOptional: BodyIsOptional, + link: OfficialDocumentationLink?.Url, + summary: HighLevelMethodXmlDocDescription, + deprecated: Deprecated, + versionAdded: VersionAdded + ), + Initializer = new InitializerMethod( + CsharpNames, + link: OfficialDocumentationLink?.Url, + summary: HighLevelMethodXmlDocDescription, + deprecated: Deprecated, + versionAdded: VersionAdded ), - Initializer = new InitializerMethod(CsharpNames, - link: OfficialDocumentationLink?.Url, - summary: HighLevelMethodXmlDocDescription, - deprecated: Deprecated, - versionAdded: VersionAdded - ) - }; + }; private List _lowLevelClientMethods; @@ -166,7 +185,8 @@ public IReadOnlyCollection LowLevelClientMethods { get { - if (_lowLevelClientMethods != null && _lowLevelClientMethods.Count > 0) return _lowLevelClientMethods; + if (_lowLevelClientMethods != null && _lowLevelClientMethods.Count > 0) + return _lowLevelClientMethods; // enumerate once and cache _lowLevelClientMethods = new List(); @@ -183,11 +203,19 @@ public IReadOnlyCollection LowLevelClientMethods // TODO This is hack until we stop transforming the new spec format into the old if (Name == "index" && !mapsApiArgumentHints.Contains("id")) httpMethod = "POST"; - else if (Name == "index") httpMethod = PreferredHttpMethod; + else if (Name == "index") + httpMethod = PreferredHttpMethod; if (Body != null) { - parts.Add(new UrlPart { Name = "body", Type = "PostData", Description = Body.Description }); + parts.Add( + new UrlPart + { + Name = "body", + Type = "PostData", + Description = Body.Description, + } + ); mapsApiArgumentHints.Add("body"); } @@ -210,7 +238,7 @@ public IReadOnlyCollection LowLevelClientMethods Parts = parts, Url = Url, HasBody = Body != null, - VersionAdded = path.VersionAdded, + VersionAdded = path.VersionAdded, }; _lowLevelClientMethods.Add(apiMethod); } diff --git a/src/ApiGenerator/Generator/ApiEndpointFactory.cs b/src/ApiGenerator/Generator/ApiEndpointFactory.cs index 65302b43d2..dc728188d0 100644 --- a/src/ApiGenerator/Generator/ApiEndpointFactory.cs +++ b/src/ApiGenerator/Generator/ApiEndpointFactory.cs @@ -242,8 +242,8 @@ private static string GetOpenSearchType(JsonSchema schema, Action { case ("string", "list"): return second; case ("boolean", "string"): return first; - case ("string", "number"): return first; case ("number", _): return "string"; + case (_,"number"): return "string"; } } } diff --git a/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml b/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml index 399f4984f7..d8e2c1db1e 100644 --- a/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml +++ b/src/ApiGenerator/Views/LowLevel/Client/Interface/IOpenSearchLowLevelClient.cshtml @@ -35,7 +35,7 @@ namespace OpenSearch.Net } - if(Model.EndpointsPerNamespaceHighLevel.TryGetValue(CsharpNames.RootNamespace, out var endpoints)) + if(Model.EndpointsPerNamespaceLowLevel.TryGetValue(CsharpNames.RootNamespace, out var endpoints)) { foreach(var m in endpoints.SelectMany(e => e.LowLevelClientMethods)) { diff --git a/src/ApiGenerator/opensearch-openapi.yaml b/src/ApiGenerator/opensearch-openapi.yaml index 6220e58ec0..82f4ef33a7 100644 --- a/src/ApiGenerator/opensearch-openapi.yaml +++ b/src/ApiGenerator/opensearch-openapi.yaml @@ -3737,15 +3737,35 @@ paths: - $ref: '#/components/parameters/_global::query.error_trace' - $ref: '#/components/parameters/_global::query.source' - $ref: '#/components/parameters/_global::query.filter_path' - /_plugins/_ism/add/{index}: + /_plugins/_ism/add: post: operationId: ism.add_policy.0 x-operation-group: ism.add_policy description: Adds a policy to an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy + parameters: + - $ref: '#/components/parameters/ism.add_policy::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.add_policy' + responses: + '200': + $ref: '#/components/responses/ism.add_policy@200' + /_plugins/_ism/add/{index}: + post: + operationId: ism.add_policy.1 + x-operation-group: ism.add_policy + description: Adds a policy to an index. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy parameters: - $ref: '#/components/parameters/ism.add_policy::path.index' + - $ref: '#/components/parameters/ism.add_policy::query.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -3756,15 +3776,35 @@ paths: responses: '200': $ref: '#/components/responses/ism.add_policy@200' - /_plugins/_ism/change_policy/{index}: + /_plugins/_ism/change_policy: post: operationId: ism.change_policy.0 x-operation-group: ism.change_policy description: Updates the managed index policy to a new policy. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy + parameters: + - $ref: '#/components/parameters/ism.change_policy::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.change_policy' + responses: + '200': + $ref: '#/components/responses/ism.change_policy@200' + /_plugins/_ism/change_policy/{index}: + post: + operationId: ism.change_policy.1 + x-operation-group: ism.change_policy + description: Updates the managed index policy to a new policy. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy parameters: - $ref: '#/components/parameters/ism.change_policy::path.index' + - $ref: '#/components/parameters/ism.change_policy::query.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -3775,15 +3815,106 @@ paths: responses: '200': $ref: '#/components/responses/ism.change_policy@200' + /_plugins/_ism/explain: + get: + operationId: ism.explain_policy.0 + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + post: + operationId: ism.explain_policy.0 + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' /_plugins/_ism/explain/{index}: get: - operationId: ism.explain_index.0 - x-operation-group: ism.explain_index - description: Gets the currently applied policy on an index. + operationId: ism.explain_policy.1 + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index parameters: - - $ref: '#/components/parameters/ism.explain_index::path.index' + - $ref: '#/components/parameters/ism.explain_policy::path.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + post: + operationId: ism.explain_policy.1 + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + parameters: + - $ref: '#/components/parameters/ism.explain_policy::path.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + /_plugins/_ism/policies: + get: + operationId: ism.get_policies.0 + x-operation-group: ism.get_policies + description: Gets the policies. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + responses: + '200': + $ref: '#/components/responses/ism.get_policies@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + put: + operationId: ism.put_policies.0 + x-operation-group: ism.put_policies + description: Gets the policies. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#create-policy + requestBody: + $ref: '#/components/requestBodies/ism.put_policies' + parameters: + - $ref: '#/components/parameters/ism.put_policies::query.if_primary_term' + - $ref: '#/components/parameters/ism.put_policies::query.if_seq_no' + - $ref: '#/components/parameters/ism.put_policies::query.policyID' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -3791,7 +3922,7 @@ paths: - $ref: '#/components/parameters/_global::query.filter_path' responses: '200': - $ref: '#/components/responses/ism.explain_index@200' + $ref: '#/components/responses/ism.put_policies@200' /_plugins/_ism/policies/{policy_id}: delete: operationId: ism.delete_policy.0 @@ -3812,9 +3943,9 @@ paths: get: operationId: ism.get_policy.0 x-operation-group: ism.get_policy - description: Gets the policy. + description: Gets a policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#put-policy parameters: - $ref: '#/components/parameters/ism.get_policy::path.policy_id' - $ref: '#/components/parameters/_global::query.pretty' @@ -3825,6 +3956,24 @@ paths: responses: '200': $ref: '#/components/responses/ism.get_policy@200' + head: + operationId: ism.exists_policy.0 + x-operation-group: ism.exists_policy + description: Checks whether the policy exists. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + parameters: + - $ref: '#/components/parameters/ism.exists_policy::path.policy_id' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.exists_policy@200' + '404': + $ref: '#/components/responses/ism.exists_policy@404' put: operationId: ism.put_policy.0 x-operation-group: ism.put_policy @@ -3847,15 +3996,33 @@ paths: $ref: '#/components/responses/ism.put_policy@200' '201': $ref: '#/components/responses/ism.put_policy@201' - /_plugins/_ism/remove/{index}: + /_plugins/_ism/remove: post: operationId: ism.remove_policy.0 x-operation-group: ism.remove_policy description: Removes a policy from an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy + parameters: + - $ref: '#/components/parameters/ism.remove_policy::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.remove_policy@200' + /_plugins/_ism/remove/{index}: + post: + operationId: ism.remove_policy.1 + x-operation-group: ism.remove_policy + description: Removes a policy from an index. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy parameters: - $ref: '#/components/parameters/ism.remove_policy::path.index' + - $ref: '#/components/parameters/ism.remove_policy::query.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -3864,6 +4031,45 @@ paths: responses: '200': $ref: '#/components/responses/ism.remove_policy@200' + /_plugins/_ism/retry: + post: + operationId: ism.retry_index.0 + x-operation-group: ism.retry_index + description: Retry the failed action for an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + parameters: + - $ref: '#/components/parameters/ism.retry_index::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.retry_index' + responses: + '200': + $ref: '#/components/responses/ism.retry_index@200' + /_plugins/_ism/retry/{index}: + post: + operationId: ism.retry_index.1 + x-operation-group: ism.retry_index + description: Retry the failed action for an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + parameters: + - $ref: '#/components/parameters/ism.retry_index::path.index' + - $ref: '#/components/parameters/ism.retry_index::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.retry_index' + responses: + '200': + $ref: '#/components/responses/ism.retry_index@200' /_plugins/_knn/{node_id}/stats: get: operationId: knn.stats.2 @@ -4826,6 +5032,23 @@ paths: responses: '200': $ref: '#/components/responses/sql.settings@200' + /_plugins/_refresh_search_analyzers/{index}: + post: + operationId: ism.refresh_search_analyzers.0 + x-operation-group: ism.refresh_search_analyzers + description: Refresh search analyzers in real time. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/refresh-analyzer/ + parameters: + - $ref: '#/components/parameters/ism.refresh_search_analyzers::path.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.refresh_search_analyzers@200' /_plugins/_rollup/jobs/{id}: delete: operationId: rollups.delete.0 @@ -7334,6 +7557,7 @@ paths: parameters: - $ref: '#/components/parameters/put_script::path.id' - $ref: '#/components/parameters/put_script::query.cluster_manager_timeout' + - $ref: '#/components/parameters/put_script::query.context' - $ref: '#/components/parameters/put_script::query.master_timeout' - $ref: '#/components/parameters/put_script::query.timeout' - $ref: '#/components/parameters/_global::query.pretty' @@ -7356,6 +7580,7 @@ paths: parameters: - $ref: '#/components/parameters/put_script::path.id' - $ref: '#/components/parameters/put_script::query.cluster_manager_timeout' + - $ref: '#/components/parameters/put_script::query.context' - $ref: '#/components/parameters/put_script::query.master_timeout' - $ref: '#/components/parameters/put_script::query.timeout' - $ref: '#/components/parameters/_global::query.pretty' @@ -7380,6 +7605,7 @@ paths: - $ref: '#/components/parameters/put_script::path.context' - $ref: '#/components/parameters/put_script::path.id' - $ref: '#/components/parameters/put_script::query.cluster_manager_timeout' + - $ref: '#/components/parameters/put_script::query.context' - $ref: '#/components/parameters/put_script::query.master_timeout' - $ref: '#/components/parameters/put_script::query.timeout' - $ref: '#/components/parameters/_global::query.pretty' @@ -7403,6 +7629,7 @@ paths: - $ref: '#/components/parameters/put_script::path.context' - $ref: '#/components/parameters/put_script::path.id' - $ref: '#/components/parameters/put_script::query.cluster_manager_timeout' + - $ref: '#/components/parameters/put_script::query.context' - $ref: '#/components/parameters/put_script::query.master_timeout' - $ref: '#/components/parameters/put_script::query.timeout' - $ref: '#/components/parameters/_global::query.pretty' @@ -11482,15 +11709,37 @@ paths: $ref: '#/components/responses/asynchronous_search.delete@200' deprecated: true x-ignorable: true - /_opendistro/_ism/add/{index}: + /_opendistro/_ism/add: post: operationId: ism.add_policy.0_superseded x-operation-group: ism.add_policy description: Adds a policy to an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy + parameters: + - $ref: '#/components/parameters/ism.add_policy::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.add_policy' + responses: + '200': + $ref: '#/components/responses/ism.add_policy@200' + deprecated: true + x-ignorable: true + /_opendistro/_ism/add/{index}: + post: + operationId: ism.add_policy.1_superseded + x-operation-group: ism.add_policy + description: Adds a policy to an index. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy parameters: - $ref: '#/components/parameters/ism.add_policy::path.index' + - $ref: '#/components/parameters/ism.add_policy::query.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -11503,15 +11752,37 @@ paths: $ref: '#/components/responses/ism.add_policy@200' deprecated: true x-ignorable: true - /_opendistro/_ism/change_policy/{index}: + /_opendistro/_ism/change_policy: post: operationId: ism.change_policy.0_superseded x-operation-group: ism.change_policy description: Updates the managed index policy to a new policy. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy + parameters: + - $ref: '#/components/parameters/ism.change_policy::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.change_policy' + responses: + '200': + $ref: '#/components/responses/ism.change_policy@200' + deprecated: true + x-ignorable: true + /_opendistro/_ism/change_policy/{index}: + post: + operationId: ism.change_policy.1_superseded + x-operation-group: ism.change_policy + description: Updates the managed index policy to a new policy. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy parameters: - $ref: '#/components/parameters/ism.change_policy::path.index' + - $ref: '#/components/parameters/ism.change_policy::query.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -11524,15 +11795,116 @@ paths: $ref: '#/components/responses/ism.change_policy@200' deprecated: true x-ignorable: true + /_opendistro/_ism/explain: + get: + operationId: ism.explain_policy.0_superseded + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + deprecated: true + x-ignorable: true + post: + operationId: ism.explain_policy.0_superseded + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + deprecated: true + x-ignorable: true /_opendistro/_ism/explain/{index}: get: - operationId: ism.explain_index.0_superseded - x-operation-group: ism.explain_index - description: Gets the currently applied policy on an index. + operationId: ism.explain_policy.1_superseded + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index + parameters: + - $ref: '#/components/parameters/ism.explain_policy::path.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + deprecated: true + x-ignorable: true + post: + operationId: ism.explain_policy.1_superseded + x-operation-group: ism.explain_policy + description: Gets the currently applied policy on indices. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#explain-index parameters: - - $ref: '#/components/parameters/ism.explain_index::path.index' + - $ref: '#/components/parameters/ism.explain_policy::path.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.explain_policy' + responses: + '200': + $ref: '#/components/responses/ism.explain_policy@200' + deprecated: true + x-ignorable: true + /_opendistro/_ism/policies: + get: + operationId: ism.get_policies.0_superseded + x-operation-group: ism.get_policies + description: Gets the policies. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + responses: + '200': + $ref: '#/components/responses/ism.get_policies@200' + parameters: + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + deprecated: true + x-ignorable: true + put: + operationId: ism.put_policies.0_superseded + x-operation-group: ism.put_policies + description: Gets the policies. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#create-policy + requestBody: + $ref: '#/components/requestBodies/ism.put_policies' + parameters: + - $ref: '#/components/parameters/ism.put_policies::query.if_primary_term' + - $ref: '#/components/parameters/ism.put_policies::query.if_seq_no' + - $ref: '#/components/parameters/ism.put_policies::query.policyID' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -11540,16 +11912,16 @@ paths: - $ref: '#/components/parameters/_global::query.filter_path' responses: '200': - $ref: '#/components/responses/ism.explain_index@200' + $ref: '#/components/responses/ism.put_policies@200' deprecated: true x-ignorable: true /_opendistro/_ism/policies/{policyID}: get: operationId: ism.get_policy.0_superseded x-operation-group: ism.get_policy - description: Gets the policy. + description: Gets a policy. externalDocs: - url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#put-policy parameters: - $ref: '#/components/parameters/ism.get_policy::path.policy_id' - $ref: '#/components/parameters/_global::query.pretty' @@ -11562,6 +11934,26 @@ paths: $ref: '#/components/responses/ism.get_policy@200' deprecated: true x-ignorable: true + head: + operationId: ism.exists_policy.0_superseded + x-operation-group: ism.exists_policy + description: Checks whether the policy exists. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#get-policy + parameters: + - $ref: '#/components/parameters/ism.exists_policy::path.policy_id' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.exists_policy@200' + '404': + $ref: '#/components/responses/ism.exists_policy@404' + deprecated: true + x-ignorable: true put: operationId: ism.put_policy.0_superseded x-operation-group: ism.put_policy @@ -11604,15 +11996,35 @@ paths: $ref: '#/components/responses/ism.delete_policy@200' deprecated: true x-ignorable: true - /_opendistro/_ism/remove/{index}: + /_opendistro/_ism/remove: post: operationId: ism.remove_policy.0_superseded x-operation-group: ism.remove_policy description: Removes a policy from an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy + parameters: + - $ref: '#/components/parameters/ism.remove_policy::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.remove_policy@200' + deprecated: true + x-ignorable: true + /_opendistro/_ism/remove/{index}: + post: + operationId: ism.remove_policy.1_superseded + x-operation-group: ism.remove_policy + description: Removes a policy from an index. externalDocs: url: https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy parameters: - $ref: '#/components/parameters/ism.remove_policy::path.index' + - $ref: '#/components/parameters/ism.remove_policy::query.index' - $ref: '#/components/parameters/_global::query.pretty' - $ref: '#/components/parameters/_global::query.human' - $ref: '#/components/parameters/_global::query.error_trace' @@ -11623,6 +12035,49 @@ paths: $ref: '#/components/responses/ism.remove_policy@200' deprecated: true x-ignorable: true + /_opendistro/_ism/retry: + post: + operationId: ism.retry_index.0_superseded + x-operation-group: ism.retry_index + description: Retry the failed action for an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + parameters: + - $ref: '#/components/parameters/ism.retry_index::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.retry_index' + responses: + '200': + $ref: '#/components/responses/ism.retry_index@200' + deprecated: true + x-ignorable: true + /_opendistro/_ism/retry/{index}: + post: + operationId: ism.retry_index.1_superseded + x-operation-group: ism.retry_index + description: Retry the failed action for an index. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/ism/api/#retry-failed-index + parameters: + - $ref: '#/components/parameters/ism.retry_index::path.index' + - $ref: '#/components/parameters/ism.retry_index::query.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + requestBody: + $ref: '#/components/requestBodies/ism.retry_index' + responses: + '200': + $ref: '#/components/responses/ism.retry_index@200' + deprecated: true + x-ignorable: true /_opendistro/_knn/stats/{stat}: get: operationId: knn.stats.1_superseded @@ -11775,6 +12230,25 @@ paths: $ref: '#/components/responses/ppl.post_stats@200' deprecated: true x-ignorable: true + /_opendistro/_refresh_search_analyzers/{index}: + post: + operationId: ism.refresh_search_analyzers.0_superseded + x-operation-group: ism.refresh_search_analyzers + description: Refresh search analyzers in real time. + externalDocs: + url: https://opensearch.org/docs/latest/im-plugin/refresh-analyzer/ + parameters: + - $ref: '#/components/parameters/ism.refresh_search_analyzers::path.index' + - $ref: '#/components/parameters/_global::query.pretty' + - $ref: '#/components/parameters/_global::query.human' + - $ref: '#/components/parameters/_global::query.error_trace' + - $ref: '#/components/parameters/_global::query.source' + - $ref: '#/components/parameters/_global::query.filter_path' + responses: + '200': + $ref: '#/components/responses/ism.refresh_search_analyzers@200' + deprecated: true + x-ignorable: true /_opendistro/_rollup/jobs/{rollupID}: get: operationId: rollups.get.0_superseded @@ -16111,7 +16585,11 @@ components: name: metric description: Limits the information returned to the specified metrics. schema: - $ref: '#/components/schemas/_common:Metrics' + oneOf: + - $ref: '#/components/schemas/cluster.reroute:Metric' + - type: array + items: + $ref: '#/components/schemas/cluster.reroute:Metric' style: form cluster.reroute::query.retry_failed: in: query @@ -16411,10 +16889,7 @@ components: description: Comma-separated list of specific routing values. style: form schema: - type: array - items: - type: string - description: Comma-separated list of specific routing values. + $ref: '#/components/schemas/_common:Routing' explode: true create::path.id: in: path @@ -19777,10 +20252,10 @@ components: description: List of shard health statuses used to limit the request. schema: oneOf: - - $ref: '#/components/schemas/indices.shard_stores:ShardStoreStatus' + - $ref: '#/components/schemas/indices.shard_stores:Status' - type: array items: - $ref: '#/components/schemas/indices.shard_stores:ShardStoreStatus' + $ref: '#/components/schemas/indices.shard_stores:Status' style: form indices.shrink::path.index: in: path @@ -20039,7 +20514,11 @@ components: description: Limit the information returned the specific metrics. required: true schema: - $ref: '#/components/schemas/_common:Metrics' + oneOf: + - $ref: '#/components/schemas/indices.stats:Metric' + - type: array + items: + $ref: '#/components/schemas/indices.stats:Metric' style: simple indices.stats::query.completion_fields: in: query @@ -20422,6 +20901,15 @@ components: schema: $ref: '#/components/schemas/_common:IndexName' style: simple + ism.add_policy::query.index: + name: index + in: query + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '#/components/schemas/_common:IndexName' ism.change_policy::path.index: name: index in: path @@ -20432,13 +20920,28 @@ components: schema: $ref: '#/components/schemas/_common:IndexName' style: simple + ism.change_policy::query.index: + name: index + in: query + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '#/components/schemas/_common:IndexName' ism.delete_policy::path.policy_id: name: policy_id in: path required: true schema: type: string - ism.explain_index::path.index: + ism.exists_policy::path.policy_id: + name: policy_id + in: path + required: true + schema: + type: string + ism.explain_policy::path.index: name: index in: path description: |- @@ -20454,6 +20957,27 @@ components: required: true schema: type: string + ism.put_policies::query.if_primary_term: + name: if_primary_term + in: query + description: Only perform the operation if the document has this primary term. + schema: + type: number + style: form + ism.put_policies::query.if_seq_no: + name: if_seq_no + in: query + description: Only perform the operation if the document has this sequence number. + schema: + $ref: '#/components/schemas/_common:SequenceNumber' + style: form + ism.put_policies::query.policyID: + name: policyID + in: query + required: true + schema: + type: string + style: form ism.put_policy::path.policy_id: name: policy_id in: path @@ -20474,6 +20998,16 @@ components: schema: $ref: '#/components/schemas/_common:SequenceNumber' style: form + ism.refresh_search_analyzers::path.index: + name: index + in: path + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '#/components/schemas/_common:IndexName' + style: simple ism.remove_policy::path.index: name: index in: path @@ -20484,6 +21018,34 @@ components: schema: $ref: '#/components/schemas/_common:IndexName' style: simple + ism.remove_policy::query.index: + name: index + in: query + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '#/components/schemas/_common:IndexName' + ism.retry_index::path.index: + name: index + in: path + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '#/components/schemas/_common:IndexName' + style: simple + ism.retry_index::query.index: + name: index + in: query + description: |- + Comma-separated list of data streams, indices, and aliases. + Supports wildcards (`*`). + required: true + schema: + $ref: '#/components/schemas/_common:IndexName' knn.delete_model::path.model_id: name: model_id in: path @@ -20700,10 +21262,7 @@ components: description: Comma-separated list of specific routing values. style: form schema: - type: array - items: - type: string - description: Comma-separated list of specific routing values. + $ref: '#/components/schemas/_common:Routing' explode: true knn.search_models::query.scroll: name: scroll @@ -21833,6 +22392,14 @@ components: schema: $ref: '#/components/schemas/_common:Duration' x-version-added: '2.0' + put_script::query.context: + name: context + in: query + description: |- + Context in which the script or search template should run. + To prevent errors, the API immediately compiles the script or template in this context. + schema: + type: string put_script::query.master_timeout: in: query name: master_timeout @@ -21904,7 +22471,7 @@ components: name: search_type description: Search operation type schema: - type: string + $ref: '#/components/schemas/_common:SearchType' style: form reindex_rethrottle::path.task_id: in: path @@ -24942,11 +25509,25 @@ components: application/json: schema: $ref: '#/components/schemas/ism._common:ChangePolicyRequest' + ism.explain_policy: + content: + application/json: + schema: {} + ism.put_policies: + content: + application/json: + schema: + $ref: '#/components/schemas/ism._common:PutPolicyRequest' ism.put_policy: content: application/json: schema: $ref: '#/components/schemas/ism._common:PutPolicyRequest' + ism.retry_index: + content: + application/json: + schema: + $ref: '#/components/schemas/ism._common:RetryIndexRequest' knn.search_models: content: application/json: @@ -25347,13 +25928,6 @@ components: type: array items: $ref: '#/components/schemas/_common.query_dsl:FieldAndFormat' - knn: - description: Defines the approximate kNN search to run. - oneOf: - - $ref: '#/components/schemas/_common.query_dsl:KnnQuery' - - type: array - items: - $ref: '#/components/schemas/_common.query_dsl:KnnQuery' rank: $ref: '#/components/schemas/_common:RankContainer' min_score: @@ -26569,6 +27143,10 @@ components: - $ref: '#/components/schemas/flow_framework.errors:ParameterConflictError' - $ref: '#/components/schemas/flow_framework.errors:MaxWorkflowsLimitError' - $ref: '#/components/schemas/flow_framework.errors:WorkflowSaveError' + - $ref: '#/components/schemas/flow_framework.errors:WorkflowParsingError' + - $ref: '#/components/schemas/flow_framework.errors:UnsupportedFieldUpdateError' + - $ref: '#/components/schemas/flow_framework.errors:InvalidTemplateVersionError' + - $ref: '#/components/schemas/flow_framework.errors:TemplateNameRequiredError' flow_framework.create@403: content: application/json: @@ -26711,6 +27289,9 @@ components: - $ref: '#/components/schemas/flow_framework.errors:ParameterConflictError' - $ref: '#/components/schemas/flow_framework.errors:MaxWorkflowsLimitError' - $ref: '#/components/schemas/flow_framework.errors:WorkflowSaveError' + - $ref: '#/components/schemas/flow_framework.errors:InvalidTemplateVersionError' + - $ref: '#/components/schemas/flow_framework.errors:UnsupportedFieldUpdateError' + - $ref: '#/components/schemas/flow_framework.errors:WorkflowParsingError' flow_framework.update@404: description: Template Not Found Error content: @@ -27347,16 +27928,34 @@ components: application/json: schema: $ref: '#/components/schemas/ism._common:DeletePolicyResponse' - ism.explain_index@200: + ism.exists_policy@200: + content: + application/json: + schema: {} + ism.exists_policy@404: + content: + application/json: + schema: {} + ism.explain_policy@200: content: application/json: schema: $ref: '#/components/schemas/ism._common:ExplainIndexResponse' + ism.get_policies@200: + content: + application/json: + schema: + $ref: '#/components/schemas/ism._common:GetPoliciesResponse' ism.get_policy@200: content: application/json: schema: $ref: '#/components/schemas/ism._common:GetPolicyResponse' + ism.put_policies@200: + content: + application/json: + schema: + $ref: '#/components/schemas/ism._common:PutPolicyResponse' ism.put_policy@200: content: application/json: @@ -27367,11 +27966,21 @@ components: application/json: schema: $ref: '#/components/schemas/ism._common:PutPolicyResponse' + ism.refresh_search_analyzers@200: + content: + application/json: + schema: + $ref: '#/components/schemas/ism._common:RefreshSearchAnalyzersResponse' ism.remove_policy@200: content: application/json: schema: $ref: '#/components/schemas/ism._common:RemovePolicyResponse' + ism.retry_index@200: + content: + application/json: + schema: + $ref: '#/components/schemas/ism._common:RetryIndexResponse' knn.delete_model@200: {} knn.get_model@200: {} knn.search_models@200: {} @@ -30341,7 +30950,11 @@ components: - bulk - search _common:Routing: - type: string + oneOf: + - type: string + - type: array + items: + type: string _common:RrfRank: allOf: - $ref: '#/components/schemas/_common:RankBase' @@ -39085,15 +39698,8 @@ components: minProperties: 1 maxProperties: 1 terms: - type: object - additionalProperties: - anyOf: - - $ref: '#/components/schemas/_common.query_dsl:TermsQuery' - - type: array - items: - type: string - minProperties: 1 - maxProperties: 1 + description: Returns documents that contain one or more exact terms in a provided field. + $ref: '#/components/schemas/_common.query_dsl:TermsQueryField' terms_set: description: |- Returns documents that contain a minimum number of exact terms in a provided field. @@ -39601,19 +40207,33 @@ components: type: boolean required: - value - _common.query_dsl:TermsQuery: - anyOf: - - $ref: '#/components/schemas/_common.query_dsl:QueryBase' - - type: object - properties: - index: - $ref: '#/components/schemas/_common:IndexName' - id: - $ref: '#/components/schemas/_common:Id' - path: - $ref: '#/components/schemas/_common:Field' - routing: - $ref: '#/components/schemas/_common:Routing' + _common.query_dsl:TermsLookupField: + type: object + properties: + index: + $ref: '#/components/schemas/_common:IndexName' + id: + $ref: '#/components/schemas/_common:Id' + path: + $ref: '#/components/schemas/_common:Field' + routing: + $ref: '#/components/schemas/_common:Routing' + _common.query_dsl:TermsQueryField: + type: object + properties: + boost: + description: |- + A floating-point value that specifies the weight of this field toward the relevance score. + Values above 1.0 increase the field’s relevance. Values between 0.0 and 1.0 decrease the field’s relevance. + Default is 1.0. + type: number + format: float + additionalProperties: + oneOf: + - $ref: '#/components/schemas/_common.query_dsl:TermsLookupField' + - type: array + items: + type: string _common.query_dsl:TermsSetQuery: allOf: - $ref: '#/components/schemas/_common.query_dsl:QueryBase' @@ -39788,17 +40408,11 @@ components: type: integer format: int32 _core.bulk:CreateOperation: - allOf: - - $ref: '#/components/schemas/_core.bulk:WriteOperation' - - type: object + $ref: '#/components/schemas/_core.bulk:WriteOperation' _core.bulk:DeleteOperation: - allOf: - - $ref: '#/components/schemas/_core.bulk:OperationBase' - - type: object + $ref: '#/components/schemas/_core.bulk:OperationBase' _core.bulk:IndexOperation: - allOf: - - $ref: '#/components/schemas/_core.bulk:WriteOperation' - - type: object + $ref: '#/components/schemas/_core.bulk:WriteOperation' _core.bulk:OperationBase: type: object properties: @@ -44611,6 +45225,18 @@ components: - index - shard - to_node + cluster.reroute:Metric: + type: string + enum: + - _all + - blocks + - cluster_manager_node + - master_node + - metadata + - nodes + - routing_nodes + - routing_table + - version cluster.reroute:RerouteDecision: type: object properties: @@ -45538,6 +46164,8 @@ components: use_case: type: string description: A use case, which can be used with the Search Workflow API to find related workflows. + workflows: + type: object version: $ref: '#/components/schemas/flow_framework.common:version' minProperties: 1 @@ -45838,7 +46466,7 @@ components: application/json: type: object properties: - message: + error: type: string example: You cannot use both the 'provision_workflow' and 'update_workflow_fields' parameters in the same request. status: @@ -45876,7 +46504,7 @@ components: application/json: type: object properties: - message: + error: type: string example: This API is disabled. To enable it, set [flow_framework.enabled] to true. status: @@ -45886,7 +46514,7 @@ components: application/json: type: object properties: - message: + error: type: string example: Only the parameters [param1, param2] are permitted unless the provision parameter is set to true. status: @@ -45900,12 +46528,21 @@ components: status: type: integer description: HTTP status code for the error. + flow_framework.errors:InvalidTemplateVersionError: + content: + application/json: + type: object + properties: + error: + type: string + description: Error message when the template version is invalid or missing. + example: Unable to parse field [version] in a version object. flow_framework.errors:MaxWorkflowsLimitError: content: application/json: type: object properties: - message: + error: type: string example: Maximum workflows limit reached 50 code: @@ -45915,7 +46552,7 @@ components: application/json: type: object properties: - message: + error: type: string example: You cannot use the 'reprovision_workflow' parameter to create a new template. status: @@ -45925,7 +46562,7 @@ components: application/json: type: object properties: - message: + error: type: string example: You cannot use the 'reprovision_workflow' and 'use_case' parameters in the same request. status: @@ -45950,32 +46587,56 @@ components: type: integer description: HTTP status code for the error. example: 408 + flow_framework.errors:TemplateNameRequiredError: + type: object + properties: + error: + type: string + description: Error message when the template name is missing. flow_framework.errors:TemplateNotFoundError: content: application/json: type: object properties: - message: + error: type: string example: Failed to retrieve template (12345) from global context. code: type: integer + flow_framework.errors:UnsupportedFieldUpdateError: + content: + application/json: + type: object + properties: + error: + type: string + description: Error message when trying to update an unsupported field in a template. + example: You can not update the field [fieldName] without updating the whole template. flow_framework.errors:WorkFlowIdNullError: content: application/json: type: object properties: - message: + error: type: string example: Workflow ID can not be null status: type: integer + flow_framework.errors:WorkflowParsingError: + content: + application/json: + type: object + properties: + error: + type: string + description: Error message when workflow parsing fails. + example: Unable to parse field [workflow] in a template object. flow_framework.errors:WorkflowSaveError: content: application/json: type: object properties: - message: + error: type: string example: Failed to save workflow state status: @@ -45985,7 +46646,7 @@ components: application/json: type: object properties: - message: + error: type: string example: Failed to retrieve workflow step json. code: @@ -47629,13 +48290,6 @@ components: required: - reason - type - indices.shard_stores:ShardStoreStatus: - type: string - enum: - - all - - green - - red - - yellow indices.shard_stores:ShardStoreWrapper: type: object properties: @@ -47645,6 +48299,13 @@ components: $ref: '#/components/schemas/indices.shard_stores:ShardStore' required: - stores + indices.shard_stores:Status: + type: string + enum: + - all + - green + - red + - yellow indices.simulate_template:Overlapping: type: object properties: @@ -47755,6 +48416,27 @@ components: - primaries - total - uuid + indices.stats:Metric: + type: string + enum: + - _all + - completion + - docs + - fielddata + - flush + - get + - indexing + - merge + - query_cache + - recovery + - refresh + - request_cache + - search + - segments + - store + - suggest + - translog + - warmer indices.stats:ShardCommit: type: object properties: @@ -49070,6 +49752,8 @@ components: required: - policy_id ism._common:ChangePolicyResponse: + $ref: '#/components/schemas/ism._common:ChangeResponse' + ism._common:ChangeResponse: type: object properties: updated_indices: @@ -49151,10 +49835,17 @@ components: type: string reason: type: string + ism._common:GetPoliciesResponse: + type: object + properties: + total_policies: + type: number + policies: + type: array + items: + $ref: '#/components/schemas/ism._common:PolicyWithMetadata' ism._common:GetPolicyResponse: - allOf: - - $ref: '#/components/schemas/ism._common:Metadata' - - $ref: '#/components/schemas/ism._common:PolicyEnvelope' + $ref: '#/components/schemas/ism._common:PolicyWithMetadata' ism._common:IncludeState: type: object properties: @@ -49218,6 +49909,11 @@ components: properties: policy: $ref: '#/components/schemas/ism._common:Policy' + ism._common:PolicyWithMetadata: + type: object + allOf: + - $ref: '#/components/schemas/ism._common:Metadata' + - $ref: '#/components/schemas/ism._common:PolicyEnvelope' ism._common:PutPolicyRequest: $ref: '#/components/schemas/ism._common:PolicyEnvelope' ism._common:PutPolicyResponse: @@ -49227,8 +49923,35 @@ components: properties: policy: $ref: '#/components/schemas/ism._common:PolicyEnvelope' + ism._common:RefreshSearchAnalyzersResponse: + type: object + properties: + _shards: + $ref: '#/components/schemas/_common:ShardStatistics' + successful_refresh_details: + type: array + items: + $ref: '#/components/schemas/ism._common:RefreshSearchAnalyzersResponseDetails' + ism._common:RefreshSearchAnalyzersResponseDetails: + type: object + properties: + index: + type: string + refreshed_analyzers: + type: array + items: + type: string ism._common:RemovePolicyResponse: $ref: '#/components/schemas/ism._common:ChangePolicyResponse' + ism._common:RetryIndexRequest: + type: object + properties: + state: + type: string + required: + - state + ism._common:RetryIndexResponse: + $ref: '#/components/schemas/ism._common:ChangeResponse' ism._common:SlackCustomWebhook: type: object properties: diff --git a/src/OpenSearch.Client/ApiUrlsLookup.cs b/src/OpenSearch.Client/ApiUrlsLookup.cs index 857b727d32..01ddc0c762 100644 --- a/src/OpenSearch.Client/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/ApiUrlsLookup.cs @@ -45,42 +45,7 @@ namespace OpenSearch.Client { internal static partial class ApiUrlsLookups { - internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[]{"_bulk", "{index}/_bulk"}); - internal static ApiUrls NoNamespaceClearScroll = new ApiUrls(new[]{"_search/scroll"}); - internal static ApiUrls NoNamespaceCount = new ApiUrls(new[]{"_count", "{index}/_count"}); - internal static ApiUrls NoNamespaceCreate = new ApiUrls(new[]{"{index}/_create/{id}"}); - internal static ApiUrls NoNamespaceDelete = new ApiUrls(new[]{"{index}/_doc/{id}"}); - internal static ApiUrls NoNamespaceDeleteByQuery = new ApiUrls(new[]{"{index}/_delete_by_query"}); - internal static ApiUrls NoNamespaceDeleteByQueryRethrottle = new ApiUrls(new[]{"_delete_by_query/{task_id}/_rethrottle"}); - internal static ApiUrls NoNamespaceDeleteScript = new ApiUrls(new[]{"_scripts/{id}"}); - internal static ApiUrls NoNamespaceDocumentExists = new ApiUrls(new[]{"{index}/_doc/{id}"}); - internal static ApiUrls NoNamespaceSourceExists = new ApiUrls(new[]{"{index}/_source/{id}"}); - internal static ApiUrls NoNamespaceExplain = new ApiUrls(new[]{"{index}/_explain/{id}"}); - internal static ApiUrls NoNamespaceFieldCapabilities = new ApiUrls(new[]{"_field_caps", "{index}/_field_caps"}); - internal static ApiUrls NoNamespaceGet = new ApiUrls(new[]{"{index}/_doc/{id}"}); - internal static ApiUrls NoNamespaceGetScript = new ApiUrls(new[]{"_scripts/{id}"}); - internal static ApiUrls NoNamespaceSource = new ApiUrls(new[]{"{index}/_source/{id}"}); - internal static ApiUrls NoNamespaceIndex = new ApiUrls(new[]{"{index}/_doc/{id}", "{index}/_doc"}); ///Deprecated as of OpenSearch 2.0 - internal static ApiUrls IndicesTypeExists = new ApiUrls(new[]{"{index}/_mapping/{type}"}); - internal static ApiUrls NoNamespaceRootNodeInfo = new ApiUrls(new[]{""}); - internal static ApiUrls NoNamespaceMultiGet = new ApiUrls(new[]{"_mget", "{index}/_mget"}); - internal static ApiUrls NoNamespaceMultiSearch = new ApiUrls(new[]{"_msearch", "{index}/_msearch"}); - internal static ApiUrls NoNamespaceMultiSearchTemplate = new ApiUrls(new[]{"_msearch/template", "{index}/_msearch/template"}); - internal static ApiUrls NoNamespaceMultiTermVectors = new ApiUrls(new[]{"_mtermvectors", "{index}/_mtermvectors"}); - internal static ApiUrls NoNamespacePing = new ApiUrls(new[]{""}); - internal static ApiUrls NoNamespacePutScript = new ApiUrls(new[]{"_scripts/{id}", "_scripts/{id}/{context}"}); - internal static ApiUrls NoNamespaceReindexOnServer = new ApiUrls(new[]{"_reindex"}); - internal static ApiUrls NoNamespaceReindexRethrottle = new ApiUrls(new[]{"_reindex/{task_id}/_rethrottle"}); - internal static ApiUrls NoNamespaceRenderSearchTemplate = new ApiUrls(new[]{"_render/template", "_render/template/{id}"}); - internal static ApiUrls NoNamespaceExecutePainlessScript = new ApiUrls(new[]{"_scripts/painless/_execute"}); - internal static ApiUrls NoNamespaceScroll = new ApiUrls(new[]{"_search/scroll"}); - internal static ApiUrls NoNamespaceSearch = new ApiUrls(new[]{"_search", "{index}/_search"}); - internal static ApiUrls NoNamespaceSearchShards = new ApiUrls(new[]{"_search_shards", "{index}/_search_shards"}); - internal static ApiUrls NoNamespaceSearchTemplate = new ApiUrls(new[]{"_search/template", "{index}/_search/template"}); - internal static ApiUrls NoNamespaceTermVectors = new ApiUrls(new[]{"{index}/_termvectors/{id}", "{index}/_termvectors"}); - internal static ApiUrls NoNamespaceUpdate = new ApiUrls(new[]{"{index}/_update/{id}"}); - internal static ApiUrls NoNamespaceUpdateByQuery = new ApiUrls(new[]{"{index}/_update_by_query"}); - internal static ApiUrls NoNamespaceUpdateByQueryRethrottle = new ApiUrls(new[]{"_update_by_query/{task_id}/_rethrottle"}); + internal static ApiUrls IndicesTypeExists = new(["{index}/_mapping/{type}"]); } } diff --git a/src/OpenSearch.Client/Descriptors.NoNamespace.cs b/src/OpenSearch.Client/Descriptors.NoNamespace.cs deleted file mode 100644 index e9f20b864a..0000000000 --- a/src/OpenSearch.Client/Descriptors.NoNamespace.cs +++ /dev/null @@ -1,1720 +0,0 @@ -/* 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(Slices 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(Slices 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(Slices 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); - } -} diff --git a/src/OpenSearch.Client/Document/Multiple/DeleteByQuery/DeleteByQueryRequest.cs b/src/OpenSearch.Client/Document/Multiple/DeleteByQuery/DeleteByQueryRequest.cs index 9c9fe23dbd..64b0c25046 100644 --- a/src/OpenSearch.Client/Document/Multiple/DeleteByQuery/DeleteByQueryRequest.cs +++ b/src/OpenSearch.Client/Document/Multiple/DeleteByQuery/DeleteByQueryRequest.cs @@ -72,6 +72,13 @@ public partial class DeleteByQueryRequest /// public long? MaximumDocuments { get; set; } + + ///The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. + public Slices Slices + { + get => Q("slices"); + set => Q("slices", value); + } } /// @@ -106,5 +113,8 @@ public DeleteByQueryDescriptor Slice(Func public DeleteByQueryDescriptor MaximumDocuments(long? maximumDocuments) => Assign(maximumDocuments, (a, v) => a.MaximumDocuments = v); + + ///The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. + public DeleteByQueryDescriptor Slices(Slices slices) => Qs("slices", slices); } } diff --git a/src/OpenSearch.Client/Document/Multiple/ReindexOnServer/ReindexOnServerRequest.cs b/src/OpenSearch.Client/Document/Multiple/ReindexOnServer/ReindexOnServerRequest.cs index 48c9fe3bdb..66e6f36262 100644 --- a/src/OpenSearch.Client/Document/Multiple/ReindexOnServer/ReindexOnServerRequest.cs +++ b/src/OpenSearch.Client/Document/Multiple/ReindexOnServer/ReindexOnServerRequest.cs @@ -92,6 +92,13 @@ public partial class ReindexOnServerRequest /// public IReindexSource Source { get; set; } + + ///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 Slices Slices + { + get => Q("slices"); + set => Q("slices", value); + } } public partial class ReindexOnServerDescriptor @@ -123,5 +130,8 @@ public ReindexOnServerDescriptor Script(Func scriptSe /// public ReindexOnServerDescriptor MaximumDocuments(long? maximumDocuments) => Assign(maximumDocuments, (a, v) => a.MaximumDocuments = v); + + ///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(Slices slices) => Qs("slices", slices); } } diff --git a/src/OpenSearch.Client/Document/Multiple/UpdateByQuery/UpdateByQueryRequest.cs b/src/OpenSearch.Client/Document/Multiple/UpdateByQuery/UpdateByQueryRequest.cs index 5e68b00a92..89039dc092 100644 --- a/src/OpenSearch.Client/Document/Multiple/UpdateByQuery/UpdateByQueryRequest.cs +++ b/src/OpenSearch.Client/Document/Multiple/UpdateByQuery/UpdateByQueryRequest.cs @@ -74,6 +74,13 @@ public partial class UpdateByQueryRequest public IScript Script { get; set; } /// public long? MaximumDocuments { get; set; } + + ///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 Slices Slices + { + get => Q("slices"); + set => Q("slices", value); + } } // ReSharper disable once UnusedTypeParameter @@ -112,5 +119,8 @@ public UpdateByQueryDescriptor MaximumDocuments(long? maximumDocument /// public UpdateByQueryDescriptor Slice(Func, ISlicedScroll> selector) => Assign(selector, (a, v) => a.Slice = v?.Invoke(new SlicedScrollDescriptor())); + + ///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(Slices slices) => Qs("slices", slices); } } diff --git a/src/OpenSearch.Client/IOpenSearchClient.Generated.cs b/src/OpenSearch.Client/IOpenSearchClient.Generated.cs deleted file mode 100644 index 1d895c73e6..0000000000 --- a/src/OpenSearch.Client/IOpenSearchClient.Generated.cs +++ /dev/null @@ -1,1004 +0,0 @@ -/* 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.Threading; -using System.Threading.Tasks; -using System.Linq; -using OpenSearch.Client.Specification.CatApi; -using OpenSearch.Client.Specification.ClusterApi; -using OpenSearch.Client.Specification.DanglingIndicesApi; -using OpenSearch.Client.Specification.IndicesApi; -using OpenSearch.Client.Specification.IngestApi; -using OpenSearch.Client.Specification.NodesApi; -using OpenSearch.Client.Specification.SnapshotApi; -using OpenSearch.Client.Specification.TasksApi; -using OpenSearch.Client; - -namespace OpenSearch.Client -{ - /// - ///OpenSearch high level client - /// - public partial interface IOpenSearchClient - { - /// - /// POST request to the bulk API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/bulk/ - /// - BulkResponse Bulk(Func selector); - /// - /// POST request to the bulk API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/bulk/ - /// - Task BulkAsync(Func selector, CancellationToken ct = default); - /// - /// POST request to the bulk API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/bulk/ - /// - BulkResponse Bulk(IBulkRequest request); - /// - /// POST request to the bulk API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/bulk/ - /// - Task BulkAsync(IBulkRequest request, CancellationToken ct = default); - /// - /// DELETE request to the clear_scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/scroll/ - /// - ClearScrollResponse ClearScroll(Func selector = null); - /// - /// DELETE request to the clear_scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/scroll/ - /// - Task ClearScrollAsync(Func selector = null, CancellationToken ct = default); - /// - /// DELETE request to the clear_scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/scroll/ - /// - ClearScrollResponse ClearScroll(IClearScrollRequest request); - /// - /// DELETE request to the clear_scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/scroll/ - /// - Task ClearScrollAsync(IClearScrollRequest request, CancellationToken ct = default); - /// - /// POST request to the count API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/count/ - /// - CountResponse Count(Func, ICountRequest> selector = null) - where TDocument : class; - /// - /// POST request to the count API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/count/ - /// - Task CountAsync(Func, ICountRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the count API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/count/ - /// - CountResponse Count(ICountRequest request); - /// - /// POST request to the count API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/count/ - /// - Task CountAsync(ICountRequest request, CancellationToken ct = default); - /// - /// PUT request to the create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - CreateResponse Create(TDocument document, Func, ICreateRequest> selector) - where TDocument : class; - /// - /// PUT request to the create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - Task CreateAsync(TDocument document, Func, ICreateRequest> selector, CancellationToken ct = default) - where TDocument : class; - /// - /// PUT request to the create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - CreateResponse Create(ICreateRequest request) - where TDocument : class; - /// - /// PUT request to the create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - Task CreateAsync(ICreateRequest request, CancellationToken ct = default) - where TDocument : class; - /// - /// DELETE request to the delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-document/ - /// - DeleteResponse Delete(DocumentPath id, Func, IDeleteRequest> selector = null) - where TDocument : class; - /// - /// DELETE request to the delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-document/ - /// - Task DeleteAsync(DocumentPath id, Func, IDeleteRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// DELETE request to the delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-document/ - /// - DeleteResponse Delete(IDeleteRequest request); - /// - /// DELETE request to the delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-document/ - /// - Task DeleteAsync(IDeleteRequest request, CancellationToken ct = default); - /// - /// POST request to the delete_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - DeleteByQueryResponse DeleteByQuery(Func, IDeleteByQueryRequest> selector) - where TDocument : class; - /// - /// POST request to the delete_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - Task DeleteByQueryAsync(Func, IDeleteByQueryRequest> selector, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the delete_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - DeleteByQueryResponse DeleteByQuery(IDeleteByQueryRequest request); - /// - /// POST request to the delete_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - Task DeleteByQueryAsync(IDeleteByQueryRequest request, CancellationToken ct = default); - /// - /// POST request to the delete_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - ListTasksResponse DeleteByQueryRethrottle(TaskId taskId, Func selector = null); - /// - /// POST request to the delete_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - Task DeleteByQueryRethrottleAsync(TaskId taskId, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the delete_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - ListTasksResponse DeleteByQueryRethrottle(IDeleteByQueryRethrottleRequest request); - /// - /// POST request to the delete_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - Task DeleteByQueryRethrottleAsync(IDeleteByQueryRethrottleRequest request, CancellationToken ct = default); - /// - /// DELETE request to the delete_script API, read more about this API online: - /// - /// - /// - DeleteScriptResponse DeleteScript(Id id, Func selector = null); - /// - /// DELETE request to the delete_script API, read more about this API online: - /// - /// - /// - Task DeleteScriptAsync(Id id, Func selector = null, CancellationToken ct = default); - /// - /// DELETE request to the delete_script API, read more about this API online: - /// - /// - /// - DeleteScriptResponse DeleteScript(IDeleteScriptRequest request); - /// - /// DELETE request to the delete_script API, read more about this API online: - /// - /// - /// - Task DeleteScriptAsync(IDeleteScriptRequest request, CancellationToken ct = default); - /// - /// HEAD request to the exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - ExistsResponse DocumentExists(DocumentPath id, Func, IDocumentExistsRequest> selector = null) - where TDocument : class; - /// - /// HEAD request to the exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - Task DocumentExistsAsync(DocumentPath id, Func, IDocumentExistsRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// HEAD request to the exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - ExistsResponse DocumentExists(IDocumentExistsRequest request); - /// - /// HEAD request to the exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - Task DocumentExistsAsync(IDocumentExistsRequest request, CancellationToken ct = default); - /// - /// HEAD request to the exists_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - ExistsResponse SourceExists(DocumentPath id, Func, ISourceExistsRequest> selector = null) - where TDocument : class; - /// - /// HEAD request to the exists_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - Task SourceExistsAsync(DocumentPath id, Func, ISourceExistsRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// HEAD request to the exists_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - ExistsResponse SourceExists(ISourceExistsRequest request); - /// - /// HEAD request to the exists_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - Task SourceExistsAsync(ISourceExistsRequest request, CancellationToken ct = default); - /// - /// POST request to the explain API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/explain/ - /// - ExplainResponse Explain(DocumentPath id, Func, IExplainRequest> selector = null) - where TDocument : class; - /// - /// POST request to the explain API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/explain/ - /// - Task> ExplainAsync(DocumentPath id, Func, IExplainRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the explain API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/explain/ - /// - ExplainResponse Explain(IExplainRequest request) - where TDocument : class; - /// - /// POST request to the explain API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/explain/ - /// - Task> ExplainAsync(IExplainRequest request, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the field_caps API, read more about this API online: - /// - /// - /// - FieldCapabilitiesResponse FieldCapabilities(Indices index = null, Func selector = null); - /// - /// POST request to the field_caps API, read more about this API online: - /// - /// - /// - Task FieldCapabilitiesAsync(Indices index = null, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the field_caps API, read more about this API online: - /// - /// - /// - FieldCapabilitiesResponse FieldCapabilities(IFieldCapabilitiesRequest request); - /// - /// POST request to the field_caps API, read more about this API online: - /// - /// - /// - Task FieldCapabilitiesAsync(IFieldCapabilitiesRequest request, CancellationToken ct = default); - /// - /// GET request to the get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - GetResponse Get(DocumentPath id, Func, IGetRequest> selector = null) - where TDocument : class; - /// - /// GET request to the get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - Task> GetAsync(DocumentPath id, Func, IGetRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// GET request to the get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - GetResponse Get(IGetRequest request) - where TDocument : class; - /// - /// GET request to the get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - Task> GetAsync(IGetRequest request, CancellationToken ct = default) - where TDocument : class; - /// - /// GET request to the get_script API, read more about this API online: - /// - /// - /// - GetScriptResponse GetScript(Id id, Func selector = null); - /// - /// GET request to the get_script API, read more about this API online: - /// - /// - /// - Task GetScriptAsync(Id id, Func selector = null, CancellationToken ct = default); - /// - /// GET request to the get_script API, read more about this API online: - /// - /// - /// - GetScriptResponse GetScript(IGetScriptRequest request); - /// - /// GET request to the get_script API, read more about this API online: - /// - /// - /// - Task GetScriptAsync(IGetScriptRequest request, CancellationToken ct = default); - /// - /// GET request to the get_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - SourceResponse Source(DocumentPath id, Func, ISourceRequest> selector = null) - where TDocument : class; - /// - /// GET request to the get_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - Task> SourceAsync(DocumentPath id, Func, ISourceRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// GET request to the get_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - SourceResponse Source(ISourceRequest request) - where TDocument : class; - /// - /// GET request to the get_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - Task> SourceAsync(ISourceRequest request, CancellationToken ct = default) - where TDocument : class; - /// - /// PUT request to the index API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - IndexResponse Index(TDocument document, Func, IIndexRequest> selector) - where TDocument : class; - /// - /// PUT request to the index API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - Task IndexAsync(TDocument document, Func, IIndexRequest> selector, CancellationToken ct = default) - where TDocument : class; - /// - /// PUT request to the index API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - IndexResponse Index(IIndexRequest request) - where TDocument : class; - /// - /// PUT request to the index API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - Task IndexAsync(IIndexRequest request, CancellationToken ct = default) - where TDocument : class; - /// - /// GET request to the info API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - RootNodeInfoResponse RootNodeInfo(Func selector = null); - /// - /// GET request to the info API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - Task RootNodeInfoAsync(Func selector = null, CancellationToken ct = default); - /// - /// GET request to the info API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - RootNodeInfoResponse RootNodeInfo(IRootNodeInfoRequest request); - /// - /// GET request to the info API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - Task RootNodeInfoAsync(IRootNodeInfoRequest request, CancellationToken ct = default); - /// - /// POST request to the mget API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/ - /// - MultiGetResponse MultiGet(Func selector = null); - /// - /// POST request to the mget API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/ - /// - Task MultiGetAsync(Func selector = null, CancellationToken ct = default); - /// - /// POST request to the mget API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/ - /// - MultiGetResponse MultiGet(IMultiGetRequest request); - /// - /// POST request to the mget API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/ - /// - Task MultiGetAsync(IMultiGetRequest request, CancellationToken ct = default); - /// - /// POST request to the msearch API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - MultiSearchResponse MultiSearch(Indices index = null, Func selector = null); - /// - /// POST request to the msearch API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - Task MultiSearchAsync(Indices index = null, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the msearch API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - MultiSearchResponse MultiSearch(IMultiSearchRequest request); - /// - /// POST request to the msearch API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - Task MultiSearchAsync(IMultiSearchRequest request, CancellationToken ct = default); - /// - /// POST request to the msearch_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - MultiSearchResponse MultiSearchTemplate(Indices index = null, Func selector = null); - /// - /// POST request to the msearch_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - Task MultiSearchTemplateAsync(Indices index = null, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the msearch_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - MultiSearchResponse MultiSearchTemplate(IMultiSearchTemplateRequest request); - /// - /// POST request to the msearch_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - Task MultiSearchTemplateAsync(IMultiSearchTemplateRequest request, CancellationToken ct = default); - /// - /// POST request to the mtermvectors API, read more about this API online: - /// - /// - /// - MultiTermVectorsResponse MultiTermVectors(Func selector = null); - /// - /// POST request to the mtermvectors API, read more about this API online: - /// - /// - /// - Task MultiTermVectorsAsync(Func selector = null, CancellationToken ct = default); - /// - /// POST request to the mtermvectors API, read more about this API online: - /// - /// - /// - MultiTermVectorsResponse MultiTermVectors(IMultiTermVectorsRequest request); - /// - /// POST request to the mtermvectors API, read more about this API online: - /// - /// - /// - Task MultiTermVectorsAsync(IMultiTermVectorsRequest request, CancellationToken ct = default); - /// - /// HEAD request to the ping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - PingResponse Ping(Func selector = null); - /// - /// HEAD request to the ping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - Task PingAsync(Func selector = null, CancellationToken ct = default); - /// - /// HEAD request to the ping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - PingResponse Ping(IPingRequest request); - /// - /// HEAD request to the ping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - Task PingAsync(IPingRequest request, CancellationToken ct = default); - /// - /// PUT request to the put_script API, read more about this API online: - /// - /// - /// - PutScriptResponse PutScript(Id id, Func selector); - /// - /// PUT request to the put_script API, read more about this API online: - /// - /// - /// - Task PutScriptAsync(Id id, Func selector, CancellationToken ct = default); - /// - /// PUT request to the put_script API, read more about this API online: - /// - /// - /// - PutScriptResponse PutScript(IPutScriptRequest request); - /// - /// PUT request to the put_script API, read more about this API online: - /// - /// - /// - Task PutScriptAsync(IPutScriptRequest request, CancellationToken ct = default); - /// - /// POST request to the reindex API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - ReindexOnServerResponse ReindexOnServer(Func selector); - /// - /// POST request to the reindex API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - Task ReindexOnServerAsync(Func selector, CancellationToken ct = default); - /// - /// POST request to the reindex API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - ReindexOnServerResponse ReindexOnServer(IReindexOnServerRequest request); - /// - /// POST request to the reindex API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - Task ReindexOnServerAsync(IReindexOnServerRequest request, CancellationToken ct = default); - /// - /// POST request to the reindex_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - ReindexRethrottleResponse ReindexRethrottle(TaskId taskId, Func selector = null); - /// - /// POST request to the reindex_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - Task ReindexRethrottleAsync(TaskId taskId, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the reindex_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - ReindexRethrottleResponse ReindexRethrottle(IReindexRethrottleRequest request); - /// - /// POST request to the reindex_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - Task ReindexRethrottleAsync(IReindexRethrottleRequest request, CancellationToken ct = default); - /// - /// POST request to the render_search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - RenderSearchTemplateResponse RenderSearchTemplate(Func selector = null); - /// - /// POST request to the render_search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - Task RenderSearchTemplateAsync(Func selector = null, CancellationToken ct = default); - /// - /// POST request to the render_search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - RenderSearchTemplateResponse RenderSearchTemplate(IRenderSearchTemplateRequest request); - /// - /// POST request to the render_search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - Task RenderSearchTemplateAsync(IRenderSearchTemplateRequest request, CancellationToken ct = default); - /// - /// POST request to the scripts_painless_execute API, read more about this API online: - /// - /// - /// - ExecutePainlessScriptResponse ExecutePainlessScript(Func selector = null); - /// - /// POST request to the scripts_painless_execute API, read more about this API online: - /// - /// - /// - Task> ExecutePainlessScriptAsync(Func selector = null, CancellationToken ct = default); - /// - /// POST request to the scripts_painless_execute API, read more about this API online: - /// - /// - /// - ExecutePainlessScriptResponse ExecutePainlessScript(IExecutePainlessScriptRequest request); - /// - /// POST request to the scripts_painless_execute API, read more about this API online: - /// - /// - /// - Task> ExecutePainlessScriptAsync(IExecutePainlessScriptRequest request, CancellationToken ct = default); - /// - /// POST request to the scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body - /// - ISearchResponse Scroll(Time scroll, string scrollId, Func, IScrollRequest> selector = null) - where TInferDocument : class where TDocument : class; - /// - /// POST request to the scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body - /// - Task> ScrollAsync(Time scroll, string scrollId, Func, IScrollRequest> selector = null, CancellationToken ct = default) - where TInferDocument : class where TDocument : class; - /// - /// POST request to the scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body - /// - ISearchResponse Scroll(Time scroll, string scrollId, Func, IScrollRequest> selector = null) - where TDocument : class; - /// - /// POST request to the scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body - /// - Task> ScrollAsync(Time scroll, string scrollId, Func, IScrollRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body - /// - ISearchResponse Scroll(IScrollRequest request) - where TDocument : class; - /// - /// POST request to the scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body - /// - Task> ScrollAsync(IScrollRequest request, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the search API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/ - /// - ISearchResponse Search(Func, ISearchRequest> selector = null) - where TInferDocument : class where TDocument : class; - /// - /// POST request to the search API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/ - /// - Task> SearchAsync(Func, ISearchRequest> selector = null, CancellationToken ct = default) - where TInferDocument : class where TDocument : class; - /// - /// POST request to the search API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/ - /// - ISearchResponse Search(Func, ISearchRequest> selector = null) - where TDocument : class; - /// - /// POST request to the search API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/ - /// - Task> SearchAsync(Func, ISearchRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the search API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/ - /// - ISearchResponse Search(ISearchRequest request) - where TDocument : class; - /// - /// POST request to the search API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/ - /// - Task> SearchAsync(ISearchRequest request, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the search_shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/security-plugin/access-control/cross-cluster-search/ - /// - SearchShardsResponse SearchShards(Func, ISearchShardsRequest> selector = null) - where TDocument : class; - /// - /// POST request to the search_shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/security-plugin/access-control/cross-cluster-search/ - /// - Task SearchShardsAsync(Func, ISearchShardsRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the search_shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/security-plugin/access-control/cross-cluster-search/ - /// - SearchShardsResponse SearchShards(ISearchShardsRequest request); - /// - /// POST request to the search_shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/security-plugin/access-control/cross-cluster-search/ - /// - Task SearchShardsAsync(ISearchShardsRequest request, CancellationToken ct = default); - /// - /// POST request to the search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - ISearchResponse SearchTemplate(Func, ISearchTemplateRequest> selector = null) - where TDocument : class; - /// - /// POST request to the search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - Task> SearchTemplateAsync(Func, ISearchTemplateRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - ISearchResponse SearchTemplate(ISearchTemplateRequest request) - where TDocument : class; - /// - /// POST request to the search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - Task> SearchTemplateAsync(ISearchTemplateRequest request, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the termvectors API, read more about this API online: - /// - /// - /// - TermVectorsResponse TermVectors(Func, ITermVectorsRequest> selector = null) - where TDocument : class; - /// - /// POST request to the termvectors API, read more about this API online: - /// - /// - /// - Task TermVectorsAsync(Func, ITermVectorsRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the termvectors API, read more about this API online: - /// - /// - /// - TermVectorsResponse TermVectors(ITermVectorsRequest request) - where TDocument : class; - /// - /// POST request to the termvectors API, read more about this API online: - /// - /// - /// - Task TermVectorsAsync(ITermVectorsRequest request, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the update API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ - /// - UpdateResponse Update(DocumentPath id, Func, IUpdateRequest> selector) - where TDocument : class where TPartialDocument : class; - /// - /// POST request to the update API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ - /// - Task> UpdateAsync(DocumentPath id, Func, IUpdateRequest> selector, CancellationToken ct = default) - where TDocument : class where TPartialDocument : class; - /// - /// POST request to the update API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ - /// - UpdateResponse Update(DocumentPath id, Func, IUpdateRequest> selector) - where TDocument : class; - /// - /// POST request to the update API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ - /// - Task> UpdateAsync(DocumentPath id, Func, IUpdateRequest> selector, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the update API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ - /// - UpdateResponse Update(IUpdateRequest request) - where TDocument : class where TPartialDocument : class; - /// - /// POST request to the update API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ - /// - Task> UpdateAsync(IUpdateRequest request, CancellationToken ct = default) - where TDocument : class where TPartialDocument : class; - /// - /// POST request to the update_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - UpdateByQueryResponse UpdateByQuery(Func, IUpdateByQueryRequest> selector = null) - where TDocument : class; - /// - /// POST request to the update_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - Task UpdateByQueryAsync(Func, IUpdateByQueryRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the update_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - UpdateByQueryResponse UpdateByQuery(IUpdateByQueryRequest request); - /// - /// POST request to the update_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - Task UpdateByQueryAsync(IUpdateByQueryRequest request, CancellationToken ct = default); - /// - /// POST request to the update_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - ListTasksResponse UpdateByQueryRethrottle(TaskId taskId, Func selector = null); - /// - /// POST request to the update_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - Task UpdateByQueryRethrottleAsync(TaskId taskId, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the update_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - ListTasksResponse UpdateByQueryRethrottle(IUpdateByQueryRethrottleRequest request); - /// - /// POST request to the update_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - Task UpdateByQueryRethrottleAsync(IUpdateByQueryRethrottleRequest request, CancellationToken ct = default); - } -} diff --git a/src/OpenSearch.Client/OpenSearchClient.NoNamespace.cs b/src/OpenSearch.Client/OpenSearchClient.NoNamespace.cs deleted file mode 100644 index 6a7caf1e77..0000000000 --- a/src/OpenSearch.Client/OpenSearchClient.NoNamespace.cs +++ /dev/null @@ -1,1003 +0,0 @@ -/* 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.Threading; -using System.Threading.Tasks; -using OpenSearch.Client.Specification.CatApi; -using OpenSearch.Client.Specification.ClusterApi; -using OpenSearch.Client.Specification.DanglingIndicesApi; -using OpenSearch.Client.Specification.IndicesApi; -using OpenSearch.Client.Specification.IngestApi; -using OpenSearch.Client.Specification.NodesApi; -using OpenSearch.Client.Specification.SnapshotApi; -using OpenSearch.Client.Specification.TasksApi; -using OpenSearch.Client; - -// ReSharper disable RedundantTypeArgumentsOfMethod -namespace OpenSearch.Client -{ - /// - ///OpenSearch high level client - /// - public partial class OpenSearchClient : IOpenSearchClient - { - /// - /// POST request to the bulk API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/bulk/ - /// - public BulkResponse Bulk(Func selector) => Bulk(selector.InvokeOrDefault(new BulkDescriptor())); - /// - /// POST request to the bulk API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/bulk/ - /// - public Task BulkAsync(Func selector, CancellationToken ct = default) => BulkAsync(selector.InvokeOrDefault(new BulkDescriptor()), ct); - /// - /// POST request to the bulk API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/bulk/ - /// - public BulkResponse Bulk(IBulkRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the bulk API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/bulk/ - /// - public Task BulkAsync(IBulkRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// DELETE request to the clear_scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/scroll/ - /// - public ClearScrollResponse ClearScroll(Func selector = null) => ClearScroll(selector.InvokeOrDefault(new ClearScrollDescriptor())); - /// - /// DELETE request to the clear_scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/scroll/ - /// - public Task ClearScrollAsync(Func selector = null, CancellationToken ct = default) => ClearScrollAsync(selector.InvokeOrDefault(new ClearScrollDescriptor()), ct); - /// - /// DELETE request to the clear_scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/scroll/ - /// - public ClearScrollResponse ClearScroll(IClearScrollRequest request) => DoRequest(request, request.RequestParameters); - /// - /// DELETE request to the clear_scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/scroll/ - /// - public Task ClearScrollAsync(IClearScrollRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the count API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/count/ - /// - public CountResponse Count(Func, ICountRequest> selector = null) - where TDocument : class => Count(selector.InvokeOrDefault(new CountDescriptor())); - /// - /// POST request to the count API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/count/ - /// - public Task CountAsync(Func, ICountRequest> selector = null, CancellationToken ct = default) - where TDocument : class => CountAsync(selector.InvokeOrDefault(new CountDescriptor()), ct); - /// - /// POST request to the count API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/count/ - /// - public CountResponse Count(ICountRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the count API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/count/ - /// - public Task CountAsync(ICountRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// PUT request to the create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - public CreateResponse Create(TDocument document, Func, ICreateRequest> selector) - where TDocument : class => Create(selector.InvokeOrDefault(new CreateDescriptor(documentWithId: document))); - /// - /// PUT request to the create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - public Task CreateAsync(TDocument document, Func, ICreateRequest> selector, CancellationToken ct = default) - where TDocument : class => CreateAsync(selector.InvokeOrDefault(new CreateDescriptor(documentWithId: document)), ct); - /// - /// PUT request to the create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - public CreateResponse Create(ICreateRequest request) - where TDocument : class => DoRequest, CreateResponse>(request, request.RequestParameters); - /// - /// PUT request to the create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - public Task CreateAsync(ICreateRequest request, CancellationToken ct = default) - where TDocument : class => DoRequestAsync, CreateResponse>(request, request.RequestParameters, ct); - /// - /// DELETE request to the delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-document/ - /// - public DeleteResponse Delete(DocumentPath id, Func, IDeleteRequest> selector = null) - where TDocument : class => Delete(selector.InvokeOrDefault(new DeleteDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id))); - /// - /// DELETE request to the delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-document/ - /// - public Task DeleteAsync(DocumentPath id, Func, IDeleteRequest> selector = null, CancellationToken ct = default) - where TDocument : class => DeleteAsync(selector.InvokeOrDefault(new DeleteDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id)), ct); - /// - /// DELETE request to the delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-document/ - /// - public DeleteResponse Delete(IDeleteRequest request) => DoRequest(request, request.RequestParameters); - /// - /// DELETE request to the delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-document/ - /// - public Task DeleteAsync(IDeleteRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the delete_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - public DeleteByQueryResponse DeleteByQuery(Func, IDeleteByQueryRequest> selector) - where TDocument : class => DeleteByQuery(selector.InvokeOrDefault(new DeleteByQueryDescriptor())); - /// - /// POST request to the delete_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - public Task DeleteByQueryAsync(Func, IDeleteByQueryRequest> selector, CancellationToken ct = default) - where TDocument : class => DeleteByQueryAsync(selector.InvokeOrDefault(new DeleteByQueryDescriptor()), ct); - /// - /// POST request to the delete_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - public DeleteByQueryResponse DeleteByQuery(IDeleteByQueryRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the delete_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - public Task DeleteByQueryAsync(IDeleteByQueryRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the delete_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - public ListTasksResponse DeleteByQueryRethrottle(TaskId taskId, Func selector = null) => DeleteByQueryRethrottle(selector.InvokeOrDefault(new DeleteByQueryRethrottleDescriptor(taskId: taskId))); - /// - /// POST request to the delete_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - public Task DeleteByQueryRethrottleAsync(TaskId taskId, Func selector = null, CancellationToken ct = default) => DeleteByQueryRethrottleAsync(selector.InvokeOrDefault(new DeleteByQueryRethrottleDescriptor(taskId: taskId)), ct); - /// - /// POST request to the delete_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - public ListTasksResponse DeleteByQueryRethrottle(IDeleteByQueryRethrottleRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the delete_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/ - /// - public Task DeleteByQueryRethrottleAsync(IDeleteByQueryRethrottleRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// DELETE request to the delete_script API, read more about this API online: - /// - /// - /// - public DeleteScriptResponse DeleteScript(Id id, Func selector = null) => DeleteScript(selector.InvokeOrDefault(new DeleteScriptDescriptor(id: id))); - /// - /// DELETE request to the delete_script API, read more about this API online: - /// - /// - /// - public Task DeleteScriptAsync(Id id, Func selector = null, CancellationToken ct = default) => DeleteScriptAsync(selector.InvokeOrDefault(new DeleteScriptDescriptor(id: id)), ct); - /// - /// DELETE request to the delete_script API, read more about this API online: - /// - /// - /// - public DeleteScriptResponse DeleteScript(IDeleteScriptRequest request) => DoRequest(request, request.RequestParameters); - /// - /// DELETE request to the delete_script API, read more about this API online: - /// - /// - /// - public Task DeleteScriptAsync(IDeleteScriptRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// HEAD request to the exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public ExistsResponse DocumentExists(DocumentPath id, Func, IDocumentExistsRequest> selector = null) - where TDocument : class => DocumentExists(selector.InvokeOrDefault(new DocumentExistsDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id))); - /// - /// HEAD request to the exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public Task DocumentExistsAsync(DocumentPath id, Func, IDocumentExistsRequest> selector = null, CancellationToken ct = default) - where TDocument : class => DocumentExistsAsync(selector.InvokeOrDefault(new DocumentExistsDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id)), ct); - /// - /// HEAD request to the exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public ExistsResponse DocumentExists(IDocumentExistsRequest request) => DoRequest(request, request.RequestParameters); - /// - /// HEAD request to the exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public Task DocumentExistsAsync(IDocumentExistsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// HEAD request to the exists_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public ExistsResponse SourceExists(DocumentPath id, Func, ISourceExistsRequest> selector = null) - where TDocument : class => SourceExists(selector.InvokeOrDefault(new SourceExistsDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id))); - /// - /// HEAD request to the exists_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public Task SourceExistsAsync(DocumentPath id, Func, ISourceExistsRequest> selector = null, CancellationToken ct = default) - where TDocument : class => SourceExistsAsync(selector.InvokeOrDefault(new SourceExistsDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id)), ct); - /// - /// HEAD request to the exists_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public ExistsResponse SourceExists(ISourceExistsRequest request) => DoRequest(request, request.RequestParameters); - /// - /// HEAD request to the exists_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public Task SourceExistsAsync(ISourceExistsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the explain API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/explain/ - /// - public ExplainResponse Explain(DocumentPath id, Func, IExplainRequest> selector = null) - where TDocument : class => Explain(selector.InvokeOrDefault(new ExplainDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id))); - /// - /// POST request to the explain API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/explain/ - /// - public Task> ExplainAsync(DocumentPath id, Func, IExplainRequest> selector = null, CancellationToken ct = default) - where TDocument : class => ExplainAsync(selector.InvokeOrDefault(new ExplainDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id)), ct); - /// - /// POST request to the explain API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/explain/ - /// - public ExplainResponse Explain(IExplainRequest request) - where TDocument : class => DoRequest>(request, request.RequestParameters); - /// - /// POST request to the explain API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/explain/ - /// - public Task> ExplainAsync(IExplainRequest request, CancellationToken ct = default) - where TDocument : class => DoRequestAsync>(request, request.RequestParameters, ct); - /// - /// POST request to the field_caps API, read more about this API online: - /// - /// - /// - public FieldCapabilitiesResponse FieldCapabilities(Indices index = null, Func selector = null) => FieldCapabilities(selector.InvokeOrDefault(new FieldCapabilitiesDescriptor().Index(index: index))); - /// - /// POST request to the field_caps API, read more about this API online: - /// - /// - /// - public Task FieldCapabilitiesAsync(Indices index = null, Func selector = null, CancellationToken ct = default) => FieldCapabilitiesAsync(selector.InvokeOrDefault(new FieldCapabilitiesDescriptor().Index(index: index)), ct); - /// - /// POST request to the field_caps API, read more about this API online: - /// - /// - /// - public FieldCapabilitiesResponse FieldCapabilities(IFieldCapabilitiesRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the field_caps API, read more about this API online: - /// - /// - /// - public Task FieldCapabilitiesAsync(IFieldCapabilitiesRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// GET request to the get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public GetResponse Get(DocumentPath id, Func, IGetRequest> selector = null) - where TDocument : class => Get(selector.InvokeOrDefault(new GetDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id))); - /// - /// GET request to the get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public Task> GetAsync(DocumentPath id, Func, IGetRequest> selector = null, CancellationToken ct = default) - where TDocument : class => GetAsync(selector.InvokeOrDefault(new GetDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id)), ct); - /// - /// GET request to the get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public GetResponse Get(IGetRequest request) - where TDocument : class => DoRequest>(request, request.RequestParameters); - /// - /// GET request to the get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public Task> GetAsync(IGetRequest request, CancellationToken ct = default) - where TDocument : class => DoRequestAsync>(request, request.RequestParameters, ct); - /// - /// GET request to the get_script API, read more about this API online: - /// - /// - /// - public GetScriptResponse GetScript(Id id, Func selector = null) => GetScript(selector.InvokeOrDefault(new GetScriptDescriptor(id: id))); - /// - /// GET request to the get_script API, read more about this API online: - /// - /// - /// - public Task GetScriptAsync(Id id, Func selector = null, CancellationToken ct = default) => GetScriptAsync(selector.InvokeOrDefault(new GetScriptDescriptor(id: id)), ct); - /// - /// GET request to the get_script API, read more about this API online: - /// - /// - /// - public GetScriptResponse GetScript(IGetScriptRequest request) => DoRequest(request, request.RequestParameters); - /// - /// GET request to the get_script API, read more about this API online: - /// - /// - /// - public Task GetScriptAsync(IGetScriptRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// GET request to the get_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public SourceResponse Source(DocumentPath id, Func, ISourceRequest> selector = null) - where TDocument : class => Source(selector.InvokeOrDefault(new SourceDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id))); - /// - /// GET request to the get_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public Task> SourceAsync(DocumentPath id, Func, ISourceRequest> selector = null, CancellationToken ct = default) - where TDocument : class => SourceAsync(selector.InvokeOrDefault(new SourceDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id)), ct); - /// - /// GET request to the get_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public SourceResponse Source(ISourceRequest request) - where TDocument : class => DoRequest>(request, ResponseBuilder(request.RequestParameters, SourceRequestResponseBuilder.Instance)); - /// - /// GET request to the get_source API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public Task> SourceAsync(ISourceRequest request, CancellationToken ct = default) - where TDocument : class => DoRequestAsync>(request, ResponseBuilder(request.RequestParameters, SourceRequestResponseBuilder.Instance), ct); - /// - /// PUT request to the index API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - public IndexResponse Index(TDocument document, Func, IIndexRequest> selector) - where TDocument : class => Index(selector.InvokeOrDefault(new IndexDescriptor(documentWithId: document))); - /// - /// PUT request to the index API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - public Task IndexAsync(TDocument document, Func, IIndexRequest> selector, CancellationToken ct = default) - where TDocument : class => IndexAsync(selector.InvokeOrDefault(new IndexDescriptor(documentWithId: document)), ct); - /// - /// PUT request to the index API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - public IndexResponse Index(IIndexRequest request) - where TDocument : class => DoRequest, IndexResponse>(request, request.RequestParameters); - /// - /// PUT request to the index API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/index-document/ - /// - public Task IndexAsync(IIndexRequest request, CancellationToken ct = default) - where TDocument : class => DoRequestAsync, IndexResponse>(request, request.RequestParameters, ct); - /// - /// GET request to the info API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - public RootNodeInfoResponse RootNodeInfo(Func selector = null) => RootNodeInfo(selector.InvokeOrDefault(new RootNodeInfoDescriptor())); - /// - /// GET request to the info API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - public Task RootNodeInfoAsync(Func selector = null, CancellationToken ct = default) => RootNodeInfoAsync(selector.InvokeOrDefault(new RootNodeInfoDescriptor()), ct); - /// - /// GET request to the info API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - public RootNodeInfoResponse RootNodeInfo(IRootNodeInfoRequest request) => DoRequest(request, request.RequestParameters); - /// - /// GET request to the info API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - public Task RootNodeInfoAsync(IRootNodeInfoRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the mget API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/ - /// - public MultiGetResponse MultiGet(Func selector = null) => MultiGet(selector.InvokeOrDefault(new MultiGetDescriptor())); - /// - /// POST request to the mget API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/ - /// - public Task MultiGetAsync(Func selector = null, CancellationToken ct = default) => MultiGetAsync(selector.InvokeOrDefault(new MultiGetDescriptor()), ct); - /// - /// POST request to the mget API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/ - /// - public MultiGetResponse MultiGet(IMultiGetRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the mget API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/multi-get/ - /// - public Task MultiGetAsync(IMultiGetRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the msearch API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - public MultiSearchResponse MultiSearch(Indices index = null, Func selector = null) => MultiSearch(selector.InvokeOrDefault(new MultiSearchDescriptor().Index(index: index))); - /// - /// POST request to the msearch API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - public Task MultiSearchAsync(Indices index = null, Func selector = null, CancellationToken ct = default) => MultiSearchAsync(selector.InvokeOrDefault(new MultiSearchDescriptor().Index(index: index)), ct); - /// - /// POST request to the msearch API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - public MultiSearchResponse MultiSearch(IMultiSearchRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the msearch API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - public Task MultiSearchAsync(IMultiSearchRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the msearch_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - public MultiSearchResponse MultiSearchTemplate(Indices index = null, Func selector = null) => MultiSearchTemplate(selector.InvokeOrDefault(new MultiSearchTemplateDescriptor().Index(index: index))); - /// - /// POST request to the msearch_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - public Task MultiSearchTemplateAsync(Indices index = null, Func selector = null, CancellationToken ct = default) => MultiSearchTemplateAsync(selector.InvokeOrDefault(new MultiSearchTemplateDescriptor().Index(index: index)), ct); - /// - /// POST request to the msearch_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - public MultiSearchResponse MultiSearchTemplate(IMultiSearchTemplateRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the msearch_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/multi-search/ - /// - public Task MultiSearchTemplateAsync(IMultiSearchTemplateRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the mtermvectors API, read more about this API online: - /// - /// - /// - public MultiTermVectorsResponse MultiTermVectors(Func selector = null) => MultiTermVectors(selector.InvokeOrDefault(new MultiTermVectorsDescriptor())); - /// - /// POST request to the mtermvectors API, read more about this API online: - /// - /// - /// - public Task MultiTermVectorsAsync(Func selector = null, CancellationToken ct = default) => MultiTermVectorsAsync(selector.InvokeOrDefault(new MultiTermVectorsDescriptor()), ct); - /// - /// POST request to the mtermvectors API, read more about this API online: - /// - /// - /// - public MultiTermVectorsResponse MultiTermVectors(IMultiTermVectorsRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the mtermvectors API, read more about this API online: - /// - /// - /// - public Task MultiTermVectorsAsync(IMultiTermVectorsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// HEAD request to the ping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - public PingResponse Ping(Func selector = null) => Ping(selector.InvokeOrDefault(new PingDescriptor())); - /// - /// HEAD request to the ping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - public Task PingAsync(Func selector = null, CancellationToken ct = default) => PingAsync(selector.InvokeOrDefault(new PingDescriptor()), ct); - /// - /// HEAD request to the ping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - public PingResponse Ping(IPingRequest request) => DoRequest(request, request.RequestParameters); - /// - /// HEAD request to the ping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/index/ - /// - public Task PingAsync(IPingRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// PUT request to the put_script API, read more about this API online: - /// - /// - /// - public PutScriptResponse PutScript(Id id, Func selector) => PutScript(selector.InvokeOrDefault(new PutScriptDescriptor(id: id))); - /// - /// PUT request to the put_script API, read more about this API online: - /// - /// - /// - public Task PutScriptAsync(Id id, Func selector, CancellationToken ct = default) => PutScriptAsync(selector.InvokeOrDefault(new PutScriptDescriptor(id: id)), ct); - /// - /// PUT request to the put_script API, read more about this API online: - /// - /// - /// - public PutScriptResponse PutScript(IPutScriptRequest request) => DoRequest(request, request.RequestParameters); - /// - /// PUT request to the put_script API, read more about this API online: - /// - /// - /// - public Task PutScriptAsync(IPutScriptRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the reindex API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - public ReindexOnServerResponse ReindexOnServer(Func selector) => ReindexOnServer(selector.InvokeOrDefault(new ReindexOnServerDescriptor())); - /// - /// POST request to the reindex API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - public Task ReindexOnServerAsync(Func selector, CancellationToken ct = default) => ReindexOnServerAsync(selector.InvokeOrDefault(new ReindexOnServerDescriptor()), ct); - /// - /// POST request to the reindex API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - public ReindexOnServerResponse ReindexOnServer(IReindexOnServerRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the reindex API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - public Task ReindexOnServerAsync(IReindexOnServerRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the reindex_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - public ReindexRethrottleResponse ReindexRethrottle(TaskId taskId, Func selector = null) => ReindexRethrottle(selector.InvokeOrDefault(new ReindexRethrottleDescriptor(taskId: taskId))); - /// - /// POST request to the reindex_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - public Task ReindexRethrottleAsync(TaskId taskId, Func selector = null, CancellationToken ct = default) => ReindexRethrottleAsync(selector.InvokeOrDefault(new ReindexRethrottleDescriptor(taskId: taskId)), ct); - /// - /// POST request to the reindex_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - public ReindexRethrottleResponse ReindexRethrottle(IReindexRethrottleRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the reindex_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/reindex/ - /// - public Task ReindexRethrottleAsync(IReindexRethrottleRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the render_search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - public RenderSearchTemplateResponse RenderSearchTemplate(Func selector = null) => RenderSearchTemplate(selector.InvokeOrDefault(new RenderSearchTemplateDescriptor())); - /// - /// POST request to the render_search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - public Task RenderSearchTemplateAsync(Func selector = null, CancellationToken ct = default) => RenderSearchTemplateAsync(selector.InvokeOrDefault(new RenderSearchTemplateDescriptor()), ct); - /// - /// POST request to the render_search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - public RenderSearchTemplateResponse RenderSearchTemplate(IRenderSearchTemplateRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the render_search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - public Task RenderSearchTemplateAsync(IRenderSearchTemplateRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the scripts_painless_execute API, read more about this API online: - /// - /// - /// - public ExecutePainlessScriptResponse ExecutePainlessScript(Func selector = null) => ExecutePainlessScript(selector.InvokeOrDefault(new ExecutePainlessScriptDescriptor())); - /// - /// POST request to the scripts_painless_execute API, read more about this API online: - /// - /// - /// - public Task> ExecutePainlessScriptAsync(Func selector = null, CancellationToken ct = default) => ExecutePainlessScriptAsync(selector.InvokeOrDefault(new ExecutePainlessScriptDescriptor()), ct); - /// - /// POST request to the scripts_painless_execute API, read more about this API online: - /// - /// - /// - public ExecutePainlessScriptResponse ExecutePainlessScript(IExecutePainlessScriptRequest request) => DoRequest>(request, request.RequestParameters); - /// - /// POST request to the scripts_painless_execute API, read more about this API online: - /// - /// - /// - public Task> ExecutePainlessScriptAsync(IExecutePainlessScriptRequest request, CancellationToken ct = default) => DoRequestAsync>(request, request.RequestParameters, ct); - /// - /// POST request to the scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body - /// - public ISearchResponse Scroll(Time scroll, string scrollId, Func, IScrollRequest> selector = null) - where TInferDocument : class where TDocument : class => Scroll(selector.InvokeOrDefault(new ScrollDescriptor(scroll, scrollId))); - /// - /// POST request to the scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body - /// - public async Task> ScrollAsync(Time scroll, string scrollId, Func, IScrollRequest> selector = null, CancellationToken ct = default) - where TInferDocument : class where TDocument : class => await ScrollAsync(selector.InvokeOrDefault(new ScrollDescriptor(scroll, scrollId)), ct).ConfigureAwait(false); - /// - /// POST request to the scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body - /// - public ISearchResponse Scroll(Time scroll, string scrollId, Func, IScrollRequest> selector = null) - where TDocument : class => Scroll(selector.InvokeOrDefault(new ScrollDescriptor(scroll, scrollId))); - /// - /// POST request to the scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body - /// - public async Task> ScrollAsync(Time scroll, string scrollId, Func, IScrollRequest> selector = null, CancellationToken ct = default) - where TDocument : class => await ScrollAsync(selector.InvokeOrDefault(new ScrollDescriptor(scroll, scrollId)), ct).ConfigureAwait(false); - /// - /// POST request to the scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body - /// - public ISearchResponse Scroll(IScrollRequest request) - where TDocument : class => DoRequest>(request, request.RequestParameters); - /// - /// POST request to the scroll API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/#request-body - /// - public async Task> ScrollAsync(IScrollRequest request, CancellationToken ct = default) - where TDocument : class => await DoRequestAsync>(request, request.RequestParameters, ct).ConfigureAwait(false); - /// - /// POST request to the search API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/ - /// - public ISearchResponse Search(Func, ISearchRequest> selector = null) - where TInferDocument : class where TDocument : class => Search(selector.InvokeOrDefault(new SearchDescriptor())); - /// - /// POST request to the search API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/ - /// - public async Task> SearchAsync(Func, ISearchRequest> selector = null, CancellationToken ct = default) - where TInferDocument : class where TDocument : class => await SearchAsync(selector.InvokeOrDefault(new SearchDescriptor()), ct).ConfigureAwait(false); - /// - /// POST request to the search API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/ - /// - public ISearchResponse Search(Func, ISearchRequest> selector = null) - where TDocument : class => Search(selector.InvokeOrDefault(new SearchDescriptor())); - /// - /// POST request to the search API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/ - /// - public async Task> SearchAsync(Func, ISearchRequest> selector = null, CancellationToken ct = default) - where TDocument : class => await SearchAsync(selector.InvokeOrDefault(new SearchDescriptor()), ct).ConfigureAwait(false); - /// - /// POST request to the search API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/ - /// - public ISearchResponse Search(ISearchRequest request) - where TDocument : class => DoRequest>(request, request.RequestParameters); - /// - /// POST request to the search API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/search/ - /// - public async Task> SearchAsync(ISearchRequest request, CancellationToken ct = default) - where TDocument : class => await DoRequestAsync>(request, request.RequestParameters, ct).ConfigureAwait(false); - /// - /// POST request to the search_shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/security-plugin/access-control/cross-cluster-search/ - /// - public SearchShardsResponse SearchShards(Func, ISearchShardsRequest> selector = null) - where TDocument : class => SearchShards(selector.InvokeOrDefault(new SearchShardsDescriptor())); - /// - /// POST request to the search_shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/security-plugin/access-control/cross-cluster-search/ - /// - public Task SearchShardsAsync(Func, ISearchShardsRequest> selector = null, CancellationToken ct = default) - where TDocument : class => SearchShardsAsync(selector.InvokeOrDefault(new SearchShardsDescriptor()), ct); - /// - /// POST request to the search_shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/security-plugin/access-control/cross-cluster-search/ - /// - public SearchShardsResponse SearchShards(ISearchShardsRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the search_shards API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/security-plugin/access-control/cross-cluster-search/ - /// - public Task SearchShardsAsync(ISearchShardsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - public ISearchResponse SearchTemplate(Func, ISearchTemplateRequest> selector = null) - where TDocument : class => SearchTemplate(selector.InvokeOrDefault(new SearchTemplateDescriptor())); - /// - /// POST request to the search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - public async Task> SearchTemplateAsync(Func, ISearchTemplateRequest> selector = null, CancellationToken ct = default) - where TDocument : class => await SearchTemplateAsync(selector.InvokeOrDefault(new SearchTemplateDescriptor()), ct).ConfigureAwait(false); - /// - /// POST request to the search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - public ISearchResponse SearchTemplate(ISearchTemplateRequest request) - where TDocument : class => DoRequest>(request, request.RequestParameters); - /// - /// POST request to the search_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/search-template/ - /// - public async Task> SearchTemplateAsync(ISearchTemplateRequest request, CancellationToken ct = default) - where TDocument : class => await DoRequestAsync>(request, request.RequestParameters, ct).ConfigureAwait(false); - /// - /// POST request to the termvectors API, read more about this API online: - /// - /// - /// - public TermVectorsResponse TermVectors(Func, ITermVectorsRequest> selector = null) - where TDocument : class => TermVectors(selector.InvokeOrDefault(new TermVectorsDescriptor())); - /// - /// POST request to the termvectors API, read more about this API online: - /// - /// - /// - public Task TermVectorsAsync(Func, ITermVectorsRequest> selector = null, CancellationToken ct = default) - where TDocument : class => TermVectorsAsync(selector.InvokeOrDefault(new TermVectorsDescriptor()), ct); - /// - /// POST request to the termvectors API, read more about this API online: - /// - /// - /// - public TermVectorsResponse TermVectors(ITermVectorsRequest request) - where TDocument : class => DoRequest, TermVectorsResponse>(request, request.RequestParameters); - /// - /// POST request to the termvectors API, read more about this API online: - /// - /// - /// - public Task TermVectorsAsync(ITermVectorsRequest request, CancellationToken ct = default) - where TDocument : class => DoRequestAsync, TermVectorsResponse>(request, request.RequestParameters, ct); - /// - /// POST request to the update API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ - /// - public UpdateResponse Update(DocumentPath id, Func, IUpdateRequest> selector) - where TDocument : class where TPartialDocument : class => Update(selector.InvokeOrDefault(new UpdateDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id))); - /// - /// POST request to the update API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ - /// - public Task> UpdateAsync(DocumentPath id, Func, IUpdateRequest> selector, CancellationToken ct = default) - where TDocument : class where TPartialDocument : class => UpdateAsync(selector.InvokeOrDefault(new UpdateDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id)), ct); - /// - /// POST request to the update API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ - /// - public UpdateResponse Update(DocumentPath id, Func, IUpdateRequest> selector) - where TDocument : class => Update(selector.InvokeOrDefault(new UpdateDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id))); - /// - /// POST request to the update API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ - /// - public Task> UpdateAsync(DocumentPath id, Func, IUpdateRequest> selector, CancellationToken ct = default) - where TDocument : class => UpdateAsync(selector.InvokeOrDefault(new UpdateDescriptor(documentWithId: id?.Document, index: id?.Self?.Index, id: id?.Self?.Id)), ct); - /// - /// POST request to the update API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ - /// - public UpdateResponse Update(IUpdateRequest request) - where TDocument : class where TPartialDocument : class => DoRequest, UpdateResponse>(request, request.RequestParameters); - /// - /// POST request to the update API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/ - /// - public Task> UpdateAsync(IUpdateRequest request, CancellationToken ct = default) - where TDocument : class where TPartialDocument : class => DoRequestAsync, UpdateResponse>(request, request.RequestParameters, ct); - /// - /// POST request to the update_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - public UpdateByQueryResponse UpdateByQuery(Func, IUpdateByQueryRequest> selector = null) - where TDocument : class => UpdateByQuery(selector.InvokeOrDefault(new UpdateByQueryDescriptor())); - /// - /// POST request to the update_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - public Task UpdateByQueryAsync(Func, IUpdateByQueryRequest> selector = null, CancellationToken ct = default) - where TDocument : class => UpdateByQueryAsync(selector.InvokeOrDefault(new UpdateByQueryDescriptor()), ct); - /// - /// POST request to the update_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - public UpdateByQueryResponse UpdateByQuery(IUpdateByQueryRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the update_by_query API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - public Task UpdateByQueryAsync(IUpdateByQueryRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the update_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - public ListTasksResponse UpdateByQueryRethrottle(TaskId taskId, Func selector = null) => UpdateByQueryRethrottle(selector.InvokeOrDefault(new UpdateByQueryRethrottleDescriptor(taskId: taskId))); - /// - /// POST request to the update_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - public Task UpdateByQueryRethrottleAsync(TaskId taskId, Func selector = null, CancellationToken ct = default) => UpdateByQueryRethrottleAsync(selector.InvokeOrDefault(new UpdateByQueryRethrottleDescriptor(taskId: taskId)), ct); - /// - /// POST request to the update_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - public ListTasksResponse UpdateByQueryRethrottle(IUpdateByQueryRethrottleRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the update_by_query_rethrottle API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/ - /// - public Task UpdateByQueryRethrottleAsync(IUpdateByQueryRethrottleRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - } -} diff --git a/src/OpenSearch.Client/Requests.NoNamespace.cs b/src/OpenSearch.Client/Requests.NoNamespace.cs deleted file mode 100644 index b63b90ec2c..0000000000 --- a/src/OpenSearch.Client/Requests.NoNamespace.cs +++ /dev/null @@ -1,3764 +0,0 @@ -/* 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 System.Runtime.Serialization; -using OpenSearch.Net; -using OpenSearch.Net.Utf8Json; - -// ReSharper disable RedundantBaseConstructorCall -// ReSharper disable UnusedTypeParameter -// ReSharper disable PartialMethodWithSinglePart -// ReSharper disable RedundantNameQualifier -namespace OpenSearch.Client -{ - [InterfaceDataContract] - public partial interface IBulkRequest : IRequest - { - [IgnoreDataMember] - IndexName Index - { - get; - } - } - - ///Request for Bulk https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/bulk/ - public partial class BulkRequest : PlainRequestBase, IBulkRequest - { - protected IBulkRequest Self => this; - internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceBulk; - ////_bulk - public BulkRequest(): base() - { - } - - ////{index}/_bulk - ///Optional, accepts null - public BulkRequest(IndexName index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - [IgnoreDataMember] - IndexName IBulkRequest.Index => Self.RouteValues.Get("index"); - // Request parameters - ///The pipeline id to preprocess incoming documents with - public string Pipeline - { - get => Q("pipeline"); - set => Q("pipeline", value); - } - - /// - /// 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 Refresh? Refresh - { - get => Q("refresh"); - set => Q("refresh", value); - } - - ///Sets require_alias for all incoming documents. Defaults to unset (false) - public bool? RequireAlias - { - get => Q("require_alias"); - set => Q("require_alias", value); - } - - /// - /// 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 Routing Routing - { - get => Q("routing"); - set => Q("routing", value); - } - - ///Whether the _source should be included in the response. - public bool? SourceEnabled - { - get => Q("_source"); - set => Q("_source", value); - } - - ///Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - public Fields SourceExcludes - { - get => Q("_source_excludes"); - set => Q("_source_excludes", value); - } - - ///Default list of fields to extract and return from the _source field, can be overridden on each sub-request - public Fields SourceIncludes - { - get => Q("_source_includes"); - set => Q("_source_includes", value); - } - - ///Explicit operation timeout - public Time Timeout - { - get => Q