diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs index 0162b83d635..ee19c41a57b 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" }); 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/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/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/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.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.g.cs index 4b30f9d66e4..525f8154ec9 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,7 @@ 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 HTTP header parameters – such as Authentication or Content-Type – that are required to access the custom service. /// For example: /// /// @@ -194,7 +194,7 @@ public CustomServiceSettingsDescriptor() /// /// - /// Specifies the HTTPS header parameters – such as Authentication or Contet-Type – that are required to access the custom service. + /// 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/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/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")]