Skip to content

Commit e37a989

Browse files
Adds DeleteScript and Explain APIs (#6338) (#6341)
Co-authored-by: Steve Gordon <[email protected]>
1 parent 72e27a9 commit e37a989

11 files changed

+1278
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ internal static class ApiUrlsLookups
6464
internal static ApiUrls NoNamespaceDeleteByQuery = new ApiUrls(new[] { "/{index}/_delete_by_query" });
6565
internal static ApiUrls NoNamespaceDeleteByQueryRethrottle = new ApiUrls(new[] { "/_delete_by_query/{task_id}/_rethrottle" });
6666
internal static ApiUrls NoNamespaceDelete = new ApiUrls(new[] { "/{index}/_doc/{id}" });
67+
internal static ApiUrls NoNamespaceDeleteScript = new ApiUrls(new[] { "/_scripts/{id}" });
6768
internal static ApiUrls EnrichDeletePolicy = new ApiUrls(new[] { "/_enrich/policy/{name}" });
6869
internal static ApiUrls EnrichExecutePolicy = new ApiUrls(new[] { "/_enrich/policy/{name}/_execute" });
6970
internal static ApiUrls EnrichGetPolicy = new ApiUrls(new[] { "/_enrich/policy/{name}", "/_enrich/policy" });
@@ -75,6 +76,7 @@ internal static class ApiUrlsLookups
7576
internal static ApiUrls EqlGet = new ApiUrls(new[] { "/_eql/search/{id}" });
7677
internal static ApiUrls NoNamespaceExists = new ApiUrls(new[] { "/{index}/_doc/{id}" });
7778
internal static ApiUrls NoNamespaceExistsSource = new ApiUrls(new[] { "/{index}/_source/{id}" });
79+
internal static ApiUrls NoNamespaceExplain = new ApiUrls(new[] { "/{index}/_explain/{id}" });
7880
internal static ApiUrls FeaturesGetFeatures = new ApiUrls(new[] { "/_features" });
7981
internal static ApiUrls FeaturesResetFeatures = new ApiUrls(new[] { "/_features/_reset" });
8082
internal static ApiUrls NoNamespaceFieldCaps = new ApiUrls(new[] { "/_field_caps", "/{index}/_field_caps" });
@@ -232,6 +234,8 @@ internal static class ApiUrlsLookups
232234
internal static ApiUrls NoNamespaceReindexRethrottle = new ApiUrls(new[] { "/_reindex/{task_id}/_rethrottle" });
233235
internal static ApiUrls NoNamespaceGetScriptContext = new ApiUrls(new[] { "/_script_context" });
234236
internal static ApiUrls NoNamespaceGetScriptLanguages = new ApiUrls(new[] { "/_script_language" });
237+
internal static ApiUrls NoNamespaceGetScript = new ApiUrls(new[] { "/_scripts/{id}" });
238+
internal static ApiUrls NoNamespaceScriptsPainlessExecute = new ApiUrls(new[] { "/_scripts/painless/_execute" });
235239
internal static ApiUrls NoNamespaceScroll = new ApiUrls(new[] { "/_search/scroll" });
236240
internal static ApiUrls SearchableSnapshotsCacheStats = new ApiUrls(new[] { "/_searchable_snapshots/cache/stats", "/_searchable_snapshots/{node_id}/cache/stats" });
237241
internal static ApiUrls SearchableSnapshotsClearCache = new ApiUrls(new[] { "/_searchable_snapshots/cache/clear", "/{index}/_searchable_snapshots/cache/clear" });
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
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
27+
{
28+
public class DeleteScriptRequestParameters : RequestParameters<DeleteScriptRequestParameters>
29+
{
30+
[JsonIgnore]
31+
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
32+
33+
[JsonIgnore]
34+
public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("timeout"); set => Q("timeout", value); }
35+
}
36+
37+
public partial class DeleteScriptRequest : PlainRequestBase<DeleteScriptRequestParameters>
38+
{
39+
public DeleteScriptRequest(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
40+
{
41+
}
42+
43+
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceDeleteScript;
44+
protected override HttpMethod HttpMethod => HttpMethod.DELETE;
45+
protected override bool SupportsBody => false;
46+
[JsonIgnore]
47+
public Elastic.Clients.Elasticsearch.Time? MasterTimeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("master_timeout"); set => Q("master_timeout", value); }
48+
49+
[JsonIgnore]
50+
public Elastic.Clients.Elasticsearch.Time? Timeout { get => Q<Elastic.Clients.Elasticsearch.Time?>("timeout"); set => Q("timeout", value); }
51+
}
52+
53+
public sealed partial class DeleteScriptRequestDescriptor<TDocument> : RequestDescriptorBase<DeleteScriptRequestDescriptor<TDocument>, DeleteScriptRequestParameters>
54+
{
55+
internal DeleteScriptRequestDescriptor(Action<DeleteScriptRequestDescriptor<TDocument>> configure) => configure.Invoke(this);
56+
public DeleteScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
57+
{
58+
}
59+
60+
internal DeleteScriptRequestDescriptor()
61+
{
62+
}
63+
64+
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceDeleteScript;
65+
protected override HttpMethod HttpMethod => HttpMethod.DELETE;
66+
protected override bool SupportsBody => false;
67+
public DeleteScriptRequestDescriptor<TDocument> MasterTimeout(Elastic.Clients.Elasticsearch.Time? masterTimeout) => Qs("master_timeout", masterTimeout);
68+
public DeleteScriptRequestDescriptor<TDocument> Timeout(Elastic.Clients.Elasticsearch.Time? timeout) => Qs("timeout", timeout);
69+
public DeleteScriptRequestDescriptor<TDocument> Id(Elastic.Clients.Elasticsearch.Id id)
70+
{
71+
RouteValues.Required("id", id);
72+
return Self;
73+
}
74+
75+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
76+
{
77+
}
78+
}
79+
80+
public sealed partial class DeleteScriptRequestDescriptor : RequestDescriptorBase<DeleteScriptRequestDescriptor, DeleteScriptRequestParameters>
81+
{
82+
internal DeleteScriptRequestDescriptor(Action<DeleteScriptRequestDescriptor> configure) => configure.Invoke(this);
83+
public DeleteScriptRequestDescriptor(Elastic.Clients.Elasticsearch.Id id) : base(r => r.Required("id", id))
84+
{
85+
}
86+
87+
internal DeleteScriptRequestDescriptor()
88+
{
89+
}
90+
91+
internal override ApiUrls ApiUrls => ApiUrlsLookups.NoNamespaceDeleteScript;
92+
protected override HttpMethod HttpMethod => HttpMethod.DELETE;
93+
protected override bool SupportsBody => false;
94+
public DeleteScriptRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Time? masterTimeout) => Qs("master_timeout", masterTimeout);
95+
public DeleteScriptRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Time? timeout) => Qs("timeout", timeout);
96+
public DeleteScriptRequestDescriptor Id(Elastic.Clients.Elasticsearch.Id id)
97+
{
98+
RouteValues.Required("id", id);
99+
return Self;
100+
}
101+
102+
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
103+
{
104+
}
105+
}
106+
}
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
24+
{
25+
public partial class DeleteScriptResponse : ElasticsearchResponseBase
26+
{
27+
[JsonInclude]
28+
[JsonPropertyName("acknowledged")]
29+
public bool Acknowledged { get; init; }
30+
}
31+
}

0 commit comments

Comments
 (0)