From 628d247b39345d8e16509e65c7244f19cfaa6533 Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Thu, 14 Apr 2022 13:13:46 +0100 Subject: [PATCH] Add Features APIs (#6310) --- .../_Generated/Api/ApiUrlsLookup.g.cs | 2 + .../Features/FeaturesGetFeaturesRequest.g.cs | 53 +++++++++++ .../Features/FeaturesGetFeaturesResponse.g.cs | 31 +++++++ .../FeaturesResetFeaturesRequest.g.cs | 53 +++++++++++ .../FeaturesResetFeaturesResponse.g.cs | 31 +++++++ .../Client/ElasticsearchClient.Features.g.cs | 87 +++++++++++++++++++ .../Client/ElasticsearchClient.g.cs | 4 + .../_Generated/Types/Features/Feature.g.cs | 37 ++++++++ 8 files changed, 298 insertions(+) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesGetFeaturesRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesGetFeaturesResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesResetFeaturesRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesResetFeaturesResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Features.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.g.cs diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs index c0edbb39c0b..843135858d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs @@ -74,6 +74,8 @@ internal static class ApiUrlsLookups internal static ApiUrls EqlGet = new ApiUrls(new[] { "/_eql/search/{id}" }); internal static ApiUrls NoNamespaceExists = new ApiUrls(new[] { "/{index}/_doc/{id}" }); internal static ApiUrls NoNamespaceExistsSource = new ApiUrls(new[] { "/{index}/_source/{id}" }); + internal static ApiUrls FeaturesGetFeatures = new ApiUrls(new[] { "/_features" }); + internal static ApiUrls FeaturesResetFeatures = new ApiUrls(new[] { "/_features/_reset" }); internal static ApiUrls NoNamespaceFieldCaps = new ApiUrls(new[] { "/_field_caps", "/{index}/_field_caps" }); internal static ApiUrls NoNamespaceGet = new ApiUrls(new[] { "/{index}/_doc/{id}" }); internal static ApiUrls GraphExplore = new ApiUrls(new[] { "/{index}/_graph/explore" }); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesGetFeaturesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesGetFeaturesRequest.g.cs new file mode 100644 index 00000000000..fc7758487b5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesGetFeaturesRequest.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Features +{ + public class FeaturesGetFeaturesRequestParameters : RequestParameters + { + } + + public partial class FeaturesGetFeaturesRequest : PlainRequestBase + { + internal override ApiUrls ApiUrls => ApiUrlsLookups.FeaturesGetFeatures; + protected override HttpMethod HttpMethod => HttpMethod.GET; + protected override bool SupportsBody => false; + } + + public sealed partial class FeaturesGetFeaturesRequestDescriptor : RequestDescriptorBase + { + internal FeaturesGetFeaturesRequestDescriptor(Action configure) => configure.Invoke(this); + public FeaturesGetFeaturesRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.FeaturesGetFeatures; + protected override HttpMethod HttpMethod => HttpMethod.GET; + protected override bool SupportsBody => false; + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesGetFeaturesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesGetFeaturesResponse.g.cs new file mode 100644 index 00000000000..6b38837c977 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesGetFeaturesResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Features +{ + public partial class FeaturesGetFeaturesResponse : ElasticsearchResponseBase + { + [JsonInclude] + [JsonPropertyName("features")] + public IReadOnlyCollection Features { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesResetFeaturesRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesResetFeaturesRequest.g.cs new file mode 100644 index 00000000000..7fdc742eb59 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesResetFeaturesRequest.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport; +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Features +{ + public class FeaturesResetFeaturesRequestParameters : RequestParameters + { + } + + public partial class FeaturesResetFeaturesRequest : PlainRequestBase + { + internal override ApiUrls ApiUrls => ApiUrlsLookups.FeaturesResetFeatures; + protected override HttpMethod HttpMethod => HttpMethod.POST; + protected override bool SupportsBody => false; + } + + public sealed partial class FeaturesResetFeaturesRequestDescriptor : RequestDescriptorBase + { + internal FeaturesResetFeaturesRequestDescriptor(Action configure) => configure.Invoke(this); + public FeaturesResetFeaturesRequestDescriptor() + { + } + + internal override ApiUrls ApiUrls => ApiUrlsLookups.FeaturesResetFeatures; + protected override HttpMethod HttpMethod => HttpMethod.POST; + protected override bool SupportsBody => false; + protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) + { + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesResetFeaturesResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesResetFeaturesResponse.g.cs new file mode 100644 index 00000000000..8aba9ad6f5f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Features/FeaturesResetFeaturesResponse.g.cs @@ -0,0 +1,31 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using Elastic.Transport.Products.Elasticsearch; +using System.Collections.Generic; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Features +{ + public partial class FeaturesResetFeaturesResponse : ElasticsearchResponseBase + { + [JsonInclude] + [JsonPropertyName("features")] + public IReadOnlyCollection Features { get; init; } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Features.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Features.g.cs new file mode 100644 index 00000000000..f23e0efaa24 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Features.g.cs @@ -0,0 +1,87 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using System; +using System.Threading; +using System.Threading.Tasks; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Features +{ + public class FeaturesNamespace : NamespacedClientProxy + { + internal FeaturesNamespace(ElasticsearchClient client) : base(client) + { + } + + public FeaturesGetFeaturesResponse GetFeatures(FeaturesGetFeaturesRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public Task GetFeaturesAsync(FeaturesGetFeaturesRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public FeaturesGetFeaturesResponse GetFeatures(Action configureRequest = null) + { + var descriptor = new FeaturesGetFeaturesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + public Task GetFeaturesAsync(Action configureRequest = null, CancellationToken cancellationToken = default) + { + var descriptor = new FeaturesGetFeaturesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor); + } + + public FeaturesResetFeaturesResponse ResetFeatures(FeaturesResetFeaturesRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public Task ResetFeaturesAsync(FeaturesResetFeaturesRequest request, CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public FeaturesResetFeaturesResponse ResetFeatures(Action configureRequest = null) + { + var descriptor = new FeaturesResetFeaturesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequest(descriptor); + } + + public Task ResetFeaturesAsync(Action configureRequest = null, CancellationToken cancellationToken = default) + { + var descriptor = new FeaturesResetFeaturesRequestDescriptor(); + configureRequest?.Invoke(descriptor); + descriptor.BeforeRequest(); + return DoRequestAsync(descriptor); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs index fa3922bec39..3206b4736f7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs @@ -22,6 +22,7 @@ using Elastic.Clients.Elasticsearch.DanglingIndices; using Elastic.Clients.Elasticsearch.Enrich; using Elastic.Clients.Elasticsearch.Eql; +using Elastic.Clients.Elasticsearch.Features; using Elastic.Clients.Elasticsearch.Graph; using Elastic.Clients.Elasticsearch.Ilm; using Elastic.Clients.Elasticsearch.IndexManagement; @@ -56,6 +57,8 @@ public partial class ElasticsearchClient public EqlNamespace Eql { get; private set; } + public FeaturesNamespace Features { get; private set; } + public GraphNamespace Graph { get; private set; } public IlmNamespace Ilm { get; private set; } @@ -87,6 +90,7 @@ private partial void SetupNamespaces() DanglingIndices = new DanglingIndicesNamespace(this); Enrich = new EnrichNamespace(this); Eql = new EqlNamespace(this); + Features = new FeaturesNamespace(this); Graph = new GraphNamespace(this); Ilm = new IlmNamespace(this); Indices = new IndicesNamespace(this); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.g.cs new file mode 100644 index 00000000000..9fa26954f45 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Features/Feature.g.cs @@ -0,0 +1,37 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Linq.Expressions; +using System.Text.Json; +using System.Text.Json.Serialization; + +#nullable restore +namespace Elastic.Clients.Elasticsearch.Features +{ + public partial class Feature + { + [JsonInclude] + [JsonPropertyName("description")] + public string Description { get; init; } + + [JsonInclude] + [JsonPropertyName("name")] + public string Name { get; init; } + } +} \ No newline at end of file