Skip to content

Commit f9706c7

Browse files
Add Features APIs (#6310) (#6311)
Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
1 parent 565516d commit f9706c7

File tree

8 files changed

+298
-0
lines changed

8 files changed

+298
-0
lines changed

src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ internal static class ApiUrlsLookups
7474
internal static ApiUrls EqlGet = new ApiUrls(new[] { "/_eql/search/{id}" });
7575
internal static ApiUrls NoNamespaceExists = new ApiUrls(new[] { "/{index}/_doc/{id}" });
7676
internal static ApiUrls NoNamespaceExistsSource = new ApiUrls(new[] { "/{index}/_source/{id}" });
77+
internal static ApiUrls FeaturesGetFeatures = new ApiUrls(new[] { "/_features" });
78+
internal static ApiUrls FeaturesResetFeatures = new ApiUrls(new[] { "/_features/_reset" });
7779
internal static ApiUrls NoNamespaceFieldCaps = new ApiUrls(new[] { "/_field_caps", "/{index}/_field_caps" });
7880
internal static ApiUrls NoNamespaceGet = new ApiUrls(new[] { "/{index}/_doc/{id}" });
7981
internal static ApiUrls GraphExplore = new ApiUrls(new[] { "/{index}/_graph/explore" });
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport;
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Linq.Expressions;
22+
using System.Text.Json;
23+
using System.Text.Json.Serialization;
24+
25+
#nullable restore
26+
namespace Elastic.Clients.Elasticsearch.Features
27+
{
28+
public class FeaturesGetFeaturesRequestParameters : RequestParameters<FeaturesGetFeaturesRequestParameters>
29+
{
30+
}
31+
32+
public partial class FeaturesGetFeaturesRequest : PlainRequestBase<FeaturesGetFeaturesRequestParameters>
33+
{
34+
internal override ApiUrls ApiUrls => ApiUrlsLookups.FeaturesGetFeatures;
35+
protected override HttpMethod HttpMethod => HttpMethod.GET;
36+
protected override bool SupportsBody => false;
37+
}
38+
39+
public sealed partial class FeaturesGetFeaturesRequestDescriptor : RequestDescriptorBase<FeaturesGetFeaturesRequestDescriptor, FeaturesGetFeaturesRequestParameters>
40+
{
41+
internal FeaturesGetFeaturesRequestDescriptor(Action<FeaturesGetFeaturesRequestDescriptor> configure) => configure.Invoke(this);
42+
public FeaturesGetFeaturesRequestDescriptor()
43+
{
44+
}
45+
46+
internal override ApiUrls ApiUrls => ApiUrlsLookups.FeaturesGetFeatures;
47+
protected override HttpMethod HttpMethod => HttpMethod.GET;
48+
protected override bool SupportsBody => false;
49+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
50+
{
51+
}
52+
}
53+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport.Products.Elasticsearch;
19+
using System.Collections.Generic;
20+
using System.Text.Json.Serialization;
21+
22+
#nullable restore
23+
namespace Elastic.Clients.Elasticsearch.Features
24+
{
25+
public partial class FeaturesGetFeaturesResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("features")]
29+
public IReadOnlyCollection<Elastic.Clients.Elasticsearch.Features.Feature> Features { get; init; }
30+
}
31+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport;
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Linq.Expressions;
22+
using System.Text.Json;
23+
using System.Text.Json.Serialization;
24+
25+
#nullable restore
26+
namespace Elastic.Clients.Elasticsearch.Features
27+
{
28+
public class FeaturesResetFeaturesRequestParameters : RequestParameters<FeaturesResetFeaturesRequestParameters>
29+
{
30+
}
31+
32+
public partial class FeaturesResetFeaturesRequest : PlainRequestBase<FeaturesResetFeaturesRequestParameters>
33+
{
34+
internal override ApiUrls ApiUrls => ApiUrlsLookups.FeaturesResetFeatures;
35+
protected override HttpMethod HttpMethod => HttpMethod.POST;
36+
protected override bool SupportsBody => false;
37+
}
38+
39+
public sealed partial class FeaturesResetFeaturesRequestDescriptor : RequestDescriptorBase<FeaturesResetFeaturesRequestDescriptor, FeaturesResetFeaturesRequestParameters>
40+
{
41+
internal FeaturesResetFeaturesRequestDescriptor(Action<FeaturesResetFeaturesRequestDescriptor> configure) => configure.Invoke(this);
42+
public FeaturesResetFeaturesRequestDescriptor()
43+
{
44+
}
45+
46+
internal override ApiUrls ApiUrls => ApiUrlsLookups.FeaturesResetFeatures;
47+
protected override HttpMethod HttpMethod => HttpMethod.POST;
48+
protected override bool SupportsBody => false;
49+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
50+
{
51+
}
52+
}
53+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using Elastic.Transport.Products.Elasticsearch;
19+
using System.Collections.Generic;
20+
using System.Text.Json.Serialization;
21+
22+
#nullable restore
23+
namespace Elastic.Clients.Elasticsearch.Features
24+
{
25+
public partial class FeaturesResetFeaturesResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("features")]
29+
public IReadOnlyCollection<Elastic.Clients.Elasticsearch.Features.Feature> Features { get; init; }
30+
}
31+
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using System;
19+
using System.Threading;
20+
using System.Threading.Tasks;
21+
22+
#nullable restore
23+
namespace Elastic.Clients.Elasticsearch.Features
24+
{
25+
public class FeaturesNamespace : NamespacedClientProxy
26+
{
27+
internal FeaturesNamespace(ElasticsearchClient client) : base(client)
28+
{
29+
}
30+
31+
public FeaturesGetFeaturesResponse GetFeatures(FeaturesGetFeaturesRequest request)
32+
{
33+
request.BeforeRequest();
34+
return DoRequest<FeaturesGetFeaturesRequest, FeaturesGetFeaturesResponse>(request);
35+
}
36+
37+
public Task<FeaturesGetFeaturesResponse> GetFeaturesAsync(FeaturesGetFeaturesRequest request, CancellationToken cancellationToken = default)
38+
{
39+
request.BeforeRequest();
40+
return DoRequestAsync<FeaturesGetFeaturesRequest, FeaturesGetFeaturesResponse>(request, cancellationToken);
41+
}
42+
43+
public FeaturesGetFeaturesResponse GetFeatures(Action<FeaturesGetFeaturesRequestDescriptor> configureRequest = null)
44+
{
45+
var descriptor = new FeaturesGetFeaturesRequestDescriptor();
46+
configureRequest?.Invoke(descriptor);
47+
descriptor.BeforeRequest();
48+
return DoRequest<FeaturesGetFeaturesRequestDescriptor, FeaturesGetFeaturesResponse>(descriptor);
49+
}
50+
51+
public Task<FeaturesGetFeaturesResponse> GetFeaturesAsync(Action<FeaturesGetFeaturesRequestDescriptor> configureRequest = null, CancellationToken cancellationToken = default)
52+
{
53+
var descriptor = new FeaturesGetFeaturesRequestDescriptor();
54+
configureRequest?.Invoke(descriptor);
55+
descriptor.BeforeRequest();
56+
return DoRequestAsync<FeaturesGetFeaturesRequestDescriptor, FeaturesGetFeaturesResponse>(descriptor);
57+
}
58+
59+
public FeaturesResetFeaturesResponse ResetFeatures(FeaturesResetFeaturesRequest request)
60+
{
61+
request.BeforeRequest();
62+
return DoRequest<FeaturesResetFeaturesRequest, FeaturesResetFeaturesResponse>(request);
63+
}
64+
65+
public Task<FeaturesResetFeaturesResponse> ResetFeaturesAsync(FeaturesResetFeaturesRequest request, CancellationToken cancellationToken = default)
66+
{
67+
request.BeforeRequest();
68+
return DoRequestAsync<FeaturesResetFeaturesRequest, FeaturesResetFeaturesResponse>(request, cancellationToken);
69+
}
70+
71+
public FeaturesResetFeaturesResponse ResetFeatures(Action<FeaturesResetFeaturesRequestDescriptor> configureRequest = null)
72+
{
73+
var descriptor = new FeaturesResetFeaturesRequestDescriptor();
74+
configureRequest?.Invoke(descriptor);
75+
descriptor.BeforeRequest();
76+
return DoRequest<FeaturesResetFeaturesRequestDescriptor, FeaturesResetFeaturesResponse>(descriptor);
77+
}
78+
79+
public Task<FeaturesResetFeaturesResponse> ResetFeaturesAsync(Action<FeaturesResetFeaturesRequestDescriptor> configureRequest = null, CancellationToken cancellationToken = default)
80+
{
81+
var descriptor = new FeaturesResetFeaturesRequestDescriptor();
82+
configureRequest?.Invoke(descriptor);
83+
descriptor.BeforeRequest();
84+
return DoRequestAsync<FeaturesResetFeaturesRequestDescriptor, FeaturesResetFeaturesResponse>(descriptor);
85+
}
86+
}
87+
}

src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
using Elastic.Clients.Elasticsearch.DanglingIndices;
2323
using Elastic.Clients.Elasticsearch.Enrich;
2424
using Elastic.Clients.Elasticsearch.Eql;
25+
using Elastic.Clients.Elasticsearch.Features;
2526
using Elastic.Clients.Elasticsearch.Graph;
2627
using Elastic.Clients.Elasticsearch.Ilm;
2728
using Elastic.Clients.Elasticsearch.IndexManagement;
@@ -56,6 +57,8 @@ public partial class ElasticsearchClient
5657

5758
public EqlNamespace Eql { get; private set; }
5859

60+
public FeaturesNamespace Features { get; private set; }
61+
5962
public GraphNamespace Graph { get; private set; }
6063

6164
public IlmNamespace Ilm { get; private set; }
@@ -87,6 +90,7 @@ private partial void SetupNamespaces()
8790
DanglingIndices = new DanglingIndicesNamespace(this);
8891
Enrich = new EnrichNamespace(this);
8992
Eql = new EqlNamespace(this);
93+
Features = new FeaturesNamespace(this);
9094
Graph = new GraphNamespace(this);
9195
Ilm = new IlmNamespace(this);
9296
Indices = new IndicesNamespace(this);
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Licensed to Elasticsearch B.V under one or more agreements.
2+
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3+
// See the LICENSE file in the project root for more information.
4+
//
5+
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6+
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7+
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8+
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9+
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10+
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11+
// ------------------------------------------------
12+
//
13+
// This file is automatically generated.
14+
// Please do not edit these files manually.
15+
//
16+
// ------------------------------------------------
17+
18+
using System;
19+
using System.Collections.Generic;
20+
using System.Linq.Expressions;
21+
using System.Text.Json;
22+
using System.Text.Json.Serialization;
23+
24+
#nullable restore
25+
namespace Elastic.Clients.Elasticsearch.Features
26+
{
27+
public partial class Feature
28+
{
29+
[JsonInclude]
30+
[JsonPropertyName("description")]
31+
public string Description { get; init; }
32+
33+
[JsonInclude]
34+
[JsonPropertyName("name")]
35+
public string Name { get; init; }
36+
}
37+
}

0 commit comments

Comments
 (0)