From 425b3e42e0ee4fe8d28874cc7c91392a4cf632d8 Mon Sep 17 00:00:00 2001 From: Florian Bernd Date: Thu, 23 Oct 2025 14:18:55 +0000 Subject: [PATCH] Regenerate client --- .../_Generated/Api/ApiUrlLookup.g.cs | 3 + .../PutClusterSettingsRequest.Converters.g.cs | 72 ++++ .../Cluster/PutClusterSettingsRequest.g.cs | 354 ++++++++++++++++++ ...PutClusterSettingsResponse.Converters.g.cs | 81 ++++ .../Cluster/PutClusterSettingsResponse.g.cs | 55 +++ .../GetSampleRequest.Converters.g.cs | 53 +++ .../Api/IndexManagement/GetSampleRequest.g.cs | 252 +++++++++++++ .../GetSampleResponse.Converters.g.cs | 63 ++++ .../IndexManagement/GetSampleResponse.g.cs | 45 +++ .../GetSampleStatsRequest.Converters.g.cs | 53 +++ .../GetSampleStatsRequest.g.cs | 252 +++++++++++++ .../GetSampleStatsResponse.Converters.g.cs | 180 +++++++++ .../GetSampleStatsResponse.g.cs | 94 +++++ .../Api/Inference/PutAi21Response.g.cs | 4 +- .../Inference/PutAlibabacloudResponse.g.cs | 4 +- .../Inference/PutAmazonbedrockResponse.g.cs | 4 +- .../Inference/PutAmazonsagemakerResponse.g.cs | 4 +- .../Api/Inference/PutAnthropicResponse.g.cs | 4 +- .../Inference/PutAzureaistudioResponse.g.cs | 4 +- .../Api/Inference/PutAzureopenaiResponse.g.cs | 4 +- .../Api/Inference/PutCohereResponse.g.cs | 4 +- .../Inference/PutContextualaiResponse.g.cs | 4 +- .../Api/Inference/PutCustomResponse.g.cs | 4 +- .../Api/Inference/PutDeepseekResponse.g.cs | 4 +- .../Inference/PutElasticsearchRequest.g.cs | 8 + .../Inference/PutElasticsearchResponse.g.cs | 4 +- .../Api/Inference/PutElserResponse.g.cs | 4 +- .../Inference/PutGoogleaistudioResponse.g.cs | 4 +- .../Inference/PutGooglevertexaiResponse.g.cs | 4 +- .../Api/Inference/PutHuggingFaceResponse.g.cs | 4 +- .../Api/Inference/PutInferenceResponse.g.cs | 4 +- .../Api/Inference/PutJinaaiResponse.g.cs | 4 +- .../Api/Inference/PutLlamaResponse.g.cs | 4 +- .../Api/Inference/PutMistralResponse.g.cs | 4 +- .../Api/Inference/PutOpenaiResponse.g.cs | 4 +- .../Api/Inference/PutVoyageaiResponse.g.cs | 4 +- .../Api/Inference/PutWatsonxResponse.g.cs | 4 +- .../Inference/UpdateInferenceResponse.g.cs | 4 +- .../Client/ElasticsearchClient.Cluster.g.cs | 46 +++ .../Client/ElasticsearchClient.Indices.g.cs | 196 ++++++++++ .../_Generated/Types/Analysis/Analyzers.g.cs | 8 +- .../Analysis/KuromojiAnalyzer.Converters.g.cs | 6 +- .../Types/Analysis/KuromojiAnalyzer.g.cs | 21 +- .../RawDocument.Converters.g.cs | 72 ++++ .../Types/IndexManagement/RawDocument.g.cs | 73 ++++ .../Types/Inference/CustomResponseParams.g.cs | 32 ++ .../CustomServiceSettings.Converters.g.cs | 9 + .../Inference/CustomServiceSettings.g.cs | 26 +- ...asticsearchServiceSettings.Converters.g.cs | 18 + .../ElasticsearchServiceSettings.g.cs | 80 ++++ .../GoogleModelGardenProvider.Converters.g.cs | 81 ++++ .../Inference/GoogleModelGardenProvider.g.cs | 33 ++ ...gleVertexAIServiceSettings.Converters.g.cs | 35 +- .../GoogleVertexAIServiceSettings.g.cs | 151 ++++++-- ...GoogleVertexAITaskSettings.Converters.g.cs | 9 + .../Inference/GoogleVertexAITaskSettings.g.cs | 24 ++ .../Types/Inference/InferenceEndpoint.g.cs | 16 +- .../Inference/InferenceEndpointInfo.g.cs | 4 +- .../OpenAITaskSettings.Converters.g.cs | 9 + .../Types/Inference/OpenAITaskSettings.g.cs | 32 ++ .../TaskTypeGoogleVertexAI.Converters.g.cs | 28 ++ .../Inference/TaskTypeGoogleVertexAI.g.cs | 4 + .../_Generated/Types/KnnQuery.Converters.g.cs | 11 +- .../_Generated/Types/KnnQuery.g.cs | 29 ++ .../Types/KnnRetriever.Converters.g.cs | 11 +- .../_Generated/Types/KnnRetriever.g.cs | 29 ++ .../Types/KnnSearch.Converters.g.cs | 11 +- .../_Generated/Types/KnnSearch.g.cs | 29 ++ 68 files changed, 2711 insertions(+), 83 deletions(-) create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsRequest.Converters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsResponse.Converters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.Converters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.Converters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.Converters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.Converters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.Converters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleModelGardenProvider.Converters.g.cs create mode 100644 src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleModelGardenProvider.g.cs diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs index e3470fbd147..3f5dfcf8e4a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs @@ -40,6 +40,7 @@ internal static class ApiUrlLookup internal static ApiUrls ClusterPendingTasks = new ApiUrls(new[] { "_cluster/pending_tasks" }); internal static ApiUrls ClusterPostVotingConfigExclusions = new ApiUrls(new[] { "_cluster/voting_config_exclusions" }); internal static ApiUrls ClusterPutComponentTemplate = new ApiUrls(new[] { "_component_template/{name}" }); + internal static ApiUrls ClusterPutSettings = new ApiUrls(new[] { "_cluster/settings" }); internal static ApiUrls ClusterStats = new ApiUrls(new[] { "_cluster/stats", "_cluster/stats/nodes/{node_id}" }); internal static ApiUrls CrossClusterReplicationDeleteAutoFollowPattern = new ApiUrls(new[] { "_ccr/auto_follow/{name}" }); internal static ApiUrls CrossClusterReplicationFollow = new ApiUrls(new[] { "{index}/_ccr/follow" }); @@ -122,6 +123,8 @@ internal static class ApiUrlLookup internal static ApiUrls IndexManagementGetIndexTemplate = new ApiUrls(new[] { "_index_template", "_index_template/{name}" }); internal static ApiUrls IndexManagementGetMapping = new ApiUrls(new[] { "_mapping", "{index}/_mapping" }); internal static ApiUrls IndexManagementGetMigrateReindexStatus = new ApiUrls(new[] { "_migration/reindex/{index}/_status" }); + internal static ApiUrls IndexManagementGetSample = new ApiUrls(new[] { "{index}/_sample" }); + internal static ApiUrls IndexManagementGetSampleStats = new ApiUrls(new[] { "{index}/_sample/stats" }); internal static ApiUrls IndexManagementGetSettings = new ApiUrls(new[] { "_settings", "{index}/_settings", "{index}/_settings/{name}", "_settings/{name}" }); internal static ApiUrls IndexManagementGetTemplate = new ApiUrls(new[] { "_template", "_template/{name}" }); internal static ApiUrls IndexManagementMigrateReindex = new ApiUrls(new[] { "_migration/reindex" }); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsRequest.Converters.g.cs new file mode 100644 index 00000000000..04aec684cd3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsRequest.Converters.g.cs @@ -0,0 +1,72 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class PutClusterSettingsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPersistent = System.Text.Json.JsonEncodedText.Encode("persistent"); + private static readonly System.Text.Json.JsonEncodedText PropTransient = System.Text.Json.JsonEncodedText.Encode("transient"); + + public override Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propPersistent = default; + LocalJsonValue?> propTransient = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPersistent.TryReadProperty(ref reader, options, PropPersistent, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (propTransient.TryReadProperty(ref reader, options, PropTransient, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Persistent = propPersistent.Value, + Transient = propTransient.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPersistent, value.Persistent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropTransient, value.Transient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsRequest.g.cs new file mode 100644 index 00000000000..a1d32be08e8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsRequest.g.cs @@ -0,0 +1,354 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +public sealed partial class PutClusterSettingsRequestParameters : Elastic.Transport.RequestParameters +{ + /// + /// + /// Return settings in flat format (default: false) + /// + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// + /// Explicit operation timeout for connection to master node + /// + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// + /// Explicit operation timeout + /// + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// +/// Update the cluster settings. +/// +/// +/// Configure and update dynamic settings on a running cluster. +/// You can also configure dynamic settings locally on an unstarted or shut down node in elasticsearch.yml. +/// +/// +/// Updates made with this API can be persistent, which apply across cluster restarts, or transient, which reset after a cluster restart. +/// You can also reset transient or persistent settings by assigning them a null value. +/// +/// +/// If you configure the same setting using multiple methods, Elasticsearch applies the settings in following order of precedence: 1) Transient setting; 2) Persistent setting; 3) elasticsearch.yml setting; 4) Default setting value. +/// For example, you can apply a transient setting to override a persistent setting or elasticsearch.yml setting. +/// However, a change to an elasticsearch.yml setting will not override a defined transient or persistent setting. +/// +/// +/// TIP: In Elastic Cloud, use the user settings feature to configure all cluster settings. This method automatically rejects unsafe settings that could break your cluster. +/// If you run Elasticsearch on your own hardware, use this API to configure dynamic cluster settings. +/// Only use elasticsearch.yml for static cluster settings and node settings. +/// The API doesn’t require a restart and ensures a setting’s value is the same on all nodes. +/// +/// +/// WARNING: Transient cluster settings are no longer recommended. Use persistent cluster settings instead. +/// If a cluster becomes unstable, transient settings can clear unexpectedly, resulting in a potentially undesired cluster configuration. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.PutClusterSettingsRequestConverter))] +public sealed partial class PutClusterSettingsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ +#if NET7_0_OR_GREATER + public PutClusterSettingsRequest() + { + } +#endif +#if !NET7_0_OR_GREATER + public PutClusterSettingsRequest() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal PutClusterSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.ClusterPutSettings; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "cluster.put_settings"; + + /// + /// + /// Return settings in flat format (default: false) + /// + /// + public bool? FlatSettings { get => Q("flat_settings"); set => Q("flat_settings", value); } + + /// + /// + /// Explicit operation timeout for connection to master node + /// + /// + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + + /// + /// + /// Explicit operation timeout + /// + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// + /// The settings that persist after the cluster restarts. + /// + /// + public System.Collections.Generic.IDictionary? Persistent { get; set; } + + /// + /// + /// The settings that do not persist after the cluster restarts. + /// + /// + public System.Collections.Generic.IDictionary? Transient { get; set; } +} + +/// +/// +/// Update the cluster settings. +/// +/// +/// Configure and update dynamic settings on a running cluster. +/// You can also configure dynamic settings locally on an unstarted or shut down node in elasticsearch.yml. +/// +/// +/// Updates made with this API can be persistent, which apply across cluster restarts, or transient, which reset after a cluster restart. +/// You can also reset transient or persistent settings by assigning them a null value. +/// +/// +/// If you configure the same setting using multiple methods, Elasticsearch applies the settings in following order of precedence: 1) Transient setting; 2) Persistent setting; 3) elasticsearch.yml setting; 4) Default setting value. +/// For example, you can apply a transient setting to override a persistent setting or elasticsearch.yml setting. +/// However, a change to an elasticsearch.yml setting will not override a defined transient or persistent setting. +/// +/// +/// TIP: In Elastic Cloud, use the user settings feature to configure all cluster settings. This method automatically rejects unsafe settings that could break your cluster. +/// If you run Elasticsearch on your own hardware, use this API to configure dynamic cluster settings. +/// Only use elasticsearch.yml for static cluster settings and node settings. +/// The API doesn’t require a restart and ensures a setting’s value is the same on all nodes. +/// +/// +/// WARNING: Transient cluster settings are no longer recommended. Use persistent cluster settings instead. +/// If a cluster becomes unstable, transient settings can clear unexpectedly, resulting in a potentially undesired cluster configuration. +/// +/// +public readonly partial struct PutClusterSettingsRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PutClusterSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest instance) + { + Instance = instance; + } + + public PutClusterSettingsRequestDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor(Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest instance) => new Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest(Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// Return settings in flat format (default: false) + /// + /// + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor FlatSettings(bool? value = true) + { + Instance.FlatSettings = value; + return this; + } + + /// + /// + /// Explicit operation timeout for connection to master node + /// + /// + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? value) + { + Instance.MasterTimeout = value; + return this; + } + + /// + /// + /// Explicit operation timeout + /// + /// + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? value) + { + Instance.Timeout = value; + return this; + } + + /// + /// + /// The settings that persist after the cluster restarts. + /// + /// + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor Persistent(System.Collections.Generic.IDictionary? value) + { + Instance.Persistent = value; + return this; + } + + /// + /// + /// The settings that persist after the cluster restarts. + /// + /// + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor Persistent() + { + Instance.Persistent = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringObject.Build(null); + return this; + } + + /// + /// + /// The settings that persist after the cluster restarts. + /// + /// + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor Persistent(System.Action? action) + { + Instance.Persistent = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringObject.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor AddPersistent(string key, object value) + { + Instance.Persistent ??= new System.Collections.Generic.Dictionary(); + Instance.Persistent.Add(key, value); + return this; + } + + /// + /// + /// The settings that do not persist after the cluster restarts. + /// + /// + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor Transient(System.Collections.Generic.IDictionary? value) + { + Instance.Transient = value; + return this; + } + + /// + /// + /// The settings that do not persist after the cluster restarts. + /// + /// + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor Transient() + { + Instance.Transient = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringObject.Build(null); + return this; + } + + /// + /// + /// The settings that do not persist after the cluster restarts. + /// + /// + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor Transient(System.Action? action) + { + Instance.Transient = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringObject.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor AddTransient(string key, object value) + { + Instance.Transient ??= new System.Collections.Generic.Dictionary(); + Instance.Transient.Add(key, value); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor(new Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsResponse.Converters.g.cs new file mode 100644 index 00000000000..eca9b04f813 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsResponse.Converters.g.cs @@ -0,0 +1,81 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster.Json; + +public sealed partial class PutClusterSettingsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAcknowledged = System.Text.Json.JsonEncodedText.Encode("acknowledged"); + private static readonly System.Text.Json.JsonEncodedText PropPersistent = System.Text.Json.JsonEncodedText.Encode("persistent"); + private static readonly System.Text.Json.JsonEncodedText PropTransient = System.Text.Json.JsonEncodedText.Encode("transient"); + + public override Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAcknowledged = default; + LocalJsonValue> propPersistent = default; + LocalJsonValue> propTransient = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAcknowledged.TryReadProperty(ref reader, options, PropAcknowledged, null)) + { + continue; + } + + if (propPersistent.TryReadProperty(ref reader, options, PropPersistent, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (propTransient.TryReadProperty(ref reader, options, PropTransient, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Acknowledged = propAcknowledged.Value, + Persistent = propPersistent.Value, + Transient = propTransient.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAcknowledged, value.Acknowledged, null, null); + writer.WriteProperty(options, PropPersistent, value.Persistent, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteProperty(options, PropTransient, value.Transient, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsResponse.g.cs new file mode 100644 index 00000000000..92cccfcbc8f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/PutClusterSettingsResponse.g.cs @@ -0,0 +1,55 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Cluster; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Cluster.Json.PutClusterSettingsResponseConverter))] +public sealed partial class PutClusterSettingsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PutClusterSettingsResponse() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal PutClusterSettingsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public +#if NET7_0_OR_GREATER +required +#endif +bool Acknowledged { get; set; } + public +#if NET7_0_OR_GREATER +required +#endif +System.Collections.Generic.IReadOnlyDictionary Persistent { get; set; } + public +#if NET7_0_OR_GREATER +required +#endif +System.Collections.Generic.IReadOnlyDictionary Transient { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.Converters.g.cs new file mode 100644 index 00000000000..392f24cce90 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetSampleRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.g.cs new file mode 100644 index 00000000000..2d882890445 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleRequest.g.cs @@ -0,0 +1,252 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class GetSampleRequestParameters : Elastic.Transport.RequestParameters +{ +} + +/// +/// +/// Request for a random sample of raw documents ingested into the given index or data stream. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetSampleRequestConverter))] +public sealed partial class GetSampleRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetSampleRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } +#if NET7_0_OR_GREATER + public GetSampleRequest() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GetSampleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.IndexManagementGetSample; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_sample"; + + /// + /// + /// Single index or data stream name. Wildcards are not supported. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.IndexName Index { get => P("index"); set => PR("index", value); } +} + +/// +/// +/// Request for a random sample of raw documents ingested into the given index or data stream. +/// +/// +public readonly partial struct GetSampleRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetSampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest instance) + { + Instance = instance; + } + + public GetSampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) + { + Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(index); + } + + [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] + public GetSampleRequestDescriptor() + { + throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); + } + + public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// Single index or data stream name. Wildcards are not supported. + /// + /// + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) + { + Instance.Index = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} + +/// +/// +/// Request for a random sample of raw documents ingested into the given index or data stream. +/// +/// +public readonly partial struct GetSampleRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetSampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest instance) + { + Instance = instance; + } + + public GetSampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) + { + Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(index); + } + + public GetSampleRequestDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(typeof(TDocument)); + } + + public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// Single index or data stream name. Wildcards are not supported. + /// + /// + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) + { + Instance.Index = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest Build(System.Action> action) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.Converters.g.cs new file mode 100644 index 00000000000..4547527f031 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.Converters.g.cs @@ -0,0 +1,63 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetSampleResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropSample = System.Text.Json.JsonEncodedText.Encode("sample"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propSample = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propSample.TryReadProperty(ref reader, options, PropSample, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Sample = propSample.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropSample, value.Sample, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.g.cs new file mode 100644 index 00000000000..5c73765a950 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleResponse.g.cs @@ -0,0 +1,45 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetSampleResponseConverter))] +public sealed partial class GetSampleResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetSampleResponse() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GetSampleResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public +#if NET7_0_OR_GREATER +required +#endif +System.Collections.Generic.IReadOnlyCollection Sample { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..43e31a3dc47 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetSampleStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.g.cs new file mode 100644 index 00000000000..67f1b70ae52 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsRequest.g.cs @@ -0,0 +1,252 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +public sealed partial class GetSampleStatsRequestParameters : Elastic.Transport.RequestParameters +{ +} + +/// +/// +/// Request stats for a random sample of raw documents ingested into the given index or data stream. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetSampleStatsRequestConverter))] +public sealed partial class GetSampleStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetSampleStatsRequest(Elastic.Clients.Elasticsearch.IndexName index) : base(r => r.Required("index", index)) + { + } +#if NET7_0_OR_GREATER + public GetSampleStatsRequest() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GetSampleStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.IndexManagementGetSampleStats; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "indices.get_sample_stats"; + + /// + /// + /// Single index or data stream name. Wildcards are not supported. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.IndexName Index { get => P("index"); set => PR("index", value); } +} + +/// +/// +/// Request stats for a random sample of raw documents ingested into the given index or data stream. +/// +/// +public readonly partial struct GetSampleStatsRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetSampleStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest instance) + { + Instance = instance; + } + + public GetSampleStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) + { + Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(index); + } + + [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] + public GetSampleStatsRequestDescriptor() + { + throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); + } + + public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// Single index or data stream name. Wildcards are not supported. + /// + /// + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) + { + Instance.Index = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} + +/// +/// +/// Request stats for a random sample of raw documents ingested into the given index or data stream. +/// +/// +public readonly partial struct GetSampleStatsRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetSampleStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest instance) + { + Instance = instance; + } + + public GetSampleStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexName index) + { + Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(index); + } + + public GetSampleStatsRequestDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(typeof(TDocument)); + } + + public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest instance) => new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// Single index or data stream name. Wildcards are not supported. + /// + /// + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor Index(Elastic.Clients.Elasticsearch.IndexName value) + { + Instance.Index = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest Build(System.Action> action) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..3be3dd65620 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.Converters.g.cs @@ -0,0 +1,180 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class GetSampleStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropLastException = System.Text.Json.JsonEncodedText.Encode("last_exception"); + private static readonly System.Text.Json.JsonEncodedText PropPotentialSamples = System.Text.Json.JsonEncodedText.Encode("potential_samples"); + private static readonly System.Text.Json.JsonEncodedText PropSamplesAccepted = System.Text.Json.JsonEncodedText.Encode("samples_accepted"); + private static readonly System.Text.Json.JsonEncodedText PropSamplesRejectedForCondition = System.Text.Json.JsonEncodedText.Encode("samples_rejected_for_condition"); + private static readonly System.Text.Json.JsonEncodedText PropSamplesRejectedForException = System.Text.Json.JsonEncodedText.Encode("samples_rejected_for_exception"); + private static readonly System.Text.Json.JsonEncodedText PropSamplesRejectedForMaxSamplesExceeded = System.Text.Json.JsonEncodedText.Encode("samples_rejected_for_max_samples_exceeded"); + private static readonly System.Text.Json.JsonEncodedText PropSamplesRejectedForRate = System.Text.Json.JsonEncodedText.Encode("samples_rejected_for_rate"); + private static readonly System.Text.Json.JsonEncodedText PropSamplesRejectedForSize = System.Text.Json.JsonEncodedText.Encode("samples_rejected_for_size"); + private static readonly System.Text.Json.JsonEncodedText PropTimeCompilingCondition = System.Text.Json.JsonEncodedText.Encode("time_compiling_condition"); + private static readonly System.Text.Json.JsonEncodedText PropTimeCompilingConditionMillis = System.Text.Json.JsonEncodedText.Encode("time_compiling_condition_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTimeEvaluatingCondition = System.Text.Json.JsonEncodedText.Encode("time_evaluating_condition"); + private static readonly System.Text.Json.JsonEncodedText PropTimeEvaluatingConditionMillis = System.Text.Json.JsonEncodedText.Encode("time_evaluating_condition_millis"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSampling = System.Text.Json.JsonEncodedText.Encode("time_sampling"); + private static readonly System.Text.Json.JsonEncodedText PropTimeSamplingMillis = System.Text.Json.JsonEncodedText.Encode("time_sampling_millis"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propLastException = default; + LocalJsonValue propPotentialSamples = default; + LocalJsonValue propSamplesAccepted = default; + LocalJsonValue propSamplesRejectedForCondition = default; + LocalJsonValue propSamplesRejectedForException = default; + LocalJsonValue propSamplesRejectedForMaxSamplesExceeded = default; + LocalJsonValue propSamplesRejectedForRate = default; + LocalJsonValue propSamplesRejectedForSize = default; + LocalJsonValue propTimeCompilingCondition = default; + LocalJsonValue propTimeCompilingConditionMillis = default; + LocalJsonValue propTimeEvaluatingCondition = default; + LocalJsonValue propTimeEvaluatingConditionMillis = default; + LocalJsonValue propTimeSampling = default; + LocalJsonValue propTimeSamplingMillis = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propLastException.TryReadProperty(ref reader, options, PropLastException, null)) + { + continue; + } + + if (propPotentialSamples.TryReadProperty(ref reader, options, PropPotentialSamples, null)) + { + continue; + } + + if (propSamplesAccepted.TryReadProperty(ref reader, options, PropSamplesAccepted, null)) + { + continue; + } + + if (propSamplesRejectedForCondition.TryReadProperty(ref reader, options, PropSamplesRejectedForCondition, null)) + { + continue; + } + + if (propSamplesRejectedForException.TryReadProperty(ref reader, options, PropSamplesRejectedForException, null)) + { + continue; + } + + if (propSamplesRejectedForMaxSamplesExceeded.TryReadProperty(ref reader, options, PropSamplesRejectedForMaxSamplesExceeded, null)) + { + continue; + } + + if (propSamplesRejectedForRate.TryReadProperty(ref reader, options, PropSamplesRejectedForRate, null)) + { + continue; + } + + if (propSamplesRejectedForSize.TryReadProperty(ref reader, options, PropSamplesRejectedForSize, null)) + { + continue; + } + + if (propTimeCompilingCondition.TryReadProperty(ref reader, options, PropTimeCompilingCondition, null)) + { + continue; + } + + if (propTimeCompilingConditionMillis.TryReadProperty(ref reader, options, PropTimeCompilingConditionMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTimeEvaluatingCondition.TryReadProperty(ref reader, options, PropTimeEvaluatingCondition, null)) + { + continue; + } + + if (propTimeEvaluatingConditionMillis.TryReadProperty(ref reader, options, PropTimeEvaluatingConditionMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (propTimeSampling.TryReadProperty(ref reader, options, PropTimeSampling, null)) + { + continue; + } + + if (propTimeSamplingMillis.TryReadProperty(ref reader, options, PropTimeSamplingMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + LastException = propLastException.Value, + PotentialSamples = propPotentialSamples.Value, + SamplesAccepted = propSamplesAccepted.Value, + SamplesRejectedForCondition = propSamplesRejectedForCondition.Value, + SamplesRejectedForException = propSamplesRejectedForException.Value, + SamplesRejectedForMaxSamplesExceeded = propSamplesRejectedForMaxSamplesExceeded.Value, + SamplesRejectedForRate = propSamplesRejectedForRate.Value, + SamplesRejectedForSize = propSamplesRejectedForSize.Value, + TimeCompilingCondition = propTimeCompilingCondition.Value, + TimeCompilingConditionMillis = propTimeCompilingConditionMillis.Value, + TimeEvaluatingCondition = propTimeEvaluatingCondition.Value, + TimeEvaluatingConditionMillis = propTimeEvaluatingConditionMillis.Value, + TimeSampling = propTimeSampling.Value, + TimeSamplingMillis = propTimeSamplingMillis.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropLastException, value.LastException, null, null); + writer.WriteProperty(options, PropPotentialSamples, value.PotentialSamples, null, null); + writer.WriteProperty(options, PropSamplesAccepted, value.SamplesAccepted, null, null); + writer.WriteProperty(options, PropSamplesRejectedForCondition, value.SamplesRejectedForCondition, null, null); + writer.WriteProperty(options, PropSamplesRejectedForException, value.SamplesRejectedForException, null, null); + writer.WriteProperty(options, PropSamplesRejectedForMaxSamplesExceeded, value.SamplesRejectedForMaxSamplesExceeded, null, null); + writer.WriteProperty(options, PropSamplesRejectedForRate, value.SamplesRejectedForRate, null, null); + writer.WriteProperty(options, PropSamplesRejectedForSize, value.SamplesRejectedForSize, null, null); + writer.WriteProperty(options, PropTimeCompilingCondition, value.TimeCompilingCondition, null, null); + writer.WriteProperty(options, PropTimeCompilingConditionMillis, value.TimeCompilingConditionMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTimeEvaluatingCondition, value.TimeEvaluatingCondition, null, null); + writer.WriteProperty(options, PropTimeEvaluatingConditionMillis, value.TimeEvaluatingConditionMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteProperty(options, PropTimeSampling, value.TimeSampling, null, null); + writer.WriteProperty(options, PropTimeSamplingMillis, value.TimeSamplingMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.g.cs new file mode 100644 index 00000000000..2ca9f4e2067 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/GetSampleStatsResponse.g.cs @@ -0,0 +1,94 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.GetSampleStatsResponseConverter))] +public sealed partial class GetSampleStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetSampleStatsResponse() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GetSampleStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public string? LastException { get; set; } + public +#if NET7_0_OR_GREATER +required +#endif +long PotentialSamples { get; set; } + public +#if NET7_0_OR_GREATER +required +#endif +long SamplesAccepted { get; set; } + public +#if NET7_0_OR_GREATER +required +#endif +long SamplesRejectedForCondition { get; set; } + public +#if NET7_0_OR_GREATER +required +#endif +long SamplesRejectedForException { get; set; } + public +#if NET7_0_OR_GREATER +required +#endif +long SamplesRejectedForMaxSamplesExceeded { get; set; } + public +#if NET7_0_OR_GREATER +required +#endif +long SamplesRejectedForRate { get; set; } + public +#if NET7_0_OR_GREATER +required +#endif +long SamplesRejectedForSize { get; set; } + public Elastic.Clients.Elasticsearch.Duration? TimeCompilingCondition { get; set; } + public +#if NET7_0_OR_GREATER +required +#endif +System.TimeSpan TimeCompilingConditionMillis { get; set; } + public Elastic.Clients.Elasticsearch.Duration? TimeEvaluatingCondition { get; set; } + public +#if NET7_0_OR_GREATER +required +#endif +System.TimeSpan TimeEvaluatingConditionMillis { get; set; } + public Elastic.Clients.Elasticsearch.Duration? TimeSampling { get; set; } + public +#if NET7_0_OR_GREATER +required +#endif +System.TimeSpan TimeSamplingMillis { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.g.cs index d3343766b50..757accbbd82 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAi21Response.g.cs @@ -39,7 +39,9 @@ internal PutAi21Response(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs index d1504d27c9e..ddb1325c3b4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAlibabacloudResponse.g.cs @@ -39,7 +39,9 @@ internal PutAlibabacloudResponse(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.g.cs index 11c8ee2afb7..878b9adef3f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonbedrockResponse.g.cs @@ -39,7 +39,9 @@ internal PutAmazonbedrockResponse(Elastic.Clients.Elasticsearch.Serialization.Js /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.g.cs index fee3fb58939..e7da6e0afe8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAmazonsagemakerResponse.g.cs @@ -39,7 +39,9 @@ internal PutAmazonsagemakerResponse(Elastic.Clients.Elasticsearch.Serialization. /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.g.cs index 50ae139fce7..675e6c24ee6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAnthropicResponse.g.cs @@ -39,7 +39,9 @@ internal PutAnthropicResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.g.cs index b4967652f38..48765668a03 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureaistudioResponse.g.cs @@ -39,7 +39,9 @@ internal PutAzureaistudioResponse(Elastic.Clients.Elasticsearch.Serialization.Js /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.g.cs index fae6875a1fa..83144eaa37a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutAzureopenaiResponse.g.cs @@ -39,7 +39,9 @@ internal PutAzureopenaiResponse(Elastic.Clients.Elasticsearch.Serialization.Json /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.g.cs index 268698bc595..5bc540d541a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCohereResponse.g.cs @@ -39,7 +39,9 @@ internal PutCohereResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.g.cs index 1a32738e990..4c8ad8a5151 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.g.cs @@ -39,7 +39,9 @@ internal PutContextualaiResponse(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.g.cs index c2c6d953823..73fef358ca3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutCustomResponse.g.cs @@ -39,7 +39,9 @@ internal PutCustomResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.g.cs index 0e893dddcfa..8e2c02ce62c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutDeepseekResponse.g.cs @@ -39,7 +39,9 @@ internal PutDeepseekResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchRequest.g.cs index 2c83850ee6f..cbb12b6dc77 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchRequest.g.cs @@ -124,6 +124,8 @@ internal PutElasticsearchRequest(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } @@ -243,6 +245,8 @@ public Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequestDescriptor /// /// /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequestDescriptor ChunkingSettings(Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? value) @@ -254,6 +258,8 @@ public Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequestDescriptor /// /// /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequestDescriptor ChunkingSettings() @@ -265,6 +271,8 @@ public Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequestDescriptor /// /// /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.PutElasticsearchRequestDescriptor ChunkingSettings(System.Action? action) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.g.cs index 3054748c539..1707bce50d2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElasticsearchResponse.g.cs @@ -39,7 +39,9 @@ internal PutElasticsearchResponse(Elastic.Clients.Elasticsearch.Serialization.Js /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.g.cs index d69730c79f3..49bacdc8fb4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutElserResponse.g.cs @@ -39,7 +39,9 @@ internal PutElserResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.g.cs index 86b904dcdaf..5c27ad4450f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGoogleaistudioResponse.g.cs @@ -39,7 +39,9 @@ internal PutGoogleaistudioResponse(Elastic.Clients.Elasticsearch.Serialization.J /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.g.cs index 3a561386256..65292f3f04a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutGooglevertexaiResponse.g.cs @@ -39,7 +39,9 @@ internal PutGooglevertexaiResponse(Elastic.Clients.Elasticsearch.Serialization.J /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.g.cs index 2153e94cf83..b30f343991c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutHuggingFaceResponse.g.cs @@ -39,7 +39,9 @@ internal PutHuggingFaceResponse(Elastic.Clients.Elasticsearch.Serialization.Json /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs index 37d019001b6..570cef2af3c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutInferenceResponse.g.cs @@ -39,7 +39,9 @@ internal PutInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.g.cs index c133d5c110a..5b9d3d9240d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutJinaaiResponse.g.cs @@ -39,7 +39,9 @@ internal PutJinaaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.g.cs index bbd2e051009..dd1c75813eb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutLlamaResponse.g.cs @@ -39,7 +39,9 @@ internal PutLlamaResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.g.cs index 8820aa14703..d1d96117fcc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutMistralResponse.g.cs @@ -39,7 +39,9 @@ internal PutMistralResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.g.cs index b5460cba600..169ddfcab4c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutOpenaiResponse.g.cs @@ -39,7 +39,9 @@ internal PutOpenaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.g.cs index 061a54ac556..adcd4cc3336 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutVoyageaiResponse.g.cs @@ -39,7 +39,9 @@ internal PutVoyageaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.g.cs index 831ecd98de8..dfbadbe5629 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutWatsonxResponse.g.cs @@ -39,7 +39,9 @@ internal PutWatsonxResponse(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.g.cs index d56778ec721..38914e99550 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/UpdateInferenceResponse.g.cs @@ -39,7 +39,9 @@ internal UpdateInferenceResponse(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Cluster.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Cluster.g.cs index ec41cd9d88f..e7486a52d15 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Cluster.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Cluster.g.cs @@ -682,6 +682,52 @@ public virtual Elastic.Clients.Elasticsearch.Cluster.PutComponentTemplateRespons return DoRequestAsync(request, cancellationToken); } + public virtual Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsResponse PutSettings(Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsResponse PutSettings() + { + var builder = new Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor(); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsResponse PutSettings(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task PutSettingsAsync(Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task PutSettingsAsync(System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor(); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task PutSettingsAsync(System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Cluster.PutClusterSettingsRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual Elastic.Clients.Elasticsearch.Cluster.ClusterStatsResponse Stats(Elastic.Clients.Elasticsearch.Cluster.ClusterStatsRequest request) { request.BeforeRequest(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs index 74d6e12add3..5dabfb4e25f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Indices.g.cs @@ -3400,6 +3400,202 @@ public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetMigrateReindexSt return DoRequestAsync(request, cancellationToken); } + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse GetSample(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse GetSample(Elastic.Clients.Elasticsearch.IndexName index) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(index); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse GetSample(Elastic.Clients.Elasticsearch.IndexName index, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(index); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse GetSample() + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse GetSample(System.Action> action) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleResponse GetSample(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(index); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task GetSampleAsync(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetSampleAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(index); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetSampleAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(index); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetSampleAsync(System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetSampleAsync(System.Action> action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetSampleAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleRequestDescriptor(index); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse GetSampleStats(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse GetSampleStats(Elastic.Clients.Elasticsearch.IndexName index) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(index); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse GetSampleStats(Elastic.Clients.Elasticsearch.IndexName index, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(index); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse GetSampleStats() + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse GetSampleStats(System.Action> action) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsResponse GetSampleStats(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(index); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task GetSampleStatsAsync(Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetSampleStatsAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(index); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetSampleStatsAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(index); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetSampleStatsAsync(System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetSampleStatsAsync(System.Action> action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetSampleStatsAsync(Elastic.Clients.Elasticsearch.IndexName index, System.Action> action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.IndexManagement.GetSampleStatsRequestDescriptor(index); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsResponse GetSettings(Elastic.Clients.Elasticsearch.IndexManagement.GetIndicesSettingsRequest request) { request.BeforeRequest(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.g.cs index 1363b56cfa8..8d408fbb1da 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/Analyzers.g.cs @@ -558,7 +558,13 @@ public Elastic.Clients.Elasticsearch.Analysis.AnalyzersDescriptor Kuromoji(strin return this; } - public Elastic.Clients.Elasticsearch.Analysis.AnalyzersDescriptor Kuromoji(string key, System.Action action) + public Elastic.Clients.Elasticsearch.Analysis.AnalyzersDescriptor Kuromoji(string key) + { + _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzerDescriptor.Build(null)); + return this; + } + + public Elastic.Clients.Elasticsearch.Analysis.AnalyzersDescriptor Kuromoji(string key, System.Action? action) { _items.Add(key, Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzerDescriptor.Build(action)); return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.Converters.g.cs index c97d230543f..50834e0a46c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.Converters.g.cs @@ -32,11 +32,11 @@ public sealed partial class KuromojiAnalyzerConverter : System.Text.Json.Seriali public override Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propMode = default; + LocalJsonValue propMode = default; LocalJsonValue propUserDictionary = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propMode.TryReadProperty(ref reader, options, PropMode, null)) + if (propMode.TryReadProperty(ref reader, options, PropMode, static Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; } @@ -72,7 +72,7 @@ public override Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer Read(ref public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropMode, value.Mode, null, null); + writer.WriteProperty(options, PropMode, value.Mode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteProperty(options, PropUserDictionary, value.UserDictionary, null, null); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.g.cs index 2bab4a43412..92557ff71d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Analysis/KuromojiAnalyzer.g.cs @@ -26,18 +26,12 @@ namespace Elastic.Clients.Elasticsearch.Analysis; [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Analysis.Json.KuromojiAnalyzerConverter))] public sealed partial class KuromojiAnalyzer : Elastic.Clients.Elasticsearch.Analysis.IAnalyzer { - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public KuromojiAnalyzer(Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode mode) - { - Mode = mode; - } #if NET7_0_OR_GREATER public KuromojiAnalyzer() { } #endif #if !NET7_0_OR_GREATER - [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] public KuromojiAnalyzer() { } @@ -48,11 +42,7 @@ internal KuromojiAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstr _ = sentinel; } - public -#if NET7_0_OR_GREATER - required -#endif - Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode Mode { get; set; } + public Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode? Mode { get; set; } public string Type => "kuromoji"; @@ -78,7 +68,7 @@ public KuromojiAnalyzerDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzerDescriptor(Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer instance) => new Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzerDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer(Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzerDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzerDescriptor Mode(Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode value) + public Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzerDescriptor Mode(Elastic.Clients.Elasticsearch.Analysis.KuromojiTokenizationMode? value) { Instance.Mode = value; return this; @@ -91,8 +81,13 @@ public Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzerDescriptor UserDic } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer Build(System.Action action) + internal static Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer Build(System.Action? action) { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + var builder = new Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzerDescriptor(new Elastic.Clients.Elasticsearch.Analysis.KuromojiAnalyzer(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); action.Invoke(builder); return builder.Instance; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.Converters.g.cs new file mode 100644 index 00000000000..29db9df6625 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.Converters.g.cs @@ -0,0 +1,72 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; + +public sealed partial class RawDocumentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); + + public override Elastic.Clients.Elasticsearch.IndexManagement.RawDocument Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propIndex = default; + LocalJsonValue propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propIndex.TryReadProperty(ref reader, options, PropIndex, null)) + { + continue; + } + + if (propSource.TryReadProperty(ref reader, options, PropSource, null)) + { + continue; + } + + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.IndexManagement.RawDocument(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Index = propIndex.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.RawDocument value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropIndex, value.Index, null, null); + writer.WriteProperty(options, PropSource, value.Source, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.g.cs new file mode 100644 index 00000000000..1062fdcf18a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RawDocument.g.cs @@ -0,0 +1,73 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.IndexManagement; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.IndexManagement.Json.RawDocumentConverter))] +public sealed partial class RawDocument +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public RawDocument(string index, Elastic.Clients.Elasticsearch.Mapping.Properties source) + { + Index = index; + Source = source; + } +#if NET7_0_OR_GREATER + public RawDocument() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public RawDocument() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal RawDocument(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Name of the index for this raw document. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + string Index { get; set; } + + /// + /// + /// The original raw source. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Mapping.Properties Source { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.g.cs index 11bc600c960..9a9b4378a17 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.g.cs @@ -85,6 +85,22 @@ internal CustomResponseParams(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// } /// } /// + /// # Elasticsearch supports the following embedding types: + /// * float + /// * byte + /// * bit (or binary) + /// + /// To specify the embedding type for the response, the `embedding_type` + /// field should be added in the `json_parser` object. Here's an example: + /// "response":{ + /// "json_parser":{ + /// "text_embeddings":"$.data[*].embedding[*]", + /// "embedding_type":"bit" + /// } + /// } + /// + /// If `embedding_type` is not specified, it defaults to `float`. + /// /// # sparse_embedding /// # For a response like this: /// @@ -250,6 +266,22 @@ public CustomResponseParamsDescriptor() /// } /// } /// + /// # Elasticsearch supports the following embedding types: + /// * float + /// * byte + /// * bit (or binary) + /// + /// To specify the embedding type for the response, the `embedding_type` + /// field should be added in the `json_parser` object. Here's an example: + /// "response":{ + /// "json_parser":{ + /// "text_embeddings":"$.data[*].embedding[*]", + /// "embedding_type":"bit" + /// } + /// } + /// + /// If `embedding_type` is not specified, it defaults to `float`. + /// /// # sparse_embedding /// # For a response like this: /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.Converters.g.cs index 4a9aefc6d37..e679eb54d9e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.Converters.g.cs @@ -25,6 +25,7 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class CustomServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropBatchSize = System.Text.Json.JsonEncodedText.Encode("batch_size"); private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); private static readonly System.Text.Json.JsonEncodedText PropInputType = System.Text.Json.JsonEncodedText.Encode("input_type"); private static readonly System.Text.Json.JsonEncodedText PropQueryParameters = System.Text.Json.JsonEncodedText.Encode("query_parameters"); @@ -36,6 +37,7 @@ public sealed partial class CustomServiceSettingsConverter : System.Text.Json.Se public override Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBatchSize = default; LocalJsonValue propHeaders = default; LocalJsonValue propInputType = default; LocalJsonValue propQueryParameters = default; @@ -45,6 +47,11 @@ public override Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings Re LocalJsonValue propUrl = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { + if (propBatchSize.TryReadProperty(ref reader, options, PropBatchSize, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) { continue; @@ -92,6 +99,7 @@ public override Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings Re reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { + BatchSize = propBatchSize.Value, Headers = propHeaders.Value, InputType = propInputType.Value, QueryParameters = propQueryParameters.Value, @@ -105,6 +113,7 @@ public override Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings Re public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); + writer.WriteProperty(options, PropBatchSize, value.BatchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); writer.WriteProperty(options, PropInputType, value.InputType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); writer.WriteProperty(options, PropQueryParameters, value.QueryParameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.g.cs index 4b30f9d66e4..86189fce0ee 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.g.cs @@ -52,7 +52,16 @@ internal CustomServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// - /// Specifies the HTTPS header parameters – such as Authentication or Contet-Type – that are required to access the custom service. + /// Specifies the batch size used for the semantic_text field. If the field is not provided, the default is 10. + /// The batch size is the maximum number of inputs in a single request to the upstream service. + /// The chunk within the batch are controlled by the selected chunking strategy for the semantic_text field. + /// + /// + public int? BatchSize { get; set; } + + /// + /// + /// Specifies the HTTP header parameters – such as Authentication or Content-Type – that are required to access the custom service. /// For example: /// /// @@ -194,7 +203,20 @@ public CustomServiceSettingsDescriptor() /// /// - /// Specifies the HTTPS header parameters – such as Authentication or Contet-Type – that are required to access the custom service. + /// Specifies the batch size used for the semantic_text field. If the field is not provided, the default is 10. + /// The batch size is the maximum number of inputs in a single request to the upstream service. + /// The chunk within the batch are controlled by the selected chunking strategy for the semantic_text field. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor BatchSize(int? value) + { + Instance.BatchSize = value; + return this; + } + + /// + /// + /// Specifies the HTTP header parameters – such as Authentication or Content-Type – that are required to access the custom service. /// For example: /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.Converters.g.cs index 40958d927a5..bb145c2372c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.Converters.g.cs @@ -27,6 +27,8 @@ public sealed partial class ElasticsearchServiceSettingsConverter : System.Text. { private static readonly System.Text.Json.JsonEncodedText PropAdaptiveAllocations = System.Text.Json.JsonEncodedText.Encode("adaptive_allocations"); private static readonly System.Text.Json.JsonEncodedText PropDeploymentId = System.Text.Json.JsonEncodedText.Encode("deployment_id"); + private static readonly System.Text.Json.JsonEncodedText PropLongDocumentStrategy = System.Text.Json.JsonEncodedText.Encode("long_document_strategy"); + private static readonly System.Text.Json.JsonEncodedText PropMaxChunksPerDoc = System.Text.Json.JsonEncodedText.Encode("max_chunks_per_doc"); private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); private static readonly System.Text.Json.JsonEncodedText PropNumAllocations = System.Text.Json.JsonEncodedText.Encode("num_allocations"); private static readonly System.Text.Json.JsonEncodedText PropNumThreads = System.Text.Json.JsonEncodedText.Encode("num_threads"); @@ -36,6 +38,8 @@ public override Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSett reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propAdaptiveAllocations = default; LocalJsonValue propDeploymentId = default; + LocalJsonValue propLongDocumentStrategy = default; + LocalJsonValue propMaxChunksPerDoc = default; LocalJsonValue propModelId = default; LocalJsonValue propNumAllocations = default; LocalJsonValue propNumThreads = default; @@ -51,6 +55,16 @@ public override Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSett continue; } + if (propLongDocumentStrategy.TryReadProperty(ref reader, options, PropLongDocumentStrategy, null)) + { + continue; + } + + if (propMaxChunksPerDoc.TryReadProperty(ref reader, options, PropMaxChunksPerDoc, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) { continue; @@ -80,6 +94,8 @@ public override Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSett { AdaptiveAllocations = propAdaptiveAllocations.Value, DeploymentId = propDeploymentId.Value, + LongDocumentStrategy = propLongDocumentStrategy.Value, + MaxChunksPerDoc = propMaxChunksPerDoc.Value, ModelId = propModelId.Value, NumAllocations = propNumAllocations.Value, NumThreads = propNumThreads.Value @@ -91,6 +107,8 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteStartObject(); writer.WriteProperty(options, PropAdaptiveAllocations, value.AdaptiveAllocations, null, null); writer.WriteProperty(options, PropDeploymentId, value.DeploymentId, null, null); + writer.WriteProperty(options, PropLongDocumentStrategy, value.LongDocumentStrategy, null, null); + writer.WriteProperty(options, PropMaxChunksPerDoc, value.MaxChunksPerDoc, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropModelId, value.ModelId, null, null); writer.WriteProperty(options, PropNumAllocations, value.NumAllocations, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropNumThreads, value.NumThreads, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.g.cs index 759c0887af1..a9a69908b06 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ElasticsearchServiceSettings.g.cs @@ -68,6 +68,42 @@ internal ElasticsearchServiceSettings(Elastic.Clients.Elasticsearch.Serializatio /// public string? DeploymentId { get; set; } + /// + /// + /// Available only for the rerank task type using the Elastic reranker model. + /// Controls the strategy used for processing long documents during inference. + /// + /// + /// Possible values: + /// + /// + /// + /// + /// truncate (default): Processes only the beginning of each document. + /// + /// + /// + /// + /// chunk: Splits long documents into smaller parts (chunks) before inference. + /// + /// + /// + /// + /// When long_document_strategy is set to chunk, Elasticsearch splits each document into smaller parts but still returns a single score per document. + /// That score reflects the highest relevance score among all chunks. + /// + /// + public string? LongDocumentStrategy { get; set; } + + /// + /// + /// Only for the rerank task type. + /// Limits the number of chunks per document that are sent for inference when chunking is enabled. + /// If not set, all chunks generated for the document are processed. + /// + /// + public int? MaxChunksPerDoc { get; set; } + /// /// /// The name of the model to use for the inference task. @@ -181,6 +217,50 @@ public Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSettingsDescr return this; } + /// + /// + /// Available only for the rerank task type using the Elastic reranker model. + /// Controls the strategy used for processing long documents during inference. + /// + /// + /// Possible values: + /// + /// + /// + /// + /// truncate (default): Processes only the beginning of each document. + /// + /// + /// + /// + /// chunk: Splits long documents into smaller parts (chunks) before inference. + /// + /// + /// + /// + /// When long_document_strategy is set to chunk, Elasticsearch splits each document into smaller parts but still returns a single score per document. + /// That score reflects the highest relevance score among all chunks. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSettingsDescriptor LongDocumentStrategy(string? value) + { + Instance.LongDocumentStrategy = value; + return this; + } + + /// + /// + /// Only for the rerank task type. + /// Limits the number of chunks per document that are sent for inference when chunking is enabled. + /// If not set, all chunks generated for the document are processed. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ElasticsearchServiceSettingsDescriptor MaxChunksPerDoc(int? value) + { + Instance.MaxChunksPerDoc = value; + return this; + } + /// /// /// The name of the model to use for the inference task. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleModelGardenProvider.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleModelGardenProvider.Converters.g.cs new file mode 100644 index 00000000000..ef1594d4dbb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleModelGardenProvider.Converters.g.cs @@ -0,0 +1,81 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class GoogleModelGardenProviderConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAnthropic = System.Text.Json.JsonEncodedText.Encode("anthropic"); + private static readonly System.Text.Json.JsonEncodedText MemberGoogle = System.Text.Json.JsonEncodedText.Encode("google"); + + public override Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAnthropic)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider.Anthropic; + } + + if (reader.ValueTextEquals(MemberGoogle)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider.Google; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAnthropic.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider.Anthropic; + } + + if (string.Equals(value, MemberGoogle.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider.Google; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider.Anthropic: + writer.WriteStringValue(MemberAnthropic); + break; + case Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider.Google: + writer.WriteStringValue(MemberGoogle); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider ReadAsPropertyName(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return Read(ref reader, typeToConvert, options); + } + + public override void WriteAsPropertyName(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider value, System.Text.Json.JsonSerializerOptions options) + { + Write(writer, value, options); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleModelGardenProvider.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleModelGardenProvider.g.cs new file mode 100644 index 00000000000..aaf61cbda99 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleModelGardenProvider.g.cs @@ -0,0 +1,33 @@ +// 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 System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.GoogleModelGardenProviderConverter))] +public enum GoogleModelGardenProvider +{ + [System.Runtime.Serialization.EnumMember(Value = "anthropic")] + Anthropic, + [System.Runtime.Serialization.EnumMember(Value = "google")] + Google +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs index 03f64fb3d1c..8481f9626e4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs @@ -29,18 +29,24 @@ public sealed partial class GoogleVertexAIServiceSettingsConverter : System.Text private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); private static readonly System.Text.Json.JsonEncodedText PropProjectId = System.Text.Json.JsonEncodedText.Encode("project_id"); + private static readonly System.Text.Json.JsonEncodedText PropProvider = System.Text.Json.JsonEncodedText.Encode("provider"); private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); private static readonly System.Text.Json.JsonEncodedText PropServiceAccountJson = System.Text.Json.JsonEncodedText.Encode("service_account_json"); + private static readonly System.Text.Json.JsonEncodedText PropStreamingUrl = System.Text.Json.JsonEncodedText.Encode("streaming_url"); + private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"); public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propDimensions = default; - LocalJsonValue propLocation = default; - LocalJsonValue propModelId = default; - LocalJsonValue propProjectId = default; + LocalJsonValue propLocation = default; + LocalJsonValue propModelId = default; + LocalJsonValue propProjectId = default; + LocalJsonValue propProvider = default; LocalJsonValue propRateLimit = default; LocalJsonValue propServiceAccountJson = default; + LocalJsonValue propStreamingUrl = default; + LocalJsonValue propUrl = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propDimensions.TryReadProperty(ref reader, options, PropDimensions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) @@ -63,6 +69,11 @@ public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSet continue; } + if (propProvider.TryReadProperty(ref reader, options, PropProvider, static Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, null)) { continue; @@ -73,6 +84,16 @@ public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSet continue; } + if (propStreamingUrl.TryReadProperty(ref reader, options, PropStreamingUrl, null)) + { + continue; + } + + if (propUrl.TryReadProperty(ref reader, options, PropUrl, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -89,8 +110,11 @@ public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSet Location = propLocation.Value, ModelId = propModelId.Value, ProjectId = propProjectId.Value, + Provider = propProvider.Value, RateLimit = propRateLimit.Value, - ServiceAccountJson = propServiceAccountJson.Value + ServiceAccountJson = propServiceAccountJson.Value, + StreamingUrl = propStreamingUrl.Value, + Url = propUrl.Value }; } @@ -101,8 +125,11 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropLocation, value.Location, null, null); writer.WriteProperty(options, PropModelId, value.ModelId, null, null); writer.WriteProperty(options, PropProjectId, value.ProjectId, null, null); + writer.WriteProperty(options, PropProvider, value.Provider, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); writer.WriteProperty(options, PropServiceAccountJson, value.ServiceAccountJson, null, null); + writer.WriteProperty(options, PropStreamingUrl, value.StreamingUrl, null, null); + writer.WriteProperty(options, PropUrl, value.Url, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs index 32b6a5a9b5d..7200ce8f605 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs @@ -27,11 +27,8 @@ namespace Elastic.Clients.Elasticsearch.Inference; public sealed partial class GoogleVertexAIServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public GoogleVertexAIServiceSettings(string location, string modelId, string projectId, string serviceAccountJson) + public GoogleVertexAIServiceSettings(string serviceAccountJson) { - Location = location; - ModelId = modelId; - ProjectId = projectId; ServiceAccountJson = serviceAccountJson; } #if NET7_0_OR_GREATER @@ -62,38 +59,53 @@ internal GoogleVertexAIServiceSettings(Elastic.Clients.Elasticsearch.Serializati /// /// - /// The name of the location to use for the inference task. + /// The name of the location to use for the inference task for the Google Vertex AI inference task. + /// For Google Vertex AI, when provider is omitted or google location is mandatory. + /// For Google Model Garden's completion and chat_completion tasks, when provider is a supported non-google value - location is ignored. /// Refer to the Google documentation for the list of supported locations. /// /// - public -#if NET7_0_OR_GREATER - required -#endif - string Location { get; set; } + public string? Location { get; set; } /// /// /// The name of the model to use for the inference task. - /// Refer to the Google documentation for the list of supported models. + /// For Google Vertex AI model_id is mandatory. + /// For Google Model Garden's completion and chat_completion tasks, when provider is a supported non-google value - model_id will be used for some providers that require it, otherwise - ignored. + /// Refer to the Google documentation for the list of supported models for Google Vertex AI. /// /// - public -#if NET7_0_OR_GREATER - required -#endif - string ModelId { get; set; } + public string? ModelId { get; set; } /// /// - /// The name of the project to use for the inference task. + /// The name of the project to use for the Google Vertex AI inference task. + /// For Google Vertex AI project_id is mandatory. + /// For Google Model Garden's completion and chat_completion tasks, when provider is a supported non-google value - project_id is ignored. /// /// - public -#if NET7_0_OR_GREATER - required -#endif - string ProjectId { get; set; } + public string? ProjectId { get; set; } + + /// + /// + /// The name of the Google Model Garden Provider for completion and chat_completion tasks. + /// In order for a Google Model Garden endpoint to be used provider must be defined and be other than google. + /// Modes: + /// + /// + /// + /// + /// Google Model Garden (third-party models): set provider to a supported non-google value and provide url and/or streaming_url. + /// + /// + /// + /// + /// Google Vertex AI: omit provider or set it to google. In this mode, do not set url or streaming_url and Elastic will construct the endpoint url from location, model_id, and project_id parameters. + /// + /// + /// + /// + public Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider? Provider { get; set; } /// /// @@ -113,6 +125,28 @@ internal GoogleVertexAIServiceSettings(Elastic.Clients.Elasticsearch.Serializati required #endif string ServiceAccountJson { get; set; } + + /// + /// + /// The URL for streaming completion and chat_completion requests to a Google Model Garden provider endpoint. + /// If both streaming_url and url are provided, each is used for its respective mode. + /// If url is not provided, streaming_url is also used for non-streaming completion requests. + /// If provider is not provided or set to google (Google Vertex AI), do not set streaming_url (or url). + /// At least one of streaming_url or url must be provided for Google Model Garden endpoint usage. + /// + /// + public string? StreamingUrl { get; set; } + + /// + /// + /// The URL for non-streaming completion requests to a Google Model Garden provider endpoint. + /// If both url and streaming_url are provided, each is used for its respective mode. + /// If streaming_url is not provided, url is also used for streaming completion and chat_completion. + /// If provider is not provided or set to google (Google Vertex AI), do not set url (or streaming_url). + /// At least one of url or streaming_url must be provided for Google Model Garden endpoint usage. + /// + /// + public string? Url { get; set; } } public readonly partial struct GoogleVertexAiServiceSettingsDescriptor @@ -149,11 +183,13 @@ public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDesc /// /// - /// The name of the location to use for the inference task. + /// The name of the location to use for the inference task for the Google Vertex AI inference task. + /// For Google Vertex AI, when provider is omitted or google location is mandatory. + /// For Google Model Garden's completion and chat_completion tasks, when provider is a supported non-google value - location is ignored. /// Refer to the Google documentation for the list of supported locations. /// /// - public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor Location(string value) + public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor Location(string? value) { Instance.Location = value; return this; @@ -162,10 +198,12 @@ public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDesc /// /// /// The name of the model to use for the inference task. - /// Refer to the Google documentation for the list of supported models. + /// For Google Vertex AI model_id is mandatory. + /// For Google Model Garden's completion and chat_completion tasks, when provider is a supported non-google value - model_id will be used for some providers that require it, otherwise - ignored. + /// Refer to the Google documentation for the list of supported models for Google Vertex AI. /// /// - public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor ModelId(string value) + public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor ModelId(string? value) { Instance.ModelId = value; return this; @@ -173,15 +211,42 @@ public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDesc /// /// - /// The name of the project to use for the inference task. + /// The name of the project to use for the Google Vertex AI inference task. + /// For Google Vertex AI project_id is mandatory. + /// For Google Model Garden's completion and chat_completion tasks, when provider is a supported non-google value - project_id is ignored. /// /// - public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor ProjectId(string value) + public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor ProjectId(string? value) { Instance.ProjectId = value; return this; } + /// + /// + /// The name of the Google Model Garden Provider for completion and chat_completion tasks. + /// In order for a Google Model Garden endpoint to be used provider must be defined and be other than google. + /// Modes: + /// + /// + /// + /// + /// Google Model Garden (third-party models): set provider to a supported non-google value and provide url and/or streaming_url. + /// + /// + /// + /// + /// Google Vertex AI: omit provider or set it to google. In this mode, do not set url or streaming_url and Elastic will construct the endpoint url from location, model_id, and project_id parameters. + /// + /// + /// + /// + public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor Provider(Elastic.Clients.Elasticsearch.Inference.GoogleModelGardenProvider? value) + { + Instance.Provider = value; + return this; + } + /// /// /// This setting helps to minimize the number of rate limit errors returned from Google Vertex AI. @@ -229,6 +294,36 @@ public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDesc return this; } + /// + /// + /// The URL for streaming completion and chat_completion requests to a Google Model Garden provider endpoint. + /// If both streaming_url and url are provided, each is used for its respective mode. + /// If url is not provided, streaming_url is also used for non-streaming completion requests. + /// If provider is not provided or set to google (Google Vertex AI), do not set streaming_url (or url). + /// At least one of streaming_url or url must be provided for Google Model Garden endpoint usage. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor StreamingUrl(string? value) + { + Instance.StreamingUrl = value; + return this; + } + + /// + /// + /// The URL for non-streaming completion requests to a Google Model Garden provider endpoint. + /// If both url and streaming_url are provided, each is used for its respective mode. + /// If streaming_url is not provided, url is also used for streaming completion and chat_completion. + /// If provider is not provided or set to google (Google Vertex AI), do not set url (or streaming_url). + /// At least one of url or streaming_url must be provided for Google Model Garden endpoint usage. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor Url(string? value) + { + Instance.Url = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings Build(System.Action action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.Converters.g.cs index 5d8afdf701d..f391fe1570b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.Converters.g.cs @@ -26,6 +26,7 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class GoogleVertexAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropAutoTruncate = System.Text.Json.JsonEncodedText.Encode("auto_truncate"); + private static readonly System.Text.Json.JsonEncodedText PropMaxTokens = System.Text.Json.JsonEncodedText.Encode("max_tokens"); private static readonly System.Text.Json.JsonEncodedText PropThinkingConfig = System.Text.Json.JsonEncodedText.Encode("thinking_config"); private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); @@ -33,6 +34,7 @@ public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskSettin { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propAutoTruncate = default; + LocalJsonValue propMaxTokens = default; LocalJsonValue propThinkingConfig = default; LocalJsonValue propTopN = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -42,6 +44,11 @@ public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskSettin continue; } + if (propMaxTokens.TryReadProperty(ref reader, options, PropMaxTokens, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propThinkingConfig.TryReadProperty(ref reader, options, PropThinkingConfig, null)) { continue; @@ -65,6 +72,7 @@ public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskSettin return new Elastic.Clients.Elasticsearch.Inference.GoogleVertexAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { AutoTruncate = propAutoTruncate.Value, + MaxTokens = propMaxTokens.Value, ThinkingConfig = propThinkingConfig.Value, TopN = propTopN.Value }; @@ -74,6 +82,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropAutoTruncate, value.AutoTruncate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMaxTokens, value.MaxTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropThinkingConfig, value.ThinkingConfig, null, null); writer.WriteProperty(options, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.g.cs index 205414d0cb1..b24b7de87bf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAITaskSettings.g.cs @@ -49,6 +49,16 @@ internal GoogleVertexAITaskSettings(Elastic.Clients.Elasticsearch.Serialization. /// public bool? AutoTruncate { get; set; } + /// + /// + /// For completion and chat_completion tasks, specifies the max_tokens value for requests sent to the Google Model Garden anthropic provider. + /// If provider is not set to anthropic, this field is ignored. + /// If max_tokens is specified - it must be a positive integer. If not specified, the default value of 1024 is used. + /// Anthropic models require max_tokens to be set for each request. Please refer to the Anthropic documentation for more information. + /// + /// + public int? MaxTokens { get; set; } + /// /// /// For a completion or chat_completion task, allows configuration of the thinking features for the model. @@ -95,6 +105,20 @@ public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiTaskSettingsDescrip return this; } + /// + /// + /// For completion and chat_completion tasks, specifies the max_tokens value for requests sent to the Google Model Garden anthropic provider. + /// If provider is not set to anthropic, this field is ignored. + /// If max_tokens is specified - it must be a positive integer. If not specified, the default value of 1024 is used. + /// Anthropic models require max_tokens to be set for each request. Please refer to the Anthropic documentation for more information. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiTaskSettingsDescriptor MaxTokens(int? value) + { + Instance.MaxTokens = value; + return this; + } + /// /// /// For a completion or chat_completion task, allows configuration of the thinking features for the model. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs index d889d77ac56..77e09cf00af 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpoint.g.cs @@ -56,7 +56,9 @@ internal InferenceEndpoint(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } @@ -117,7 +119,9 @@ public InferenceEndpointDescriptor() /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceEndpointDescriptor ChunkingSettings(Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? value) @@ -128,7 +132,9 @@ public Elastic.Clients.Elasticsearch.Inference.InferenceEndpointDescriptor Chunk /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceEndpointDescriptor ChunkingSettings() @@ -139,7 +145,9 @@ public Elastic.Clients.Elasticsearch.Inference.InferenceEndpointDescriptor Chunk /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceEndpointDescriptor ChunkingSettings(System.Action? action) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs index 3a6dae0bd94..c41201edef1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/InferenceEndpointInfo.g.cs @@ -58,7 +58,9 @@ internal InferenceEndpointInfo(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// - /// Chunking configuration object + /// The chunking configuration object. + /// Applies only to the sparse_embedding and text_embedding task types. + /// Not applicable to the rerank, completion, or chat_completion task types. /// /// public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.Converters.g.cs index 6c9a32a1787..03414e32bb6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.Converters.g.cs @@ -25,14 +25,21 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class OpenAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"); public override Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propHeaders = default; LocalJsonValue propUser = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + if (propUser.TryReadProperty(ref reader, options, PropUser, null)) { continue; @@ -50,6 +57,7 @@ public override Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings Read( reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { + Headers = propHeaders.Value, User = propUser.Value }; } @@ -57,6 +65,7 @@ public override Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings Read( public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); + writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))); writer.WriteProperty(options, PropUser, value.User, null, null); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs index 905706ae577..ab24be39e97 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs @@ -42,6 +42,20 @@ internal OpenAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonCons _ = sentinel; } + /// + /// + /// Specifies custom HTTP header parameters. + /// For example: + /// + /// + /// "headers":{ + /// "Custom-Header": "Some-Value", + /// "Another-Custom-Header": "Another-Value" + /// } + /// + /// + public object? Headers { get; set; } + /// /// /// For a completion or text_embedding task, specify the user issuing the request. @@ -70,6 +84,24 @@ public OpenAiTaskSettingsDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Inference.OpenAiTaskSettingsDescriptor(Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings instance) => new Elastic.Clients.Elasticsearch.Inference.OpenAiTaskSettingsDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Inference.OpenAITaskSettings(Elastic.Clients.Elasticsearch.Inference.OpenAiTaskSettingsDescriptor descriptor) => descriptor.Instance; + /// + /// + /// Specifies custom HTTP header parameters. + /// For example: + /// + /// + /// "headers":{ + /// "Custom-Header": "Some-Value", + /// "Another-Custom-Header": "Another-Value" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.OpenAiTaskSettingsDescriptor Headers(object? value) + { + Instance.Headers = value; + return this; + } + /// /// /// For a completion or text_embedding task, specify the user issuing the request. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.Converters.g.cs index bfc939c9240..ce9091a5d36 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.Converters.g.cs @@ -25,11 +25,23 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class TaskTypeGoogleVertexAIConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText MemberChatCompletion = System.Text.Json.JsonEncodedText.Encode("chat_completion"); + private static readonly System.Text.Json.JsonEncodedText MemberCompletion = System.Text.Json.JsonEncodedText.Encode("completion"); private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); private static readonly System.Text.Json.JsonEncodedText MemberTextEmbedding = System.Text.Json.JsonEncodedText.Encode("text_embedding"); public override Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { + if (reader.ValueTextEquals(MemberChatCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.ChatCompletion; + } + + if (reader.ValueTextEquals(MemberCompletion)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.Completion; + } + if (reader.ValueTextEquals(MemberRerank)) { return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.Rerank; @@ -41,6 +53,16 @@ public override Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI R } var value = reader.GetString()!; + if (string.Equals(value, MemberChatCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.ChatCompletion; + } + + if (string.Equals(value, MemberCompletion.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.Completion; + } + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.Rerank; @@ -58,6 +80,12 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { switch (value) { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.ChatCompletion: + writer.WriteStringValue(MemberChatCompletion); + break; + case Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.Completion: + writer.WriteStringValue(MemberCompletion); + break; case Elastic.Clients.Elasticsearch.Inference.TaskTypeGoogleVertexAI.Rerank: writer.WriteStringValue(MemberRerank); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.g.cs index ad2099eda5a..434c41f08f8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeGoogleVertexAI.g.cs @@ -26,6 +26,10 @@ namespace Elastic.Clients.Elasticsearch.Inference; [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TaskTypeGoogleVertexAIConverter))] public enum TaskTypeGoogleVertexAI { + [System.Runtime.Serialization.EnumMember(Value = "chat_completion")] + ChatCompletion, + [System.Runtime.Serialization.EnumMember(Value = "completion")] + Completion, [System.Runtime.Serialization.EnumMember(Value = "rerank")] Rerank, [System.Runtime.Serialization.EnumMember(Value = "text_embedding")] diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.Converters.g.cs index 02d9998069e..23e8ef5c6d5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.Converters.g.cs @@ -35,6 +35,7 @@ public sealed partial class KnnQueryConverter : System.Text.Json.Serialization.J private static readonly System.Text.Json.JsonEncodedText PropQueryVectorBuilder = System.Text.Json.JsonEncodedText.Encode("query_vector_builder"); private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"); private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + private static readonly System.Text.Json.JsonEncodedText PropVisitPercentage = System.Text.Json.JsonEncodedText.Encode("visit_percentage"); public override Elastic.Clients.Elasticsearch.KnnQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -49,6 +50,7 @@ public override Elastic.Clients.Elasticsearch.KnnQuery Read(ref System.Text.Json LocalJsonValue propQueryVectorBuilder = default; LocalJsonValue propRescoreVector = default; LocalJsonValue propSimilarity = default; + LocalJsonValue propVisitPercentage = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) @@ -101,6 +103,11 @@ public override Elastic.Clients.Elasticsearch.KnnQuery Read(ref System.Text.Json continue; } + if (propVisitPercentage.TryReadProperty(ref reader, options, PropVisitPercentage, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -122,7 +129,8 @@ public override Elastic.Clients.Elasticsearch.KnnQuery Read(ref System.Text.Json QueryVector = propQueryVector.Value, QueryVectorBuilder = propQueryVectorBuilder.Value, RescoreVector = propRescoreVector.Value, - Similarity = propSimilarity.Value + Similarity = propSimilarity.Value, + VisitPercentage = propVisitPercentage.Value }; } @@ -139,6 +147,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropQueryVectorBuilder, value.QueryVectorBuilder, null, null); writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVisitPercentage, value.VisitPercentage, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.g.cs index a0e73f252e7..3a44f43a0c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnQuery.g.cs @@ -118,6 +118,13 @@ internal KnnQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSen /// /// public float? Similarity { get; set; } + + /// + /// + /// The percentage of vectors to explore per shard while doing knn search with bbq_disk + /// + /// + public float? VisitPercentage { get; set; } } public readonly partial struct KnnQueryDescriptor @@ -319,6 +326,17 @@ public Elastic.Clients.Elasticsearch.KnnQueryDescriptor Similarity(fl return this; } + /// + /// + /// The percentage of vectors to explore per shard while doing knn search with bbq_disk + /// + /// + public Elastic.Clients.Elasticsearch.KnnQueryDescriptor VisitPercentage(float? value) + { + Instance.VisitPercentage = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.KnnQuery Build(System.Action> action) { @@ -544,6 +562,17 @@ public Elastic.Clients.Elasticsearch.KnnQueryDescriptor Similarity(float? value) return this; } + /// + /// + /// The percentage of vectors to explore per shard while doing knn search with bbq_disk + /// + /// + public Elastic.Clients.Elasticsearch.KnnQueryDescriptor VisitPercentage(float? value) + { + Instance.VisitPercentage = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.KnnQuery Build(System.Action action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.Converters.g.cs index 714be2dff6c..02ca4115ca9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.Converters.g.cs @@ -35,6 +35,7 @@ public sealed partial class KnnRetrieverConverter : System.Text.Json.Serializati private static readonly System.Text.Json.JsonEncodedText PropQueryVectorBuilder = System.Text.Json.JsonEncodedText.Encode("query_vector_builder"); private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"); private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + private static readonly System.Text.Json.JsonEncodedText PropVisitPercentage = System.Text.Json.JsonEncodedText.Encode("visit_percentage"); public override Elastic.Clients.Elasticsearch.KnnRetriever Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -49,6 +50,7 @@ public override Elastic.Clients.Elasticsearch.KnnRetriever Read(ref System.Text. LocalJsonValue propQueryVectorBuilder = default; LocalJsonValue propRescoreVector = default; LocalJsonValue propSimilarity = default; + LocalJsonValue propVisitPercentage = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propField.TryReadProperty(ref reader, options, PropField, null)) @@ -101,6 +103,11 @@ public override Elastic.Clients.Elasticsearch.KnnRetriever Read(ref System.Text. continue; } + if (propVisitPercentage.TryReadProperty(ref reader, options, PropVisitPercentage, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -122,7 +129,8 @@ public override Elastic.Clients.Elasticsearch.KnnRetriever Read(ref System.Text. QueryVector = propQueryVector.Value, QueryVectorBuilder = propQueryVectorBuilder.Value, RescoreVector = propRescoreVector.Value, - Similarity = propSimilarity.Value + Similarity = propSimilarity.Value, + VisitPercentage = propVisitPercentage.Value }; } @@ -139,6 +147,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropQueryVectorBuilder, value.QueryVectorBuilder, null, null); writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVisitPercentage, value.VisitPercentage, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.g.cs index 1b899698e2e..64cbfc3bb2e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnRetriever.g.cs @@ -131,6 +131,13 @@ internal KnnRetriever(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo /// /// public float? Similarity { get; set; } + + /// + /// + /// The percentage of vectors to explore per shard while doing knn search with bbq_disk + /// + /// + public float? VisitPercentage { get; set; } } public readonly partial struct KnnRetrieverDescriptor @@ -323,6 +330,17 @@ public Elastic.Clients.Elasticsearch.KnnRetrieverDescriptor Similarit return this; } + /// + /// + /// The percentage of vectors to explore per shard while doing knn search with bbq_disk + /// + /// + public Elastic.Clients.Elasticsearch.KnnRetrieverDescriptor VisitPercentage(float? value) + { + Instance.VisitPercentage = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.KnnRetriever Build(System.Action> action) { @@ -539,6 +557,17 @@ public Elastic.Clients.Elasticsearch.KnnRetrieverDescriptor Similarity(float? va return this; } + /// + /// + /// The percentage of vectors to explore per shard while doing knn search with bbq_disk + /// + /// + public Elastic.Clients.Elasticsearch.KnnRetrieverDescriptor VisitPercentage(float? value) + { + Instance.VisitPercentage = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.KnnRetriever Build(System.Action action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.Converters.g.cs index 7cef81bdc28..9fd0cc41e03 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.Converters.g.cs @@ -35,6 +35,7 @@ public sealed partial class KnnSearchConverter : System.Text.Json.Serialization. private static readonly System.Text.Json.JsonEncodedText PropQueryVectorBuilder = System.Text.Json.JsonEncodedText.Encode("query_vector_builder"); private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"); private static readonly System.Text.Json.JsonEncodedText PropSimilarity = System.Text.Json.JsonEncodedText.Encode("similarity"); + private static readonly System.Text.Json.JsonEncodedText PropVisitPercentage = System.Text.Json.JsonEncodedText.Encode("visit_percentage"); public override Elastic.Clients.Elasticsearch.KnnSearch Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -49,6 +50,7 @@ public override Elastic.Clients.Elasticsearch.KnnSearch Read(ref System.Text.Jso LocalJsonValue propQueryVectorBuilder = default; LocalJsonValue propRescoreVector = default; LocalJsonValue propSimilarity = default; + LocalJsonValue propVisitPercentage = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propBoost.TryReadProperty(ref reader, options, PropBoost, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) @@ -101,6 +103,11 @@ public override Elastic.Clients.Elasticsearch.KnnSearch Read(ref System.Text.Jso continue; } + if (propVisitPercentage.TryReadProperty(ref reader, options, PropVisitPercentage, static float? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -122,7 +129,8 @@ public override Elastic.Clients.Elasticsearch.KnnSearch Read(ref System.Text.Jso QueryVector = propQueryVector.Value, QueryVectorBuilder = propQueryVectorBuilder.Value, RescoreVector = propRescoreVector.Value, - Similarity = propSimilarity.Value + Similarity = propSimilarity.Value, + VisitPercentage = propVisitPercentage.Value }; } @@ -139,6 +147,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropQueryVectorBuilder, value.QueryVectorBuilder, null, null); writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); writer.WriteProperty(options, PropSimilarity, value.Similarity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropVisitPercentage, value.VisitPercentage, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.g.cs index f86b5e8b2ee..f9f05187993 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/KnnSearch.g.cs @@ -121,6 +121,13 @@ internal KnnSearch(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSe /// /// public float? Similarity { get; set; } + + /// + /// + /// The percentage of vectors to explore per shard while doing knn search with bbq_disk + /// + /// + public float? VisitPercentage { get; set; } } public readonly partial struct KnnSearchDescriptor @@ -346,6 +353,17 @@ public Elastic.Clients.Elasticsearch.KnnSearchDescriptor Similarity(f return this; } + /// + /// + /// The percentage of vectors to explore per shard while doing knn search with bbq_disk + /// + /// + public Elastic.Clients.Elasticsearch.KnnSearchDescriptor VisitPercentage(float? value) + { + Instance.VisitPercentage = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.KnnSearch Build(System.Action> action) { @@ -606,6 +624,17 @@ public Elastic.Clients.Elasticsearch.KnnSearchDescriptor Similarity(float? value return this; } + /// + /// + /// The percentage of vectors to explore per shard while doing knn search with bbq_disk + /// + /// + public Elastic.Clients.Elasticsearch.KnnSearchDescriptor VisitPercentage(float? value) + { + Instance.VisitPercentage = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.KnnSearch Build(System.Action action) {