Skip to content

Commit fa9f821

Browse files
committed
Generate Async Search APIs
1 parent b5f9d3f commit fa9f821

17 files changed

+1593
-7
lines changed

benchmarks/Benchmarks/Program.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ public void Version8()
4646
_ = AlphaClient.RequestResponseSerializer.Deserialize<Elastic.Clients.Elasticsearch.Cluster.ClusterHealthResponse>(Stream);
4747
}
4848

49-
[Benchmark]
50-
public void Version8_String()
51-
{
52-
Stream.Position = 0;
53-
_ = AlphaClient.RequestResponseSerializer.Deserialize<Elastic.Clients.Elasticsearch.Cluster.ClusterHealthResponseV2>(Stream);
54-
}
49+
// [Benchmark]
50+
// public void Version8_String()
51+
// {
52+
// Stream.Position = 0;
53+
// _ = AlphaClient.RequestResponseSerializer.Deserialize<Elastic.Clients.Elasticsearch.Cluster.ClusterHealthResponseV2>(Stream);
54+
// }
5555

5656
//[Benchmark]
5757
//public void Version8_String_Converter()

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

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ namespace Elastic.Clients.Elasticsearch
1919
{
2020
internal static class ApiUrlsLookups
2121
{
22+
internal static ApiUrls AsyncSearchStatus = new ApiUrls(new[] { "/_async_search/status/{id}" });
23+
internal static ApiUrls AsyncSearchSubmit = new ApiUrls(new[] { "/_async_search", "/{index}/_async_search" });
24+
internal static ApiUrls AsyncSearchDelete = new ApiUrls(new[] { "/_async_search/{id}" });
25+
internal static ApiUrls AsyncSearchGet = new ApiUrls(new[] { "/_async_search/{id}" });
2226
internal static ApiUrls NoNamespaceBulk = new ApiUrls(new[] { "/_bulk", "/{index}/_bulk" });
2327
internal static ApiUrls NoNamespaceClosePointInTime = new ApiUrls(new[] { "/_pit" });
2428
internal static ApiUrls ClusterAllocationExplain = new ApiUrls(new[] { "/_cluster/allocation/explain" });
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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.AsyncSearch
27+
{
28+
public class AsyncSearchStatusRequestParameters : RequestParameters<AsyncSearchStatusRequestParameters>
29+
{
30+
}
31+
32+
public partial class AsyncSearchStatusRequest : PlainRequestBase<AsyncSearchStatusRequestParameters>
33+
{
34+
public AsyncSearchStatusRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
35+
{
36+
}
37+
38+
internal override ApiUrls ApiUrls => ApiUrlsLookups.AsyncSearchStatus;
39+
protected override HttpMethod HttpMethod => HttpMethod.GET;
40+
protected override bool SupportsBody => false;
41+
}
42+
43+
public sealed partial class AsyncSearchStatusRequestDescriptor : RequestDescriptorBase<AsyncSearchStatusRequestDescriptor, AsyncSearchStatusRequestParameters>
44+
{
45+
public AsyncSearchStatusRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
46+
{
47+
}
48+
49+
internal AsyncSearchStatusRequestDescriptor()
50+
{
51+
}
52+
53+
internal AsyncSearchStatusRequestDescriptor(Action<AsyncSearchStatusRequestDescriptor> configure) => configure.Invoke(this);
54+
internal override ApiUrls ApiUrls => ApiUrlsLookups.AsyncSearchStatus;
55+
protected override HttpMethod HttpMethod => HttpMethod.GET;
56+
protected override bool SupportsBody => false;
57+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
58+
{
59+
}
60+
}
61+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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.AsyncSearch
24+
{
25+
public partial class AsyncSearchStatusResponse<TDocument> : AsyncSearch.AsyncSearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("completion_status")]
29+
public int CompletionStatus { get; init; }
30+
31+
[JsonInclude]
32+
[JsonPropertyName("_shards")]
33+
public Elastic.Clients.Elasticsearch.ShardStatistics Shards { get; init; }
34+
}
35+
}

0 commit comments

Comments
 (0)