From 25dbc8ebd663b6452fa2bc385c1309638e225cf2 Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Mon, 10 Feb 2020 21:33:15 +0100 Subject: [PATCH 1/2] make provisions for unions --- .../Domain/Specification/QueryParameters.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/ApiGenerator/Domain/Specification/QueryParameters.cs b/src/ApiGenerator/Domain/Specification/QueryParameters.cs index a58ddba074c..964e8edb56b 100644 --- a/src/ApiGenerator/Domain/Specification/QueryParameters.cs +++ b/src/ApiGenerator/Domain/Specification/QueryParameters.cs @@ -7,10 +7,7 @@ namespace ApiGenerator.Domain.Specification { public class QueryParameters { - private static readonly string[] FieldsParams = - { - "fields", "_source_includes", "_source_excludes", - }; + private static readonly string[] FieldsParams = { "fields", "_source_includes", "_source_excludes", }; public bool Skip { get; set; } @@ -72,7 +69,16 @@ public IEnumerable DescriptionHighLevel public string SetterLowLevel => "value"; - public string Type { get; set; } + private string _type; + + public string Type + { + // TODO support unions + get => !_type.Contains("|") + ? _type + : _type.Split('|', StringSplitOptions.RemoveEmptyEntries).First().Trim(); + set => _type = value; + } public string TypeHighLevel { From 8931234e1574e0eba0d9d0539e59a301b017d23f Mon Sep 17 00:00:00 2001 From: Martijn Laarman Date: Mon, 10 Feb 2020 21:39:25 +0100 Subject: [PATCH 2/2] update code and specs to latest for 7.x --- .../RestSpecification/Core/cat.indices.json | 14 +- .../RestSpecification/Core/cat.nodes.json | 14 +- .../Core/cat.pending_tasks.json | 14 +- .../RestSpecification/Core/cat.recovery.json | 14 +- .../RestSpecification/Core/cat.shards.json | 14 +- .../RestSpecification/Core/cat.snapshots.json | 14 +- .../RestSpecification/Core/cat.tasks.json | 14 +- .../RestSpecification/Core/reindex.json | 4 +- .../RestSpecification/Core/root.html | 59 +++--- .../Core/update_by_query.json | 4 +- .../autoscaling.get_autoscaling_decision.json | 18 ++ .../XPack/cat.ml_datafeeds.json | 72 +++++++ .../RestSpecification/XPack/cat.ml_jobs.json | 89 +++++++++ .../XPack/cat.ml_trained_models.json | 100 ++++++++++ .../RestSpecification/XPack/root.html | 103 ++++++---- .../XPack/slm.delete_lifecycle.json | 2 +- .../XPack/slm.execute_lifecycle.json | 2 +- .../XPack/slm.get_lifecycle.json | 2 +- .../XPack/slm.get_stats.json | 2 +- .../XPack/slm.put_lifecycle.json | 2 +- .../XPack/transform.delete_transform.json | 2 +- .../XPack/transform.get_transform.json | 2 +- .../XPack/transform.get_transform_stats.json | 2 +- .../XPack/transform.preview_transform.json | 2 +- .../XPack/transform.put_transform.json | 2 +- .../XPack/transform.start_transform.json | 2 +- .../XPack/transform.stop_transform.json | 2 +- .../XPack/transform.update_transform.json | 2 +- .../RequestParameters.Autoscaling.cs | 32 +++ .../RequestParameters.Cat.cs | 184 ++++++++++++++++++ .../RequestParameters.NoNamespace.cs | 4 +- ...tParameters.SnapshotLifecycleManagement.cs | 10 +- .../ElasticLowLevelClient.Autoscaling.cs | 58 ++++++ .../ElasticLowLevelClient.Cat.cs | 60 ++++++ .../ElasticLowLevelClient.NoNamespace.cs | 8 + ...LevelClient.SnapshotLifecycleManagement.cs | 24 +-- .../ElasticLowLevelClient.Transform.cs | 18 -- .../IElasticLowLevelClient.Generated.cs | 7 + 38 files changed, 811 insertions(+), 167 deletions(-) create mode 100644 src/ApiGenerator/RestSpecification/XPack/autoscaling.get_autoscaling_decision.json create mode 100644 src/ApiGenerator/RestSpecification/XPack/cat.ml_datafeeds.json create mode 100644 src/ApiGenerator/RestSpecification/XPack/cat.ml_jobs.json create mode 100644 src/ApiGenerator/RestSpecification/XPack/cat.ml_trained_models.json create mode 100644 src/Elasticsearch.Net/Api/RequestParameters/RequestParameters.Autoscaling.cs create mode 100644 src/Elasticsearch.Net/ElasticLowLevelClient.Autoscaling.cs diff --git a/src/ApiGenerator/RestSpecification/Core/cat.indices.json b/src/ApiGenerator/RestSpecification/Core/cat.indices.json index 68194bc652b..76c749cc7d3 100644 --- a/src/ApiGenerator/RestSpecification/Core/cat.indices.json +++ b/src/ApiGenerator/RestSpecification/Core/cat.indices.json @@ -89,13 +89,13 @@ "type":"enum", "description":"The unit in which to display time values", "options":[ - "d (Days)", - "h (Hours)", - "m (Minutes)", - "s (Seconds)", - "ms (Milliseconds)", - "micros (Microseconds)", - "nanos (Nanoseconds)" + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" ] }, "v":{ diff --git a/src/ApiGenerator/RestSpecification/Core/cat.nodes.json b/src/ApiGenerator/RestSpecification/Core/cat.nodes.json index eb3a965349b..ba3faa92c5e 100644 --- a/src/ApiGenerator/RestSpecification/Core/cat.nodes.json +++ b/src/ApiGenerator/RestSpecification/Core/cat.nodes.json @@ -70,13 +70,13 @@ "type":"enum", "description":"The unit in which to display time values", "options":[ - "d (Days)", - "h (Hours)", - "m (Minutes)", - "s (Seconds)", - "ms (Milliseconds)", - "micros (Microseconds)", - "nanos (Nanoseconds)" + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" ] }, "v":{ diff --git a/src/ApiGenerator/RestSpecification/Core/cat.pending_tasks.json b/src/ApiGenerator/RestSpecification/Core/cat.pending_tasks.json index 3ea0896ccf3..36fa33be495 100644 --- a/src/ApiGenerator/RestSpecification/Core/cat.pending_tasks.json +++ b/src/ApiGenerator/RestSpecification/Core/cat.pending_tasks.json @@ -45,13 +45,13 @@ "type":"enum", "description":"The unit in which to display time values", "options":[ - "d (Days)", - "h (Hours)", - "m (Minutes)", - "s (Seconds)", - "ms (Milliseconds)", - "micros (Microseconds)", - "nanos (Nanoseconds)" + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" ] }, "v":{ diff --git a/src/ApiGenerator/RestSpecification/Core/cat.recovery.json b/src/ApiGenerator/RestSpecification/Core/cat.recovery.json index 64c102d0897..7baf0b8ded6 100644 --- a/src/ApiGenerator/RestSpecification/Core/cat.recovery.json +++ b/src/ApiGenerator/RestSpecification/Core/cat.recovery.json @@ -80,13 +80,13 @@ "type":"enum", "description":"The unit in which to display time values", "options":[ - "d (Days)", - "h (Hours)", - "m (Minutes)", - "s (Seconds)", - "ms (Milliseconds)", - "micros (Microseconds)", - "nanos (Nanoseconds)" + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" ] }, "v":{ diff --git a/src/ApiGenerator/RestSpecification/Core/cat.shards.json b/src/ApiGenerator/RestSpecification/Core/cat.shards.json index 6eb170ac4a7..a13c0f6bf6d 100644 --- a/src/ApiGenerator/RestSpecification/Core/cat.shards.json +++ b/src/ApiGenerator/RestSpecification/Core/cat.shards.json @@ -74,13 +74,13 @@ "type":"enum", "description":"The unit in which to display time values", "options":[ - "d (Days)", - "h (Hours)", - "m (Minutes)", - "s (Seconds)", - "ms (Milliseconds)", - "micros (Microseconds)", - "nanos (Nanoseconds)" + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" ] }, "v":{ diff --git a/src/ApiGenerator/RestSpecification/Core/cat.snapshots.json b/src/ApiGenerator/RestSpecification/Core/cat.snapshots.json index 9bca1038726..757c2cfbe7d 100644 --- a/src/ApiGenerator/RestSpecification/Core/cat.snapshots.json +++ b/src/ApiGenerator/RestSpecification/Core/cat.snapshots.json @@ -58,13 +58,13 @@ "type":"enum", "description":"The unit in which to display time values", "options":[ - "d (Days)", - "h (Hours)", - "m (Minutes)", - "s (Seconds)", - "ms (Milliseconds)", - "micros (Microseconds)", - "nanos (Nanoseconds)" + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" ] }, "v":{ diff --git a/src/ApiGenerator/RestSpecification/Core/cat.tasks.json b/src/ApiGenerator/RestSpecification/Core/cat.tasks.json index 1c04b05c985..ae25ab10c01 100644 --- a/src/ApiGenerator/RestSpecification/Core/cat.tasks.json +++ b/src/ApiGenerator/RestSpecification/Core/cat.tasks.json @@ -53,13 +53,13 @@ "type":"enum", "description":"The unit in which to display time values", "options":[ - "d (Days)", - "h (Hours)", - "m (Minutes)", - "s (Seconds)", - "ms (Milliseconds)", - "micros (Microseconds)", - "nanos (Nanoseconds)" + "d", + "h", + "m", + "s", + "ms", + "micros", + "nanos" ] }, "v":{ diff --git a/src/ApiGenerator/RestSpecification/Core/reindex.json b/src/ApiGenerator/RestSpecification/Core/reindex.json index 0ebfddd9413..2fbaf86cab6 100644 --- a/src/ApiGenerator/RestSpecification/Core/reindex.json +++ b/src/ApiGenerator/RestSpecification/Core/reindex.json @@ -45,9 +45,9 @@ "default":"5m" }, "slices":{ - "type":"number", + "type":"number|string", "default":1, - "description":"The number of slices this task should be divided into. Defaults to 1 meaning the task isn't sliced into subtasks." + "description":"The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`." }, "max_docs":{ "type":"number", diff --git a/src/ApiGenerator/RestSpecification/Core/root.html b/src/ApiGenerator/RestSpecification/Core/root.html index 2c7dbba49b6..509344f502f 100644 --- a/src/ApiGenerator/RestSpecification/Core/root.html +++ b/src/ApiGenerator/RestSpecification/Core/root.html @@ -20,7 +20,7 @@ - + @@ -42,7 +42,7 @@ - + @@ -78,7 +78,7 @@ - + @@ -116,7 +116,7 @@ - +