-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathMultiSearchTemplateRequest.g.cs
275 lines (226 loc) · 11.7 KB
/
MultiSearchTemplateRequest.g.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
// 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.
//
// ------------------------------------------------
#nullable restore
using Elastic.Clients.Elasticsearch.Serverless.Fluent;
using Elastic.Clients.Elasticsearch.Serverless.Requests;
using Elastic.Clients.Elasticsearch.Serverless.Serialization;
using Elastic.Transport;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace Elastic.Clients.Elasticsearch.Serverless;
public sealed partial class MultiSearchTemplateRequestParameters : RequestParameters
{
/// <summary>
/// <para>If `true`, network round-trips are minimized for cross-cluster search requests.</para>
/// </summary>
public bool? CcsMinimizeRoundtrips { get => Q<bool?>("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); }
/// <summary>
/// <para>Maximum number of concurrent searches the API can run.</para>
/// </summary>
public long? MaxConcurrentSearches { get => Q<long?>("max_concurrent_searches"); set => Q("max_concurrent_searches", value); }
/// <summary>
/// <para>If `true`, the response returns `hits.total` as an integer.<br/>If `false`, it returns `hits.total` as an object.</para>
/// </summary>
public bool? RestTotalHitsAsInt { get => Q<bool?>("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); }
/// <summary>
/// <para>The type of the search operation.<br/>Available options: `query_then_fetch`, `dfs_query_then_fetch`.</para>
/// </summary>
public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q<Elastic.Clients.Elasticsearch.Serverless.SearchType?>("search_type"); set => Q("search_type", value); }
/// <summary>
/// <para>If `true`, the response prefixes aggregation and suggester names with their respective types.</para>
/// </summary>
public bool? TypedKeys { get => Q<bool?>("typed_keys"); set => Q("typed_keys", value); }
}
/// <summary>
/// <para>Runs multiple templated searches with a single request.</para>
/// </summary>
public sealed partial class MultiSearchTemplateRequest : PlainRequest<MultiSearchTemplateRequestParameters>, IStreamSerializable
{
public MultiSearchTemplateRequest()
{
}
public MultiSearchTemplateRequest(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices))
{
}
internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearchTemplate;
protected override HttpMethod StaticHttpMethod => HttpMethod.POST;
internal override bool SupportsBody => true;
internal override string OperationName => "msearch_template";
/// <summary>
/// <para>If `true`, network round-trips are minimized for cross-cluster search requests.</para>
/// </summary>
[JsonIgnore]
public bool? CcsMinimizeRoundtrips { get => Q<bool?>("ccs_minimize_roundtrips"); set => Q("ccs_minimize_roundtrips", value); }
/// <summary>
/// <para>Maximum number of concurrent searches the API can run.</para>
/// </summary>
[JsonIgnore]
public long? MaxConcurrentSearches { get => Q<long?>("max_concurrent_searches"); set => Q("max_concurrent_searches", value); }
/// <summary>
/// <para>If `true`, the response returns `hits.total` as an integer.<br/>If `false`, it returns `hits.total` as an object.</para>
/// </summary>
[JsonIgnore]
public bool? RestTotalHitsAsInt { get => Q<bool?>("rest_total_hits_as_int"); set => Q("rest_total_hits_as_int", value); }
/// <summary>
/// <para>The type of the search operation.<br/>Available options: `query_then_fetch`, `dfs_query_then_fetch`.</para>
/// </summary>
[JsonIgnore]
public Elastic.Clients.Elasticsearch.Serverless.SearchType? SearchType { get => Q<Elastic.Clients.Elasticsearch.Serverless.SearchType?>("search_type"); set => Q("search_type", value); }
/// <summary>
/// <para>If `true`, the response prefixes aggregation and suggester names with their respective types.</para>
/// </summary>
[JsonIgnore]
public bool? TypedKeys { get => Q<bool?>("typed_keys"); set => Q("typed_keys", value); }
public List<Elastic.Clients.Elasticsearch.Serverless.Core.MSearchTemplate.SearchTemplateRequestItem> SearchTemplates { get; set; }
void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting)
{
if (SearchTemplates is null)
return;
foreach (var item in SearchTemplates)
{
if (item is IStreamSerializable serializable)
serializable.Serialize(stream, settings, formatting);
}
}
async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting)
{
if (SearchTemplates is null)
return;
foreach (var item in SearchTemplates)
{
if (item is IStreamSerializable serializable)
await serializable.SerializeAsync(stream, settings, formatting).ConfigureAwait(false);
}
}
}
/// <summary>
/// <para>Runs multiple templated searches with a single request.</para>
/// </summary>
public sealed partial class MultiSearchTemplateRequestDescriptor<TDocument> : RequestDescriptor<MultiSearchTemplateRequestDescriptor<TDocument>, MultiSearchTemplateRequestParameters>, IStreamSerializable
{
internal MultiSearchTemplateRequestDescriptor(Action<MultiSearchTemplateRequestDescriptor<TDocument>> configure) => configure.Invoke(this);
public MultiSearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices))
{
}
public MultiSearchTemplateRequestDescriptor()
{
}
internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearchTemplate;
protected override HttpMethod StaticHttpMethod => HttpMethod.POST;
internal override bool SupportsBody => true;
internal override string OperationName => "msearch_template";
public MultiSearchTemplateRequestDescriptor<TDocument> CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips);
public MultiSearchTemplateRequestDescriptor<TDocument> MaxConcurrentSearches(long? maxConcurrentSearches) => Qs("max_concurrent_searches", maxConcurrentSearches);
public MultiSearchTemplateRequestDescriptor<TDocument> RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt);
public MultiSearchTemplateRequestDescriptor<TDocument> SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType);
public MultiSearchTemplateRequestDescriptor<TDocument> TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys);
public MultiSearchTemplateRequestDescriptor<TDocument> Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices)
{
RouteValues.Optional("index", indices);
return Self;
}
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
{
}
List<Elastic.Clients.Elasticsearch.Serverless.Core.MSearchTemplate.SearchTemplateRequestItem> _items = new();
void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting)
{
if (_items is null)
return;
foreach (var item in _items)
{
if (item is IStreamSerializable serializable)
serializable.Serialize(stream, settings, formatting);
}
}
async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting)
{
if (_items is null)
return;
foreach (var item in _items)
{
if (item is IStreamSerializable serializable)
await serializable.SerializeAsync(stream, settings, formatting).ConfigureAwait(false);
}
}
public MultiSearchTemplateRequestDescriptor<TDocument> AddSearchTemplates(Elastic.Clients.Elasticsearch.Serverless.Core.MSearchTemplate.SearchTemplateRequestItem searchTemplates)
{
_items.Add(searchTemplates);
return this;
}
}
/// <summary>
/// <para>Runs multiple templated searches with a single request.</para>
/// </summary>
public sealed partial class MultiSearchTemplateRequestDescriptor : RequestDescriptor<MultiSearchTemplateRequestDescriptor, MultiSearchTemplateRequestParameters>, IStreamSerializable
{
internal MultiSearchTemplateRequestDescriptor(Action<MultiSearchTemplateRequestDescriptor> configure) => configure.Invoke(this);
public MultiSearchTemplateRequestDescriptor(Elastic.Clients.Elasticsearch.Serverless.Indices? indices) : base(r => r.Optional("index", indices))
{
}
public MultiSearchTemplateRequestDescriptor()
{
}
internal override ApiUrls ApiUrls => ApiUrlLookup.NoNamespaceMultiSearchTemplate;
protected override HttpMethod StaticHttpMethod => HttpMethod.POST;
internal override bool SupportsBody => true;
internal override string OperationName => "msearch_template";
public MultiSearchTemplateRequestDescriptor CcsMinimizeRoundtrips(bool? ccsMinimizeRoundtrips = true) => Qs("ccs_minimize_roundtrips", ccsMinimizeRoundtrips);
public MultiSearchTemplateRequestDescriptor MaxConcurrentSearches(long? maxConcurrentSearches) => Qs("max_concurrent_searches", maxConcurrentSearches);
public MultiSearchTemplateRequestDescriptor RestTotalHitsAsInt(bool? restTotalHitsAsInt = true) => Qs("rest_total_hits_as_int", restTotalHitsAsInt);
public MultiSearchTemplateRequestDescriptor SearchType(Elastic.Clients.Elasticsearch.Serverless.SearchType? searchType) => Qs("search_type", searchType);
public MultiSearchTemplateRequestDescriptor TypedKeys(bool? typedKeys = true) => Qs("typed_keys", typedKeys);
public MultiSearchTemplateRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Serverless.Indices? indices)
{
RouteValues.Optional("index", indices);
return Self;
}
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
{
}
List<Elastic.Clients.Elasticsearch.Serverless.Core.MSearchTemplate.SearchTemplateRequestItem> _items = new();
void IStreamSerializable.Serialize(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting)
{
if (_items is null)
return;
foreach (var item in _items)
{
if (item is IStreamSerializable serializable)
serializable.Serialize(stream, settings, formatting);
}
}
async Task IStreamSerializable.SerializeAsync(Stream stream, IElasticsearchClientSettings settings, SerializationFormatting formatting)
{
if (_items is null)
return;
foreach (var item in _items)
{
if (item is IStreamSerializable serializable)
await serializable.SerializeAsync(stream, settings, formatting).ConfigureAwait(false);
}
}
public MultiSearchTemplateRequestDescriptor AddSearchTemplates(Elastic.Clients.Elasticsearch.Serverless.Core.MSearchTemplate.SearchTemplateRequestItem searchTemplates)
{
_items.Add(searchTemplates);
return this;
}
}