Skip to content

Commit e218d08

Browse files
committed
updated codegen to not include new ML api's and ran codegen over the changes of existing ML api's cc @codebrain
1 parent bee6b3c commit e218d08

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

src/CodeGeneration/ApiGenerator/ApiGenerator.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ public static void Generate(string downloadBranch, params string[] folders)
4141
}
4242
}
4343

44+
private static string[] IgnoredApis { get; } =
45+
{
46+
"xpack.ml.delete_filter.json",
47+
"xpack.ml.get_filters.json",
48+
"xpack.ml.put_filter.json",
49+
};
50+
4451
private static RestApiSpec CreateRestApiSpecModel(string downloadBranch, string[] folders)
4552
{
4653
var directories = Directory.GetDirectories(CodeConfiguration.RestSpecificationFolder, "*", SearchOption.AllDirectories)
@@ -50,7 +57,12 @@ private static RestApiSpec CreateRestApiSpecModel(string downloadBranch, string[
5057
var endpoints = new Dictionary<string, ApiEndpoint>();
5158
using (var pbar = new ProgressBar(directories.Count, $"Listing {directories.Count} directories", new ProgressBarOptions { BackgroundColor = ConsoleColor.DarkGray }))
5259
{
53-
foreach (var jsonFiles in directories.Select(dir => Directory.GetFiles(dir).Where(f => f.EndsWith(".json")).ToList()))
60+
var folderFiles = directories.Select(dir =>
61+
Directory.GetFiles(dir)
62+
.Where(f => f.EndsWith(".json") && !IgnoredApis.Contains(new FileInfo(f).Name))
63+
.ToList()
64+
);
65+
foreach (var jsonFiles in folderFiles)
5466
{
5567
using (var fileProgress = pbar.Spawn(jsonFiles.Count, $"Listing {jsonFiles.Count} files", new ProgressBarOptions { ProgressCharacter = '─', BackgroundColor = ConsoleColor.DarkGray }))
5668
{

src/Elasticsearch.Net/Domain/RequestParameters/RequestParameters.Generated.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8223,6 +8223,10 @@ public class WatcherStatsRequestParameters : FluentRequestParameters<WatcherStat
82238223
{
82248224
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
82258225

8226+
///<summary>Emits stack traces of currently running watches</summary>
8227+
public WatcherStatsRequestParameters EmitStacktraces(bool emit_stacktraces) => this.AddQueryString("emit_stacktraces", emit_stacktraces);
8228+
8229+
82268230
///<summary>Pretty format the returned JSON response.</summary>
82278231
public WatcherStatsRequestParameters Pretty(bool pretty) => this.AddQueryString("pretty", pretty);
82288232

src/Nest/_Generated/_Descriptors.generated.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7819,6 +7819,9 @@ public WatcherStatsDescriptor() : base(){}
78197819
public WatcherStatsDescriptor WatcherStatsMetric(WatcherStatsMetric watcherStatsMetric) => Assign(a=>a.RouteValues.Optional("watcher_stats_metric", (Metrics)watcherStatsMetric));
78207820

78217821

7822+
///<summary>Emits stack traces of currently running watches</summary>
7823+
public WatcherStatsDescriptor EmitStacktraces(bool emit_stacktraces = true) => AssignParam(p=>p.EmitStacktraces(emit_stacktraces));
7824+
78227825
///<summary>Pretty format the returned JSON response.</summary>
78237826
public WatcherStatsDescriptor Pretty(bool pretty = true) => AssignParam(p=>p.Pretty(pretty));
78247827

src/Nest/_Generated/_Requests.generated.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9255,7 +9255,10 @@ public WatcherStatsRequest() : base(){}
92559255
public WatcherStatsRequest(WatcherStatsMetric watcher_stats_metric) : base(r=>r.Optional("watcher_stats_metric", (Metrics)watcher_stats_metric)){}
92569256

92579257

9258-
///<summary>Pretty format the returned JSON response.</summary>
9258+
///<summary>Emits stack traces of currently running watches</summary>
9259+
public bool EmitStacktraces { get { return Q<bool>("emit_stacktraces"); } set { Q("emit_stacktraces", value); } }
9260+
9261+
///<summary>Pretty format the returned JSON response.</summary>
92599262
public bool Pretty { get { return Q<bool>("pretty"); } set { Q("pretty", value); } }
92609263

92619264
///<summary>Return human readable values for statistics.</summary>

0 commit comments

Comments
 (0)