diff --git a/UPGRADING.md b/UPGRADING.md index 24761940d1..d9afa1e55d 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -77,6 +77,15 @@ #### Features Namespace - The entire `Features` API namespace has been removed, there is no migration path as it was never supported by OpenSearch. +#### Indices.AddBlock Action +- 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` + +#### Indices.ClearCache Action +- 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. @@ -91,6 +100,9 @@ #### Indices.PutTemplateV2 Action - 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. + #### 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`. diff --git a/dotnet-tools.json b/dotnet-tools.json index 13d7551c9b..4f3ee637f8 100644 --- a/dotnet-tools.json +++ b/dotnet-tools.json @@ -6,25 +6,36 @@ "version": "0.13.0", "commands": [ "assembly-rewriter" - ] + ], + "rollForward": false }, "assembly-differ": { "version": "0.15.0", "commands": [ "assembly-differ" - ] + ], + "rollForward": false }, "nupkg-validator": { "version": "0.6.0", "commands": [ "nupkg-validator" - ] + ], + "rollForward": false }, "release-notes": { "version": "0.6.0", "commands": [ "release-notes" - ] + ], + "rollForward": false + }, + "csharpier": { + "version": "0.29.2", + "commands": [ + "dotnet-csharpier" + ], + "rollForward": false } } -} +} \ No newline at end of file diff --git a/src/ApiGenerator/Configuration/CodeConfiguration.cs b/src/ApiGenerator/Configuration/CodeConfiguration.cs index 67c203f206..5bd360cb7a 100644 --- a/src/ApiGenerator/Configuration/CodeConfiguration.cs +++ b/src/ApiGenerator/Configuration/CodeConfiguration.cs @@ -38,22 +38,19 @@ namespace ApiGenerator.Configuration public static class CodeConfiguration { private static readonly Glob[] OperationsToInclude = - { - new("{create,delete}_pit"), + [ + new("{create,delete}_pit"), new("{delete,get}_all_pits"), new("cat.*"), new("cluster.*"), new("dangling_indices.*"), - - new("indices.{delete,exists,get,put}_index_template"), - new("indices.stats"), - + new("indices.*"), new("ingest.*"), new("nodes.*"), new("snapshot.*"), new("tasks.*") - }; + ]; public static bool IncludeOperation(string name) => OperationsToInclude.Any(g => g.IsMatch(name)); @@ -62,6 +59,8 @@ public static class CodeConfiguration /// private static readonly Dictionary LowLevelApiNameMapping = new() { + {"indices.recovery", "RecoveryStatus"}, + {"indices.shard_stores", "IndicesShardStores"} }; /// diff --git a/src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs b/src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs index f543df3231..c7df1b0a46 100644 --- a/src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs +++ b/src/ApiGenerator/Configuration/Overrides/GlobalOverrides.cs @@ -38,7 +38,9 @@ private GlobalOverrides() { } public IDictionary RenameEnums { get; } = new Dictionary { - { "ExpandWildcard", "ExpandWildcards" } + { "ExpandWildcard", "ExpandWildcards" }, + { "QueryDslOperator", "DefaultOperator" }, + { "IndicesAddBlockIndicesBlockOptions", "IndexApiBlock" } }; public override IDictionary ObsoleteQueryStringParams { get; set; } = new Dictionary diff --git a/src/ApiGenerator/Domain/Code/HighLevel/Requests/DescriptorPartialImplementation.cs b/src/ApiGenerator/Domain/Code/HighLevel/Requests/DescriptorPartialImplementation.cs index 3f5a39882d..84923e5810 100644 --- a/src/ApiGenerator/Domain/Code/HighLevel/Requests/DescriptorPartialImplementation.cs +++ b/src/ApiGenerator/Domain/Code/HighLevel/Requests/DescriptorPartialImplementation.cs @@ -26,6 +26,7 @@ * under the License. */ +using System; using System.Collections.Generic; using System.Linq; using ApiGenerator.Domain.Specification; @@ -51,18 +52,17 @@ public IEnumerable GetFluentRouteSetters() var parts = Parts .Where(p => !p.Required || alwaysGenerate.Contains(p.Name)) .Where(p => !string.IsNullOrEmpty(p.Name)) + .OrderBy(p => p.Name) .ToList(); var returnType = CsharpNames.GenericOrNonGenericDescriptorName; - foreach (var part in parts) + foreach (var p in parts) { - var p = part; var paramName = p.Name.ToPascalCase(); - if (paramName.Length > 1) - paramName = paramName.Substring(0, 1).ToLowerInvariant() + paramName.Substring(1); - else - paramName = paramName.ToLowerInvariant(); + paramName = paramName.Length > 1 + ? string.Concat(paramName[..1].ToLowerInvariant(), paramName.AsSpan(1)) + : paramName.ToLowerInvariant(); - var routeValue = "v"; + const string routeValue = "v"; var routeSetter = p.Required ? "Required" : "Optional"; var code = diff --git a/src/ApiGenerator/Domain/Specification/UrlInformation.cs b/src/ApiGenerator/Domain/Specification/UrlInformation.cs index 34f7c55591..7eb212cc84 100644 --- a/src/ApiGenerator/Domain/Specification/UrlInformation.cs +++ b/src/ApiGenerator/Domain/Specification/UrlInformation.cs @@ -45,7 +45,6 @@ public class UrlInformation public IReadOnlyCollection Parts => Paths .SelectMany(p => p.Parts) .DistinctBy(p => p.Name) - .OrderBy(p => p.Name) .ToList(); public bool IsPartless => !Parts.Any(); diff --git a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml index 2e0626c3c1..0b8e1944b4 100644 --- a/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Descriptors/Descriptor.cshtml @@ -20,9 +20,9 @@ } // values part of the url path -@foreach (var part in Model.Parts) +@foreach (var part in Model.Parts.OrderBy(p => p.Name)) { - @(Raw(part.HighLevelTypeName)) @(Raw(baseInterface)).@(part.InterfaceName) => Self.RouteValues.Get@(Raw(string.Format("<{0}>",part.HighLevelTypeName)))("@(part.Name)"); + @(Raw(part.HighLevelTypeName)) @(Raw(baseInterface)).@(part.InterfaceName) => Self.RouteValues.Get@(Raw($"<{part.HighLevelTypeName}>"))("@(part.Name)"); } @foreach (var c in Model.GetFluentRouteSetters()) diff --git a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml index eaca2173f2..92edb5e073 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/ApiUrlsLookup.cshtml @@ -17,7 +17,7 @@ namespace OpenSearch.Client var propertyName = $"{endpoint.CsharpNames.Namespace}{endpoint.CsharpNames.MethodName}"; var paths = !endpoint.Url.Paths.Any() ? endpoint.Url.AllPaths : endpoint.Url.Paths; - internal static readonly ApiUrls @(Raw(propertyName)) = new(new [] {@Raw(string.Join(", ", paths.Select(p=>$"\"{p.Path.TrimStart('/')}\"")))}); + internal static readonly ApiUrls @(Raw(propertyName)) = new([@Raw(string.Join(", ", paths.Select(p=>$"\"{p.Path.TrimStart('/')}\"")))]); } } diff --git a/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml index 0be9404b61..672e47af94 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/RequestImplementations.cshtml @@ -24,8 +24,8 @@ /// @Raw("Note: " + Model.Stability + " within the OpenSearch server, " + warningMessage + "") } - public partial class @Raw(Model.Name) @Raw(string.Format(": PlainRequestBase<{0}>, {1}", Model.CsharpNames.ParametersName, Model.InterfaceName)) -{ + public partial class @Raw(Model.Name) @Raw($": PlainRequestBase<{Model.CsharpNames.ParametersName}>, {Model.InterfaceName}") + { protected @Raw(Model.InterfaceName) Self => this; internal override ApiUrls ApiUrls => @apiLookup; @foreach (var c in Model.Constructors) @@ -34,10 +34,10 @@ } // values part of the url path -@foreach (var part in Model.Parts) +@foreach (var part in Model.Parts.OrderBy(p => p.Name)) { [IgnoreDataMember] - @(Raw(part.HighLevelTypeName)) @(Raw(Model.InterfaceName)).@(part.InterfaceName) => Self.RouteValues.Get@(Raw(string.Format("<{0}>", part.HighLevelTypeName)))("@(part.Name)"); + @(Raw(part.HighLevelTypeName)) @(Raw(Model.InterfaceName)).@(part.InterfaceName) => Self.RouteValues.Get@(Raw($"<{part.HighLevelTypeName}>"))("@(part.Name)"); } @@ -69,7 +69,7 @@ } @if (Model.NeedsGenericImplementation) { - public partial class @Raw(Model.CsharpNames.GenericRequestName) @Raw(string.Format(": {0}, {1}", Model.CsharpNames.RequestName, Model.CsharpNames.GenericInterfaceName)) + public partial class @Raw(Model.CsharpNames.GenericRequestName) @Raw($": {Model.CsharpNames.RequestName}, {Model.CsharpNames.GenericInterfaceName}") { protected @Raw(Model.CsharpNames.GenericInterfaceName) TypedSelf => this; @foreach (Constructor c in Model.GenericConstructors) diff --git a/src/ApiGenerator/Views/HighLevel/Requests/RequestInterface.cshtml b/src/ApiGenerator/Views/HighLevel/Requests/RequestInterface.cshtml index efe0da4f29..4051c69ea0 100644 --- a/src/ApiGenerator/Views/HighLevel/Requests/RequestInterface.cshtml +++ b/src/ApiGenerator/Views/HighLevel/Requests/RequestInterface.cshtml @@ -4,9 +4,9 @@ var name = Model.CsharpNames.RequestInterfaceName; } [InterfaceDataContract] - public partial interface @Raw(Model.Name) : IRequest@(Raw(string.Format("<{0}>", Model.CsharpNames.ParametersName))) -{ -@foreach (var part in Model.UrlParts) + public partial interface @Raw(Model.Name) : IRequest@(Raw($"<{Model.CsharpNames.ParametersName}>")) + { +@foreach (var part in Model.UrlParts.OrderBy(p => p.Name)) { [IgnoreDataMember] @(Raw(part.HighLevelTypeName)) @(part.InterfaceName) { get; } diff --git a/src/OpenSearch.Client/ApiUrlsLookup.cs b/src/OpenSearch.Client/ApiUrlsLookup.cs index 69dd3f37bf..857b727d32 100644 --- a/src/OpenSearch.Client/ApiUrlsLookup.cs +++ b/src/OpenSearch.Client/ApiUrlsLookup.cs @@ -61,43 +61,8 @@ internal static partial class ApiUrlsLookups 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"}); - internal static ApiUrls IndicesAddBlock = new ApiUrls(new[]{"{index}/_block/{block}"}); - internal static ApiUrls IndicesAnalyze = new ApiUrls(new[]{"_analyze", "{index}/_analyze"}); - internal static ApiUrls IndicesClearCache = new ApiUrls(new[]{"_cache/clear", "{index}/_cache/clear"}); - internal static ApiUrls IndicesClone = new ApiUrls(new[]{"{index}/_clone/{target}"}); - internal static ApiUrls IndicesClose = new ApiUrls(new[]{"{index}/_close"}); - internal static ApiUrls IndicesCreate = new ApiUrls(new[]{"{index}"}); - internal static ApiUrls IndicesDelete = new ApiUrls(new[]{"{index}"}); - internal static ApiUrls IndicesDeleteAlias = new ApiUrls(new[]{"{index}/_alias/{name}"}); - internal static ApiUrls IndicesDeleteTemplate = new ApiUrls(new[]{"_template/{name}"}); - internal static ApiUrls IndicesExists = new ApiUrls(new[]{"{index}"}); - internal static ApiUrls IndicesAliasExists = new ApiUrls(new[]{"_alias/{name}", "{index}/_alias/{name}"}); - internal static ApiUrls IndicesTemplateExists = new ApiUrls(new[]{"_template/{name}"}); ///Deprecated as of OpenSearch 2.0 internal static ApiUrls IndicesTypeExists = new ApiUrls(new[]{"{index}/_mapping/{type}"}); - internal static ApiUrls IndicesFlush = new ApiUrls(new[]{"_flush", "{index}/_flush"}); - internal static ApiUrls IndicesForceMerge = new ApiUrls(new[]{"_forcemerge", "{index}/_forcemerge"}); - internal static ApiUrls IndicesGet = new ApiUrls(new[]{"{index}"}); - internal static ApiUrls IndicesGetAlias = new ApiUrls(new[]{"_alias", "_alias/{name}", "{index}/_alias/{name}", "{index}/_alias"}); - internal static ApiUrls IndicesGetFieldMapping = new ApiUrls(new[]{"_mapping/field/{fields}", "{index}/_mapping/field/{fields}"}); - internal static ApiUrls IndicesGetMapping = new ApiUrls(new[]{"_mapping", "{index}/_mapping"}); - internal static ApiUrls IndicesGetSettings = new ApiUrls(new[]{"_settings", "{index}/_settings", "{index}/_settings/{name}", "_settings/{name}"}); - internal static ApiUrls IndicesGetTemplate = new ApiUrls(new[]{"_template", "_template/{name}"}); - internal static ApiUrls IndicesOpen = new ApiUrls(new[]{"{index}/_open"}); - internal static ApiUrls IndicesPutAlias = new ApiUrls(new[]{"{index}/_alias/{name}"}); - internal static ApiUrls IndicesPutMapping = new ApiUrls(new[]{"{index}/_mapping"}); - internal static ApiUrls IndicesUpdateSettings = new ApiUrls(new[]{"_settings", "{index}/_settings"}); - internal static ApiUrls IndicesPutTemplate = new ApiUrls(new[]{"_template/{name}"}); - internal static ApiUrls IndicesRecoveryStatus = new ApiUrls(new[]{"_recovery", "{index}/_recovery"}); - internal static ApiUrls IndicesRefresh = new ApiUrls(new[]{"_refresh", "{index}/_refresh"}); - internal static ApiUrls IndicesResolve = new ApiUrls(new[]{"_resolve/index/{name}"}); - internal static ApiUrls IndicesRollover = new ApiUrls(new[]{"{alias}/_rollover", "{alias}/_rollover/{new_index}"}); - internal static ApiUrls IndicesSegments = new ApiUrls(new[]{"_segments", "{index}/_segments"}); - internal static ApiUrls IndicesShardStores = new ApiUrls(new[]{"_shard_stores", "{index}/_shard_stores"}); - internal static ApiUrls IndicesShrink = new ApiUrls(new[]{"{index}/_shrink/{target}"}); - internal static ApiUrls IndicesSplit = new ApiUrls(new[]{"{index}/_split/{target}"}); - internal static ApiUrls IndicesBulkAlias = new ApiUrls(new[]{"_aliases"}); - internal static ApiUrls IndicesValidateQuery = new ApiUrls(new[]{"_validate/query", "{index}/_validate/query"}); 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"}); diff --git a/src/OpenSearch.Client/Descriptors.Indices.cs b/src/OpenSearch.Client/Descriptors.Indices.cs index b923fd07e9..9ccfb0030c 100644 --- a/src/OpenSearch.Client/Descriptors.Indices.cs +++ b/src/OpenSearch.Client/Descriptors.Indices.cs @@ -45,11 +45,11 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Linq.Expressions; +using System.Text; using OpenSearch.Net; -using OpenSearch.Net.Utf8Json; using OpenSearch.Net.Specification.IndicesApi; +using OpenSearch.Net.Utf8Json; // ReSharper disable RedundantBaseConstructorCall // ReSharper disable UnusedTypeParameter @@ -57,1350 +57,123 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - ///Descriptor for AddBlock - public partial class AddIndexBlockDescriptor : RequestDescriptorBase, IAddIndexBlockRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesAddBlock; - ////{index}/_block/{block} - ///this parameter is required - ///this parameter is required - public AddIndexBlockDescriptor(Indices index, IndexBlock block): base(r => r.Required("index", index).Required("block", block)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected AddIndexBlockDescriptor(): base() - { - } - - // values part of the url path - Indices IAddIndexBlockRequest.Index => Self.RouteValues.Get("index"); - IndexBlock IAddIndexBlockRequest.Block => Self.RouteValues.Get("block"); - ///A comma separated list of indices to add a block to - public AddIndexBlockDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public AddIndexBlockDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public AddIndexBlockDescriptor 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 AddIndexBlockDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public AddIndexBlockDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public AddIndexBlockDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public AddIndexBlockDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public AddIndexBlockDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit operation timeout - public AddIndexBlockDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - } - - ///Descriptor for Analyze - public partial class AnalyzeDescriptor : RequestDescriptorBase, IAnalyzeRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesAnalyze; - ////_analyze - public AnalyzeDescriptor(): base() - { - } - - ////{index}/_analyze - ///Optional, accepts null - public AnalyzeDescriptor(IndexName index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - IndexName IAnalyzeRequest.Index => Self.RouteValues.Get("index"); - ///The name of the index to scope the operation - public AnalyzeDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public AnalyzeDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (IndexName)v)); - // Request parameters - } - - ///Descriptor for ClearCache - public partial class ClearCacheDescriptor : RequestDescriptorBase, IClearCacheRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesClearCache; - ////_cache/clear - public ClearCacheDescriptor(): base() - { - } - - ////{index}/_cache/clear - ///Optional, accepts null - public ClearCacheDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices IClearCacheRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index name to limit the operation - public ClearCacheDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public ClearCacheDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public ClearCacheDescriptor 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 ClearCacheDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public ClearCacheDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Clear field data - public ClearCacheDescriptor Fielddata(bool? fielddata = true) => Qs("fielddata", fielddata); - ///A comma-separated list of fields to clear when using the `fielddata` parameter (default: all) - public ClearCacheDescriptor Fields(Fields fields) => Qs("fields", fields); - ///A comma-separated list of fields to clear when using the `fielddata` parameter (default: all) - public ClearCacheDescriptor 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 ClearCacheDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Clear query caches - public ClearCacheDescriptor Query(bool? query = true) => Qs("query", query); - ///Clear request cache - public ClearCacheDescriptor Request(bool? request = true) => Qs("request", request); - } - - ///Descriptor for Clone https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/clone/ - public partial class CloneIndexDescriptor : RequestDescriptorBase, ICloneIndexRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesClone; - ////{index}/_clone/{target} - ///this parameter is required - ///this parameter is required - public CloneIndexDescriptor(IndexName index, IndexName target): base(r => r.Required("index", index).Required("target", target)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected CloneIndexDescriptor(): base() - { - } - - // values part of the url path - IndexName ICloneIndexRequest.Index => Self.RouteValues.Get("index"); - IndexName ICloneIndexRequest.Target => Self.RouteValues.Get("target"); - ///The name of the source index to clone - public CloneIndexDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public CloneIndexDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v)); - // Request parameters - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CloneIndexDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CloneIndexDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit operation timeout - public CloneIndexDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - ///Set the number of active shards to wait for on the cloned index before the operation returns. - public CloneIndexDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards); - } - - ///Descriptor for Close https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - public partial class CloseIndexDescriptor : RequestDescriptorBase, ICloseIndexRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesClose; - ////{index}/_close - ///this parameter is required - public CloseIndexDescriptor(Indices index): base(r => r.Required("index", index)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected CloseIndexDescriptor(): base() - { - } - - // values part of the url path - Indices ICloseIndexRequest.Index => Self.RouteValues.Get("index"); - ///A comma separated list of indices to close - public CloseIndexDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public CloseIndexDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public CloseIndexDescriptor 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 CloseIndexDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public CloseIndexDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public CloseIndexDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CloseIndexDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CloseIndexDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit operation timeout - public CloseIndexDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - ///Sets the number of active shards to wait for before the operation returns. - public CloseIndexDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards); - } - - ///Descriptor for Create https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/create-index/ - public partial class CreateIndexDescriptor : RequestDescriptorBase, ICreateIndexRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesCreate; - ////{index} - ///this parameter is required - public CreateIndexDescriptor(IndexName index): base(r => r.Required("index", index)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected CreateIndexDescriptor(): base() - { - } - - // values part of the url path - IndexName ICreateIndexRequest.Index => Self.RouteValues.Get("index"); - ///The name of the index - public CreateIndexDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public CreateIndexDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v)); - // Request parameters - ///Whether a type should be expected in the body of the mappings. - ///Deprecated as of OpenSearch 2.0 - public CreateIndexDescriptor IncludeTypeName(bool? includetypename = true) => Qs("include_type_name", includetypename); - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public CreateIndexDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public CreateIndexDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit operation timeout - public CreateIndexDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - ///Set the number of active shards to wait for before the operation returns. - public CreateIndexDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards); - } - - ///Descriptor for Delete https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/delete-index/ - public partial class DeleteIndexDescriptor : RequestDescriptorBase, IDeleteIndexRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesDelete; - ////{index} - ///this parameter is required - public DeleteIndexDescriptor(Indices index): base(r => r.Required("index", index)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected DeleteIndexDescriptor(): base() - { - } - - // values part of the url path - Indices IDeleteIndexRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - public DeleteIndexDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public DeleteIndexDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public DeleteIndexDescriptor AllIndices() => Index(Indices.All); - // Request parameters - ///Ignore if a wildcard expression resolves to no concrete indices (default: false) - public DeleteIndexDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether wildcard expressions should get expanded to open or closed indices (default: open) - public DeleteIndexDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Ignore unavailable indexes (default: false) - public DeleteIndexDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public DeleteIndexDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public DeleteIndexDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit operation timeout - public DeleteIndexDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - } - - ///Descriptor for DeleteAlias https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - public partial class DeleteAliasDescriptor : RequestDescriptorBase, IDeleteAliasRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesDeleteAlias; - ////{index}/_alias/{name} - ///this parameter is required - ///this parameter is required - public DeleteAliasDescriptor(Indices index, Names name): base(r => r.Required("index", index).Required("name", name)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected DeleteAliasDescriptor(): base() - { - } - - // values part of the url path - Indices IDeleteAliasRequest.Index => Self.RouteValues.Get("index"); - Names IDeleteAliasRequest.Name => Self.RouteValues.Get("name"); - ///A comma-separated list of index names (supports wildcards); use `_all` for all indices - public DeleteAliasDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public DeleteAliasDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public DeleteAliasDescriptor AllIndices() => Index(Indices.All); - // Request parameters - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public DeleteAliasDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public DeleteAliasDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit timestamp for the document - public DeleteAliasDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - } - - ///Descriptor for DeleteTemplate https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - public partial class DeleteIndexTemplateDescriptor : RequestDescriptorBase, IDeleteIndexTemplateRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesDeleteTemplate; - ////_template/{name} - ///this parameter is required - public DeleteIndexTemplateDescriptor(Name name): base(r => r.Required("name", name)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected DeleteIndexTemplateDescriptor(): base() - { - } - - // values part of the url path - Name IDeleteIndexTemplateRequest.Name => Self.RouteValues.Get("name"); - // Request parameters - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public DeleteIndexTemplateDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public DeleteIndexTemplateDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit operation timeout - public DeleteIndexTemplateDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - } - - ///Descriptor for Exists https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - public partial class IndexExistsDescriptor : RequestDescriptorBase, IIndexExistsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesExists; - ////{index} - ///this parameter is required - public IndexExistsDescriptor(Indices index): base(r => r.Required("index", index)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected IndexExistsDescriptor(): base() - { - } - - // values part of the url path - Indices IIndexExistsRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index names - public IndexExistsDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public IndexExistsDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public IndexExistsDescriptor AllIndices() => Index(Indices.All); - // Request parameters - ///Ignore if a wildcard expression resolves to no concrete indices (default: false) - public IndexExistsDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether wildcard expressions should get expanded to open or closed indices (default: open) - public IndexExistsDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Return settings in flat format (default: false) - public IndexExistsDescriptor FlatSettings(bool? flatsettings = true) => Qs("flat_settings", flatsettings); - ///Ignore unavailable indexes (default: false) - public IndexExistsDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Whether to return all default setting for each of the indices. - public IndexExistsDescriptor IncludeDefaults(bool? includedefaults = true) => Qs("include_defaults", includedefaults); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public IndexExistsDescriptor Local(bool? local = true) => Qs("local", local); - } - - ///Descriptor for AliasExists https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - public partial class AliasExistsDescriptor : RequestDescriptorBase, IAliasExistsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesAliasExists; - ////_alias/{name} - ///this parameter is required - public AliasExistsDescriptor(Names name): base(r => r.Required("name", name)) - { - } - - ////{index}/_alias/{name} - ///Optional, accepts null - ///this parameter is required - public AliasExistsDescriptor(Indices index, Names name): base(r => r.Optional("index", index).Required("name", name)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected AliasExistsDescriptor(): base() - { - } - - // values part of the url path - Names IAliasExistsRequest.Name => Self.RouteValues.Get("name"); - Indices IAliasExistsRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index names to filter aliases - public AliasExistsDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public AliasExistsDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public AliasExistsDescriptor 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 AliasExistsDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public AliasExistsDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public AliasExistsDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public AliasExistsDescriptor Local(bool? local = true) => Qs("local", local); - } - - ///Descriptor for TemplateExists https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - public partial class IndexTemplateExistsDescriptor : RequestDescriptorBase, IIndexTemplateExistsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesTemplateExists; - ////_template/{name} - ///this parameter is required - public IndexTemplateExistsDescriptor(Names name): base(r => r.Required("name", name)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected IndexTemplateExistsDescriptor(): base() - { - } - - // values part of the url path - Names IIndexTemplateExistsRequest.Name => Self.RouteValues.Get("name"); - // Request parameters - ///Return settings in flat format (default: false) - public IndexTemplateExistsDescriptor FlatSettings(bool? flatsettings = true) => Qs("flat_settings", flatsettings); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public IndexTemplateExistsDescriptor Local(bool? local = true) => Qs("local", local); - ///Specify timeout for connection to master node - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public IndexTemplateExistsDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public IndexTemplateExistsDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - } - - ///Descriptor for TypeExists https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - ///Deprecated as of OpenSearch 2.0 - public partial class TypeExistsDescriptor : RequestDescriptorBase, ITypeExistsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesTypeExists; - ////{index}/_mapping/{type} - ///this parameter is required - ///this parameter is required - public TypeExistsDescriptor(Indices index, Names type): base(r => r.Required("index", index).Required("type", type)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected TypeExistsDescriptor(): base() - { - } - - // values part of the url path - Indices ITypeExistsRequest.Index => Self.RouteValues.Get("index"); - Names ITypeExistsRequest.Type => Self.RouteValues.Get("type"); - ///A comma-separated list of index names; use `_all` to check the types across all indices - public TypeExistsDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public TypeExistsDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public TypeExistsDescriptor 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 TypeExistsDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public TypeExistsDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public TypeExistsDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public TypeExistsDescriptor Local(bool? local = true) => Qs("local", local); - } - - ///Descriptor for Flush - public partial class FlushDescriptor : RequestDescriptorBase, IFlushRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesFlush; - ////_flush - public FlushDescriptor(): base() - { - } - - ////{index}/_flush - ///Optional, accepts null - public FlushDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices IFlushRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index names; use the special string `_all` or Indices.All for all indices - public FlushDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public FlushDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public FlushDescriptor 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 FlushDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public FlushDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - public FlushDescriptor Force(bool? force = true) => Qs("force", force); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public FlushDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - public FlushDescriptor WaitIfOngoing(bool? waitifongoing = true) => Qs("wait_if_ongoing", waitifongoing); - } - - ///Descriptor for ForceMerge - public partial class ForceMergeDescriptor : RequestDescriptorBase, IForceMergeRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesForceMerge; - ////_forcemerge - public ForceMergeDescriptor(): base() - { - } - - ////{index}/_forcemerge - ///Optional, accepts null - public ForceMergeDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices IForceMergeRequest.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 ForceMergeDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public ForceMergeDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public ForceMergeDescriptor 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 ForceMergeDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public ForceMergeDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Specify whether the index should be flushed after performing the operation (default: true) - public ForceMergeDescriptor Flush(bool? flush = true) => Qs("flush", flush); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public ForceMergeDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///The number of segments the index should be merged into (default: dynamic) - public ForceMergeDescriptor MaxNumSegments(long? maxnumsegments) => Qs("max_num_segments", maxnumsegments); - ///Specify whether the operation should only expunge deleted documents - public ForceMergeDescriptor OnlyExpungeDeletes(bool? onlyexpungedeletes = true) => Qs("only_expunge_deletes", onlyexpungedeletes); - } - - ///Descriptor for Get https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-index/ - public partial class GetIndexDescriptor : RequestDescriptorBase, IGetIndexRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesGet; - ////{index} - ///this parameter is required - public GetIndexDescriptor(Indices index): base(r => r.Required("index", index)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected GetIndexDescriptor(): base() - { - } - - // values part of the url path - Indices IGetIndexRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index names - public GetIndexDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public GetIndexDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public GetIndexDescriptor AllIndices() => Index(Indices.All); - // Request parameters - ///Ignore if a wildcard expression resolves to no concrete indices (default: false) - public GetIndexDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether wildcard expressions should get expanded to open or closed indices (default: open) - public GetIndexDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Return settings in flat format (default: false) - public GetIndexDescriptor FlatSettings(bool? flatsettings = true) => Qs("flat_settings", flatsettings); - ///Ignore unavailable indexes (default: false) - public GetIndexDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Whether to return all default setting for each of the indices. - public GetIndexDescriptor IncludeDefaults(bool? includedefaults = true) => Qs("include_defaults", includedefaults); - ///Whether to add the type name to the response (default: false) - ///Deprecated as of OpenSearch 2.0 - public GetIndexDescriptor IncludeTypeName(bool? includetypename = true) => Qs("include_type_name", includetypename); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public GetIndexDescriptor Local(bool? local = true) => Qs("local", local); - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public GetIndexDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public GetIndexDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - } - - ///Descriptor for GetAlias https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - public partial class GetAliasDescriptor : RequestDescriptorBase, IGetAliasRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesGetAlias; - ////_alias - public GetAliasDescriptor(): base() - { - } - - ////_alias/{name} - ///Optional, accepts null - public GetAliasDescriptor(Names name): base(r => r.Optional("name", name)) - { - } - - ////{index}/_alias/{name} - ///Optional, accepts null - ///Optional, accepts null - public GetAliasDescriptor(Indices index, Names name): base(r => r.Optional("index", index).Optional("name", name)) - { - } - - ////{index}/_alias - ///Optional, accepts null - public GetAliasDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Names IGetAliasRequest.Name => Self.RouteValues.Get("name"); - Indices IGetAliasRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of alias names to return - public GetAliasDescriptor Name(Names name) => Assign(name, (a, v) => a.RouteValues.Optional("name", v)); - ///A comma-separated list of index names to filter aliases - public GetAliasDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public GetAliasDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public GetAliasDescriptor 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 GetAliasDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public GetAliasDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public GetAliasDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public GetAliasDescriptor Local(bool? local = true) => Qs("local", local); - } - - ///Descriptor for GetFieldMapping https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - public partial class GetFieldMappingDescriptor : RequestDescriptorBase, GetFieldMappingRequestParameters, IGetFieldMappingRequest>, IGetFieldMappingRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesGetFieldMapping; - ////{index}/_mapping/field/{fields} - ///this parameter is required - public GetFieldMappingDescriptor(Fields fields): this(typeof(TDocument), fields) - { - } - - ////{index}/_mapping/field/{fields} - ///Optional, accepts null - ///this parameter is required - public GetFieldMappingDescriptor(Indices index, Fields fields): base(r => r.Optional("index", index).Required("fields", fields)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected GetFieldMappingDescriptor(): base() - { - } - - // values part of the url path - Fields IGetFieldMappingRequest.Fields => Self.RouteValues.Get("fields"); - Indices IGetFieldMappingRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index names - public GetFieldMappingDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public GetFieldMappingDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public GetFieldMappingDescriptor 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 GetFieldMappingDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public GetFieldMappingDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public GetFieldMappingDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Whether the default mapping values should be returned as well - public GetFieldMappingDescriptor IncludeDefaults(bool? includedefaults = true) => Qs("include_defaults", includedefaults); - ///Whether a type should be returned in the body of the mappings. - ///Deprecated as of OpenSearch 2.0 - public GetFieldMappingDescriptor IncludeTypeName(bool? includetypename = true) => Qs("include_type_name", includetypename); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public GetFieldMappingDescriptor Local(bool? local = true) => Qs("local", local); - } - - ///Descriptor for GetMapping https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - public partial class GetMappingDescriptor : RequestDescriptorBase, GetMappingRequestParameters, IGetMappingRequest>, IGetMappingRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesGetMapping; - ////{index}/_mapping - public GetMappingDescriptor(): this(typeof(TDocument)) - { - } - - ////{index}/_mapping - ///Optional, accepts null - public GetMappingDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices IGetMappingRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index names - public GetMappingDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public GetMappingDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public GetMappingDescriptor 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 GetMappingDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public GetMappingDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public GetMappingDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Whether to add the type name to the response (default: false) - ///Deprecated as of OpenSearch 2.0 - public GetMappingDescriptor IncludeTypeName(bool? includetypename = true) => Qs("include_type_name", includetypename); - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public GetMappingDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public GetMappingDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - } - - ///Descriptor for GetSettings - public partial class GetIndexSettingsDescriptor : RequestDescriptorBase, IGetIndexSettingsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesGetSettings; - ////_settings - public GetIndexSettingsDescriptor(): base() - { - } - - ////{index}/_settings - ///Optional, accepts null - public GetIndexSettingsDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - ////{index}/_settings/{name} - ///Optional, accepts null - ///Optional, accepts null - public GetIndexSettingsDescriptor(Indices index, Names name): base(r => r.Optional("index", index).Optional("name", name)) - { - } - - ////_settings/{name} - ///Optional, accepts null - public GetIndexSettingsDescriptor(Names name): base(r => r.Optional("name", name)) - { - } - - // values part of the url path - Indices IGetIndexSettingsRequest.Index => Self.RouteValues.Get("index"); - Names IGetIndexSettingsRequest.Name => Self.RouteValues.Get("name"); - ///A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices - public GetIndexSettingsDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public GetIndexSettingsDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public GetIndexSettingsDescriptor AllIndices() => Index(Indices.All); - ///The name of the settings that should be included - public GetIndexSettingsDescriptor Name(Names name) => Assign(name, (a, v) => a.RouteValues.Optional("name", v)); - // 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 GetIndexSettingsDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public GetIndexSettingsDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Return settings in flat format (default: false) - public GetIndexSettingsDescriptor FlatSettings(bool? flatsettings = true) => Qs("flat_settings", flatsettings); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public GetIndexSettingsDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Whether to return all default setting for each of the indices. - public GetIndexSettingsDescriptor IncludeDefaults(bool? includedefaults = true) => Qs("include_defaults", includedefaults); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public GetIndexSettingsDescriptor Local(bool? local = true) => Qs("local", local); - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public GetIndexSettingsDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public GetIndexSettingsDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - } - - ///Descriptor for GetTemplate https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - public partial class GetIndexTemplateDescriptor : RequestDescriptorBase, IGetIndexTemplateRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesGetTemplate; - ////_template - public GetIndexTemplateDescriptor(): base() - { - } - - ////_template/{name} - ///Optional, accepts null - public GetIndexTemplateDescriptor(Names name): base(r => r.Optional("name", name)) - { - } - - // values part of the url path - Names IGetIndexTemplateRequest.Name => Self.RouteValues.Get("name"); - ///The comma separated names of the index templates - public GetIndexTemplateDescriptor Name(Names name) => Assign(name, (a, v) => a.RouteValues.Optional("name", v)); - // Request parameters - ///Return settings in flat format (default: false) - public GetIndexTemplateDescriptor FlatSettings(bool? flatsettings = true) => Qs("flat_settings", flatsettings); - ///Whether a type should be returned in the body of the mappings. - ///Deprecated as of OpenSearch 2.0 - public GetIndexTemplateDescriptor IncludeTypeName(bool? includetypename = true) => Qs("include_type_name", includetypename); - ///Return local information, do not retrieve the state from cluster_manager node (default: false) - public GetIndexTemplateDescriptor Local(bool? local = true) => Qs("local", local); - ///Specify timeout for connection to master node - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public GetIndexTemplateDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public GetIndexTemplateDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - } - - ///Descriptor for Open https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - public partial class OpenIndexDescriptor : RequestDescriptorBase, IOpenIndexRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesOpen; - ////{index}/_open - ///this parameter is required - public OpenIndexDescriptor(Indices index): base(r => r.Required("index", index)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected OpenIndexDescriptor(): base() - { - } - - // values part of the url path - Indices IOpenIndexRequest.Index => Self.RouteValues.Get("index"); - ///A comma separated list of indices to open - public OpenIndexDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public OpenIndexDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public OpenIndexDescriptor 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 OpenIndexDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public OpenIndexDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public OpenIndexDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public OpenIndexDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public OpenIndexDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit operation timeout - public OpenIndexDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - ///Sets the number of active shards to wait for before the operation returns. - public OpenIndexDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards); - } - - ///Descriptor for PutAlias https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - public partial class PutAliasDescriptor : RequestDescriptorBase, IPutAliasRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesPutAlias; - ////{index}/_alias/{name} - ///this parameter is required - ///this parameter is required - public PutAliasDescriptor(Indices index, Name name): base(r => r.Required("index", index).Required("name", name)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected PutAliasDescriptor(): base() - { - } - - // values part of the url path - Indices IPutAliasRequest.Index => Self.RouteValues.Get("index"); - Name IPutAliasRequest.Name => Self.RouteValues.Get("name"); - ///A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - public PutAliasDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public PutAliasDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public PutAliasDescriptor AllIndices() => Index(Indices.All); - // Request parameters - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public PutAliasDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public PutAliasDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit timestamp for the document - public PutAliasDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - } - - ///Descriptor for PutMapping https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - public partial class PutMappingDescriptor : RequestDescriptorBase, PutMappingRequestParameters, IPutMappingRequest>, IPutMappingRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesPutMapping; - ////{index}/_mapping - ///this parameter is required - public PutMappingDescriptor(Indices index): base(r => r.Required("index", index)) - { - } - - ////{index}/_mapping - public PutMappingDescriptor(): this(typeof(TDocument)) - { - } - - // values part of the url path - Indices IPutMappingRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. - public PutMappingDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public PutMappingDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public PutMappingDescriptor 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 PutMappingDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public PutMappingDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public PutMappingDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Whether a type should be expected in the body of the mappings. - ///Deprecated as of OpenSearch 2.0 - public PutMappingDescriptor IncludeTypeName(bool? includetypename = true) => Qs("include_type_name", includetypename); - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public PutMappingDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public PutMappingDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit operation timeout - public PutMappingDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - ///When true, applies mappings only to the write index of an alias - public PutMappingDescriptor WriteIndexOnly(bool? writeindexonly = true) => Qs("write_index_only", writeindexonly); - } - - ///Descriptor for UpdateSettings - public partial class UpdateIndexSettingsDescriptor : RequestDescriptorBase, IUpdateIndexSettingsRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesUpdateSettings; - ////_settings - public UpdateIndexSettingsDescriptor(): base() - { - } - - ////{index}/_settings - ///Optional, accepts null - public UpdateIndexSettingsDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices IUpdateIndexSettingsRequest.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 UpdateIndexSettingsDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public UpdateIndexSettingsDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public UpdateIndexSettingsDescriptor 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 UpdateIndexSettingsDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public UpdateIndexSettingsDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Return settings in flat format (default: false) - public UpdateIndexSettingsDescriptor FlatSettings(bool? flatsettings = true) => Qs("flat_settings", flatsettings); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public UpdateIndexSettingsDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public UpdateIndexSettingsDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public UpdateIndexSettingsDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - public UpdateIndexSettingsDescriptor PreserveExisting(bool? preserveexisting = true) => Qs("preserve_existing", preserveexisting); - ///Explicit operation timeout - public UpdateIndexSettingsDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - } - - ///Descriptor for PutTemplate https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - public partial class PutIndexTemplateDescriptor : RequestDescriptorBase, IPutIndexTemplateRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesPutTemplate; - ////_template/{name} - ///this parameter is required - public PutIndexTemplateDescriptor(Name name): base(r => r.Required("name", name)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected PutIndexTemplateDescriptor(): base() - { - } - - // values part of the url path - Name IPutIndexTemplateRequest.Name => Self.RouteValues.Get("name"); - // Request parameters - ///Whether the index template should only be added if new or can also replace an existing one - public PutIndexTemplateDescriptor Create(bool? create = true) => Qs("create", create); - ///Whether a type should be returned in the body of the mappings. - ///Deprecated as of OpenSearch 2.0 - public PutIndexTemplateDescriptor IncludeTypeName(bool? includetypename = true) => Qs("include_type_name", includetypename); - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public PutIndexTemplateDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public PutIndexTemplateDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - } - - ///Descriptor for Refresh https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - public partial class RefreshDescriptor : RequestDescriptorBase, IRefreshRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesRefresh; - ////_refresh - public RefreshDescriptor(): base() - { - } - - ////{index}/_refresh - ///Optional, accepts null - public RefreshDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices IRefreshRequest.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 RefreshDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public RefreshDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public RefreshDescriptor 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 RefreshDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public RefreshDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public RefreshDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - } - - ///Descriptor for Resolve - public partial class ResolveIndexDescriptor : RequestDescriptorBase, IResolveIndexRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesResolve; - ////_resolve/index/{name} - ///this parameter is required - public ResolveIndexDescriptor(Names name): base(r => r.Required("name", name)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected ResolveIndexDescriptor(): base() - { - } - - // values part of the url path - Names IResolveIndexRequest.Name => Self.RouteValues.Get("name"); - // Request parameters - ///Whether wildcard expressions should get expanded to open or closed indices (default: open) - public ResolveIndexDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - } - - ///Descriptor for Rollover https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream - public partial class RolloverIndexDescriptor : RequestDescriptorBase, IRolloverIndexRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesRollover; - ////{alias}/_rollover - ///this parameter is required - public RolloverIndexDescriptor(Name alias): base(r => r.Required("alias", alias)) - { - } - - ////{alias}/_rollover/{new_index} - ///this parameter is required - ///Optional, accepts null - public RolloverIndexDescriptor(Name alias, IndexName newIndex): base(r => r.Required("alias", alias).Optional("new_index", newIndex)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected RolloverIndexDescriptor(): base() - { - } - - // values part of the url path - Name IRolloverIndexRequest.Alias => Self.RouteValues.Get("alias"); - IndexName IRolloverIndexRequest.NewIndex => Self.RouteValues.Get("new_index"); - ///The name of the rollover index - public RolloverIndexDescriptor NewIndex(IndexName newIndex) => Assign(newIndex, (a, v) => a.RouteValues.Optional("new_index", v)); - // Request parameters - ///If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - public RolloverIndexDescriptor DryRun(bool? dryrun = true) => Qs("dry_run", dryrun); - ///Whether a type should be included in the body of the mappings. - ///Deprecated as of OpenSearch 2.0 - public RolloverIndexDescriptor IncludeTypeName(bool? includetypename = true) => Qs("include_type_name", includetypename); - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public RolloverIndexDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public RolloverIndexDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit operation timeout - public RolloverIndexDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - ///Set the number of active shards to wait for on the newly created rollover index before the operation returns. - public RolloverIndexDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards); - } - - ///Descriptor for ShardStores - public partial class IndicesShardStoresDescriptor : RequestDescriptorBase, IIndicesShardStoresRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesShardStores; - ////_shard_stores - public IndicesShardStoresDescriptor(): base() - { - } - - ////{index}/_shard_stores - ///Optional, accepts null - public IndicesShardStoresDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices IIndicesShardStoresRequest.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 IndicesShardStoresDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public IndicesShardStoresDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public IndicesShardStoresDescriptor 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 IndicesShardStoresDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public IndicesShardStoresDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public IndicesShardStoresDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable); - ///A comma-separated list of statuses used to filter on shards to get store information for - public IndicesShardStoresDescriptor Status(params string[] status) => Qs("status", status); - } - - ///Descriptor for Shrink https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/shrink-index/ - public partial class ShrinkIndexDescriptor : RequestDescriptorBase, IShrinkIndexRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesShrink; - ////{index}/_shrink/{target} - ///this parameter is required - ///this parameter is required - public ShrinkIndexDescriptor(IndexName index, IndexName target): base(r => r.Required("index", index).Required("target", target)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected ShrinkIndexDescriptor(): base() - { - } - - // values part of the url path - IndexName IShrinkIndexRequest.Index => Self.RouteValues.Get("index"); - IndexName IShrinkIndexRequest.Target => Self.RouteValues.Get("target"); - ///The name of the source index to shrink - public ShrinkIndexDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public ShrinkIndexDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v)); - // Request parameters - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public ShrinkIndexDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public ShrinkIndexDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit operation timeout - public ShrinkIndexDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - ///Set the number of active shards to wait for on the shrunken index before the operation returns. - public ShrinkIndexDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards); - } - - ///Descriptor for Split https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/split/ - public partial class SplitIndexDescriptor : RequestDescriptorBase, ISplitIndexRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesSplit; - ////{index}/_split/{target} - ///this parameter is required - ///this parameter is required - public SplitIndexDescriptor(IndexName index, IndexName target): base(r => r.Required("index", index).Required("target", target)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected SplitIndexDescriptor(): base() - { - } - - // values part of the url path - IndexName ISplitIndexRequest.Index => Self.RouteValues.Get("index"); - IndexName ISplitIndexRequest.Target => Self.RouteValues.Get("target"); - ///The name of the source index to split - public SplitIndexDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public SplitIndexDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v)); - // Request parameters - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public SplitIndexDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public SplitIndexDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Explicit operation timeout - public SplitIndexDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - ///Set the number of active shards to wait for on the shrunken index before the operation returns. - public SplitIndexDescriptor WaitForActiveShards(string waitforactiveshards) => Qs("wait_for_active_shards", waitforactiveshards); - } - - ///Descriptor for BulkAlias https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - public partial class BulkAliasDescriptor : RequestDescriptorBase, IBulkAliasRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesBulkAlias; - // values part of the url path - // Request parameters - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public BulkAliasDescriptor MasterTimeout(Time mastertimeout) => Qs("master_timeout", mastertimeout); - ///Specify timeout for connection to cluster_manager node - ///Introduced in OpenSearch 2.0 instead of - public BulkAliasDescriptor ClusterManagerTimeout(Time timeout) => Qs("cluster_manager_timeout", timeout); - ///Request timeout - public BulkAliasDescriptor Timeout(Time timeout) => Qs("timeout", timeout); - } - - ///Descriptor for ValidateQuery - public partial class ValidateQueryDescriptor : RequestDescriptorBase, ValidateQueryRequestParameters, IValidateQueryRequest>, IValidateQueryRequest - { - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesValidateQuery; - ////{index}/_validate/query - public ValidateQueryDescriptor(): this(typeof(TDocument)) - { - } - - ////{index}/_validate/query - ///Optional, accepts null - public ValidateQueryDescriptor(Indices index): base(r => r.Optional("index", index)) - { - } - - // values part of the url path - Indices IValidateQueryRequest.Index => Self.RouteValues.Get("index"); - ///A comma-separated list of index names to restrict the operation; use the special string `_all` or Indices.All to perform the operation on all indices - public ValidateQueryDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v)); - ///a shortcut into calling Index(typeof(TOther)) - public ValidateQueryDescriptor Index() - where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v)); - ///A shortcut into calling Index(Indices.All) - public ValidateQueryDescriptor AllIndices() => Index(Indices.All); - // Request parameters - ///Execute validation on all shards instead of one random shard per index - public ValidateQueryDescriptor AllShards(bool? allshards = true) => Qs("all_shards", allshards); - ///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 ValidateQueryDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices); - ///Specify whether wildcard and prefix queries should be analyzed (default: false) - public ValidateQueryDescriptor AnalyzeWildcard(bool? analyzewildcard = true) => Qs("analyze_wildcard", analyzewildcard); - ///The analyzer to use for the query string - public ValidateQueryDescriptor Analyzer(string analyzer) => Qs("analyzer", analyzer); - ///The default operator for query string query (AND or OR) - public ValidateQueryDescriptor DefaultOperator(DefaultOperator? defaultoperator) => Qs("default_operator", defaultoperator); - ///The field to use as default where no field prefix is given in the query string - public ValidateQueryDescriptor Df(string df) => Qs("df", df); - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public ValidateQueryDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards); - ///Return detailed information about the error - public ValidateQueryDescriptor Explain(bool? explain = true) => Qs("explain", explain); - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public ValidateQueryDescriptor 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 ValidateQueryDescriptor Lenient(bool? lenient = true) => Qs("lenient", lenient); - ///Query in the Lucene query string syntax - public ValidateQueryDescriptor QueryOnQueryString(string queryonquerystring) => Qs("q", queryonquerystring); - ///Provide a more detailed explanation showing the actual Lucene query that will be executed. - public ValidateQueryDescriptor Rewrite(bool? rewrite = true) => Qs("rewrite", rewrite); - } + public partial class CreateIndexDescriptor + { + ///Whether a type should be expected in the body of the mappings. + ///Deprecated as of OpenSearch 2.0 + public CreateIndexDescriptor IncludeTypeName(bool? includetypename = true) => + Qs("include_type_name", includetypename); + } + + ///Descriptor for TypeExists https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ + ///Deprecated as of OpenSearch 2.0 + public partial class TypeExistsDescriptor + : RequestDescriptorBase< + TypeExistsDescriptor, + TypeExistsRequestParameters, + ITypeExistsRequest + >, + ITypeExistsRequest + { + internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesTypeExists; + + ////{index}/_mapping/{type} + ///this parameter is required + ///this parameter is required + public TypeExistsDescriptor(Indices index, Names type) + : base(r => r.Required("index", index).Required("type", type)) { } + + ///Used for serialization purposes, making sure we have a parameterless constructor + [SerializationConstructor] + protected TypeExistsDescriptor() + : base() { } + + // values part of the url path + Indices ITypeExistsRequest.Index => Self.RouteValues.Get("index"); + Names ITypeExistsRequest.Type => Self.RouteValues.Get("type"); + + ///A comma-separated list of index names; use `_all` to check the types across all indices + public TypeExistsDescriptor Index(Indices index) => + Assign(index, (a, v) => a.RouteValues.Required("index", v)); + + ///a shortcut into calling Index(typeof(TOther)) + public TypeExistsDescriptor Index() + where TOther : class => + Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (Indices)v)); + + ///A shortcut into calling Index(Indices.All) + public TypeExistsDescriptor 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 TypeExistsDescriptor AllowNoIndices(bool? allownoindices = true) => + Qs("allow_no_indices", allownoindices); + + ///Whether to expand wildcard expression to concrete indices that are open, closed or both. + public TypeExistsDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => + Qs("expand_wildcards", expandwildcards); + + ///Whether specified concrete indices should be ignored when unavailable (missing or closed) + public TypeExistsDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => + Qs("ignore_unavailable", ignoreunavailable); + + ///Return local information, do not retrieve the state from cluster_manager node (default: false) + public TypeExistsDescriptor Local(bool? local = true) => Qs("local", local); + } + + public partial class GetIndexDescriptor + { + ///Whether to add the type name to the response (default: false) + ///Deprecated as of OpenSearch 2.0 + public GetIndexDescriptor IncludeTypeName(bool? includetypename = true) => + Qs("include_type_name", includetypename); + } + + public partial class GetFieldMappingDescriptor + { + ///Whether a type should be returned in the body of the mappings. + ///Deprecated as of OpenSearch 2.0 + public GetFieldMappingDescriptor IncludeTypeName(bool? includetypename = true) => + Qs("include_type_name", includetypename); + } + + public partial class GetMappingDescriptor + { + ///Whether to add the type name to the response (default: false) + ///Deprecated as of OpenSearch 2.0 + public GetMappingDescriptor IncludeTypeName(bool? includetypename = true) => + Qs("include_type_name", includetypename); + } + + public partial class GetIndexTemplateDescriptor + { + ///Whether a type should be returned in the body of the mappings. + ///Deprecated as of OpenSearch 2.0 + public GetIndexTemplateDescriptor IncludeTypeName(bool? includetypename = true) => + Qs("include_type_name", includetypename); + } + + public partial class PutMappingDescriptor + { + ///Whether a type should be expected in the body of the mappings. + ///Deprecated as of OpenSearch 2.0 + public PutMappingDescriptor IncludeTypeName(bool? includetypename = true) => + Qs("include_type_name", includetypename); + } + + public partial class PutIndexTemplateDescriptor + { + ///Whether a type should be returned in the body of the mappings. + ///Deprecated as of OpenSearch 2.0 + public PutIndexTemplateDescriptor IncludeTypeName(bool? includetypename = true) => + Qs("include_type_name", includetypename); + } + + public partial class RolloverIndexDescriptor + { + ///Whether a type should be included in the body of the mappings. + ///Deprecated as of OpenSearch 2.0 + public RolloverIndexDescriptor IncludeTypeName(bool? includetypename = true) => + Qs("include_type_name", includetypename); + } } diff --git a/src/OpenSearch.Client/OpenSearchClient.Indices.cs b/src/OpenSearch.Client/OpenSearchClient.Indices.cs index 75d23d1293..3b10bd68c0 100644 --- a/src/OpenSearch.Client/OpenSearchClient.Indices.cs +++ b/src/OpenSearch.Client/OpenSearchClient.Indices.cs @@ -51,1624 +51,160 @@ // ReSharper disable RedundantTypeArgumentsOfMethod namespace OpenSearch.Client.Specification.IndicesApi { + public partial interface IIndicesNamespace + { + /// + /// HEAD request to the indices.exists_type API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ + /// + /// Deprecated as of OpenSearch 2.0 + ExistsResponse TypeExists( + Indices index, + Names type, + Func selector = null + ); - /// - /// Indices API. - /// Not intended to be instantiated directly. Use the property - /// on . - /// - /// - public partial interface IIndicesNamespace - { - /// - /// PUT request to the indices.add_block API, read more about this API online: - /// - /// - /// - AddIndexBlockResponse AddBlock(Indices index, IndexBlock block, Func selector = null); - /// - /// PUT request to the indices.add_block API, read more about this API online: - /// - /// - /// - Task AddBlockAsync(Indices index, IndexBlock block, Func selector = null, CancellationToken ct = default); - /// - /// PUT request to the indices.add_block API, read more about this API online: - /// - /// - /// - AddIndexBlockResponse AddBlock(IAddIndexBlockRequest request); - /// - /// PUT request to the indices.add_block API, read more about this API online: - /// - /// - /// - Task AddBlockAsync(IAddIndexBlockRequest request, CancellationToken ct = default); - /// - /// POST request to the indices.analyze API, read more about this API online: - /// - /// - /// - AnalyzeResponse Analyze(Func selector = null); - /// - /// POST request to the indices.analyze API, read more about this API online: - /// - /// - /// - Task AnalyzeAsync(Func selector = null, CancellationToken ct = default); - /// - /// POST request to the indices.analyze API, read more about this API online: - /// - /// - /// - AnalyzeResponse Analyze(IAnalyzeRequest request); - /// - /// POST request to the indices.analyze API, read more about this API online: - /// - /// - /// - Task AnalyzeAsync(IAnalyzeRequest request, CancellationToken ct = default); - /// - /// POST request to the indices.clear_cache API, read more about this API online: - /// - /// - /// - ClearCacheResponse ClearCache(Indices index = null, Func selector = null); - /// - /// POST request to the indices.clear_cache API, read more about this API online: - /// - /// - /// - Task ClearCacheAsync(Indices index = null, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the indices.clear_cache API, read more about this API online: - /// - /// - /// - ClearCacheResponse ClearCache(IClearCacheRequest request); - /// - /// POST request to the indices.clear_cache API, read more about this API online: - /// - /// - /// - Task ClearCacheAsync(IClearCacheRequest request, CancellationToken ct = default); - /// - /// PUT request to the indices.clone API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/clone/ - /// - CloneIndexResponse Clone(IndexName index, IndexName target, Func selector = null); - /// - /// PUT request to the indices.clone API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/clone/ - /// - Task CloneAsync(IndexName index, IndexName target, Func selector = null, CancellationToken ct = default); - /// - /// PUT request to the indices.clone API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/clone/ - /// - CloneIndexResponse Clone(ICloneIndexRequest request); - /// - /// PUT request to the indices.clone API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/clone/ - /// - Task CloneAsync(ICloneIndexRequest request, CancellationToken ct = default); - /// - /// POST request to the indices.close API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - CloseIndexResponse Close(Indices index, Func selector = null); - /// - /// POST request to the indices.close API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - Task CloseAsync(Indices index, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the indices.close API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - CloseIndexResponse Close(ICloseIndexRequest request); - /// - /// POST request to the indices.close API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - Task CloseAsync(ICloseIndexRequest request, CancellationToken ct = default); - /// - /// PUT request to the indices.create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/create-index/ - /// - CreateIndexResponse Create(IndexName index, Func selector = null); - /// - /// PUT request to the indices.create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/create-index/ - /// - Task CreateAsync(IndexName index, Func selector = null, CancellationToken ct = default); - /// - /// PUT request to the indices.create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/create-index/ - /// - CreateIndexResponse Create(ICreateIndexRequest request); - /// - /// PUT request to the indices.create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/create-index/ - /// - Task CreateAsync(ICreateIndexRequest request, CancellationToken ct = default); - /// - /// DELETE request to the indices.delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/delete-index/ - /// - DeleteIndexResponse Delete(Indices index, Func selector = null); - /// - /// DELETE request to the indices.delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/delete-index/ - /// - Task DeleteAsync(Indices index, Func selector = null, CancellationToken ct = default); - /// - /// DELETE request to the indices.delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/delete-index/ - /// - DeleteIndexResponse Delete(IDeleteIndexRequest request); - /// - /// DELETE request to the indices.delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/delete-index/ - /// - Task DeleteAsync(IDeleteIndexRequest request, CancellationToken ct = default); - /// - /// DELETE request to the indices.delete_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - DeleteAliasResponse DeleteAlias(Indices index, Names name, Func selector = null); - /// - /// DELETE request to the indices.delete_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - Task DeleteAliasAsync(Indices index, Names name, Func selector = null, CancellationToken ct = default); - /// - /// DELETE request to the indices.delete_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - DeleteAliasResponse DeleteAlias(IDeleteAliasRequest request); - /// - /// DELETE request to the indices.delete_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - Task DeleteAliasAsync(IDeleteAliasRequest request, CancellationToken ct = default); - /// - /// DELETE request to the indices.delete_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - DeleteIndexTemplateResponse DeleteTemplate(Name name, Func selector = null); - /// - /// DELETE request to the indices.delete_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - Task DeleteTemplateAsync(Name name, Func selector = null, CancellationToken ct = default); - /// - /// DELETE request to the indices.delete_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - DeleteIndexTemplateResponse DeleteTemplate(IDeleteIndexTemplateRequest request); - /// - /// DELETE request to the indices.delete_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - Task DeleteTemplateAsync(IDeleteIndexTemplateRequest request, CancellationToken ct = default); - /// - /// HEAD request to the indices.exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - ExistsResponse Exists(Indices index, Func selector = null); - /// - /// HEAD request to the indices.exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - Task ExistsAsync(Indices index, Func selector = null, CancellationToken ct = default); - /// - /// HEAD request to the indices.exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - ExistsResponse Exists(IIndexExistsRequest request); - /// - /// HEAD request to the indices.exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - Task ExistsAsync(IIndexExistsRequest request, CancellationToken ct = default); - /// - /// HEAD request to the indices.exists_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - ExistsResponse AliasExists(Names name, Func selector = null); - /// - /// HEAD request to the indices.exists_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - Task AliasExistsAsync(Names name, Func selector = null, CancellationToken ct = default); - /// - /// HEAD request to the indices.exists_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - ExistsResponse AliasExists(IAliasExistsRequest request); - /// - /// HEAD request to the indices.exists_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - Task AliasExistsAsync(IAliasExistsRequest request, CancellationToken ct = default); - /// - /// HEAD request to the indices.exists_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - ExistsResponse TemplateExists(Names name, Func selector = null); - /// - /// HEAD request to the indices.exists_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - Task TemplateExistsAsync(Names name, Func selector = null, CancellationToken ct = default); - /// - /// HEAD request to the indices.exists_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - ExistsResponse TemplateExists(IIndexTemplateExistsRequest request); - /// - /// HEAD request to the indices.exists_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - Task TemplateExistsAsync(IIndexTemplateExistsRequest request, CancellationToken ct = default); - /// - /// HEAD request to the indices.exists_type API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - /// Deprecated as of OpenSearch 2.0 - ExistsResponse TypeExists(Indices index, Names type, Func selector = null); - /// - /// HEAD request to the indices.exists_type API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - /// Deprecated as of OpenSearch 2.0 - Task TypeExistsAsync(Indices index, Names type, Func selector = null, CancellationToken ct = default); - /// - /// HEAD request to the indices.exists_type API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - /// Deprecated as of OpenSearch 2.0 - ExistsResponse TypeExists(ITypeExistsRequest request); - /// - /// HEAD request to the indices.exists_type API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - /// Deprecated as of OpenSearch 2.0 - Task TypeExistsAsync(ITypeExistsRequest request, CancellationToken ct = default); - /// - /// POST request to the indices.flush API, read more about this API online: - /// - /// - /// - FlushResponse Flush(Indices index = null, Func selector = null); - /// - /// POST request to the indices.flush API, read more about this API online: - /// - /// - /// - Task FlushAsync(Indices index = null, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the indices.flush API, read more about this API online: - /// - /// - /// - FlushResponse Flush(IFlushRequest request); - /// - /// POST request to the indices.flush API, read more about this API online: - /// - /// - /// - Task FlushAsync(IFlushRequest request, CancellationToken ct = default); - /// - /// POST request to the indices.forcemerge API, read more about this API online: - /// - /// - /// - ForceMergeResponse ForceMerge(Indices index = null, Func selector = null); - /// - /// POST request to the indices.forcemerge API, read more about this API online: - /// - /// - /// - Task ForceMergeAsync(Indices index = null, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the indices.forcemerge API, read more about this API online: - /// - /// - /// - ForceMergeResponse ForceMerge(IForceMergeRequest request); - /// - /// POST request to the indices.forcemerge API, read more about this API online: - /// - /// - /// - Task ForceMergeAsync(IForceMergeRequest request, CancellationToken ct = default); - /// - /// GET request to the indices.get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-index/ - /// - GetIndexResponse Get(Indices index, Func selector = null); - /// - /// GET request to the indices.get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-index/ - /// - Task GetAsync(Indices index, Func selector = null, CancellationToken ct = default); - /// - /// GET request to the indices.get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-index/ - /// - GetIndexResponse Get(IGetIndexRequest request); - /// - /// GET request to the indices.get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-index/ - /// - Task GetAsync(IGetIndexRequest request, CancellationToken ct = default); - /// - /// GET request to the indices.get_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - GetAliasResponse GetAlias(Indices index = null, Func selector = null); - /// - /// GET request to the indices.get_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - Task GetAliasAsync(Indices index = null, Func selector = null, CancellationToken ct = default); - /// - /// GET request to the indices.get_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - GetAliasResponse GetAlias(IGetAliasRequest request); - /// - /// GET request to the indices.get_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - Task GetAliasAsync(IGetAliasRequest request, CancellationToken ct = default); - /// - /// GET request to the indices.get_field_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - GetFieldMappingResponse GetFieldMapping(Fields fields, Func, IGetFieldMappingRequest> selector = null) - where TDocument : class; - /// - /// GET request to the indices.get_field_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - Task GetFieldMappingAsync(Fields fields, Func, IGetFieldMappingRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// GET request to the indices.get_field_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - GetFieldMappingResponse GetFieldMapping(IGetFieldMappingRequest request); - /// - /// GET request to the indices.get_field_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - Task GetFieldMappingAsync(IGetFieldMappingRequest request, CancellationToken ct = default); - /// - /// GET request to the indices.get_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - GetMappingResponse GetMapping(Func, IGetMappingRequest> selector = null) - where TDocument : class; - /// - /// GET request to the indices.get_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - Task GetMappingAsync(Func, IGetMappingRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// GET request to the indices.get_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - GetMappingResponse GetMapping(IGetMappingRequest request); - /// - /// GET request to the indices.get_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - Task GetMappingAsync(IGetMappingRequest request, CancellationToken ct = default); - /// - /// GET request to the indices.get_settings API, read more about this API online: - /// - /// - /// - GetIndexSettingsResponse GetSettings(Indices index = null, Func selector = null); - /// - /// GET request to the indices.get_settings API, read more about this API online: - /// - /// - /// - Task GetSettingsAsync(Indices index = null, Func selector = null, CancellationToken ct = default); - /// - /// GET request to the indices.get_settings API, read more about this API online: - /// - /// - /// - GetIndexSettingsResponse GetSettings(IGetIndexSettingsRequest request); - /// - /// GET request to the indices.get_settings API, read more about this API online: - /// - /// - /// - Task GetSettingsAsync(IGetIndexSettingsRequest request, CancellationToken ct = default); - /// - /// GET request to the indices.get_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - GetIndexTemplateResponse GetTemplate(Names name = null, Func selector = null); - /// - /// GET request to the indices.get_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - Task GetTemplateAsync(Names name = null, Func selector = null, CancellationToken ct = default); - /// - /// GET request to the indices.get_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - GetIndexTemplateResponse GetTemplate(IGetIndexTemplateRequest request); - /// - /// GET request to the indices.get_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - Task GetTemplateAsync(IGetIndexTemplateRequest request, CancellationToken ct = default); - /// - /// POST request to the indices.open API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - OpenIndexResponse Open(Indices index, Func selector = null); - /// - /// POST request to the indices.open API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - Task OpenAsync(Indices index, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the indices.open API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - OpenIndexResponse Open(IOpenIndexRequest request); - /// - /// POST request to the indices.open API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - Task OpenAsync(IOpenIndexRequest request, CancellationToken ct = default); - /// - /// PUT request to the indices.put_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - PutAliasResponse PutAlias(Indices index, Name name, Func selector = null); - /// - /// PUT request to the indices.put_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - Task PutAliasAsync(Indices index, Name name, Func selector = null, CancellationToken ct = default); - /// - /// PUT request to the indices.put_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - PutAliasResponse PutAlias(IPutAliasRequest request); - /// - /// PUT request to the indices.put_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - Task PutAliasAsync(IPutAliasRequest request, CancellationToken ct = default); - /// - /// PUT request to the indices.put_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - PutMappingResponse PutMapping(Func, IPutMappingRequest> selector) - where TDocument : class; - /// - /// PUT request to the indices.put_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - Task PutMappingAsync(Func, IPutMappingRequest> selector, CancellationToken ct = default) - where TDocument : class; - /// - /// PUT request to the indices.put_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - PutMappingResponse PutMapping(IPutMappingRequest request); - /// - /// PUT request to the indices.put_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - Task PutMappingAsync(IPutMappingRequest request, CancellationToken ct = default); - /// - /// PUT request to the indices.put_settings API, read more about this API online: - /// - /// - /// - UpdateIndexSettingsResponse UpdateSettings(Indices index, Func selector); - /// - /// PUT request to the indices.put_settings API, read more about this API online: - /// - /// - /// - Task UpdateSettingsAsync(Indices index, Func selector, CancellationToken ct = default); - /// - /// PUT request to the indices.put_settings API, read more about this API online: - /// - /// - /// - UpdateIndexSettingsResponse UpdateSettings(IUpdateIndexSettingsRequest request); - /// - /// PUT request to the indices.put_settings API, read more about this API online: - /// - /// - /// - Task UpdateSettingsAsync(IUpdateIndexSettingsRequest request, CancellationToken ct = default); - /// - /// PUT request to the indices.put_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - PutIndexTemplateResponse PutTemplate(Name name, Func selector); - /// - /// PUT request to the indices.put_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - Task PutTemplateAsync(Name name, Func selector, CancellationToken ct = default); - /// - /// PUT request to the indices.put_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - PutIndexTemplateResponse PutTemplate(IPutIndexTemplateRequest request); - /// - /// PUT request to the indices.put_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - Task PutTemplateAsync(IPutIndexTemplateRequest request, CancellationToken ct = default); - /// - /// GET request to the indices.recovery API, read more about this API online: - /// - /// - /// - RefreshResponse Refresh(Indices index = null, Func selector = null); - /// - /// POST request to the indices.refresh API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - Task RefreshAsync(Indices index = null, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the indices.refresh API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - RefreshResponse Refresh(IRefreshRequest request); - /// - /// POST request to the indices.refresh API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - Task RefreshAsync(IRefreshRequest request, CancellationToken ct = default); - /// - /// GET request to the indices.resolve_index API, read more about this API online: - /// - /// - ResolveIndexResponse Resolve(Names name, Func selector = null); - /// - /// GET request to the indices.resolve_index API, read more about this API online: - /// - /// - Task ResolveAsync(Names name, Func selector = null, CancellationToken ct = default); - /// - /// GET request to the indices.resolve_index API, read more about this API online: - /// - /// - ResolveIndexResponse Resolve(IResolveIndexRequest request); - /// - /// GET request to the indices.resolve_index API, read more about this API online: - /// - /// - Task ResolveAsync(IResolveIndexRequest request, CancellationToken ct = default); - /// - /// POST request to the indices.rollover API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream - /// - RolloverIndexResponse Rollover(Name alias, Func selector = null); - /// - /// POST request to the indices.rollover API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream - /// - Task RolloverAsync(Name alias, Func selector = null, CancellationToken ct = default); - /// - /// POST request to the indices.rollover API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream - /// - RolloverIndexResponse Rollover(IRolloverIndexRequest request); - /// - /// POST request to the indices.rollover API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream - /// - Task RolloverAsync(IRolloverIndexRequest request, CancellationToken ct = default); - /// - /// GET request to the indices.segments API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - /// - ShrinkIndexResponse Shrink(IndexName index, IndexName target, Func selector = null); - /// - /// PUT request to the indices.shrink API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/shrink-index/ - /// - Task ShrinkAsync(IndexName index, IndexName target, Func selector = null, CancellationToken ct = default); - /// - /// PUT request to the indices.shrink API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/shrink-index/ - /// - ShrinkIndexResponse Shrink(IShrinkIndexRequest request); - /// - /// PUT request to the indices.shrink API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/shrink-index/ - /// - Task ShrinkAsync(IShrinkIndexRequest request, CancellationToken ct = default); - /// - /// PUT request to the indices.split API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/split/ - /// - SplitIndexResponse Split(IndexName index, IndexName target, Func selector = null); - /// - /// PUT request to the indices.split API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/split/ - /// - Task SplitAsync(IndexName index, IndexName target, Func selector = null, CancellationToken ct = default); - /// - /// PUT request to the indices.split API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/split/ - /// - SplitIndexResponse Split(ISplitIndexRequest request); - /// - /// PUT request to the indices.split API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/split/ - /// - Task SplitAsync(ISplitIndexRequest request, CancellationToken ct = default); - /// - /// POST request to the indices.update_aliases API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - BulkAliasResponse BulkAlias(Func selector); - /// - /// POST request to the indices.update_aliases API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - Task BulkAliasAsync(Func selector, CancellationToken ct = default); - /// - /// POST request to the indices.update_aliases API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - BulkAliasResponse BulkAlias(IBulkAliasRequest request); - /// - /// POST request to the indices.update_aliases API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - Task BulkAliasAsync(IBulkAliasRequest request, CancellationToken ct = default); - /// - /// POST request to the indices.validate_query API, read more about this API online: - /// - /// - /// - ValidateQueryResponse ValidateQuery(Func, IValidateQueryRequest> selector = null) - where TDocument : class; - /// - /// POST request to the indices.validate_query API, read more about this API online: - /// - /// - /// - Task ValidateQueryAsync(Func, IValidateQueryRequest> selector = null, CancellationToken ct = default) - where TDocument : class; - /// - /// POST request to the indices.validate_query API, read more about this API online: - /// - /// - /// - ValidateQueryResponse ValidateQuery(IValidateQueryRequest request); - /// - /// POST request to the indices.validate_query API, read more about this API online: - /// - /// - /// - Task ValidateQueryAsync(IValidateQueryRequest request, CancellationToken ct = default); - } + /// + /// HEAD request to the indices.exists_type API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ + /// + /// Deprecated as of OpenSearch 2.0 + Task TypeExistsAsync( + Indices index, + Names type, + Func selector = null, + CancellationToken ct = default + ); - /// - /// Indices implementation. - /// Not intended to be instantiated directly. Use the property - /// on . - /// - /// - public partial class IndicesNamespace : NamespacedClientProxy - { - /// - /// PUT request to the indices.add_block API, read more about this API online: - /// - /// - /// - public AddIndexBlockResponse AddBlock(Indices index, IndexBlock block, Func selector = null) => AddBlock(selector.InvokeOrDefault(new AddIndexBlockDescriptor(index: index, block: block))); - /// - /// PUT request to the indices.add_block API, read more about this API online: - /// - /// - /// - public Task AddBlockAsync(Indices index, IndexBlock block, Func selector = null, CancellationToken ct = default) => AddBlockAsync(selector.InvokeOrDefault(new AddIndexBlockDescriptor(index: index, block: block)), ct); - /// - /// PUT request to the indices.add_block API, read more about this API online: - /// - /// - /// - public AddIndexBlockResponse AddBlock(IAddIndexBlockRequest request) => DoRequest(request, request.RequestParameters); - /// - /// PUT request to the indices.add_block API, read more about this API online: - /// - /// - /// - public Task AddBlockAsync(IAddIndexBlockRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the indices.analyze API, read more about this API online: - /// - /// - /// - public AnalyzeResponse Analyze(Func selector = null) => Analyze(selector.InvokeOrDefault(new AnalyzeDescriptor())); - /// - /// POST request to the indices.analyze API, read more about this API online: - /// - /// - /// - public Task AnalyzeAsync(Func selector = null, CancellationToken ct = default) => AnalyzeAsync(selector.InvokeOrDefault(new AnalyzeDescriptor()), ct); - /// - /// POST request to the indices.analyze API, read more about this API online: - /// - /// - /// - public AnalyzeResponse Analyze(IAnalyzeRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the indices.analyze API, read more about this API online: - /// - /// - /// - public Task AnalyzeAsync(IAnalyzeRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the indices.clear_cache API, read more about this API online: - /// - /// - /// - public ClearCacheResponse ClearCache(Indices index = null, Func selector = null) => ClearCache(selector.InvokeOrDefault(new ClearCacheDescriptor().Index(index: index))); - /// - /// POST request to the indices.clear_cache API, read more about this API online: - /// - /// - /// - public Task ClearCacheAsync(Indices index = null, Func selector = null, CancellationToken ct = default) => ClearCacheAsync(selector.InvokeOrDefault(new ClearCacheDescriptor().Index(index: index)), ct); - /// - /// POST request to the indices.clear_cache API, read more about this API online: - /// - /// - /// - public ClearCacheResponse ClearCache(IClearCacheRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the indices.clear_cache API, read more about this API online: - /// - /// - /// - public Task ClearCacheAsync(IClearCacheRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// PUT request to the indices.clone API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/clone/ - /// - public CloneIndexResponse Clone(IndexName index, IndexName target, Func selector = null) => Clone(selector.InvokeOrDefault(new CloneIndexDescriptor(index: index, target: target))); - /// - /// PUT request to the indices.clone API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/clone/ - /// - public Task CloneAsync(IndexName index, IndexName target, Func selector = null, CancellationToken ct = default) => CloneAsync(selector.InvokeOrDefault(new CloneIndexDescriptor(index: index, target: target)), ct); - /// - /// PUT request to the indices.clone API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/clone/ - /// - public CloneIndexResponse Clone(ICloneIndexRequest request) => DoRequest(request, request.RequestParameters); - /// - /// PUT request to the indices.clone API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/clone/ - /// - public Task CloneAsync(ICloneIndexRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the indices.close API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - public CloseIndexResponse Close(Indices index, Func selector = null) => Close(selector.InvokeOrDefault(new CloseIndexDescriptor(index: index))); - /// - /// POST request to the indices.close API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - public Task CloseAsync(Indices index, Func selector = null, CancellationToken ct = default) => CloseAsync(selector.InvokeOrDefault(new CloseIndexDescriptor(index: index)), ct); - /// - /// POST request to the indices.close API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - public CloseIndexResponse Close(ICloseIndexRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the indices.close API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - public Task CloseAsync(ICloseIndexRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// PUT request to the indices.create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/create-index/ - /// - public CreateIndexResponse Create(IndexName index, Func selector = null) => Create(selector.InvokeOrDefault(new CreateIndexDescriptor(index: index))); - /// - /// PUT request to the indices.create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/create-index/ - /// - public Task CreateAsync(IndexName index, Func selector = null, CancellationToken ct = default) => CreateAsync(selector.InvokeOrDefault(new CreateIndexDescriptor(index: index)), ct); - /// - /// PUT request to the indices.create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/create-index/ - /// - public CreateIndexResponse Create(ICreateIndexRequest request) => DoRequest(request, request.RequestParameters); - /// - /// PUT request to the indices.create API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/create-index/ - /// - public Task CreateAsync(ICreateIndexRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// DELETE request to the indices.delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/delete-index/ - /// - public DeleteIndexResponse Delete(Indices index, Func selector = null) => Delete(selector.InvokeOrDefault(new DeleteIndexDescriptor(index: index))); - /// - /// DELETE request to the indices.delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/delete-index/ - /// - public Task DeleteAsync(Indices index, Func selector = null, CancellationToken ct = default) => DeleteAsync(selector.InvokeOrDefault(new DeleteIndexDescriptor(index: index)), ct); - /// - /// DELETE request to the indices.delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/delete-index/ - /// - public DeleteIndexResponse Delete(IDeleteIndexRequest request) => DoRequest(request, request.RequestParameters); - /// - /// DELETE request to the indices.delete API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/delete-index/ - /// - public Task DeleteAsync(IDeleteIndexRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// DELETE request to the indices.delete_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public DeleteAliasResponse DeleteAlias(Indices index, Names name, Func selector = null) => DeleteAlias(selector.InvokeOrDefault(new DeleteAliasDescriptor(index: index, name: name))); - /// - /// DELETE request to the indices.delete_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public Task DeleteAliasAsync(Indices index, Names name, Func selector = null, CancellationToken ct = default) => DeleteAliasAsync(selector.InvokeOrDefault(new DeleteAliasDescriptor(index: index, name: name)), ct); - /// - /// DELETE request to the indices.delete_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public DeleteAliasResponse DeleteAlias(IDeleteAliasRequest request) => DoRequest(request, request.RequestParameters); - /// - /// DELETE request to the indices.delete_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public Task DeleteAliasAsync(IDeleteAliasRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// DELETE request to the indices.delete_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public DeleteIndexTemplateResponse DeleteTemplate(Name name, Func selector = null) => DeleteTemplate(selector.InvokeOrDefault(new DeleteIndexTemplateDescriptor(name: name))); - /// - /// DELETE request to the indices.delete_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public Task DeleteTemplateAsync(Name name, Func selector = null, CancellationToken ct = default) => DeleteTemplateAsync(selector.InvokeOrDefault(new DeleteIndexTemplateDescriptor(name: name)), ct); - /// - /// DELETE request to the indices.delete_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public DeleteIndexTemplateResponse DeleteTemplate(IDeleteIndexTemplateRequest request) => DoRequest(request, request.RequestParameters); - /// - /// DELETE request to the indices.delete_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public Task DeleteTemplateAsync(IDeleteIndexTemplateRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// HEAD request to the indices.exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - public ExistsResponse Exists(Indices index, Func selector = null) => Exists(selector.InvokeOrDefault(new IndexExistsDescriptor(index: index))); - /// - /// HEAD request to the indices.exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - public Task ExistsAsync(Indices index, Func selector = null, CancellationToken ct = default) => ExistsAsync(selector.InvokeOrDefault(new IndexExistsDescriptor(index: index)), ct); - /// - /// HEAD request to the indices.exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - public ExistsResponse Exists(IIndexExistsRequest request) => DoRequest(request, request.RequestParameters); - /// - /// HEAD request to the indices.exists API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - public Task ExistsAsync(IIndexExistsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// HEAD request to the indices.exists_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public ExistsResponse AliasExists(Names name, Func selector = null) => AliasExists(selector.InvokeOrDefault(new AliasExistsDescriptor(name: name))); - /// - /// HEAD request to the indices.exists_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public Task AliasExistsAsync(Names name, Func selector = null, CancellationToken ct = default) => AliasExistsAsync(selector.InvokeOrDefault(new AliasExistsDescriptor(name: name)), ct); - /// - /// HEAD request to the indices.exists_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public ExistsResponse AliasExists(IAliasExistsRequest request) => DoRequest(request, request.RequestParameters); - /// - /// HEAD request to the indices.exists_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public Task AliasExistsAsync(IAliasExistsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// HEAD request to the indices.exists_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public ExistsResponse TemplateExists(Names name, Func selector = null) => TemplateExists(selector.InvokeOrDefault(new IndexTemplateExistsDescriptor(name: name))); - /// - /// HEAD request to the indices.exists_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public Task TemplateExistsAsync(Names name, Func selector = null, CancellationToken ct = default) => TemplateExistsAsync(selector.InvokeOrDefault(new IndexTemplateExistsDescriptor(name: name)), ct); - /// - /// HEAD request to the indices.exists_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public ExistsResponse TemplateExists(IIndexTemplateExistsRequest request) => DoRequest(request, request.RequestParameters); - /// - /// HEAD request to the indices.exists_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public Task TemplateExistsAsync(IIndexTemplateExistsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// HEAD request to the indices.exists_type API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - /// Deprecated as of OpenSearch 2.0 - public ExistsResponse TypeExists(Indices index, Names type, Func selector = null) => TypeExists(selector.InvokeOrDefault(new TypeExistsDescriptor(index: index, type: type))); - /// - /// HEAD request to the indices.exists_type API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - /// Deprecated as of OpenSearch 2.0 - public Task TypeExistsAsync(Indices index, Names type, Func selector = null, CancellationToken ct = default) => TypeExistsAsync(selector.InvokeOrDefault(new TypeExistsDescriptor(index: index, type: type)), ct); - /// - /// HEAD request to the indices.exists_type API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - /// Deprecated as of OpenSearch 2.0 - public ExistsResponse TypeExists(ITypeExistsRequest request) => DoRequest(request, request.RequestParameters); - /// - /// HEAD request to the indices.exists_type API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ - /// - /// Deprecated as of OpenSearch 2.0 - public Task TypeExistsAsync(ITypeExistsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the indices.flush API, read more about this API online: - /// - /// - /// - public FlushResponse Flush(Indices index = null, Func selector = null) => Flush(selector.InvokeOrDefault(new FlushDescriptor().Index(index: index))); - /// - /// POST request to the indices.flush API, read more about this API online: - /// - /// - /// - public Task FlushAsync(Indices index = null, Func selector = null, CancellationToken ct = default) => FlushAsync(selector.InvokeOrDefault(new FlushDescriptor().Index(index: index)), ct); - /// - /// POST request to the indices.flush API, read more about this API online: - /// - /// - /// - public FlushResponse Flush(IFlushRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the indices.flush API, read more about this API online: - /// - /// - /// - public Task FlushAsync(IFlushRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the indices.forcemerge API, read more about this API online: - /// - /// - /// - public ForceMergeResponse ForceMerge(Indices index = null, Func selector = null) => ForceMerge(selector.InvokeOrDefault(new ForceMergeDescriptor().Index(index: index))); - /// - /// POST request to the indices.forcemerge API, read more about this API online: - /// - /// - /// - public Task ForceMergeAsync(Indices index = null, Func selector = null, CancellationToken ct = default) => ForceMergeAsync(selector.InvokeOrDefault(new ForceMergeDescriptor().Index(index: index)), ct); - /// - /// POST request to the indices.forcemerge API, read more about this API online: - /// - /// - /// - public ForceMergeResponse ForceMerge(IForceMergeRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the indices.forcemerge API, read more about this API online: - /// - /// - /// - public Task ForceMergeAsync(IForceMergeRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// GET request to the indices.get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-index/ - /// - public GetIndexResponse Get(Indices index, Func selector = null) => Get(selector.InvokeOrDefault(new GetIndexDescriptor(index: index))); - /// - /// GET request to the indices.get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-index/ - /// - public Task GetAsync(Indices index, Func selector = null, CancellationToken ct = default) => GetAsync(selector.InvokeOrDefault(new GetIndexDescriptor(index: index)), ct); - /// - /// GET request to the indices.get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-index/ - /// - public GetIndexResponse Get(IGetIndexRequest request) => DoRequest(request, request.RequestParameters); - /// - /// GET request to the indices.get API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/get-index/ - /// - public Task GetAsync(IGetIndexRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// GET request to the indices.get_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public GetAliasResponse GetAlias(Indices index = null, Func selector = null) => GetAlias(selector.InvokeOrDefault(new GetAliasDescriptor().Index(index: index))); - /// - /// GET request to the indices.get_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public Task GetAliasAsync(Indices index = null, Func selector = null, CancellationToken ct = default) => GetAliasAsync(selector.InvokeOrDefault(new GetAliasDescriptor().Index(index: index)), ct); - /// - /// GET request to the indices.get_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public GetAliasResponse GetAlias(IGetAliasRequest request) => DoRequest(request, request.RequestParameters); - /// - /// GET request to the indices.get_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public Task GetAliasAsync(IGetAliasRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// GET request to the indices.get_field_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - public GetFieldMappingResponse GetFieldMapping(Fields fields, Func, IGetFieldMappingRequest> selector = null) - where TDocument : class => GetFieldMapping(selector.InvokeOrDefault(new GetFieldMappingDescriptor(fields: fields))); - /// - /// GET request to the indices.get_field_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - public Task GetFieldMappingAsync(Fields fields, Func, IGetFieldMappingRequest> selector = null, CancellationToken ct = default) - where TDocument : class => GetFieldMappingAsync(selector.InvokeOrDefault(new GetFieldMappingDescriptor(fields: fields)), ct); - /// - /// GET request to the indices.get_field_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - public GetFieldMappingResponse GetFieldMapping(IGetFieldMappingRequest request) => DoRequest(request, request.RequestParameters); - /// - /// GET request to the indices.get_field_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - public Task GetFieldMappingAsync(IGetFieldMappingRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// GET request to the indices.get_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - public GetMappingResponse GetMapping(Func, IGetMappingRequest> selector = null) - where TDocument : class => GetMapping(selector.InvokeOrDefault(new GetMappingDescriptor())); - /// - /// GET request to the indices.get_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - public Task GetMappingAsync(Func, IGetMappingRequest> selector = null, CancellationToken ct = default) - where TDocument : class => GetMappingAsync(selector.InvokeOrDefault(new GetMappingDescriptor()), ct); - /// - /// GET request to the indices.get_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - public GetMappingResponse GetMapping(IGetMappingRequest request) => DoRequest(request, request.RequestParameters); - /// - /// GET request to the indices.get_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - public Task GetMappingAsync(IGetMappingRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// GET request to the indices.get_settings API, read more about this API online: - /// - /// - /// - public GetIndexSettingsResponse GetSettings(Indices index = null, Func selector = null) => GetSettings(selector.InvokeOrDefault(new GetIndexSettingsDescriptor().Index(index: index))); - /// - /// GET request to the indices.get_settings API, read more about this API online: - /// - /// - /// - public Task GetSettingsAsync(Indices index = null, Func selector = null, CancellationToken ct = default) => GetSettingsAsync(selector.InvokeOrDefault(new GetIndexSettingsDescriptor().Index(index: index)), ct); - /// - /// GET request to the indices.get_settings API, read more about this API online: - /// - /// - /// - public GetIndexSettingsResponse GetSettings(IGetIndexSettingsRequest request) => DoRequest(request, request.RequestParameters); - /// - /// GET request to the indices.get_settings API, read more about this API online: - /// - /// - /// - public Task GetSettingsAsync(IGetIndexSettingsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// GET request to the indices.get_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public GetIndexTemplateResponse GetTemplate(Names name = null, Func selector = null) => GetTemplate(selector.InvokeOrDefault(new GetIndexTemplateDescriptor().Name(name: name))); - /// - /// GET request to the indices.get_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public Task GetTemplateAsync(Names name = null, Func selector = null, CancellationToken ct = default) => GetTemplateAsync(selector.InvokeOrDefault(new GetIndexTemplateDescriptor().Name(name: name)), ct); - /// - /// GET request to the indices.get_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public GetIndexTemplateResponse GetTemplate(IGetIndexTemplateRequest request) => DoRequest(request, request.RequestParameters); - /// - /// GET request to the indices.get_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public Task GetTemplateAsync(IGetIndexTemplateRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the indices.open API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - public OpenIndexResponse Open(Indices index, Func selector = null) => Open(selector.InvokeOrDefault(new OpenIndexDescriptor(index: index))); - /// - /// POST request to the indices.open API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - public Task OpenAsync(Indices index, Func selector = null, CancellationToken ct = default) => OpenAsync(selector.InvokeOrDefault(new OpenIndexDescriptor(index: index)), ct); - /// - /// POST request to the indices.open API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - public OpenIndexResponse Open(IOpenIndexRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the indices.open API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/close-index/ - /// - public Task OpenAsync(IOpenIndexRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// PUT request to the indices.put_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public PutAliasResponse PutAlias(Indices index, Name name, Func selector = null) => PutAlias(selector.InvokeOrDefault(new PutAliasDescriptor(index: index, name: name))); - /// - /// PUT request to the indices.put_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public Task PutAliasAsync(Indices index, Name name, Func selector = null, CancellationToken ct = default) => PutAliasAsync(selector.InvokeOrDefault(new PutAliasDescriptor(index: index, name: name)), ct); - /// - /// PUT request to the indices.put_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public PutAliasResponse PutAlias(IPutAliasRequest request) => DoRequest(request, request.RequestParameters); - /// - /// PUT request to the indices.put_alias API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public Task PutAliasAsync(IPutAliasRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// PUT request to the indices.put_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - public PutMappingResponse PutMapping(Func, IPutMappingRequest> selector) - where TDocument : class => PutMapping(selector.InvokeOrDefault(new PutMappingDescriptor())); - /// - /// PUT request to the indices.put_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - public Task PutMappingAsync(Func, IPutMappingRequest> selector, CancellationToken ct = default) - where TDocument : class => PutMappingAsync(selector.InvokeOrDefault(new PutMappingDescriptor()), ct); - /// - /// PUT request to the indices.put_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - public PutMappingResponse PutMapping(IPutMappingRequest request) => DoRequest(request, request.RequestParameters); - /// - /// PUT request to the indices.put_mapping API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/update-mapping/ - /// - public Task PutMappingAsync(IPutMappingRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// PUT request to the indices.put_settings API, read more about this API online: - /// - /// - /// - public UpdateIndexSettingsResponse UpdateSettings(Indices index, Func selector) => UpdateSettings(selector.InvokeOrDefault(new UpdateIndexSettingsDescriptor().Index(index: index))); - /// - /// PUT request to the indices.put_settings API, read more about this API online: - /// - /// - /// - public Task UpdateSettingsAsync(Indices index, Func selector, CancellationToken ct = default) => UpdateSettingsAsync(selector.InvokeOrDefault(new UpdateIndexSettingsDescriptor().Index(index: index)), ct); - /// - /// PUT request to the indices.put_settings API, read more about this API online: - /// - /// - /// - public UpdateIndexSettingsResponse UpdateSettings(IUpdateIndexSettingsRequest request) => DoRequest(request, request.RequestParameters); - /// - /// PUT request to the indices.put_settings API, read more about this API online: - /// - /// - /// - public Task UpdateSettingsAsync(IUpdateIndexSettingsRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// PUT request to the indices.put_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public PutIndexTemplateResponse PutTemplate(Name name, Func selector) => PutTemplate(selector.InvokeOrDefault(new PutIndexTemplateDescriptor(name: name))); - /// - /// PUT request to the indices.put_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public Task PutTemplateAsync(Name name, Func selector, CancellationToken ct = default) => PutTemplateAsync(selector.InvokeOrDefault(new PutIndexTemplateDescriptor(name: name)), ct); - /// - /// PUT request to the indices.put_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public PutIndexTemplateResponse PutTemplate(IPutIndexTemplateRequest request) => DoRequest(request, request.RequestParameters); - /// - /// PUT request to the indices.put_template API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-templates/ - /// - public Task PutTemplateAsync(IPutIndexTemplateRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// GET request to the indices.recovery API, read more about this API online: - /// - /// - /// - public RefreshResponse Refresh(Indices index = null, Func selector = null) => Refresh(selector.InvokeOrDefault(new RefreshDescriptor().Index(index: index))); - /// - /// POST request to the indices.refresh API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public Task RefreshAsync(Indices index = null, Func selector = null, CancellationToken ct = default) => RefreshAsync(selector.InvokeOrDefault(new RefreshDescriptor().Index(index: index)), ct); - /// - /// POST request to the indices.refresh API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public RefreshResponse Refresh(IRefreshRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the indices.refresh API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/get-documents/ - /// - public Task RefreshAsync(IRefreshRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// GET request to the indices.resolve_index API, read more about this API online: - /// - /// - public ResolveIndexResponse Resolve(Names name, Func selector = null) => Resolve(selector.InvokeOrDefault(new ResolveIndexDescriptor(name: name))); - /// - /// GET request to the indices.resolve_index API, read more about this API online: - /// - /// - public Task ResolveAsync(Names name, Func selector = null, CancellationToken ct = default) => ResolveAsync(selector.InvokeOrDefault(new ResolveIndexDescriptor(name: name)), ct); - /// - /// GET request to the indices.resolve_index API, read more about this API online: - /// - /// - public ResolveIndexResponse Resolve(IResolveIndexRequest request) => DoRequest(request, request.RequestParameters); - /// - /// GET request to the indices.resolve_index API, read more about this API online: - /// - /// - public Task ResolveAsync(IResolveIndexRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the indices.rollover API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream - /// - public RolloverIndexResponse Rollover(Name alias, Func selector = null) => Rollover(selector.InvokeOrDefault(new RolloverIndexDescriptor(alias: alias))); - /// - /// POST request to the indices.rollover API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream - /// - public Task RolloverAsync(Name alias, Func selector = null, CancellationToken ct = default) => RolloverAsync(selector.InvokeOrDefault(new RolloverIndexDescriptor(alias: alias)), ct); - /// - /// POST request to the indices.rollover API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream - /// - public RolloverIndexResponse Rollover(IRolloverIndexRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the indices.rollover API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/data-streams/#step-5-rollover-a-data-stream - /// - public Task RolloverAsync(IRolloverIndexRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// GET request to the indices.segments API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-segments/ - /// - public ShrinkIndexResponse Shrink(IndexName index, IndexName target, Func selector = null) => Shrink(selector.InvokeOrDefault(new ShrinkIndexDescriptor(index: index, target: target))); - /// - /// PUT request to the indices.shrink API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/shrink-index/ - /// - public Task ShrinkAsync(IndexName index, IndexName target, Func selector = null, CancellationToken ct = default) => ShrinkAsync(selector.InvokeOrDefault(new ShrinkIndexDescriptor(index: index, target: target)), ct); - /// - /// PUT request to the indices.shrink API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/shrink-index/ - /// - public ShrinkIndexResponse Shrink(IShrinkIndexRequest request) => DoRequest(request, request.RequestParameters); - /// - /// PUT request to the indices.shrink API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/shrink-index/ - /// - public Task ShrinkAsync(IShrinkIndexRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// PUT request to the indices.split API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/split/ - /// - public SplitIndexResponse Split(IndexName index, IndexName target, Func selector = null) => Split(selector.InvokeOrDefault(new SplitIndexDescriptor(index: index, target: target))); - /// - /// PUT request to the indices.split API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/split/ - /// - public Task SplitAsync(IndexName index, IndexName target, Func selector = null, CancellationToken ct = default) => SplitAsync(selector.InvokeOrDefault(new SplitIndexDescriptor(index: index, target: target)), ct); - /// - /// PUT request to the indices.split API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/split/ - /// - public SplitIndexResponse Split(ISplitIndexRequest request) => DoRequest(request, request.RequestParameters); - /// - /// PUT request to the indices.split API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/split/ - /// - public Task SplitAsync(ISplitIndexRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the indices.update_aliases API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public BulkAliasResponse BulkAlias(Func selector) => BulkAlias(selector.InvokeOrDefault(new BulkAliasDescriptor())); - /// - /// POST request to the indices.update_aliases API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public Task BulkAliasAsync(Func selector, CancellationToken ct = default) => BulkAliasAsync(selector.InvokeOrDefault(new BulkAliasDescriptor()), ct); - /// - /// POST request to the indices.update_aliases API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public BulkAliasResponse BulkAlias(IBulkAliasRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the indices.update_aliases API, read more about this API online: - /// - /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ - /// - public Task BulkAliasAsync(IBulkAliasRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - /// - /// POST request to the indices.validate_query API, read more about this API online: - /// - /// - /// - public ValidateQueryResponse ValidateQuery(Func, IValidateQueryRequest> selector = null) - where TDocument : class => ValidateQuery(selector.InvokeOrDefault(new ValidateQueryDescriptor())); - /// - /// POST request to the indices.validate_query API, read more about this API online: - /// - /// - /// - public Task ValidateQueryAsync(Func, IValidateQueryRequest> selector = null, CancellationToken ct = default) - where TDocument : class => ValidateQueryAsync(selector.InvokeOrDefault(new ValidateQueryDescriptor()), ct); - /// - /// POST request to the indices.validate_query API, read more about this API online: - /// - /// - /// - public ValidateQueryResponse ValidateQuery(IValidateQueryRequest request) => DoRequest(request, request.RequestParameters); - /// - /// POST request to the indices.validate_query API, read more about this API online: - /// - /// - /// - public Task ValidateQueryAsync(IValidateQueryRequest request, CancellationToken ct = default) => DoRequestAsync(request, request.RequestParameters, ct); - } + /// + /// HEAD request to the indices.exists_type API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ + /// + /// Deprecated as of OpenSearch 2.0 + ExistsResponse TypeExists(ITypeExistsRequest request); + + /// + /// HEAD request to the indices.exists_type API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ + /// + /// Deprecated as of OpenSearch 2.0 + Task TypeExistsAsync( + ITypeExistsRequest request, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.put_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ + /// + PutAliasResponse PutAlias( + Indices index, + Name name, + Func selector = null + ); + + /// + /// PUT request to the indices.put_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ + /// + Task PutAliasAsync( + Indices index, + Name name, + Func selector = null, + CancellationToken ct = default + ); + } + + public partial class IndicesNamespace + { + /// + /// HEAD request to the indices.exists_type API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ + /// + /// Deprecated as of OpenSearch 2.0 + public ExistsResponse TypeExists( + Indices index, + Names type, + Func selector = null + ) => + TypeExists( + selector.InvokeOrDefault(new TypeExistsDescriptor(index: index, type: type)) + ); + + /// + /// HEAD request to the indices.exists_type API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ + /// + /// Deprecated as of OpenSearch 2.0 + public Task TypeExistsAsync( + Indices index, + Names type, + Func selector = null, + CancellationToken ct = default + ) => + TypeExistsAsync( + selector.InvokeOrDefault(new TypeExistsDescriptor(index: index, type: type)), + ct + ); + + /// + /// HEAD request to the indices.exists_type API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ + /// + /// Deprecated as of OpenSearch 2.0 + public ExistsResponse TypeExists(ITypeExistsRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// HEAD request to the indices.exists_type API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/opensearch/rest-api/index-apis/exists/ + /// + /// Deprecated as of OpenSearch 2.0 + public Task TypeExistsAsync( + ITypeExistsRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// PUT request to the indices.put_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ + /// + public PutAliasResponse PutAlias( + Indices index, + Name name, + Func selector = null + ) => PutAlias(selector.InvokeOrDefault(new PutAliasDescriptor(index: index, name: name))); + + /// + /// PUT request to the indices.put_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/opensearch/rest-api/alias/ + /// + public Task PutAliasAsync( + Indices index, + Name name, + Func selector = null, + CancellationToken ct = default + ) => + PutAliasAsync( + selector.InvokeOrDefault(new PutAliasDescriptor(index: index, name: name)), + ct + ); + } } diff --git a/src/OpenSearch.Client/Requests.Indices.cs b/src/OpenSearch.Client/Requests.Indices.cs index 27a1bfd028..64fa614470 100644 --- a/src/OpenSearch.Client/Requests.Indices.cs +++ b/src/OpenSearch.Client/Requests.Indices.cs @@ -45,12 +45,12 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Linq.Expressions; using System.Runtime.Serialization; +using System.Text; using OpenSearch.Net; -using OpenSearch.Net.Utf8Json; using OpenSearch.Net.Specification.IndicesApi; +using OpenSearch.Net.Utf8Json; // ReSharper disable RedundantBaseConstructorCall // ReSharper disable UnusedTypeParameter @@ -58,2583 +58,162 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { - [InterfaceDataContract] - public partial interface IAddIndexBlockRequest : IRequest - { - [IgnoreDataMember] - Indices Index - { - get; - } - - [IgnoreDataMember] - IndexBlock Block - { - get; - } - } - - ///Request for AddBlock - public partial class AddIndexBlockRequest : PlainRequestBase, IAddIndexBlockRequest - { - protected IAddIndexBlockRequest Self => this; - internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesAddBlock; - ////{index}/_block/{block} - ///this parameter is required - ///this parameter is required - public AddIndexBlockRequest(Indices index, IndexBlock block): base(r => r.Required("index", index).Required("block", block)) - { - } - - ///Used for serialization purposes, making sure we have a parameterless constructor - [SerializationConstructor] - protected AddIndexBlockRequest(): base() - { - } - - // values part of the url path - [IgnoreDataMember] - Indices IAddIndexBlockRequest.Index => Self.RouteValues.Get("index"); - [IgnoreDataMember] - IndexBlock IAddIndexBlockRequest.Block => Self.RouteValues.Get("block"); - // 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 bool? AllowNoIndices - { - get => Q("allow_no_indices"); - set => Q("allow_no_indices", value); - } - - ///Whether to expand wildcard expression to concrete indices that are open, closed or both. - public ExpandWildcards? ExpandWildcards - { - get => Q("expand_wildcards"); - set => Q("expand_wildcards", value); - } - - ///Whether specified concrete indices should be ignored when unavailable (missing or closed) - public bool? IgnoreUnavailable - { - get => Q("ignore_unavailable"); - set => Q("ignore_unavailable", value); - } - - ///Specify timeout for connection to master node - ///Deprecated as of OpenSearch 2.0, use instead - public Time MasterTimeout - { - get => Q public partial interface IIndicesNamespace { + /// + /// PUT request to the indices.add_block API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + AddIndexBlockResponse AddBlock( + Indices index, + IndexBlock block, + Func selector = null + ); + + /// + /// PUT request to the indices.add_block API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task AddBlockAsync( + Indices index, + IndexBlock block, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.add_block API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + AddIndexBlockResponse AddBlock(IAddIndexBlockRequest request); + + /// + /// PUT request to the indices.add_block API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task AddBlockAsync( + IAddIndexBlockRequest request, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.analyze API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ + /// + AnalyzeResponse Analyze(Func selector = null); + + /// + /// POST request to the indices.analyze API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ + /// + Task AnalyzeAsync( + Func selector = null, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.analyze API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ + /// + AnalyzeResponse Analyze(IAnalyzeRequest request); + + /// + /// POST request to the indices.analyze API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ + /// + Task AnalyzeAsync(IAnalyzeRequest request, CancellationToken ct = default); + + /// + /// POST request to the indices.clear_cache API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ + /// + ClearCacheResponse ClearCache( + Indices index = null, + Func selector = null + ); + + /// + /// POST request to the indices.clear_cache API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ + /// + Task ClearCacheAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.clear_cache API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ + /// + ClearCacheResponse ClearCache(IClearCacheRequest request); + + /// + /// POST request to the indices.clear_cache API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ + /// + Task ClearCacheAsync( + IClearCacheRequest request, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.clone API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clone/ + /// + CloneIndexResponse Clone( + IndexName index, + IndexName target, + Func selector = null + ); + + /// + /// PUT request to the indices.clone API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clone/ + /// + Task CloneAsync( + IndexName index, + IndexName target, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.clone API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clone/ + /// + CloneIndexResponse Clone(ICloneIndexRequest request); + + /// + /// PUT request to the indices.clone API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clone/ + /// + Task CloneAsync( + ICloneIndexRequest request, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.close API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/close-index/ + /// + CloseIndexResponse Close( + Indices index, + Func selector = null + ); + + /// + /// POST request to the indices.close API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/close-index/ + /// + Task CloseAsync( + Indices index, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.close API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/close-index/ + /// + CloseIndexResponse Close(ICloseIndexRequest request); + + /// + /// POST request to the indices.close API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/close-index/ + /// + Task CloseAsync( + ICloseIndexRequest request, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.create API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ + /// + CreateIndexResponse Create( + IndexName index, + Func selector = null + ); + + /// + /// PUT request to the indices.create API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ + /// + Task CreateAsync( + IndexName index, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.create API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ + /// + CreateIndexResponse Create(ICreateIndexRequest request); + + /// + /// PUT request to the indices.create API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ + /// + Task CreateAsync( + ICreateIndexRequest request, + CancellationToken ct = default + ); + + /// + /// DELETE request to the indices.delete API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/ + /// + DeleteIndexResponse Delete( + Indices index, + Func selector = null + ); + + /// + /// DELETE request to the indices.delete API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/ + /// + Task DeleteAsync( + Indices index, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// DELETE request to the indices.delete API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/ + /// + DeleteIndexResponse Delete(IDeleteIndexRequest request); + + /// + /// DELETE request to the indices.delete API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/ + /// + Task DeleteAsync( + IDeleteIndexRequest request, + CancellationToken ct = default + ); + + /// + /// DELETE request to the indices.delete_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/#delete-aliases + /// + DeleteAliasResponse DeleteAlias( + Indices index, + Names name, + Func selector = null + ); + + /// + /// DELETE request to the indices.delete_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/#delete-aliases + /// + Task DeleteAliasAsync( + Indices index, + Names name, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// DELETE request to the indices.delete_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/#delete-aliases + /// + DeleteAliasResponse DeleteAlias(IDeleteAliasRequest request); + + /// + /// DELETE request to the indices.delete_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/#delete-aliases + /// + Task DeleteAliasAsync( + IDeleteAliasRequest request, + CancellationToken ct = default + ); + /// /// DELETE request to the indices.delete_index_template API, read more about this API online: /// @@ -104,425 +407,2778 @@ Task DeleteComposableTemplateAsync( ); /// - /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// DELETE request to the indices.delete_template API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest /// - ExistsResponse ComposableTemplateExists( + DeleteIndexTemplateResponse DeleteTemplate( Name name, - Func< - ComposableIndexTemplateExistsDescriptor, - IComposableIndexTemplateExistsRequest - > selector = null + Func selector = null ); /// - /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// DELETE request to the indices.delete_template API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest /// - Task ComposableTemplateExistsAsync( + Task DeleteTemplateAsync( Name name, - Func< - ComposableIndexTemplateExistsDescriptor, - IComposableIndexTemplateExistsRequest - > selector = null, + Func selector = null, CancellationToken ct = default ); /// - /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// DELETE request to the indices.delete_template API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest /// - ExistsResponse ComposableTemplateExists(IComposableIndexTemplateExistsRequest request); + DeleteIndexTemplateResponse DeleteTemplate(IDeleteIndexTemplateRequest request); /// - /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// DELETE request to the indices.delete_template API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest /// - Task ComposableTemplateExistsAsync( - IComposableIndexTemplateExistsRequest request, + Task DeleteTemplateAsync( + IDeleteIndexTemplateRequest request, CancellationToken ct = default ); /// - /// GET request to the indices.get_index_template API, read more about this API online: + /// HEAD request to the indices.exists API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/api-reference/index-apis/exists/ /// - GetComposableIndexTemplateResponse GetComposableTemplate( - Name name = null, - Func< - GetComposableIndexTemplateDescriptor, - IGetComposableIndexTemplateRequest - > selector = null + ExistsResponse Exists( + Indices index, + Func selector = null ); /// - /// GET request to the indices.get_index_template API, read more about this API online: + /// HEAD request to the indices.exists API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/api-reference/index-apis/exists/ /// - Task GetComposableTemplateAsync( - Name name = null, - Func< - GetComposableIndexTemplateDescriptor, - IGetComposableIndexTemplateRequest - > selector = null, + Task ExistsAsync( + Indices index, + Func selector = null, CancellationToken ct = default ); /// - /// GET request to the indices.get_index_template API, read more about this API online: + /// HEAD request to the indices.exists API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/api-reference/index-apis/exists/ /// - GetComposableIndexTemplateResponse GetComposableTemplate( - IGetComposableIndexTemplateRequest request + ExistsResponse Exists(IIndexExistsRequest request); + + /// + /// HEAD request to the indices.exists API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/exists/ + /// + Task ExistsAsync( + IIndexExistsRequest request, + CancellationToken ct = default ); /// - /// GET request to the indices.get_index_template API, read more about this API online: + /// HEAD request to the indices.exists_alias API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest /// - Task GetComposableTemplateAsync( - IGetComposableIndexTemplateRequest request, + ExistsResponse AliasExists( + Names name, + Func selector = null + ); + + /// + /// HEAD request to the indices.exists_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task AliasExistsAsync( + Names name, + Func selector = null, CancellationToken ct = default ); /// - /// PUT request to the indices.put_index_template API, read more about this API online: + /// HEAD request to the indices.exists_alias API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest /// - PutComposableIndexTemplateResponse PutComposableTemplate( - Name name, - Func selector + ExistsResponse AliasExists(IAliasExistsRequest request); + + /// + /// HEAD request to the indices.exists_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task AliasExistsAsync( + IAliasExistsRequest request, + CancellationToken ct = default ); /// - /// PUT request to the indices.put_index_template API, read more about this API online: + /// HEAD request to the indices.exists_index_template API, read more about this API online: /// /// https://opensearch.org/docs/latest/im-plugin/index-templates/ /// - Task PutComposableTemplateAsync( + ExistsResponse ComposableTemplateExists( Name name, - Func selector, - CancellationToken ct = default + Func< + ComposableIndexTemplateExistsDescriptor, + IComposableIndexTemplateExistsRequest + > selector = null ); /// - /// PUT request to the indices.put_index_template API, read more about this API online: + /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + Task ComposableTemplateExistsAsync( + Name name, + Func< + ComposableIndexTemplateExistsDescriptor, + IComposableIndexTemplateExistsRequest + > selector = null, + CancellationToken ct = default + ); + + /// + /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + ExistsResponse ComposableTemplateExists(IComposableIndexTemplateExistsRequest request); + + /// + /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + Task ComposableTemplateExistsAsync( + IComposableIndexTemplateExistsRequest request, + CancellationToken ct = default + ); + + /// + /// HEAD request to the indices.exists_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + ExistsResponse TemplateExists( + Names name, + Func selector = null + ); + + /// + /// HEAD request to the indices.exists_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task TemplateExistsAsync( + Names name, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// HEAD request to the indices.exists_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + ExistsResponse TemplateExists(IIndexTemplateExistsRequest request); + + /// + /// HEAD request to the indices.exists_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task TemplateExistsAsync( + IIndexTemplateExistsRequest request, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.flush API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + FlushResponse Flush( + Indices index = null, + Func selector = null + ); + + /// + /// POST request to the indices.flush API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task FlushAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.flush API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + FlushResponse Flush(IFlushRequest request); + + /// + /// POST request to the indices.flush API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task FlushAsync(IFlushRequest request, CancellationToken ct = default); + + /// + /// POST request to the indices.forcemerge API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + ForceMergeResponse ForceMerge( + Indices index = null, + Func selector = null + ); + + /// + /// POST request to the indices.forcemerge API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task ForceMergeAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.forcemerge API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + ForceMergeResponse ForceMerge(IForceMergeRequest request); + + /// + /// POST request to the indices.forcemerge API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task ForceMergeAsync( + IForceMergeRequest request, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.get API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ + /// + GetIndexResponse Get( + Indices index, + Func selector = null + ); + + /// + /// GET request to the indices.get API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ + /// + Task GetAsync( + Indices index, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.get API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ + /// + GetIndexResponse Get(IGetIndexRequest request); + + /// + /// GET request to the indices.get API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ + /// + Task GetAsync(IGetIndexRequest request, CancellationToken ct = default); + + /// + /// GET request to the indices.get_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/ + /// + GetAliasResponse GetAlias( + Indices index = null, + Func selector = null + ); + + /// + /// GET request to the indices.get_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/ + /// + Task GetAliasAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.get_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/ + /// + GetAliasResponse GetAlias(IGetAliasRequest request); + + /// + /// GET request to the indices.get_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/ + /// + Task GetAliasAsync( + IGetAliasRequest request, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.get_field_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/ + /// + GetFieldMappingResponse GetFieldMapping( + Fields fields, + Func, IGetFieldMappingRequest> selector = null + ) + where TDocument : class; + + /// + /// GET request to the indices.get_field_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/ + /// + Task GetFieldMappingAsync( + Fields fields, + Func, IGetFieldMappingRequest> selector = null, + CancellationToken ct = default + ) + where TDocument : class; + + /// + /// GET request to the indices.get_field_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/ + /// + GetFieldMappingResponse GetFieldMapping(IGetFieldMappingRequest request); + + /// + /// GET request to the indices.get_field_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/ + /// + Task GetFieldMappingAsync( + IGetFieldMappingRequest request, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.get_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + GetComposableIndexTemplateResponse GetComposableTemplate( + Name name = null, + Func< + GetComposableIndexTemplateDescriptor, + IGetComposableIndexTemplateRequest + > selector = null + ); + + /// + /// GET request to the indices.get_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + Task GetComposableTemplateAsync( + Name name = null, + Func< + GetComposableIndexTemplateDescriptor, + IGetComposableIndexTemplateRequest + > selector = null, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.get_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + GetComposableIndexTemplateResponse GetComposableTemplate( + IGetComposableIndexTemplateRequest request + ); + + /// + /// GET request to the indices.get_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + Task GetComposableTemplateAsync( + IGetComposableIndexTemplateRequest request, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.get_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/#get-a-mapping + /// + GetMappingResponse GetMapping( + Func, IGetMappingRequest> selector = null + ) + where TDocument : class; + + /// + /// GET request to the indices.get_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/#get-a-mapping + /// + Task GetMappingAsync( + Func, IGetMappingRequest> selector = null, + CancellationToken ct = default + ) + where TDocument : class; + + /// + /// GET request to the indices.get_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/#get-a-mapping + /// + GetMappingResponse GetMapping(IGetMappingRequest request); + + /// + /// GET request to the indices.get_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/#get-a-mapping + /// + Task GetMappingAsync( + IGetMappingRequest request, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.get_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ + /// + GetIndexSettingsResponse GetSettings( + Indices index = null, + Func selector = null + ); + + /// + /// GET request to the indices.get_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ + /// + Task GetSettingsAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.get_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ + /// + GetIndexSettingsResponse GetSettings(IGetIndexSettingsRequest request); + + /// + /// GET request to the indices.get_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ + /// + Task GetSettingsAsync( + IGetIndexSettingsRequest request, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.get_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + GetIndexTemplateResponse GetTemplate( + Names name = null, + Func selector = null + ); + + /// + /// GET request to the indices.get_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task GetTemplateAsync( + Names name = null, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.get_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + GetIndexTemplateResponse GetTemplate(IGetIndexTemplateRequest request); + + /// + /// GET request to the indices.get_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task GetTemplateAsync( + IGetIndexTemplateRequest request, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.open API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/open-index/ + /// + OpenIndexResponse Open( + Indices index, + Func selector = null + ); + + /// + /// POST request to the indices.open API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/open-index/ + /// + Task OpenAsync( + Indices index, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.open API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/open-index/ + /// + OpenIndexResponse Open(IOpenIndexRequest request); + + /// + /// POST request to the indices.open API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/open-index/ + /// + Task OpenAsync( + IOpenIndexRequest request, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.put_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + /// + PutAliasResponse PutAlias( + Indices index = null, + Func selector = null + ); + + /// + /// PUT request to the indices.put_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + /// + Task PutAliasAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.put_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + /// + PutAliasResponse PutAlias(IPutAliasRequest request); + + /// + /// PUT request to the indices.put_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + /// + Task PutAliasAsync( + IPutAliasRequest request, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.put_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + PutComposableIndexTemplateResponse PutComposableTemplate( + Name name, + Func selector + ); + + /// + /// PUT request to the indices.put_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + Task PutComposableTemplateAsync( + Name name, + Func selector, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.put_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + PutComposableIndexTemplateResponse PutComposableTemplate( + IPutComposableIndexTemplateRequest request + ); + + /// + /// PUT request to the indices.put_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + Task PutComposableTemplateAsync( + IPutComposableIndexTemplateRequest request, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.put_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ + /// + PutMappingResponse PutMapping( + Func, IPutMappingRequest> selector + ) + where TDocument : class; + + /// + /// PUT request to the indices.put_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ + /// + Task PutMappingAsync( + Func, IPutMappingRequest> selector, + CancellationToken ct = default + ) + where TDocument : class; + + /// + /// PUT request to the indices.put_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ + /// + PutMappingResponse PutMapping(IPutMappingRequest request); + + /// + /// PUT request to the indices.put_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ + /// + Task PutMappingAsync( + IPutMappingRequest request, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.put_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ + /// + UpdateIndexSettingsResponse UpdateSettings( + Indices index, + Func selector + ); + + /// + /// PUT request to the indices.put_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ + /// + Task UpdateSettingsAsync( + Indices index, + Func selector, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.put_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ + /// + UpdateIndexSettingsResponse UpdateSettings(IUpdateIndexSettingsRequest request); + + /// + /// PUT request to the indices.put_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ + /// + Task UpdateSettingsAsync( + IUpdateIndexSettingsRequest request, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.put_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + PutIndexTemplateResponse PutTemplate( + Name name, + Func selector + ); + + /// + /// PUT request to the indices.put_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + Task PutTemplateAsync( + Name name, + Func selector, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.put_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + PutIndexTemplateResponse PutTemplate(IPutIndexTemplateRequest request); + + /// + /// PUT request to the indices.put_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + Task PutTemplateAsync( + IPutIndexTemplateRequest request, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.refresh API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability + /// + RefreshResponse Refresh( + Indices index = null, + Func selector = null + ); + + /// + /// POST request to the indices.refresh API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability + /// + Task RefreshAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.refresh API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability + /// + RefreshResponse Refresh(IRefreshRequest request); + + /// + /// POST request to the indices.refresh API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability + /// + Task RefreshAsync(IRefreshRequest request, CancellationToken ct = default); + + /// + /// GET request to the indices.resolve_index API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + ResolveIndexResponse Resolve( + Names name, + Func selector = null + ); + + /// + /// GET request to the indices.resolve_index API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task ResolveAsync( + Names name, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.resolve_index API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + ResolveIndexResponse Resolve(IResolveIndexRequest request); + + /// + /// GET request to the indices.resolve_index API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task ResolveAsync( + IResolveIndexRequest request, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.rollover API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/dashboards/im-dashboards/rollover/ + /// + RolloverIndexResponse Rollover( + Name alias, + Func selector = null + ); + + /// + /// POST request to the indices.rollover API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/dashboards/im-dashboards/rollover/ + /// + Task RolloverAsync( + Name alias, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.rollover API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/dashboards/im-dashboards/rollover/ + /// + RolloverIndexResponse Rollover(IRolloverIndexRequest request); + + /// + /// POST request to the indices.rollover API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/dashboards/im-dashboards/rollover/ + /// + Task RolloverAsync( + IRolloverIndexRequest request, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.shrink API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ + /// + ShrinkIndexResponse Shrink( + IndexName index, + IndexName target, + Func selector = null + ); + + /// + /// PUT request to the indices.shrink API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ + /// + Task ShrinkAsync( + IndexName index, + IndexName target, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.shrink API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ + /// + ShrinkIndexResponse Shrink(IShrinkIndexRequest request); + + /// + /// PUT request to the indices.shrink API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ + /// + Task ShrinkAsync( + IShrinkIndexRequest request, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.split API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/split/ + /// + SplitIndexResponse Split( + IndexName index, + IndexName target, + Func selector = null + ); + + /// + /// PUT request to the indices.split API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/split/ + /// + Task SplitAsync( + IndexName index, + IndexName target, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// PUT request to the indices.split API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/split/ + /// + SplitIndexResponse Split(ISplitIndexRequest request); + + /// + /// PUT request to the indices.split API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/split/ + /// + Task SplitAsync( + ISplitIndexRequest request, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.stats API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + IndicesStatsResponse Stats( + Indices index = null, + Func selector = null + ); + + /// + /// GET request to the indices.stats API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task StatsAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ); + + /// + /// GET request to the indices.stats API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + IndicesStatsResponse Stats(IIndicesStatsRequest request); + + /// + /// GET request to the indices.stats API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task StatsAsync( + IIndicesStatsRequest request, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.update_aliases API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/alias/ + /// + BulkAliasResponse BulkAlias(Func selector); + + /// + /// POST request to the indices.update_aliases API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/alias/ + /// + Task BulkAliasAsync( + Func selector, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.update_aliases API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/alias/ + /// + BulkAliasResponse BulkAlias(IBulkAliasRequest request); + + /// + /// POST request to the indices.update_aliases API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/alias/ + /// + Task BulkAliasAsync( + IBulkAliasRequest request, + CancellationToken ct = default + ); + + /// + /// POST request to the indices.validate_query API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + ValidateQueryResponse ValidateQuery( + Func, IValidateQueryRequest> selector = null + ) + where TDocument : class; + + /// + /// POST request to the indices.validate_query API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task ValidateQueryAsync( + Func, IValidateQueryRequest> selector = null, + CancellationToken ct = default + ) + where TDocument : class; + + /// + /// POST request to the indices.validate_query API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + ValidateQueryResponse ValidateQuery(IValidateQueryRequest request); + + /// + /// POST request to the indices.validate_query API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + Task ValidateQueryAsync( + IValidateQueryRequest request, + CancellationToken ct = default + ); + } + + /// + /// Indices implementation. + /// Not intended to be instantiated directly. Use the property + /// on . + /// + /// + public partial class IndicesNamespace : NamespacedClientProxy, IIndicesNamespace + { + internal IndicesNamespace(OpenSearchClient client) + : base(client) { } + + /// + /// PUT request to the indices.add_block API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public AddIndexBlockResponse AddBlock( + Indices index, + IndexBlock block, + Func selector = null + ) => + AddBlock( + selector.InvokeOrDefault(new AddIndexBlockDescriptor(index: index, block: block)) + ); + + /// + /// PUT request to the indices.add_block API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task AddBlockAsync( + Indices index, + IndexBlock block, + Func selector = null, + CancellationToken ct = default + ) => + AddBlockAsync( + selector.InvokeOrDefault(new AddIndexBlockDescriptor(index: index, block: block)), + ct + ); + + /// + /// PUT request to the indices.add_block API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public AddIndexBlockResponse AddBlock(IAddIndexBlockRequest request) => + DoRequest( + request, + request.RequestParameters + ); + + /// + /// PUT request to the indices.add_block API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task AddBlockAsync( + IAddIndexBlockRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// POST request to the indices.analyze API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ + /// + public AnalyzeResponse Analyze(Func selector = null) => + Analyze(selector.InvokeOrDefault(new AnalyzeDescriptor())); + + /// + /// POST request to the indices.analyze API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ + /// + public Task AnalyzeAsync( + Func selector = null, + CancellationToken ct = default + ) => AnalyzeAsync(selector.InvokeOrDefault(new AnalyzeDescriptor()), ct); + + /// + /// POST request to the indices.analyze API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ + /// + public AnalyzeResponse Analyze(IAnalyzeRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// POST request to the indices.analyze API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/analyze-apis/perform-text-analysis/ + /// + public Task AnalyzeAsync( + IAnalyzeRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// POST request to the indices.clear_cache API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ + /// + public ClearCacheResponse ClearCache( + Indices index = null, + Func selector = null + ) => ClearCache(selector.InvokeOrDefault(new ClearCacheDescriptor().Index(index: index))); + + /// + /// POST request to the indices.clear_cache API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ + /// + public Task ClearCacheAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ) => + ClearCacheAsync( + selector.InvokeOrDefault(new ClearCacheDescriptor().Index(index: index)), + ct + ); + + /// + /// POST request to the indices.clear_cache API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ + /// + public ClearCacheResponse ClearCache(IClearCacheRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// POST request to the indices.clear_cache API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clear-index-cache/ + /// + public Task ClearCacheAsync( + IClearCacheRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// PUT request to the indices.clone API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clone/ + /// + public CloneIndexResponse Clone( + IndexName index, + IndexName target, + Func selector = null + ) => + Clone(selector.InvokeOrDefault(new CloneIndexDescriptor(index: index, target: target))); + + /// + /// PUT request to the indices.clone API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clone/ + /// + public Task CloneAsync( + IndexName index, + IndexName target, + Func selector = null, + CancellationToken ct = default + ) => + CloneAsync( + selector.InvokeOrDefault(new CloneIndexDescriptor(index: index, target: target)), + ct + ); + + /// + /// PUT request to the indices.clone API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clone/ + /// + public CloneIndexResponse Clone(ICloneIndexRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// PUT request to the indices.clone API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/clone/ + /// + public Task CloneAsync( + ICloneIndexRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// POST request to the indices.close API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/close-index/ + /// + public CloseIndexResponse Close( + Indices index, + Func selector = null + ) => Close(selector.InvokeOrDefault(new CloseIndexDescriptor(index: index))); + + /// + /// POST request to the indices.close API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/close-index/ + /// + public Task CloseAsync( + Indices index, + Func selector = null, + CancellationToken ct = default + ) => CloseAsync(selector.InvokeOrDefault(new CloseIndexDescriptor(index: index)), ct); + + /// + /// POST request to the indices.close API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/close-index/ + /// + public CloseIndexResponse Close(ICloseIndexRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// POST request to the indices.close API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/close-index/ + /// + public Task CloseAsync( + ICloseIndexRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// PUT request to the indices.create API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ + /// + public CreateIndexResponse Create( + IndexName index, + Func selector = null + ) => Create(selector.InvokeOrDefault(new CreateIndexDescriptor(index: index))); + + /// + /// PUT request to the indices.create API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ + /// + public Task CreateAsync( + IndexName index, + Func selector = null, + CancellationToken ct = default + ) => CreateAsync(selector.InvokeOrDefault(new CreateIndexDescriptor(index: index)), ct); + + /// + /// PUT request to the indices.create API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ + /// + public CreateIndexResponse Create(ICreateIndexRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// PUT request to the indices.create API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/create-index/ + /// + public Task CreateAsync( + ICreateIndexRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// DELETE request to the indices.delete API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/ + /// + public DeleteIndexResponse Delete( + Indices index, + Func selector = null + ) => Delete(selector.InvokeOrDefault(new DeleteIndexDescriptor(index: index))); + + /// + /// DELETE request to the indices.delete API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/ + /// + public Task DeleteAsync( + Indices index, + Func selector = null, + CancellationToken ct = default + ) => DeleteAsync(selector.InvokeOrDefault(new DeleteIndexDescriptor(index: index)), ct); + + /// + /// DELETE request to the indices.delete API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/ + /// + public DeleteIndexResponse Delete(IDeleteIndexRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// DELETE request to the indices.delete API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/delete-index/ + /// + public Task DeleteAsync( + IDeleteIndexRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// DELETE request to the indices.delete_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/#delete-aliases + /// + public DeleteAliasResponse DeleteAlias( + Indices index, + Names name, + Func selector = null + ) => + DeleteAlias( + selector.InvokeOrDefault(new DeleteAliasDescriptor(index: index, name: name)) + ); + + /// + /// DELETE request to the indices.delete_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/#delete-aliases + /// + public Task DeleteAliasAsync( + Indices index, + Names name, + Func selector = null, + CancellationToken ct = default + ) => + DeleteAliasAsync( + selector.InvokeOrDefault(new DeleteAliasDescriptor(index: index, name: name)), + ct + ); + + /// + /// DELETE request to the indices.delete_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/#delete-aliases + /// + public DeleteAliasResponse DeleteAlias(IDeleteAliasRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// DELETE request to the indices.delete_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/#delete-aliases + /// + public Task DeleteAliasAsync( + IDeleteAliasRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// DELETE request to the indices.delete_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/#delete-a-template + /// + public DeleteComposableIndexTemplateResponse DeleteComposableTemplate( + Name name, + Func< + DeleteComposableIndexTemplateDescriptor, + IDeleteComposableIndexTemplateRequest + > selector = null + ) => + DeleteComposableTemplate( + selector.InvokeOrDefault(new DeleteComposableIndexTemplateDescriptor(name: name)) + ); + + /// + /// DELETE request to the indices.delete_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/#delete-a-template + /// + public Task DeleteComposableTemplateAsync( + Name name, + Func< + DeleteComposableIndexTemplateDescriptor, + IDeleteComposableIndexTemplateRequest + > selector = null, + CancellationToken ct = default + ) => + DeleteComposableTemplateAsync( + selector.InvokeOrDefault(new DeleteComposableIndexTemplateDescriptor(name: name)), + ct + ); + + /// + /// DELETE request to the indices.delete_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/#delete-a-template + /// + public DeleteComposableIndexTemplateResponse DeleteComposableTemplate( + IDeleteComposableIndexTemplateRequest request + ) => + DoRequest( + request, + request.RequestParameters + ); + + /// + /// DELETE request to the indices.delete_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/#delete-a-template + /// + public Task DeleteComposableTemplateAsync( + IDeleteComposableIndexTemplateRequest request, + CancellationToken ct = default + ) => + DoRequestAsync< + IDeleteComposableIndexTemplateRequest, + DeleteComposableIndexTemplateResponse + >(request, request.RequestParameters, ct); + + /// + /// DELETE request to the indices.delete_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public DeleteIndexTemplateResponse DeleteTemplate( + Name name, + Func selector = null + ) => + DeleteTemplate(selector.InvokeOrDefault(new DeleteIndexTemplateDescriptor(name: name))); + + /// + /// DELETE request to the indices.delete_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task DeleteTemplateAsync( + Name name, + Func selector = null, + CancellationToken ct = default + ) => + DeleteTemplateAsync( + selector.InvokeOrDefault(new DeleteIndexTemplateDescriptor(name: name)), + ct + ); + + /// + /// DELETE request to the indices.delete_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public DeleteIndexTemplateResponse DeleteTemplate(IDeleteIndexTemplateRequest request) => + DoRequest( + request, + request.RequestParameters + ); + + /// + /// DELETE request to the indices.delete_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task DeleteTemplateAsync( + IDeleteIndexTemplateRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// HEAD request to the indices.exists API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/exists/ + /// + public ExistsResponse Exists( + Indices index, + Func selector = null + ) => Exists(selector.InvokeOrDefault(new IndexExistsDescriptor(index: index))); + + /// + /// HEAD request to the indices.exists API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/exists/ + /// + public Task ExistsAsync( + Indices index, + Func selector = null, + CancellationToken ct = default + ) => ExistsAsync(selector.InvokeOrDefault(new IndexExistsDescriptor(index: index)), ct); + + /// + /// HEAD request to the indices.exists API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/exists/ + /// + public ExistsResponse Exists(IIndexExistsRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// HEAD request to the indices.exists API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/exists/ + /// + public Task ExistsAsync( + IIndexExistsRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// HEAD request to the indices.exists_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public ExistsResponse AliasExists( + Names name, + Func selector = null + ) => AliasExists(selector.InvokeOrDefault(new AliasExistsDescriptor(name: name))); + + /// + /// HEAD request to the indices.exists_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task AliasExistsAsync( + Names name, + Func selector = null, + CancellationToken ct = default + ) => AliasExistsAsync(selector.InvokeOrDefault(new AliasExistsDescriptor(name: name)), ct); + + /// + /// HEAD request to the indices.exists_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public ExistsResponse AliasExists(IAliasExistsRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// HEAD request to the indices.exists_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task AliasExistsAsync( + IAliasExistsRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public ExistsResponse ComposableTemplateExists( + Name name, + Func< + ComposableIndexTemplateExistsDescriptor, + IComposableIndexTemplateExistsRequest + > selector = null + ) => + ComposableTemplateExists( + selector.InvokeOrDefault(new ComposableIndexTemplateExistsDescriptor(name: name)) + ); + + /// + /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public Task ComposableTemplateExistsAsync( + Name name, + Func< + ComposableIndexTemplateExistsDescriptor, + IComposableIndexTemplateExistsRequest + > selector = null, + CancellationToken ct = default + ) => + ComposableTemplateExistsAsync( + selector.InvokeOrDefault(new ComposableIndexTemplateExistsDescriptor(name: name)), + ct + ); + + /// + /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public ExistsResponse ComposableTemplateExists( + IComposableIndexTemplateExistsRequest request + ) => + DoRequest( + request, + request.RequestParameters + ); + + /// + /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public Task ComposableTemplateExistsAsync( + IComposableIndexTemplateExistsRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// HEAD request to the indices.exists_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public ExistsResponse TemplateExists( + Names name, + Func selector = null + ) => + TemplateExists(selector.InvokeOrDefault(new IndexTemplateExistsDescriptor(name: name))); + + /// + /// HEAD request to the indices.exists_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task TemplateExistsAsync( + Names name, + Func selector = null, + CancellationToken ct = default + ) => + TemplateExistsAsync( + selector.InvokeOrDefault(new IndexTemplateExistsDescriptor(name: name)), + ct + ); + + /// + /// HEAD request to the indices.exists_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public ExistsResponse TemplateExists(IIndexTemplateExistsRequest request) => + DoRequest( + request, + request.RequestParameters + ); + + /// + /// HEAD request to the indices.exists_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task TemplateExistsAsync( + IIndexTemplateExistsRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// POST request to the indices.flush API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public FlushResponse Flush( + Indices index = null, + Func selector = null + ) => Flush(selector.InvokeOrDefault(new FlushDescriptor().Index(index: index))); + + /// + /// POST request to the indices.flush API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task FlushAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ) => FlushAsync(selector.InvokeOrDefault(new FlushDescriptor().Index(index: index)), ct); + + /// + /// POST request to the indices.flush API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public FlushResponse Flush(IFlushRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// POST request to the indices.flush API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task FlushAsync( + IFlushRequest request, + CancellationToken ct = default + ) => DoRequestAsync(request, request.RequestParameters, ct); + + /// + /// POST request to the indices.forcemerge API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public ForceMergeResponse ForceMerge( + Indices index = null, + Func selector = null + ) => ForceMerge(selector.InvokeOrDefault(new ForceMergeDescriptor().Index(index: index))); + + /// + /// POST request to the indices.forcemerge API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task ForceMergeAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ) => + ForceMergeAsync( + selector.InvokeOrDefault(new ForceMergeDescriptor().Index(index: index)), + ct + ); + + /// + /// POST request to the indices.forcemerge API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public ForceMergeResponse ForceMerge(IForceMergeRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// POST request to the indices.forcemerge API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task ForceMergeAsync( + IForceMergeRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// GET request to the indices.get API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ + /// + public GetIndexResponse Get( + Indices index, + Func selector = null + ) => Get(selector.InvokeOrDefault(new GetIndexDescriptor(index: index))); + + /// + /// GET request to the indices.get API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ + /// + public Task GetAsync( + Indices index, + Func selector = null, + CancellationToken ct = default + ) => GetAsync(selector.InvokeOrDefault(new GetIndexDescriptor(index: index)), ct); + + /// + /// GET request to the indices.get API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ + /// + public GetIndexResponse Get(IGetIndexRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// GET request to the indices.get API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-index/ + /// + public Task GetAsync( + IGetIndexRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// GET request to the indices.get_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/ + /// + public GetAliasResponse GetAlias( + Indices index = null, + Func selector = null + ) => GetAlias(selector.InvokeOrDefault(new GetAliasDescriptor().Index(index: index))); + + /// + /// GET request to the indices.get_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/ + /// + public Task GetAliasAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ) => + GetAliasAsync( + selector.InvokeOrDefault(new GetAliasDescriptor().Index(index: index)), + ct + ); + + /// + /// GET request to the indices.get_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/ + /// + public GetAliasResponse GetAlias(IGetAliasRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// GET request to the indices.get_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-alias/ + /// + public Task GetAliasAsync( + IGetAliasRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// GET request to the indices.get_field_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/ + /// + public GetFieldMappingResponse GetFieldMapping( + Fields fields, + Func, IGetFieldMappingRequest> selector = null + ) + where TDocument : class => + GetFieldMapping( + selector.InvokeOrDefault(new GetFieldMappingDescriptor(fields: fields)) + ); + + /// + /// GET request to the indices.get_field_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/ + /// + public Task GetFieldMappingAsync( + Fields fields, + Func, IGetFieldMappingRequest> selector = null, + CancellationToken ct = default + ) + where TDocument : class => + GetFieldMappingAsync( + selector.InvokeOrDefault(new GetFieldMappingDescriptor(fields: fields)), + ct + ); + + /// + /// GET request to the indices.get_field_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/ + /// + public GetFieldMappingResponse GetFieldMapping(IGetFieldMappingRequest request) => + DoRequest( + request, + request.RequestParameters + ); + + /// + /// GET request to the indices.get_field_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/ + /// + public Task GetFieldMappingAsync( + IGetFieldMappingRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// GET request to the indices.get_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public GetComposableIndexTemplateResponse GetComposableTemplate( + Name name = null, + Func< + GetComposableIndexTemplateDescriptor, + IGetComposableIndexTemplateRequest + > selector = null + ) => + GetComposableTemplate( + selector.InvokeOrDefault( + new GetComposableIndexTemplateDescriptor().Name(name: name) + ) + ); + + /// + /// GET request to the indices.get_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public Task GetComposableTemplateAsync( + Name name = null, + Func< + GetComposableIndexTemplateDescriptor, + IGetComposableIndexTemplateRequest + > selector = null, + CancellationToken ct = default + ) => + GetComposableTemplateAsync( + selector.InvokeOrDefault( + new GetComposableIndexTemplateDescriptor().Name(name: name) + ), + ct + ); + + /// + /// GET request to the indices.get_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public GetComposableIndexTemplateResponse GetComposableTemplate( + IGetComposableIndexTemplateRequest request + ) => + DoRequest( + request, + request.RequestParameters + ); + + /// + /// GET request to the indices.get_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public Task GetComposableTemplateAsync( + IGetComposableIndexTemplateRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// GET request to the indices.get_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/#get-a-mapping + /// + public GetMappingResponse GetMapping( + Func, IGetMappingRequest> selector = null + ) + where TDocument : class => + GetMapping(selector.InvokeOrDefault(new GetMappingDescriptor())); + + /// + /// GET request to the indices.get_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/#get-a-mapping + /// + public Task GetMappingAsync( + Func, IGetMappingRequest> selector = null, + CancellationToken ct = default + ) + where TDocument : class => + GetMappingAsync(selector.InvokeOrDefault(new GetMappingDescriptor()), ct); + + /// + /// GET request to the indices.get_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/#get-a-mapping + /// + public GetMappingResponse GetMapping(IGetMappingRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// GET request to the indices.get_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/field-types/index/#get-a-mapping + /// + public Task GetMappingAsync( + IGetMappingRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// GET request to the indices.get_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ + /// + public GetIndexSettingsResponse GetSettings( + Indices index = null, + Func selector = null + ) => + GetSettings( + selector.InvokeOrDefault(new GetIndexSettingsDescriptor().Index(index: index)) + ); + + /// + /// GET request to the indices.get_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ + /// + public Task GetSettingsAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ) => + GetSettingsAsync( + selector.InvokeOrDefault(new GetIndexSettingsDescriptor().Index(index: index)), + ct + ); + + /// + /// GET request to the indices.get_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ + /// + public GetIndexSettingsResponse GetSettings(IGetIndexSettingsRequest request) => + DoRequest( + request, + request.RequestParameters + ); + + /// + /// GET request to the indices.get_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/get-settings/ + /// + public Task GetSettingsAsync( + IGetIndexSettingsRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// GET request to the indices.get_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public GetIndexTemplateResponse GetTemplate( + Names name = null, + Func selector = null + ) => + GetTemplate( + selector.InvokeOrDefault(new GetIndexTemplateDescriptor().Name(name: name)) + ); + + /// + /// GET request to the indices.get_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task GetTemplateAsync( + Names name = null, + Func selector = null, + CancellationToken ct = default + ) => + GetTemplateAsync( + selector.InvokeOrDefault(new GetIndexTemplateDescriptor().Name(name: name)), + ct + ); + + /// + /// GET request to the indices.get_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public GetIndexTemplateResponse GetTemplate(IGetIndexTemplateRequest request) => + DoRequest( + request, + request.RequestParameters + ); + + /// + /// GET request to the indices.get_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task GetTemplateAsync( + IGetIndexTemplateRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// POST request to the indices.open API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/open-index/ + /// + public OpenIndexResponse Open( + Indices index, + Func selector = null + ) => Open(selector.InvokeOrDefault(new OpenIndexDescriptor(index: index))); + + /// + /// POST request to the indices.open API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/open-index/ + /// + public Task OpenAsync( + Indices index, + Func selector = null, + CancellationToken ct = default + ) => OpenAsync(selector.InvokeOrDefault(new OpenIndexDescriptor(index: index)), ct); + + /// + /// POST request to the indices.open API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/open-index/ + /// + public OpenIndexResponse Open(IOpenIndexRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// POST request to the indices.open API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/open-index/ + /// + public Task OpenAsync( + IOpenIndexRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// PUT request to the indices.put_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + /// + public PutAliasResponse PutAlias( + Indices index = null, + Func selector = null + ) => PutAlias(selector.InvokeOrDefault(new PutAliasDescriptor().Index(index: index))); + + /// + /// PUT request to the indices.put_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + /// + public Task PutAliasAsync( + Indices index = null, + Func selector = null, + CancellationToken ct = default + ) => + PutAliasAsync( + selector.InvokeOrDefault(new PutAliasDescriptor().Index(index: index)), + ct + ); + + /// + /// PUT request to the indices.put_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + /// + public PutAliasResponse PutAlias(IPutAliasRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// PUT request to the indices.put_alias API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-alias/ + /// + public Task PutAliasAsync( + IPutAliasRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// PUT request to the indices.put_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public PutComposableIndexTemplateResponse PutComposableTemplate( + Name name, + Func selector + ) => + PutComposableTemplate( + selector.InvokeOrDefault(new PutComposableIndexTemplateDescriptor(name: name)) + ); + + /// + /// PUT request to the indices.put_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public Task PutComposableTemplateAsync( + Name name, + Func selector, + CancellationToken ct = default + ) => + PutComposableTemplateAsync( + selector.InvokeOrDefault(new PutComposableIndexTemplateDescriptor(name: name)), + ct + ); + + /// + /// PUT request to the indices.put_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public PutComposableIndexTemplateResponse PutComposableTemplate( + IPutComposableIndexTemplateRequest request + ) => + DoRequest( + request, + request.RequestParameters + ); + + /// + /// PUT request to the indices.put_index_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public Task PutComposableTemplateAsync( + IPutComposableIndexTemplateRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// PUT request to the indices.put_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ + /// + public PutMappingResponse PutMapping( + Func, IPutMappingRequest> selector + ) + where TDocument : class => + PutMapping(selector.InvokeOrDefault(new PutMappingDescriptor())); + + /// + /// PUT request to the indices.put_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ + /// + public Task PutMappingAsync( + Func, IPutMappingRequest> selector, + CancellationToken ct = default + ) + where TDocument : class => + PutMappingAsync(selector.InvokeOrDefault(new PutMappingDescriptor()), ct); + + /// + /// PUT request to the indices.put_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ + /// + public PutMappingResponse PutMapping(IPutMappingRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// PUT request to the indices.put_mapping API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/put-mapping/ + /// + public Task PutMappingAsync( + IPutMappingRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// PUT request to the indices.put_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ + /// + public UpdateIndexSettingsResponse UpdateSettings( + Indices index, + Func selector + ) => + UpdateSettings( + selector.InvokeOrDefault(new UpdateIndexSettingsDescriptor().Index(index: index)) + ); + + /// + /// PUT request to the indices.put_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ + /// + public Task UpdateSettingsAsync( + Indices index, + Func selector, + CancellationToken ct = default + ) => + UpdateSettingsAsync( + selector.InvokeOrDefault(new UpdateIndexSettingsDescriptor().Index(index: index)), + ct + ); + + /// + /// PUT request to the indices.put_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ + /// + public UpdateIndexSettingsResponse UpdateSettings(IUpdateIndexSettingsRequest request) => + DoRequest( + request, + request.RequestParameters + ); + + /// + /// PUT request to the indices.put_settings API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/update-settings/ + /// + public Task UpdateSettingsAsync( + IUpdateIndexSettingsRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// PUT request to the indices.put_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public PutIndexTemplateResponse PutTemplate( + Name name, + Func selector + ) => PutTemplate(selector.InvokeOrDefault(new PutIndexTemplateDescriptor(name: name))); + + /// + /// PUT request to the indices.put_template API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// + public Task PutTemplateAsync( + Name name, + Func selector, + CancellationToken ct = default + ) => + PutTemplateAsync( + selector.InvokeOrDefault(new PutIndexTemplateDescriptor(name: name)), + ct + ); + + /// + /// PUT request to the indices.put_template API, read more about this API online: /// /// https://opensearch.org/docs/latest/im-plugin/index-templates/ /// - PutComposableIndexTemplateResponse PutComposableTemplate( - IPutComposableIndexTemplateRequest request - ); + public PutIndexTemplateResponse PutTemplate(IPutIndexTemplateRequest request) => + DoRequest( + request, + request.RequestParameters + ); /// - /// PUT request to the indices.put_index_template API, read more about this API online: + /// PUT request to the indices.put_template API, read more about this API online: /// /// https://opensearch.org/docs/latest/im-plugin/index-templates/ /// - Task PutComposableTemplateAsync( - IPutComposableIndexTemplateRequest request, + public Task PutTemplateAsync( + IPutIndexTemplateRequest request, CancellationToken ct = default - ); + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); /// - /// GET request to the indices.stats API, read more about this API online: + /// POST request to the indices.refresh API, read more about this API online: /// - /// https://opensearch.org/docs/latest + /// https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability /// - IndicesStatsResponse Stats( + public RefreshResponse Refresh( Indices index = null, - Func selector = null - ); + Func selector = null + ) => Refresh(selector.InvokeOrDefault(new RefreshDescriptor().Index(index: index))); /// - /// GET request to the indices.stats API, read more about this API online: + /// POST request to the indices.refresh API, read more about this API online: /// - /// https://opensearch.org/docs/latest + /// https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability /// - Task StatsAsync( + public Task RefreshAsync( Indices index = null, - Func selector = null, + Func selector = null, CancellationToken ct = default - ); + ) => + RefreshAsync(selector.InvokeOrDefault(new RefreshDescriptor().Index(index: index)), ct); /// - /// GET request to the indices.stats API, read more about this API online: + /// POST request to the indices.refresh API, read more about this API online: /// - /// https://opensearch.org/docs/latest + /// https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability /// - IndicesStatsResponse Stats(IIndicesStatsRequest request); + public RefreshResponse Refresh(IRefreshRequest request) => + DoRequest(request, request.RequestParameters); /// - /// GET request to the indices.stats API, read more about this API online: + /// POST request to the indices.refresh API, read more about this API online: /// - /// https://opensearch.org/docs/latest + /// https://opensearch.org/docs/latest/tuning-your-cluster/availability-and-recovery/remote-store/index/#refresh-level-and-request-level-durability /// - Task StatsAsync( - IIndicesStatsRequest request, + public Task RefreshAsync( + IRefreshRequest request, CancellationToken ct = default - ); - } - - /// - /// Indices implementation. - /// Not intended to be instantiated directly. Use the property - /// on . - /// - /// - public partial class IndicesNamespace : NamespacedClientProxy, IIndicesNamespace - { - internal IndicesNamespace(OpenSearchClient client) - : base(client) { } + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); /// - /// DELETE request to the indices.delete_index_template API, read more about this API online: + /// GET request to the indices.resolve_index API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/#delete-a-template + /// https://opensearch.org/docs/latest /// - public DeleteComposableIndexTemplateResponse DeleteComposableTemplate( - Name name, - Func< - DeleteComposableIndexTemplateDescriptor, - IDeleteComposableIndexTemplateRequest - > selector = null - ) => - DeleteComposableTemplate( - selector.InvokeOrDefault(new DeleteComposableIndexTemplateDescriptor(name: name)) - ); + public ResolveIndexResponse Resolve( + Names name, + Func selector = null + ) => Resolve(selector.InvokeOrDefault(new ResolveIndexDescriptor(name: name))); /// - /// DELETE request to the indices.delete_index_template API, read more about this API online: + /// GET request to the indices.resolve_index API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/#delete-a-template + /// https://opensearch.org/docs/latest /// - public Task DeleteComposableTemplateAsync( - Name name, - Func< - DeleteComposableIndexTemplateDescriptor, - IDeleteComposableIndexTemplateRequest - > selector = null, + public Task ResolveAsync( + Names name, + Func selector = null, CancellationToken ct = default - ) => - DeleteComposableTemplateAsync( - selector.InvokeOrDefault(new DeleteComposableIndexTemplateDescriptor(name: name)), - ct - ); + ) => ResolveAsync(selector.InvokeOrDefault(new ResolveIndexDescriptor(name: name)), ct); /// - /// DELETE request to the indices.delete_index_template API, read more about this API online: + /// GET request to the indices.resolve_index API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/#delete-a-template + /// https://opensearch.org/docs/latest /// - public DeleteComposableIndexTemplateResponse DeleteComposableTemplate( - IDeleteComposableIndexTemplateRequest request - ) => - DoRequest( + public ResolveIndexResponse Resolve(IResolveIndexRequest request) => + DoRequest( request, request.RequestParameters ); /// - /// DELETE request to the indices.delete_index_template API, read more about this API online: + /// GET request to the indices.resolve_index API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/#delete-a-template + /// https://opensearch.org/docs/latest /// - public Task DeleteComposableTemplateAsync( - IDeleteComposableIndexTemplateRequest request, + public Task ResolveAsync( + IResolveIndexRequest request, CancellationToken ct = default ) => - DoRequestAsync< - IDeleteComposableIndexTemplateRequest, - DeleteComposableIndexTemplateResponse - >(request, request.RequestParameters, ct); + DoRequestAsync( + request, + request.RequestParameters, + ct + ); /// - /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// POST request to the indices.rollover API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/dashboards/im-dashboards/rollover/ /// - public ExistsResponse ComposableTemplateExists( - Name name, - Func< - ComposableIndexTemplateExistsDescriptor, - IComposableIndexTemplateExistsRequest - > selector = null - ) => - ComposableTemplateExists( - selector.InvokeOrDefault(new ComposableIndexTemplateExistsDescriptor(name: name)) - ); + public RolloverIndexResponse Rollover( + Name alias, + Func selector = null + ) => Rollover(selector.InvokeOrDefault(new RolloverIndexDescriptor(alias: alias))); /// - /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// POST request to the indices.rollover API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/dashboards/im-dashboards/rollover/ /// - public Task ComposableTemplateExistsAsync( - Name name, - Func< - ComposableIndexTemplateExistsDescriptor, - IComposableIndexTemplateExistsRequest - > selector = null, + public Task RolloverAsync( + Name alias, + Func selector = null, CancellationToken ct = default - ) => - ComposableTemplateExistsAsync( - selector.InvokeOrDefault(new ComposableIndexTemplateExistsDescriptor(name: name)), - ct - ); + ) => RolloverAsync(selector.InvokeOrDefault(new RolloverIndexDescriptor(alias: alias)), ct); /// - /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// POST request to the indices.rollover API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/dashboards/im-dashboards/rollover/ /// - public ExistsResponse ComposableTemplateExists( - IComposableIndexTemplateExistsRequest request - ) => - DoRequest( + public RolloverIndexResponse Rollover(IRolloverIndexRequest request) => + DoRequest( request, request.RequestParameters ); /// - /// HEAD request to the indices.exists_index_template API, read more about this API online: + /// POST request to the indices.rollover API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/dashboards/im-dashboards/rollover/ /// - public Task ComposableTemplateExistsAsync( - IComposableIndexTemplateExistsRequest request, + public Task RolloverAsync( + IRolloverIndexRequest request, CancellationToken ct = default ) => - DoRequestAsync( + DoRequestAsync( request, request.RequestParameters, ct ); /// - /// GET request to the indices.get_index_template API, read more about this API online: + /// PUT request to the indices.shrink API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ /// - public GetComposableIndexTemplateResponse GetComposableTemplate( - Name name = null, - Func< - GetComposableIndexTemplateDescriptor, - IGetComposableIndexTemplateRequest - > selector = null + public ShrinkIndexResponse Shrink( + IndexName index, + IndexName target, + Func selector = null ) => - GetComposableTemplate( - selector.InvokeOrDefault( - new GetComposableIndexTemplateDescriptor().Name(name: name) - ) + Shrink( + selector.InvokeOrDefault(new ShrinkIndexDescriptor(index: index, target: target)) ); /// - /// GET request to the indices.get_index_template API, read more about this API online: + /// PUT request to the indices.shrink API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ /// - public Task GetComposableTemplateAsync( - Name name = null, - Func< - GetComposableIndexTemplateDescriptor, - IGetComposableIndexTemplateRequest - > selector = null, + public Task ShrinkAsync( + IndexName index, + IndexName target, + Func selector = null, CancellationToken ct = default ) => - GetComposableTemplateAsync( - selector.InvokeOrDefault( - new GetComposableIndexTemplateDescriptor().Name(name: name) - ), + ShrinkAsync( + selector.InvokeOrDefault(new ShrinkIndexDescriptor(index: index, target: target)), ct ); /// - /// GET request to the indices.get_index_template API, read more about this API online: + /// PUT request to the indices.shrink API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ /// - public GetComposableIndexTemplateResponse GetComposableTemplate( - IGetComposableIndexTemplateRequest request - ) => - DoRequest( - request, - request.RequestParameters - ); + public ShrinkIndexResponse Shrink(IShrinkIndexRequest request) => + DoRequest(request, request.RequestParameters); /// - /// GET request to the indices.get_index_template API, read more about this API online: + /// PUT request to the indices.shrink API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/api-reference/index-apis/shrink-index/ /// - public Task GetComposableTemplateAsync( - IGetComposableIndexTemplateRequest request, + public Task ShrinkAsync( + IShrinkIndexRequest request, CancellationToken ct = default ) => - DoRequestAsync( + DoRequestAsync( request, request.RequestParameters, ct ); /// - /// PUT request to the indices.put_index_template API, read more about this API online: + /// PUT request to the indices.split API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/api-reference/index-apis/split/ /// - public PutComposableIndexTemplateResponse PutComposableTemplate( - Name name, - Func selector + public SplitIndexResponse Split( + IndexName index, + IndexName target, + Func selector = null ) => - PutComposableTemplate( - selector.InvokeOrDefault(new PutComposableIndexTemplateDescriptor(name: name)) - ); + Split(selector.InvokeOrDefault(new SplitIndexDescriptor(index: index, target: target))); /// - /// PUT request to the indices.put_index_template API, read more about this API online: + /// PUT request to the indices.split API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/api-reference/index-apis/split/ /// - public Task PutComposableTemplateAsync( - Name name, - Func selector, + public Task SplitAsync( + IndexName index, + IndexName target, + Func selector = null, CancellationToken ct = default ) => - PutComposableTemplateAsync( - selector.InvokeOrDefault(new PutComposableIndexTemplateDescriptor(name: name)), + SplitAsync( + selector.InvokeOrDefault(new SplitIndexDescriptor(index: index, target: target)), ct ); /// - /// PUT request to the indices.put_index_template API, read more about this API online: + /// PUT request to the indices.split API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/api-reference/index-apis/split/ /// - public PutComposableIndexTemplateResponse PutComposableTemplate( - IPutComposableIndexTemplateRequest request - ) => - DoRequest( - request, - request.RequestParameters - ); + public SplitIndexResponse Split(ISplitIndexRequest request) => + DoRequest(request, request.RequestParameters); /// - /// PUT request to the indices.put_index_template API, read more about this API online: + /// PUT request to the indices.split API, read more about this API online: /// - /// https://opensearch.org/docs/latest/im-plugin/index-templates/ + /// https://opensearch.org/docs/latest/api-reference/index-apis/split/ /// - public Task PutComposableTemplateAsync( - IPutComposableIndexTemplateRequest request, + public Task SplitAsync( + ISplitIndexRequest request, CancellationToken ct = default ) => - DoRequestAsync( + DoRequestAsync( request, request.RequestParameters, ct @@ -578,5 +3234,98 @@ public Task StatsAsync( request.RequestParameters, ct ); + + /// + /// POST request to the indices.update_aliases API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/alias/ + /// + public BulkAliasResponse BulkAlias(Func selector) => + BulkAlias(selector.InvokeOrDefault(new BulkAliasDescriptor())); + + /// + /// POST request to the indices.update_aliases API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/alias/ + /// + public Task BulkAliasAsync( + Func selector, + CancellationToken ct = default + ) => BulkAliasAsync(selector.InvokeOrDefault(new BulkAliasDescriptor()), ct); + + /// + /// POST request to the indices.update_aliases API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/alias/ + /// + public BulkAliasResponse BulkAlias(IBulkAliasRequest request) => + DoRequest(request, request.RequestParameters); + + /// + /// POST request to the indices.update_aliases API, read more about this API online: + /// + /// https://opensearch.org/docs/latest/api-reference/index-apis/alias/ + /// + public Task BulkAliasAsync( + IBulkAliasRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); + + /// + /// POST request to the indices.validate_query API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public ValidateQueryResponse ValidateQuery( + Func, IValidateQueryRequest> selector = null + ) + where TDocument : class => + ValidateQuery(selector.InvokeOrDefault(new ValidateQueryDescriptor())); + + /// + /// POST request to the indices.validate_query API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task ValidateQueryAsync( + Func, IValidateQueryRequest> selector = null, + CancellationToken ct = default + ) + where TDocument : class => + ValidateQueryAsync( + selector.InvokeOrDefault(new ValidateQueryDescriptor()), + ct + ); + + /// + /// POST request to the indices.validate_query API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public ValidateQueryResponse ValidateQuery(IValidateQueryRequest request) => + DoRequest( + request, + request.RequestParameters + ); + + /// + /// POST request to the indices.validate_query API, read more about this API online: + /// + /// https://opensearch.org/docs/latest + /// + public Task ValidateQueryAsync( + IValidateQueryRequest request, + CancellationToken ct = default + ) => + DoRequestAsync( + request, + request.RequestParameters, + ct + ); } } diff --git a/src/OpenSearch.Client/_Generated/Requests.Indices.cs b/src/OpenSearch.Client/_Generated/Requests.Indices.cs index 11508b9ac1..365b032de5 100644 --- a/src/OpenSearch.Client/_Generated/Requests.Indices.cs +++ b/src/OpenSearch.Client/_Generated/Requests.Indices.cs @@ -58,37 +58,2113 @@ // ReSharper disable RedundantNameQualifier namespace OpenSearch.Client { + [InterfaceDataContract] + public partial interface IAddIndexBlockRequest : IRequest + { + [IgnoreDataMember] + IndexBlock Block { get; } + + [IgnoreDataMember] + Indices Index { get; } + } + + /// Request for AddBlock https://opensearch.org/docs/latest + public partial class AddIndexBlockRequest + : PlainRequestBase, + IAddIndexBlockRequest + { + protected IAddIndexBlockRequest Self => this; + internal override ApiUrls ApiUrls => ApiUrlsLookups.IndicesAddBlock; + + /// /{index}/_block/{block} + /// this parameter is required + /// this parameter is required + public AddIndexBlockRequest(Indices index, IndexBlock block) + : base(r => r.Required("index", index).Required("block", block)) { } + + /// Used for serialization purposes, making sure we have a parameterless constructor + [SerializationConstructor] + protected AddIndexBlockRequest() + : base() { } + + // values part of the url path + [IgnoreDataMember] + IndexBlock IAddIndexBlockRequest.Block => Self.RouteValues.Get("block"); + + [IgnoreDataMember] + Indices IAddIndexBlockRequest.Index => Self.RouteValues.Get("index"); + + // 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 bool? AllowNoIndices + { + get => Q("allow_no_indices"); + set => Q("allow_no_indices", value); + } + + /// Operation timeout for connection to cluster-manager node. + /// Supported by OpenSearch servers of version 2.0.0 or greater. + public Time ClusterManagerTimeout + { + get => Q