From 4a11d5422c22cb8cd47c2d576477543246153d4f Mon Sep 17 00:00:00 2001 From: Steve Gordon Date: Tue, 19 Apr 2022 13:44:51 +0100 Subject: [PATCH] Minor API fixes (#6343) * Update SDK version * Remove ML Get Trained Models * Update from latest spec * Fix SQL Query * Update packages (cherry picked from commit aa87a7dbd06864bdb9d443f129b051f697da1861) --- .ci/DockerFile | 2 +- .ci/make.sh | 2 +- .ci/readme.md | 2 +- .ci/run-repository.ps1 | 2 +- .ci/run-repository.sh | 2 +- .ci/run-tests.ps1 | 2 +- .ci/test-matrix.yml | 2 +- .github/workflows/integration-jobs.yml | 2 +- .github/workflows/make-bump.yml | 2 +- .github/workflows/make-release-notes.yml | 2 +- .github/workflows/stale-jobs.yml | 2 +- .github/workflows/test-jobs.yml | 4 +- .github/workflows/unified-release.yml | 2 +- build/scripts/packages.lock.json | 6 +- global.json | 2 +- .../Api/SqlQueryResponse.cs | 15 +++ .../_Generated/Api/ApiUrlsLookup.g.cs | 1 - .../Api/Ml/MlGetTrainedModelsRequest.g.cs | 114 ------------------ .../Api/Ml/MlGetTrainedModelsResponse.g.cs | 31 ----- .../Api/Snapshot/SnapshotRestoreRequest.g.cs | 18 +++ .../_Generated/Api/Sql/SqlQueryResponse.g.cs | 4 - .../Client/ElasticsearchClient.Ml.g.cs | 28 ----- .../_Generated/Types/Enums/Enums.Ml.g.cs | 56 --------- 23 files changed, 51 insertions(+), 252 deletions(-) create mode 100644 src/Elastic.Clients.Elasticsearch/Api/SqlQueryResponse.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Ml/MlGetTrainedModelsRequest.g.cs delete mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Ml/MlGetTrainedModelsResponse.g.cs diff --git a/.ci/DockerFile b/.ci/DockerFile index 687b0236739..c36c9917204 100644 --- a/.ci/DockerFile +++ b/.ci/DockerFile @@ -1,4 +1,4 @@ -ARG DOTNET_VERSION=6.0.101 +ARG DOTNET_VERSION=6.0.202 FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS elasticsearch-net-build ARG USER_ID diff --git a/.ci/make.sh b/.ci/make.sh index 9f20306b299..f5e602f0641 100755 --- a/.ci/make.sh +++ b/.ci/make.sh @@ -42,7 +42,7 @@ OUTPUT_DIR="$repo/${output_folder}" REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}" mkdir -p "$OUTPUT_DIR" -DOTNET_VERSION=${DOTNET_VERSION-6.0.101} +DOTNET_VERSION=${DOTNET_VERSION-6.0.202} echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m" echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m" diff --git a/.ci/readme.md b/.ci/readme.md index 5577d0998d3..7a56159268e 100644 --- a/.ci/readme.md +++ b/.ci/readme.md @@ -30,7 +30,7 @@ $ STACK_VERSION=8.0.0-SNAPSHOT ./.ci/run-tests |-------------------------|-------------|-------------| | `STACK_VERSION` | `N/A` | The elasticsearch version to target | `TEST_SUITE` | `basic` | `free` or `platinum` sets which test suite to run and which container to run against. | -| `DOTNET_VERSION` | `6.0.101` | The .NET sdk version used to grab the proper container | +| `DOTNET_VERSION` | `6.0.202` | The .NET sdk version used to grab the proper container | If you want to manually spin up elasticsearch for these tests and call the runner afterwards you can use diff --git a/.ci/run-repository.ps1 b/.ci/run-repository.ps1 index bb535004608..b79a4c52bac 100644 --- a/.ci/run-repository.ps1 +++ b/.ci/run-repository.ps1 @@ -14,7 +14,7 @@ param( $NODE_NAME, [string] - $DOTNET_VERSION = "6.0.101" + $DOTNET_VERSION = "6.0.202" ) $ESC = [char]27 diff --git a/.ci/run-repository.sh b/.ci/run-repository.sh index fe552789841..971f19673ab 100755 --- a/.ci/run-repository.sh +++ b/.ci/run-repository.sh @@ -9,7 +9,7 @@ script_path=$(dirname $(realpath -s $0)) source $script_path/functions/imports.sh set -euo pipefail -DOTNET_VERSION=${DOTNET_VERSION-6.0.101} +DOTNET_VERSION=${DOTNET_VERSION-6.0.202} ELASTICSEARCH_URL=${ELASTICSEARCH_URL-"$elasticsearch_url"} elasticsearch_container=${elasticsearch_container-} diff --git a/.ci/run-tests.ps1 b/.ci/run-tests.ps1 index def935de01b..85dc52e6f53 100644 --- a/.ci/run-tests.ps1 +++ b/.ci/run-tests.ps1 @@ -8,7 +8,7 @@ param ( $TEST_SUITE = "free", [string] - $DOTNET_VERSION = "6.0.101" + $DOTNET_VERSION = "6.0.202" ) $ESC = [char]27 diff --git a/.ci/test-matrix.yml b/.ci/test-matrix.yml index cf5c2212c75..47d6abe7e7a 100755 --- a/.ci/test-matrix.yml +++ b/.ci/test-matrix.yml @@ -8,6 +8,6 @@ TEST_SUITE: - platinum DOTNET_VERSION: - - 6.0.101 + - 6.0.202 exclude: ~ diff --git a/.github/workflows/integration-jobs.yml b/.github/workflows/integration-jobs.yml index 0bf0259d53f..f51a734a3c0 100644 --- a/.github/workflows/integration-jobs.yml +++ b/.github/workflows/integration-jobs.yml @@ -31,7 +31,7 @@ jobs: uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.101' + dotnet-version: '6.0.202' - uses: actions/cache@v2 with: path: ~/.nuget/packages diff --git a/.github/workflows/make-bump.yml b/.github/workflows/make-bump.yml index f1f10d9c2fd..8bb6fc98d90 100644 --- a/.github/workflows/make-bump.yml +++ b/.github/workflows/make-bump.yml @@ -35,7 +35,7 @@ jobs: # Add version and backport labels automatically - uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.101' + dotnet-version: '6.0.202' - name: Install dotnet-script run: dotnet tool install release-notes --tool-path dotnet-tool diff --git a/.github/workflows/make-release-notes.yml b/.github/workflows/make-release-notes.yml index 659e99d0ed3..c568a3ba4f4 100644 --- a/.github/workflows/make-release-notes.yml +++ b/.github/workflows/make-release-notes.yml @@ -51,7 +51,7 @@ jobs: - uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.101' + dotnet-version: '6.0.202' - name: Install dotnet-script run: dotnet tool install release-notes --tool-path dotnet-tool diff --git a/.github/workflows/stale-jobs.yml b/.github/workflows/stale-jobs.yml index 80b83792ece..24dd140c1fe 100644 --- a/.github/workflows/stale-jobs.yml +++ b/.github/workflows/stale-jobs.yml @@ -24,7 +24,7 @@ jobs: uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.101' + dotnet-version: '6.0.202' - uses: actions/cache@v2 with: path: ~/.nuget/packages diff --git a/.github/workflows/test-jobs.yml b/.github/workflows/test-jobs.yml index 9a7906a5067..fd6b06bfee1 100644 --- a/.github/workflows/test-jobs.yml +++ b/.github/workflows/test-jobs.yml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.101' + dotnet-version: '6.0.202' - uses: actions/cache@v2 with: path: ~/.nuget/packages @@ -53,7 +53,7 @@ jobs: uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.101' + dotnet-version: '6.0.202' - uses: actions/cache@v2 with: path: ~/.nuget/packages diff --git a/.github/workflows/unified-release.yml b/.github/workflows/unified-release.yml index cacabcb4fde..48f6a6df1ae 100644 --- a/.github/workflows/unified-release.yml +++ b/.github/workflows/unified-release.yml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@v2 - uses: actions/setup-dotnet@v1 with: - dotnet-version: '6.0.101' + dotnet-version: '6.0.202' - run: "./.ci/make.sh assemble ${{ matrix.stack_version }}" name: Assemble ${{ matrix.stack_version }} \ No newline at end of file diff --git a/build/scripts/packages.lock.json b/build/scripts/packages.lock.json index a51ed30efbc..da6c5cae7db 100644 --- a/build/scripts/packages.lock.json +++ b/build/scripts/packages.lock.json @@ -80,9 +80,9 @@ }, "FSharp.Core": { "type": "Direct", - "requested": "[6.0.1, )", - "resolved": "6.0.1", - "contentHash": "VrFAiW8dEEekk+0aqlbvMNZzDvYXmgWZwAt68AUBqaWK8RnoEVUNglj66bZzhs4/U63q0EfXlhcEKnH1sTYLjw==" + "requested": "[6.0.2, )", + "resolved": "6.0.2", + "contentHash": "8GZqv6buY71KQlWT+cl2eMi+aNX9xQ61RgI3Pzv9zPxPOX6tWCLRrBj0MYQ3h871r2RhiHUl7f0AXUD/POr8eA==" }, "Microsoft.NETFramework.ReferenceAssemblies": { "type": "Direct", diff --git a/global.json b/global.json index 9656e07c524..291a6895c8b 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "6.0.100", + "version": "6.0.202", "rollForward": "latestPatch", "allowPrerelease": false }, diff --git a/src/Elastic.Clients.Elasticsearch/Api/SqlQueryResponse.cs b/src/Elastic.Clients.Elasticsearch/Api/SqlQueryResponse.cs new file mode 100644 index 00000000000..83be184c9d1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/Api/SqlQueryResponse.cs @@ -0,0 +1,15 @@ +// 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. + +using System.Collections.Generic; +using System.Text.Json.Serialization; + +namespace Elastic.Clients.Elasticsearch.Sql; + +public partial class SqlQueryResponse +{ + [JsonInclude] + [JsonPropertyName("rows")] + public IReadOnlyCollection Rows { get; init; } +} diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs index cda35cea745..31c49e40053 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlsLookup.g.cs @@ -187,7 +187,6 @@ internal static class ApiUrlsLookups internal static ApiUrls MachineLearningGetModelSnapshots = new ApiUrls(new[] { "/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}", "/_ml/anomaly_detectors/{job_id}/model_snapshots" }); internal static ApiUrls MachineLearningGetOverallBuckets = new ApiUrls(new[] { "/_ml/anomaly_detectors/{job_id}/results/overall_buckets" }); internal static ApiUrls MachineLearningGetRecords = new ApiUrls(new[] { "/_ml/anomaly_detectors/{job_id}/results/records" }); - internal static ApiUrls MachineLearningGetTrainedModels = new ApiUrls(new[] { "/_ml/trained_models/{model_id}", "/_ml/trained_models" }); internal static ApiUrls MachineLearningGetTrainedModelsStats = new ApiUrls(new[] { "/_ml/trained_models/{model_id}/_stats", "/_ml/trained_models/_stats" }); internal static ApiUrls MachineLearningInferTrainedModelDeployment = new ApiUrls(new[] { "/_ml/trained_models/{model_id}/deployment/_infer" }); internal static ApiUrls MachineLearningInfo = new ApiUrls(new[] { "/_ml/info" }); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ml/MlGetTrainedModelsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ml/MlGetTrainedModelsRequest.g.cs deleted file mode 100644 index da7a541de82..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ml/MlGetTrainedModelsRequest.g.cs +++ /dev/null @@ -1,114 +0,0 @@ -// 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. -// -// ------------------------------------------------ - -using Elastic.Transport; -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text.Json; -using System.Text.Json.Serialization; - -#nullable restore -namespace Elastic.Clients.Elasticsearch.Ml -{ - public class MlGetTrainedModelsRequestParameters : RequestParameters - { - [JsonIgnore] - public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } - - [JsonIgnore] - public bool? DecompressDefinition { get => Q("decompress_definition"); set => Q("decompress_definition", value); } - - [JsonIgnore] - public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } - - [JsonIgnore] - public int? From { get => Q("from"); set => Q("from", value); } - - [JsonIgnore] - public Elastic.Clients.Elasticsearch.Ml.Include? Include { get => Q("include"); set => Q("include", value); } - - [JsonIgnore] - public int? Size { get => Q("size"); set => Q("size", value); } - - [JsonIgnore] - public string? Tags { get => Q("tags"); set => Q("tags", value); } - } - - public partial class MlGetTrainedModelsRequest : PlainRequestBase - { - public MlGetTrainedModelsRequest() - { - } - - public MlGetTrainedModelsRequest(Elastic.Clients.Elasticsearch.Id? model_id) : base(r => r.Optional("model_id", model_id)) - { - } - - internal override ApiUrls ApiUrls => ApiUrlsLookups.MachineLearningGetTrainedModels; - protected override HttpMethod HttpMethod => HttpMethod.GET; - protected override bool SupportsBody => false; - [JsonIgnore] - public bool? AllowNoMatch { get => Q("allow_no_match"); set => Q("allow_no_match", value); } - - [JsonIgnore] - public bool? DecompressDefinition { get => Q("decompress_definition"); set => Q("decompress_definition", value); } - - [JsonIgnore] - public bool? ExcludeGenerated { get => Q("exclude_generated"); set => Q("exclude_generated", value); } - - [JsonIgnore] - public int? From { get => Q("from"); set => Q("from", value); } - - [JsonIgnore] - public Elastic.Clients.Elasticsearch.Ml.Include? Include { get => Q("include"); set => Q("include", value); } - - [JsonIgnore] - public int? Size { get => Q("size"); set => Q("size", value); } - - [JsonIgnore] - public string? Tags { get => Q("tags"); set => Q("tags", value); } - } - - public sealed partial class MlGetTrainedModelsRequestDescriptor : RequestDescriptorBase - { - internal MlGetTrainedModelsRequestDescriptor(Action configure) => configure.Invoke(this); - public MlGetTrainedModelsRequestDescriptor() - { - } - - internal override ApiUrls ApiUrls => ApiUrlsLookups.MachineLearningGetTrainedModels; - protected override HttpMethod HttpMethod => HttpMethod.GET; - protected override bool SupportsBody => false; - public MlGetTrainedModelsRequestDescriptor AllowNoMatch(bool? allowNoMatch = true) => Qs("allow_no_match", allowNoMatch); - public MlGetTrainedModelsRequestDescriptor DecompressDefinition(bool? decompressDefinition = true) => Qs("decompress_definition", decompressDefinition); - public MlGetTrainedModelsRequestDescriptor ExcludeGenerated(bool? excludeGenerated = true) => Qs("exclude_generated", excludeGenerated); - public MlGetTrainedModelsRequestDescriptor From(int? from) => Qs("from", from); - public MlGetTrainedModelsRequestDescriptor Include(Elastic.Clients.Elasticsearch.Ml.Include? include) => Qs("include", include); - public MlGetTrainedModelsRequestDescriptor Size(int? size) => Qs("size", size); - public MlGetTrainedModelsRequestDescriptor Tags(string? tags) => Qs("tags", tags); - public MlGetTrainedModelsRequestDescriptor ModelId(Elastic.Clients.Elasticsearch.Id? model_id) - { - RouteValues.Optional("model_id", model_id); - return Self; - } - - protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) - { - } - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ml/MlGetTrainedModelsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ml/MlGetTrainedModelsResponse.g.cs deleted file mode 100644 index 51266fd1053..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Ml/MlGetTrainedModelsResponse.g.cs +++ /dev/null @@ -1,31 +0,0 @@ -// 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. -// -// ------------------------------------------------ - -using Elastic.Transport.Products.Elasticsearch; -using System.Collections.Generic; -using System.Text.Json.Serialization; - -#nullable restore -namespace Elastic.Clients.Elasticsearch.Ml -{ - public partial class MlGetTrainedModelsResponse : ElasticsearchResponseBase - { - [JsonInclude] - [JsonPropertyName("count")] - public int Count { get; init; } - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotRestoreRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotRestoreRequest.g.cs index ba769e027cc..75111b34800 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotRestoreRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Snapshot/SnapshotRestoreRequest.g.cs @@ -65,6 +65,10 @@ public SnapshotRestoreRequest(Elastic.Clients.Elasticsearch.Name repository, Ela [JsonPropertyName("include_global_state")] public bool? IncludeGlobalState { get; set; } + [JsonInclude] + [JsonPropertyName("index_settings")] + public Elastic.Clients.Elasticsearch.IndexManagement.PutSettingsRequest? IndexSettings { get; set; } + [JsonInclude] [JsonPropertyName("indices")] public Elastic.Clients.Elasticsearch.Indices? Indices { get; set; } @@ -118,6 +122,8 @@ public SnapshotRestoreRequestDescriptor Snapshot(Elastic.Clients.Elasticsearch.N private bool? IncludeGlobalStateValue { get; set; } + private Elastic.Clients.Elasticsearch.IndexManagement.PutSettingsRequest? IndexSettingsValue { get; set; } + private Elastic.Clients.Elasticsearch.Indices? IndicesValue { get; set; } private bool? PartialValue { get; set; } @@ -150,6 +156,12 @@ public SnapshotRestoreRequestDescriptor IncludeGlobalState(bool? includeGlobalSt return Self; } + public SnapshotRestoreRequestDescriptor IndexSettings(Elastic.Clients.Elasticsearch.IndexManagement.PutSettingsRequest? indexSettings) + { + IndexSettingsValue = indexSettings; + return Self; + } + public SnapshotRestoreRequestDescriptor Indices(Elastic.Clients.Elasticsearch.Indices? indices) { IndicesValue = indices; @@ -201,6 +213,12 @@ protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions o writer.WriteBooleanValue(IncludeGlobalStateValue.Value); } + if (IndexSettingsValue is not null) + { + writer.WritePropertyName("index_settings"); + JsonSerializer.Serialize(writer, IndexSettingsValue, options); + } + if (IndicesValue is not null) { writer.WritePropertyName("indices"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/SqlQueryResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/SqlQueryResponse.g.cs index ffd24340899..5f20a2d718f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/SqlQueryResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/SqlQueryResponse.g.cs @@ -43,9 +43,5 @@ public partial class SqlQueryResponse : ElasticsearchResponseBase [JsonInclude] [JsonPropertyName("is_running")] public bool? IsRunning { get; init; } - - [JsonInclude] - [JsonPropertyName("rows")] - public IReadOnlyCollection> Rows { get; init; } } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ml.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ml.g.cs index 2bb5e2d6018..74b9ff16502 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ml.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Ml.g.cs @@ -756,34 +756,6 @@ public Task GetRecordsAsync(Elastic.Clients.Elasticsearch. return DoRequestAsync(descriptor); } - public MlGetTrainedModelsResponse GetTrainedModels(MlGetTrainedModelsRequest request) - { - request.BeforeRequest(); - return DoRequest(request); - } - - public Task GetTrainedModelsAsync(MlGetTrainedModelsRequest request, CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public MlGetTrainedModelsResponse GetTrainedModels(Action configureRequest = null) - { - var descriptor = new MlGetTrainedModelsRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequest(descriptor); - } - - public Task GetTrainedModelsAsync(Action configureRequest = null, CancellationToken cancellationToken = default) - { - var descriptor = new MlGetTrainedModelsRequestDescriptor(); - configureRequest?.Invoke(descriptor); - descriptor.BeforeRequest(); - return DoRequestAsync(descriptor); - } - public MlGetTrainedModelsStatsResponse GetTrainedModelsStats(MlGetTrainedModelsStatsRequest request) { request.BeforeRequest(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ml.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ml.g.cs index 3ad78cef610..5052e86b009 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ml.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Enums/Enums.Ml.g.cs @@ -437,62 +437,6 @@ public override void Write(Utf8JsonWriter writer, FilterType value, JsonSerializ } } - [JsonConverter(typeof(IncludeConverter))] - public enum Include - { - [EnumMember(Value = "total_feature_importance")] - TotalFeatureImportance, - [EnumMember(Value = "hyperparameters")] - Hyperparameters, - [EnumMember(Value = "feature_importance_baseline")] - FeatureImportanceBaseline, - [EnumMember(Value = "definition")] - Definition - } - - internal sealed class IncludeConverter : JsonConverter - { - public override Include Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) - { - var enumString = reader.GetString(); - switch (enumString) - { - case "total_feature_importance": - return Include.TotalFeatureImportance; - case "hyperparameters": - return Include.Hyperparameters; - case "feature_importance_baseline": - return Include.FeatureImportanceBaseline; - case "definition": - return Include.Definition; - } - - ThrowHelper.ThrowJsonException(); - return default; - } - - public override void Write(Utf8JsonWriter writer, Include value, JsonSerializerOptions options) - { - switch (value) - { - case Include.TotalFeatureImportance: - writer.WriteStringValue("total_feature_importance"); - return; - case Include.Hyperparameters: - writer.WriteStringValue("hyperparameters"); - return; - case Include.FeatureImportanceBaseline: - writer.WriteStringValue("feature_importance_baseline"); - return; - case Include.Definition: - writer.WriteStringValue("definition"); - return; - } - - writer.WriteNullValue(); - } - } - [JsonConverter(typeof(JobStateConverter))] public enum JobState {