diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsRequest.g.cs index f6b9df7b69b..99feb429177 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Cluster/GetClusterSettingsRequest.g.cs @@ -34,12 +34,13 @@ public sealed partial class GetClusterSettingsRequestParameters : Elastic.Transp /// /// - /// If true, also returns default values for all other cluster settings, reflecting the values - /// in the elasticsearch.yml file of one of the nodes in the cluster. If the nodes in your - /// cluster do not all have the same values in their elasticsearch.yml config files then the - /// values returned by this API may vary from invocation to invocation and may not reflect the - /// values that Elasticsearch uses in all situations. Use the GET _nodes/settings API to - /// fetch the settings for each individual node in your cluster. + /// If true, also returns the values of all other cluster settings set in the + /// elasticsearch.yml file on one of the nodes in your cluster, together with the default + /// values of all other cluster settings on that node. The default value of each setting may + /// depend on the values of other settings on that node. If the nodes in your cluster do not all + /// have the same configuration then the values returned by this API may vary from invocation to + /// invocation and may not reflect the values that Elasticsearch uses in all situations. Use the + /// GET _nodes/settings API to fetch the settings for each individual node in your cluster. /// /// public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } @@ -99,12 +100,13 @@ internal GetClusterSettingsRequest(Elastic.Clients.Elasticsearch.Serialization.J /// /// - /// If true, also returns default values for all other cluster settings, reflecting the values - /// in the elasticsearch.yml file of one of the nodes in the cluster. If the nodes in your - /// cluster do not all have the same values in their elasticsearch.yml config files then the - /// values returned by this API may vary from invocation to invocation and may not reflect the - /// values that Elasticsearch uses in all situations. Use the GET _nodes/settings API to - /// fetch the settings for each individual node in your cluster. + /// If true, also returns the values of all other cluster settings set in the + /// elasticsearch.yml file on one of the nodes in your cluster, together with the default + /// values of all other cluster settings on that node. The default value of each setting may + /// depend on the values of other settings on that node. If the nodes in your cluster do not all + /// have the same configuration then the values returned by this API may vary from invocation to + /// invocation and may not reflect the values that Elasticsearch uses in all situations. Use the + /// GET _nodes/settings API to fetch the settings for each individual node in your cluster. /// /// public bool? IncludeDefaults { get => Q("include_defaults"); set => Q("include_defaults", value); } @@ -165,12 +167,13 @@ public Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsRequestDescriptor /// /// - /// If true, also returns default values for all other cluster settings, reflecting the values - /// in the elasticsearch.yml file of one of the nodes in the cluster. If the nodes in your - /// cluster do not all have the same values in their elasticsearch.yml config files then the - /// values returned by this API may vary from invocation to invocation and may not reflect the - /// values that Elasticsearch uses in all situations. Use the GET _nodes/settings API to - /// fetch the settings for each individual node in your cluster. + /// If true, also returns the values of all other cluster settings set in the + /// elasticsearch.yml file on one of the nodes in your cluster, together with the default + /// values of all other cluster settings on that node. The default value of each setting may + /// depend on the values of other settings on that node. If the nodes in your cluster do not all + /// have the same configuration then the values returned by this API may vary from invocation to + /// invocation and may not reflect the values that Elasticsearch uses in all situations. Use the + /// GET _nodes/settings API to fetch the settings for each individual node in your cluster. /// /// public Elastic.Clients.Elasticsearch.Cluster.GetClusterSettingsRequestDescriptor IncludeDefaults(bool? value = true) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs index 4409bb9a245..419eabaed21 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.Converters.g.cs @@ -49,7 +49,7 @@ public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest Read(ref Sy LocalJsonValue propKeepAlive = default; LocalJsonValue propKeepOnCompletion = default; LocalJsonValue propLocale = default; - LocalJsonValue?> propParams = default; + LocalJsonValue>, System.Collections.Generic.ICollection>>>?> propParams = default; LocalJsonValue propProfile = default; LocalJsonValue propProjectRouting = default; LocalJsonValue propQuery = default; @@ -92,7 +92,7 @@ public override Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequest Read(ref Sy continue; } - if (propParams.TryReadProperty(ref reader, options, PropParams, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + if (propParams.TryReadProperty(ref reader, options, PropParams, static Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue>, System.Collections.Generic.ICollection>>>(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.T1(ref r, o), static System.Collections.Generic.ICollection> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)!, static System.Collections.Generic.ICollection>> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>>(o, static System.Collections.Generic.KeyValuePair> (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue>(o, null, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!))!))) { continue; } @@ -160,7 +160,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropKeepAlive, value.KeepAlive, null, null); writer.WriteProperty(options, PropKeepOnCompletion, value.KeepOnCompletion, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropLocale, value.Locale, null, null); - writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropParams, value.Params, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? v) => w.WriteUnionValue>, System.Collections.Generic.ICollection>>>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection> v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>> v) => w.WriteCollectionValue>>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair> v) => w.WriteKeyValuePairValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null))))); writer.WriteProperty(options, PropProfile, value.Profile, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropProjectRouting, value.ProjectRouting, null, null); writer.WriteProperty(options, PropQuery, value.Query, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.g.cs index e514b1c5e8a..00a41cb3159 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Esql/AsyncQueryRequest.g.cs @@ -209,7 +209,7 @@ internal AsyncQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. /// /// - public System.Collections.Generic.ICollection? Params { get; set; } + public Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? Params { get; set; } /// /// @@ -459,23 +459,12 @@ public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor Locale(str /// To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. /// /// - public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor Params(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor Params(Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? value) { Instance.Params = value; return this; } - /// - /// - /// To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. - /// - /// - public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor Params(params Elastic.Clients.Elasticsearch.FieldValue[] values) - { - Instance.Params = [.. values]; - return this; - } - /// /// /// If provided and true the response will include an extra profile object @@ -788,23 +777,12 @@ public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor /// To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. /// /// - public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor Params(System.Collections.Generic.ICollection? value) + public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor Params(Elastic.Clients.Elasticsearch.Union>, System.Collections.Generic.ICollection>>>? value) { Instance.Params = value; return this; } - /// - /// - /// To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters. - /// - /// - public Elastic.Clients.Elasticsearch.Esql.AsyncQueryRequestDescriptor Params(params Elastic.Clients.Elasticsearch.FieldValue[] values) - { - Instance.Params = [.. values]; - return this; - } - /// /// /// If provided and true the response will include an extra profile object diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.g.cs index a123024f107..af78835edfe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostRequest.g.cs @@ -27,7 +27,8 @@ public sealed partial class PostRequestParameters : Elastic.Transport.RequestPar { /// /// - /// Specifies whether you acknowledge the license changes. + /// To update a license, you must accept the acknowledge messages and set this parameter to true. + /// In particular, if you are upgrading or downgrading a license, you must acknowlege the feature changes. /// /// public bool? Acknowledge { get => Q("acknowledge"); set => Q("acknowledge", value); } @@ -85,7 +86,8 @@ internal PostRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor /// /// - /// Specifies whether you acknowledge the license changes. + /// To update a license, you must accept the acknowledge messages and set this parameter to true. + /// In particular, if you are upgrading or downgrading a license, you must acknowlege the feature changes. /// /// public bool? Acknowledge { get => Q("acknowledge"); set => Q("acknowledge", value); } @@ -148,7 +150,8 @@ public PostRequestDescriptor() /// /// - /// Specifies whether you acknowledge the license changes. + /// To update a license, you must accept the acknowledge messages and set this parameter to true. + /// In particular, if you are upgrading or downgrading a license, you must acknowlege the feature changes. /// /// public Elastic.Clients.Elasticsearch.LicenseManagement.PostRequestDescriptor Acknowledge(bool? value = true) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.g.cs index 775c27e7129..6f71d17d753 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartBasicRequest.g.cs @@ -27,7 +27,7 @@ public sealed partial class PostStartBasicRequestParameters : Elastic.Transport. { /// /// - /// Whether the user has acknowledged acknowledge messages + /// To start a basic license, you must accept the acknowledge messages and set this parameter to true. /// /// public bool? Acknowledge { get => Q("acknowledge"); set => Q("acknowledge", value); } @@ -88,7 +88,7 @@ internal PostStartBasicRequest(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// - /// Whether the user has acknowledged acknowledge messages + /// To start a basic license, you must accept the acknowledge messages and set this parameter to true. /// /// public bool? Acknowledge { get => Q("acknowledge"); set => Q("acknowledge", value); } @@ -146,7 +146,7 @@ public PostStartBasicRequestDescriptor() /// /// - /// Whether the user has acknowledged acknowledge messages + /// To start a basic license, you must accept the acknowledge messages and set this parameter to true. /// /// public Elastic.Clients.Elasticsearch.LicenseManagement.PostStartBasicRequestDescriptor Acknowledge(bool? value = true) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.g.cs index bc2b7fe7bc8..0363ae93057 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/LicenseManagement/PostStartTrialRequest.g.cs @@ -27,7 +27,7 @@ public sealed partial class PostStartTrialRequestParameters : Elastic.Transport. { /// /// - /// Whether the user has acknowledged acknowledge messages + /// To start a trial, you must accept the acknowledge messages and set this parameter to true. /// /// public bool? Acknowledge { get => Q("acknowledge"); set => Q("acknowledge", value); } @@ -85,7 +85,7 @@ internal PostStartTrialRequest(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// - /// Whether the user has acknowledged acknowledge messages + /// To start a trial, you must accept the acknowledge messages and set this parameter to true. /// /// public bool? Acknowledge { get => Q("acknowledge"); set => Q("acknowledge", value); } @@ -140,7 +140,7 @@ public PostStartTrialRequestDescriptor() /// /// - /// Whether the user has acknowledged acknowledge messages + /// To start a trial, you must accept the acknowledge messages and set this parameter to true. /// /// public Elastic.Clients.Elasticsearch.LicenseManagement.PostStartTrialRequestDescriptor Acknowledge(bool? value = true) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs index a0eb07bb96e..936f6287781 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/GetSynonymRuleResponse.g.cs @@ -39,14 +39,15 @@ internal GetSynonymRuleResponse(Elastic.Clients.Elasticsearch.Serialization.Json /// /// - /// Synonym Rule identifier + /// The identifier for the synonym rule. + /// If you do not specify a synonym rule ID when you create a rule, an identifier is created automatically by Elasticsearch. /// /// public required string Id { get; set; } /// /// - /// Synonyms, in Solr format, that conform the synonym rule. + /// The synonyms that conform the synonym rule in Solr format. /// /// public required string Synonyms { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.g.cs index c4dde4fdc40..cc197d7fc8b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Synonyms/PutSynonymRequest.g.cs @@ -40,7 +40,6 @@ public sealed partial class PutSynonymRequestParameters : Elastic.Transport.Requ /// /// /// Synonyms sets are limited to a maximum of 10,000 synonym rules per set. -/// If you need to manage more synonym rules, you can create multiple synonym sets. /// /// /// When an existing synonyms set is updated, the search analyzers that use the synonyms set are reloaded automatically for all indices. @@ -112,7 +111,6 @@ internal PutSynonymRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// /// Synonyms sets are limited to a maximum of 10,000 synonym rules per set. -/// If you need to manage more synonym rules, you can create multiple synonym sets. /// /// /// When an existing synonyms set is updated, the search analyzers that use the synonyms set are reloaded automatically for all indices. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Fluent/FluentDictionaryOfCustomServiceInputTypeString.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Fluent/FluentDictionaryOfCustomServiceInputTypeString.g.cs new file mode 100644 index 00000000000..8906d02cad1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Fluent/FluentDictionaryOfCustomServiceInputTypeString.g.cs @@ -0,0 +1,54 @@ +// 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.Fluent; + +public readonly partial struct FluentDictionaryOfCustomServiceInputTypeString +{ + private readonly System.Collections.Generic.Dictionary _items = new(); + + private System.Collections.Generic.IDictionary Value => _items; + + public FluentDictionaryOfCustomServiceInputTypeString() + { + } + + public Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfCustomServiceInputTypeString Add(Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType key, string value) + { + _items.Add(key, value); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static System.Collections.Generic.IDictionary Build(System.Action? action) + { + if (action is null) + { + return new System.Collections.Generic.Dictionary(); + } + + var builder = new Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfCustomServiceInputTypeString(); + action.Invoke(builder); + return builder.Value; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.Converters.g.cs index ea002297c7d..cfade5c077b 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.Converters.g.cs @@ -31,7 +31,7 @@ public sealed partial class ComponentTemplateConverter : System.Text.Json.Serial public override Elastic.Clients.Elasticsearch.Cluster.ComponentTemplate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propComponentTemplateNode = default; + LocalJsonValue propComponentTemplateNode = default; LocalJsonValue propName = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.g.cs index 54d5fab87fa..e7cd4fd1d72 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplate.g.cs @@ -27,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster; public sealed partial class ComponentTemplate { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public ComponentTemplate(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode componentTemplateNode, string name) + public ComponentTemplate(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeWithRollover componentTemplateNode, string name) { ComponentTemplateNode = componentTemplateNode; Name = name; @@ -43,6 +43,6 @@ internal ComponentTemplate(Elastic.Clients.Elasticsearch.Serialization.JsonConst _ = sentinel; } - public required Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNode ComponentTemplateNode { get; set; } + public required Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeWithRollover ComponentTemplateNode { get; set; } public required string Name { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNodeWithRollover.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNodeWithRollover.Converters.g.cs new file mode 100644 index 00000000000..9d512ed2a43 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNodeWithRollover.Converters.g.cs @@ -0,0 +1,126 @@ +// 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 ComponentTemplateNodeWithRolloverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCreatedDate = System.Text.Json.JsonEncodedText.Encode("created_date"u8); + private static readonly System.Text.Json.JsonEncodedText PropCreatedDateMillis = System.Text.Json.JsonEncodedText.Encode("created_date_millis"u8); + private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"u8); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"u8); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"u8); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"u8); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"u8); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"u8); + + public override Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeWithRollover Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCreatedDate = default; + LocalJsonValue propCreatedDateMillis = default; + LocalJsonValue propDeprecated = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propModifiedDate = default; + LocalJsonValue propModifiedDateMillis = default; + LocalJsonValue propTemplate = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCreatedDate.TryReadProperty(ref reader, options, PropCreatedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propCreatedDateMillis.TryReadProperty(ref reader, options, PropCreatedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, 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 (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (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(); + 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.ComponentTemplateNodeWithRollover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + CreatedDate = propCreatedDate.Value, + CreatedDateMillis = propCreatedDateMillis.Value, + Deprecated = propDeprecated.Value, + Meta = propMeta.Value, + ModifiedDate = propModifiedDate.Value, + ModifiedDateMillis = propModifiedDateMillis.Value, + Template = propTemplate.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateNodeWithRollover value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCreatedDate, value.CreatedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropCreatedDateMillis, value.CreatedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropMeta, value.Meta, 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, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNodeWithRollover.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNodeWithRollover.g.cs new file mode 100644 index 00000000000..03b8976cc3b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateNodeWithRollover.g.cs @@ -0,0 +1,76 @@ +// 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.ComponentTemplateNodeWithRolloverConverter))] +public sealed partial class ComponentTemplateNodeWithRollover +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ComponentTemplateNodeWithRollover(Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryRes template) + { + Template = template; + } + + public ComponentTemplateNodeWithRollover() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ComponentTemplateNodeWithRollover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Date and time when the component template was created. Only returned if the human query parameter is true. + /// + /// + public System.DateTimeOffset? CreatedDate { get; set; } + + /// + /// + /// Date and time when the component template was created, in milliseconds since the epoch. + /// + /// + public System.DateTimeOffset? CreatedDateMillis { get; set; } + public bool? Deprecated { get; set; } + public System.Collections.Generic.IReadOnlyDictionary? Meta { get; set; } + + /// + /// + /// Date and time when the component template was last modified. Only returned if the human query parameter is true. + /// + /// + public System.DateTimeOffset? ModifiedDate { get; set; } + + /// + /// + /// Date and time when the component template was last modified, in milliseconds since the epoch. + /// + /// + public System.DateTimeOffset? ModifiedDateMillis { get; set; } + public required Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryRes Template { get; set; } + public long? Version { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.Converters.g.cs index 18ed39a0919..c466fcb8bbe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.Converters.g.cs @@ -38,7 +38,7 @@ public override Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummary R reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propAliases = default; LocalJsonValue propDataStreamOptions = default; - LocalJsonValue propLifecycle = default; + LocalJsonValue propLifecycle = default; LocalJsonValue propMappings = default; LocalJsonValue?> propMeta = default; LocalJsonValue?> propSettings = default; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs index d1f2a5a43b0..5e9a5b56520 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummary.g.cs @@ -38,7 +38,7 @@ internal ComponentTemplateSummary(Elastic.Clients.Elasticsearch.Serialization.Js public System.Collections.Generic.IDictionary? Aliases { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptions? DataStreamOptions { get; set; } - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? Lifecycle { get; set; } + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle? Lifecycle { get; set; } public Elastic.Clients.Elasticsearch.Mapping.TypeMapping? Mappings { get; set; } public System.Collections.Generic.IDictionary? Meta { get; set; } public System.Collections.Generic.IDictionary? Settings { get; set; } @@ -139,7 +139,7 @@ public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor< return this; } - public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? value) + public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle? value) { Instance.Lifecycle = value; return this; @@ -147,13 +147,13 @@ public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor< public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor Lifecycle() { - Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor.Build(null); + Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor.Build(null); return this; } - public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor Lifecycle(System.Action? action) + public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor Lifecycle(System.Action? action) { - Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor.Build(action); + Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor.Build(action); return this; } @@ -384,7 +384,7 @@ public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor return this; } - public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? value) + public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle? value) { Instance.Lifecycle = value; return this; @@ -392,13 +392,13 @@ public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor Lifecycle() { - Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor.Build(null); + Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor.Build(null); return this; } - public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor Lifecycle(System.Action? action) + public Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryDescriptor Lifecycle(System.Action? action) { - Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor.Build(action); + Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor.Build(action); return this; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummaryRes.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummaryRes.Converters.g.cs new file mode 100644 index 00000000000..06964627581 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummaryRes.Converters.g.cs @@ -0,0 +1,117 @@ +// 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 ComponentTemplateSummaryResConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"u8); + private static readonly System.Text.Json.JsonEncodedText PropDataStreamOptions = System.Text.Json.JsonEncodedText.Encode("data_stream_options"u8); + private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"u8); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"u8); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"u8); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"u8); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"u8); + + public override Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryRes Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue propDataStreamOptions = default; + LocalJsonValue propLifecycle = default; + LocalJsonValue propMappings = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue?> propSettings = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propDataStreamOptions.TryReadProperty(ref reader, options, PropDataStreamOptions, null)) + { + continue; + } + + if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, 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 (propSettings.TryReadProperty(ref reader, options, PropSettings, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (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(); + 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.ComponentTemplateSummaryRes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + DataStreamOptions = propDataStreamOptions.Value, + Lifecycle = propLifecycle.Value, + Mappings = propMappings.Value, + Meta = propMeta.Value, + Settings = propSettings.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ComponentTemplateSummaryRes value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDataStreamOptions, value.DataStreamOptions, null, null); + writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropMeta, value.Meta, 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, PropSettings, value.Settings, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummaryRes.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummaryRes.g.cs new file mode 100644 index 00000000000..83352ef0e35 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ComponentTemplateSummaryRes.g.cs @@ -0,0 +1,46 @@ +// 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.ComponentTemplateSummaryResConverter))] +public sealed partial class ComponentTemplateSummaryRes +{ + public ComponentTemplateSummaryRes() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ComponentTemplateSummaryRes(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public System.Collections.Generic.IReadOnlyDictionary? Aliases { get; set; } + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptions? DataStreamOptions { get; set; } + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? Lifecycle { get; set; } + public Elastic.Clients.Elasticsearch.Mapping.TypeMapping? Mappings { get; set; } + public System.Collections.Generic.IReadOnlyDictionary? Meta { get; set; } + public System.Collections.Generic.IReadOnlyDictionary? Settings { get; set; } + public long? Version { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/ResponseItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/ResponseItem.g.cs index 4ca86471000..9d418741842 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/ResponseItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Bulk/ResponseItem.g.cs @@ -79,7 +79,7 @@ internal ResponseItem(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo /// /// /// The result of the operation. - /// Successful values are created, deleted, and updated. + /// Possible values are created, updated, deleted, noop, and not_found. /// /// public string? Result { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.Converters.g.cs index acb9e1b4f20..728a1cba199 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.Converters.g.cs @@ -39,7 +39,6 @@ public sealed partial class PhraseSuggesterConverter : System.Text.Json.Serializ private static readonly System.Text.Json.JsonEncodedText PropShardSize = System.Text.Json.JsonEncodedText.Encode("shard_size"u8); private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"u8); private static readonly System.Text.Json.JsonEncodedText PropSmoothing = System.Text.Json.JsonEncodedText.Encode("smoothing"u8); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"u8); private static readonly System.Text.Json.JsonEncodedText PropTokenLimit = System.Text.Json.JsonEncodedText.Encode("token_limit"u8); public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) @@ -59,7 +58,6 @@ public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester Read(r LocalJsonValue propShardSize = default; LocalJsonValue propSize = default; LocalJsonValue propSmoothing = default; - LocalJsonValue propText = default; LocalJsonValue propTokenLimit = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -133,11 +131,6 @@ public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester Read(r continue; } - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - if (propTokenLimit.TryReadProperty(ref reader, options, PropTokenLimit, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; @@ -169,7 +162,6 @@ public override Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggester Read(r ShardSize = propShardSize.Value, Size = propSize.Value, Smoothing = propSmoothing.Value, - Text = propText.Value, TokenLimit = propTokenLimit.Value }; } @@ -191,7 +183,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropShardSize, value.ShardSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropSmoothing, value.Smoothing, null, null); - writer.WriteProperty(options, PropText, value.Text, null, null); writer.WriteProperty(options, PropTokenLimit, value.TokenLimit, 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/Core/Search/PhraseSuggester.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.g.cs index 6efb213c378..973bd7d3edd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/PhraseSuggester.g.cs @@ -142,13 +142,6 @@ internal PhraseSuggester(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// /// public Elastic.Clients.Elasticsearch.Core.Search.SmoothingModel? Smoothing { get; set; } - - /// - /// - /// The text/query to provide suggestions for. - /// - /// - public string? Text { get; set; } public int? TokenLimit { get; set; } } @@ -404,17 +397,6 @@ public Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggesterDescriptor - /// - /// The text/query to provide suggestions for. - /// - /// - public Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggesterDescriptor Text(string? value) - { - Instance.Text = value; - return this; - } - public Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggesterDescriptor TokenLimit(int? value) { Instance.TokenLimit = value; @@ -699,17 +681,6 @@ public Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggesterDescriptor Smoot return this; } - /// - /// - /// The text/query to provide suggestions for. - /// - /// - public Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggesterDescriptor Text(string? value) - { - Instance.Text = value; - return this; - } - public Elastic.Clients.Elasticsearch.Core.Search.PhraseSuggesterDescriptor TokenLimit(int? value) { Instance.TokenLimit = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.Converters.g.cs index f7c035355f1..81dd49ea19c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.Converters.g.cs @@ -39,7 +39,6 @@ public sealed partial class TermSuggesterConverter : System.Text.Json.Serializat private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"u8); private static readonly System.Text.Json.JsonEncodedText PropStringDistance = System.Text.Json.JsonEncodedText.Encode("string_distance"u8); private static readonly System.Text.Json.JsonEncodedText PropSuggestMode = System.Text.Json.JsonEncodedText.Encode("suggest_mode"u8); - private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"u8); public override Elastic.Clients.Elasticsearch.Core.Search.TermSuggester Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -58,7 +57,6 @@ public override Elastic.Clients.Elasticsearch.Core.Search.TermSuggester Read(ref LocalJsonValue propSort = default; LocalJsonValue propStringDistance = default; LocalJsonValue propSuggestMode = default; - LocalJsonValue propText = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propAnalyzer.TryReadProperty(ref reader, options, PropAnalyzer, null)) @@ -131,11 +129,6 @@ public override Elastic.Clients.Elasticsearch.Core.Search.TermSuggester Read(ref continue; } - if (propText.TryReadProperty(ref reader, options, PropText, null)) - { - continue; - } - if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -161,8 +154,7 @@ public override Elastic.Clients.Elasticsearch.Core.Search.TermSuggester Read(ref Size = propSize.Value, Sort = propSort.Value, StringDistance = propStringDistance.Value, - SuggestMode = propSuggestMode.Value, - Text = propText.Value + SuggestMode = propSuggestMode.Value }; } @@ -183,7 +175,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropSort, value.Sort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.SuggestSort? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropStringDistance, value.StringDistance, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Core.Search.StringDistance? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropSuggestMode, value.SuggestMode, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.SuggestMode? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropText, value.Text, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.g.cs index 9a6386bb90c..4e38d157183 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Search/TermSuggester.g.cs @@ -143,14 +143,6 @@ internal TermSuggester(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// /// public Elastic.Clients.Elasticsearch.SuggestMode? SuggestMode { get; set; } - - /// - /// - /// The suggest text. - /// Needs to be set globally or per suggestion. - /// - /// - public string? Text { get; set; } } public readonly partial struct TermSuggesterDescriptor @@ -343,18 +335,6 @@ public Elastic.Clients.Elasticsearch.Core.Search.TermSuggesterDescriptor - /// - /// The suggest text. - /// Needs to be set globally or per suggestion. - /// - /// - public Elastic.Clients.Elasticsearch.Core.Search.TermSuggesterDescriptor Text(string? value) - { - Instance.Text = value; - return this; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.Core.Search.TermSuggester Build(System.Action> action) { @@ -554,18 +534,6 @@ public Elastic.Clients.Elasticsearch.Core.Search.TermSuggesterDescriptor Suggest return this; } - /// - /// - /// The suggest text. - /// Needs to be set globally or per suggestion. - /// - /// - public Elastic.Clients.Elasticsearch.Core.Search.TermSuggesterDescriptor Text(string? value) - { - Instance.Text = value; - return this; - } - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.Core.Search.TermSuggester Build(System.Action action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.Converters.g.cs index c00743d7e4d..e3d8fd2f3fa 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.Converters.g.cs @@ -29,6 +29,7 @@ public sealed partial class DataStreamLifecycleConverter : System.Text.Json.Seri private static readonly System.Text.Json.JsonEncodedText PropDownsampling = System.Text.Json.JsonEncodedText.Encode("downsampling"u8); private static readonly System.Text.Json.JsonEncodedText PropDownsamplingMethod = System.Text.Json.JsonEncodedText.Encode("downsampling_method"u8); private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"u8); + private static readonly System.Text.Json.JsonEncodedText PropFrozenAfter = System.Text.Json.JsonEncodedText.Encode("frozen_after"u8); public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -37,6 +38,7 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl LocalJsonValue?> propDownsampling = default; LocalJsonValue propDownsamplingMethod = default; LocalJsonValue propEnabled = default; + LocalJsonValue propFrozenAfter = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propDataRetention.TryReadProperty(ref reader, options, PropDataRetention, null)) @@ -59,6 +61,11 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl continue; } + if (propFrozenAfter.TryReadProperty(ref reader, options, PropFrozenAfter, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -74,7 +81,8 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl DataRetention = propDataRetention.Value, Downsampling = propDownsampling.Value, DownsamplingMethod = propDownsamplingMethod.Value, - Enabled = propEnabled.Value + Enabled = propEnabled.Value, + FrozenAfter = propFrozenAfter.Value }; } @@ -85,6 +93,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropDownsampling, value.Downsampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropDownsamplingMethod, value.DownsamplingMethod, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.SamplingMethod? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFrozenAfter, value.FrozenAfter, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs index ebb8f8b5439..37943965ac9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycle.g.cs @@ -72,6 +72,13 @@ internal DataStreamLifecycle(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// public bool? Enabled { get; set; } + + /// + /// + /// Only available with feature flag dlm_searchable_snapshots. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? FrozenAfter { get; set; } } /// @@ -174,6 +181,17 @@ public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescript return this; } + /// + /// + /// Only available with feature flag dlm_searchable_snapshots. + /// + /// + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor FrozenAfter(Elastic.Clients.Elasticsearch.Duration? value) + { + Instance.FrozenAfter = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle Build(System.Action? action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs index 498c2a82140..e387cb476f4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleRolloverConditions.g.cs @@ -46,121 +46,4 @@ internal DataStreamLifecycleRolloverConditions(Elastic.Clients.Elasticsearch.Ser public long? MinPrimaryShardDocs { get; set; } public Elastic.Clients.Elasticsearch.ByteSize? MinPrimaryShardSize { get; set; } public Elastic.Clients.Elasticsearch.ByteSize? MinSize { get; set; } -} - -public readonly partial struct DataStreamLifecycleRolloverConditionsDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public DataStreamLifecycleRolloverConditionsDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions instance) - { - Instance = instance; - } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public DataStreamLifecycleRolloverConditionsDescriptor() - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions instance) => new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor descriptor) => descriptor.Instance; - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MaxAge(string? value) - { - Instance.MaxAge = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MaxDocs(long? value) - { - Instance.MaxDocs = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MaxPrimaryShardDocs(long? value) - { - Instance.MaxPrimaryShardDocs = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MaxPrimaryShardSize(Elastic.Clients.Elasticsearch.ByteSize? value) - { - Instance.MaxPrimaryShardSize = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MaxPrimaryShardSize(System.Func action) - { - Instance.MaxPrimaryShardSize = Elastic.Clients.Elasticsearch.ByteSizeFactory.Build(action); - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MaxSize(Elastic.Clients.Elasticsearch.ByteSize? value) - { - Instance.MaxSize = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MaxSize(System.Func action) - { - Instance.MaxSize = Elastic.Clients.Elasticsearch.ByteSizeFactory.Build(action); - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MinAge(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.MinAge = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MinDocs(long? value) - { - Instance.MinDocs = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MinPrimaryShardDocs(long? value) - { - Instance.MinPrimaryShardDocs = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MinPrimaryShardSize(Elastic.Clients.Elasticsearch.ByteSize? value) - { - Instance.MinPrimaryShardSize = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MinPrimaryShardSize(System.Func action) - { - Instance.MinPrimaryShardSize = Elastic.Clients.Elasticsearch.ByteSizeFactory.Build(action); - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MinSize(Elastic.Clients.Elasticsearch.ByteSize? value) - { - Instance.MinSize = value; - return this; - } - - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor MinSize(System.Func action) - { - Instance.MinSize = Elastic.Clients.Elasticsearch.ByteSizeFactory.Build(action); - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions Build(System.Action? action) - { - if (action is null) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); - } - - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.Converters.g.cs index cfb2796e137..09d897af0db 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.Converters.g.cs @@ -29,15 +29,17 @@ public sealed partial class DataStreamLifecycleWithRolloverConverter : System.Te private static readonly System.Text.Json.JsonEncodedText PropDownsampling = System.Text.Json.JsonEncodedText.Encode("downsampling"u8); private static readonly System.Text.Json.JsonEncodedText PropDownsamplingMethod = System.Text.Json.JsonEncodedText.Encode("downsampling_method"u8); private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"u8); + private static readonly System.Text.Json.JsonEncodedText PropFrozenAfter = System.Text.Json.JsonEncodedText.Encode("frozen_after"u8); private static readonly System.Text.Json.JsonEncodedText PropRollover = System.Text.Json.JsonEncodedText.Encode("rollover"u8); public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propDataRetention = default; - LocalJsonValue?> propDownsampling = default; + LocalJsonValue?> propDownsampling = default; LocalJsonValue propDownsamplingMethod = default; LocalJsonValue propEnabled = default; + LocalJsonValue propFrozenAfter = default; LocalJsonValue propRollover = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -46,7 +48,7 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl continue; } - if (propDownsampling.TryReadProperty(ref reader, options, PropDownsampling, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + if (propDownsampling.TryReadProperty(ref reader, options, PropDownsampling, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) { continue; } @@ -61,6 +63,11 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl continue; } + if (propFrozenAfter.TryReadProperty(ref reader, options, PropFrozenAfter, null)) + { + continue; + } + if (propRollover.TryReadProperty(ref reader, options, PropRollover, null)) { continue; @@ -82,6 +89,7 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycl Downsampling = propDownsampling.Value, DownsamplingMethod = propDownsamplingMethod.Value, Enabled = propEnabled.Value, + FrozenAfter = propFrozenAfter.Value, Rollover = propRollover.Value }; } @@ -90,9 +98,10 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropDataRetention, value.DataRetention, null, null); - writer.WriteProperty(options, PropDownsampling, value.Downsampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropDownsampling, value.Downsampling, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropDownsamplingMethod, value.DownsamplingMethod, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.IndexManagement.SamplingMethod? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFrozenAfter, value.FrozenAfter, null, null); writer.WriteProperty(options, PropRollover, value.Rollover, null, null); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs index ad764963285..28780587e17 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamLifecycleWithRollover.g.cs @@ -56,7 +56,7 @@ internal DataStreamLifecycleWithRollover(Elastic.Clients.Elasticsearch.Serializa /// The list of downsampling rounds to execute as part of this downsampling configuration /// /// - public System.Collections.Generic.ICollection? Downsampling { get; set; } + public System.Collections.Generic.IReadOnlyCollection? Downsampling { get; set; } /// /// @@ -76,127 +76,10 @@ internal DataStreamLifecycleWithRollover(Elastic.Clients.Elasticsearch.Serializa /// /// - /// The conditions which will trigger the rollover of a backing index as configured by the cluster setting cluster.lifecycle.default.rollover. - /// This property is an implementation detail and it will only be retrieved when the query param include_defaults is set to true. - /// The contents of this field are subject to change. + /// Only available with feature flag dlm_searchable_snapshots. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions? Rollover { get; set; } -} - -/// -/// -/// Data stream lifecycle with rollover can be used to display the configuration including the default rollover conditions, -/// if asked. -/// -/// -public readonly partial struct DataStreamLifecycleWithRolloverDescriptor -{ - internal Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public DataStreamLifecycleWithRolloverDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover instance) - { - Instance = instance; - } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public DataStreamLifecycleWithRolloverDescriptor() - { - Instance = new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); - } - - public static explicit operator Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover instance) => new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor descriptor) => descriptor.Instance; - - /// - /// - /// If defined, every document added to this data stream will be stored at least for this time frame. - /// Any time after this duration the document could be deleted. - /// When empty, every document in this data stream will be stored indefinitely. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor DataRetention(Elastic.Clients.Elasticsearch.Duration? value) - { - Instance.DataRetention = value; - return this; - } - - /// - /// - /// The list of downsampling rounds to execute as part of this downsampling configuration - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor Downsampling(System.Collections.Generic.ICollection? value) - { - Instance.Downsampling = value; - return this; - } - - /// - /// - /// The list of downsampling rounds to execute as part of this downsampling configuration - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor Downsampling(params Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRound[] values) - { - Instance.Downsampling = [.. values]; - return this; - } - - /// - /// - /// The list of downsampling rounds to execute as part of this downsampling configuration - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor Downsampling(params System.Action[] actions) - { - var items = new System.Collections.Generic.List(); - foreach (var action in actions) - { - items.Add(Elastic.Clients.Elasticsearch.IndexManagement.DownsamplingRoundDescriptor.Build(action)); - } - - Instance.Downsampling = items; - return this; - } - - /// - /// - /// The method used to downsample the data. There are two options aggregate and last_value. It requires - /// downsampling to be defined. Defaults to aggregate. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor DownsamplingMethod(Elastic.Clients.Elasticsearch.IndexManagement.SamplingMethod? value) - { - Instance.DownsamplingMethod = value; - return this; - } - - /// - /// - /// If defined, it turns data stream lifecycle on/off (true/false) for this data stream. A data stream lifecycle - /// that's disabled (enabled: false) will have no effect on the data stream. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor Enabled(bool? value = true) - { - Instance.Enabled = value; - return this; - } - - /// - /// - /// The conditions which will trigger the rollover of a backing index as configured by the cluster setting cluster.lifecycle.default.rollover. - /// This property is an implementation detail and it will only be retrieved when the query param include_defaults is set to true. - /// The contents of this field are subject to change. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor Rollover(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions? value) - { - Instance.Rollover = value; - return this; - } + public Elastic.Clients.Elasticsearch.Duration? FrozenAfter { get; set; } /// /// @@ -205,35 +88,5 @@ public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRoll /// The contents of this field are subject to change. /// /// - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor Rollover() - { - Instance.Rollover = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor.Build(null); - return this; - } - - /// - /// - /// The conditions which will trigger the rollover of a backing index as configured by the cluster setting cluster.lifecycle.default.rollover. - /// This property is an implementation detail and it will only be retrieved when the query param include_defaults is set to true. - /// The contents of this field are subject to change. - /// - /// - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor Rollover(System.Action? action) - { - Instance.Rollover = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditionsDescriptor.Build(action); - return this; - } - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover Build(System.Action? action) - { - if (action is null) - { - return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); - } - - var builder = new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor(new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleRolloverConditions? Rollover { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.Converters.g.cs index 823cb0e52d2..32c0e93b6a6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.Converters.g.cs @@ -26,12 +26,14 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement.Json; public sealed partial class DataStreamVisibilityConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropAllowCustomRouting = System.Text.Json.JsonEncodedText.Encode("allow_custom_routing"u8); + private static readonly System.Text.Json.JsonEncodedText PropFailureStore = System.Text.Json.JsonEncodedText.Encode("failure_store"u8); private static readonly System.Text.Json.JsonEncodedText PropHidden = System.Text.Json.JsonEncodedText.Encode("hidden"u8); public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibility Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propAllowCustomRouting = default; + LocalJsonValue propFailureStore = default; LocalJsonValue propHidden = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -40,6 +42,11 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibili continue; } + if (propFailureStore.TryReadProperty(ref reader, options, PropFailureStore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propHidden.TryReadProperty(ref reader, options, PropHidden, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; @@ -58,6 +65,7 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibili return new Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibility(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { AllowCustomRouting = propAllowCustomRouting.Value, + FailureStore = propFailureStore.Value, Hidden = propHidden.Value }; } @@ -66,6 +74,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropAllowCustomRouting, value.AllowCustomRouting, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFailureStore, value.FailureStore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropHidden, value.Hidden, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs index 6a27ebf5569..af20d3372d4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/DataStreamVisibility.g.cs @@ -37,6 +37,7 @@ internal DataStreamVisibility(Elastic.Clients.Elasticsearch.Serialization.JsonCo } public bool? AllowCustomRouting { get; set; } + public bool? FailureStore { get; set; } public bool? Hidden { get; set; } } @@ -65,6 +66,12 @@ public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescrip return this; } + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor FailureStore(bool? value = true) + { + Instance.FailureStore = value; + return this; + } + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamVisibilityDescriptor Hidden(bool? value = true) { Instance.Hidden = value; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.Converters.g.cs index 4ca3c286bd0..ff1fe6e8ff3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.Converters.g.cs @@ -31,7 +31,7 @@ public sealed partial class IndexTemplateItemConverter : System.Text.Json.Serial public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateItem Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propIndexTemplate = default; + LocalJsonValue propIndexTemplate = default; LocalJsonValue propName = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.g.cs index 1715fb8f51a..8bd426fb65f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateItem.g.cs @@ -27,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.IndexManagement; public sealed partial class IndexTemplateItem { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public IndexTemplateItem(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate indexTemplate, string name) + public IndexTemplateItem(Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateWithRollover indexTemplate, string name) { IndexTemplate = indexTemplate; Name = name; @@ -43,6 +43,6 @@ internal IndexTemplateItem(Elastic.Clients.Elasticsearch.Serialization.JsonConst _ = sentinel; } - public required Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplate IndexTemplate { get; set; } + public required Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateWithRollover IndexTemplate { get; set; } public required string Name { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.Converters.g.cs index 8f1abb9d338..f709916ca46 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.Converters.g.cs @@ -36,7 +36,7 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSumma reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propAliases = default; LocalJsonValue propDataStreamOptions = default; - LocalJsonValue propLifecycle = default; + LocalJsonValue propLifecycle = default; LocalJsonValue propMappings = default; LocalJsonValue propSettings = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs index 30b607237d8..a3ed41647a1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummary.g.cs @@ -46,7 +46,7 @@ internal IndexTemplateSummary(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// public System.Collections.Generic.IDictionary? Aliases { get; set; } public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptions? DataStreamOptions { get; set; } - public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? Lifecycle { get; set; } + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle? Lifecycle { get; set; } /// /// @@ -198,7 +198,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescrip return this; } - public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? value) + public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle? value) { Instance.Lifecycle = value; return this; @@ -206,13 +206,13 @@ public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescrip public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor Lifecycle() { - Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor.Build(null); + Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor.Build(null); return this; } - public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor Lifecycle(System.Action? action) + public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor Lifecycle(System.Action? action) { - Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor.Build(action); + Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor.Build(action); return this; } @@ -454,7 +454,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescrip return this; } - public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? value) + public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor Lifecycle(Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycle? value) { Instance.Lifecycle = value; return this; @@ -462,13 +462,13 @@ public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescrip public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor Lifecycle() { - Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor.Build(null); + Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor.Build(null); return this; } - public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor Lifecycle(System.Action? action) + public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryDescriptor Lifecycle(System.Action? action) { - Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRolloverDescriptor.Build(action); + Instance.Lifecycle = Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleDescriptor.Build(action); return this; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummaryWithRollover.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummaryWithRollover.Converters.g.cs new file mode 100644 index 00000000000..7e980395c64 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummaryWithRollover.Converters.g.cs @@ -0,0 +1,99 @@ +// 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 IndexTemplateSummaryWithRolloverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAliases = System.Text.Json.JsonEncodedText.Encode("aliases"u8); + private static readonly System.Text.Json.JsonEncodedText PropDataStreamOptions = System.Text.Json.JsonEncodedText.Encode("data_stream_options"u8); + private static readonly System.Text.Json.JsonEncodedText PropLifecycle = System.Text.Json.JsonEncodedText.Encode("lifecycle"u8); + private static readonly System.Text.Json.JsonEncodedText PropMappings = System.Text.Json.JsonEncodedText.Encode("mappings"u8); + private static readonly System.Text.Json.JsonEncodedText PropSettings = System.Text.Json.JsonEncodedText.Encode("settings"u8); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryWithRollover Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue?> propAliases = default; + LocalJsonValue propDataStreamOptions = default; + LocalJsonValue propLifecycle = default; + LocalJsonValue propMappings = default; + LocalJsonValue propSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAliases.TryReadProperty(ref reader, options, PropAliases, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propDataStreamOptions.TryReadProperty(ref reader, options, PropDataStreamOptions, null)) + { + continue; + } + + if (propLifecycle.TryReadProperty(ref reader, options, PropLifecycle, null)) + { + continue; + } + + if (propMappings.TryReadProperty(ref reader, options, PropMappings, null)) + { + continue; + } + + if (propSettings.TryReadProperty(ref reader, options, PropSettings, 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.IndexTemplateSummaryWithRollover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aliases = propAliases.Value, + DataStreamOptions = propDataStreamOptions.Value, + Lifecycle = propLifecycle.Value, + Mappings = propMappings.Value, + Settings = propSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryWithRollover value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAliases, value.Aliases, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropDataStreamOptions, value.DataStreamOptions, null, null); + writer.WriteProperty(options, PropLifecycle, value.Lifecycle, null, null); + writer.WriteProperty(options, PropMappings, value.Mappings, null, null); + writer.WriteProperty(options, PropSettings, value.Settings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummaryWithRollover.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummaryWithRollover.g.cs new file mode 100644 index 00000000000..aff22f47e7c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateSummaryWithRollover.g.cs @@ -0,0 +1,65 @@ +// 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.IndexTemplateSummaryWithRolloverConverter))] +public sealed partial class IndexTemplateSummaryWithRollover +{ + public IndexTemplateSummaryWithRollover() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal IndexTemplateSummaryWithRollover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Aliases to add. + /// If the index template includes a data_stream object, these are data stream aliases. + /// Otherwise, these are index aliases. + /// Data stream aliases ignore the index_routing, routing, and search_routing options. + /// + /// + public System.Collections.Generic.IReadOnlyDictionary? Aliases { get; set; } + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamOptions? DataStreamOptions { get; set; } + public Elastic.Clients.Elasticsearch.IndexManagement.DataStreamLifecycleWithRollover? Lifecycle { get; set; } + + /// + /// + /// Mapping for fields in the index. + /// If specified, this mapping can include field names, field data types, and mapping parameters. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.TypeMapping? Mappings { get; set; } + + /// + /// + /// Configuration options for the index. + /// + /// + public Elastic.Clients.Elasticsearch.IndexManagement.IndexSettings? Settings { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateWithRollover.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateWithRollover.Converters.g.cs new file mode 100644 index 00000000000..8aecee00440 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateWithRollover.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 IndexTemplateWithRolloverConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowAutoCreate = System.Text.Json.JsonEncodedText.Encode("allow_auto_create"u8); + private static readonly System.Text.Json.JsonEncodedText PropComposedOf = System.Text.Json.JsonEncodedText.Encode("composed_of"u8); + private static readonly System.Text.Json.JsonEncodedText PropCreatedDate = System.Text.Json.JsonEncodedText.Encode("created_date"u8); + private static readonly System.Text.Json.JsonEncodedText PropCreatedDateMillis = System.Text.Json.JsonEncodedText.Encode("created_date_millis"u8); + private static readonly System.Text.Json.JsonEncodedText PropDataStream = System.Text.Json.JsonEncodedText.Encode("data_stream"u8); + private static readonly System.Text.Json.JsonEncodedText PropDeprecated = System.Text.Json.JsonEncodedText.Encode("deprecated"u8); + private static readonly System.Text.Json.JsonEncodedText PropIgnoreMissingComponentTemplates = System.Text.Json.JsonEncodedText.Encode("ignore_missing_component_templates"u8); + private static readonly System.Text.Json.JsonEncodedText PropIndexPatterns = System.Text.Json.JsonEncodedText.Encode("index_patterns"u8); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("_meta"u8); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDate = System.Text.Json.JsonEncodedText.Encode("modified_date"u8); + private static readonly System.Text.Json.JsonEncodedText PropModifiedDateMillis = System.Text.Json.JsonEncodedText.Encode("modified_date_millis"u8); + private static readonly System.Text.Json.JsonEncodedText PropPriority = System.Text.Json.JsonEncodedText.Encode("priority"u8); + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"u8); + private static readonly System.Text.Json.JsonEncodedText PropVersion = System.Text.Json.JsonEncodedText.Encode("version"u8); + + public override Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateWithRollover Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowAutoCreate = default; + LocalJsonValue> propComposedOf = default; + LocalJsonValue propCreatedDate = default; + LocalJsonValue propCreatedDateMillis = default; + LocalJsonValue propDataStream = default; + LocalJsonValue propDeprecated = default; + LocalJsonValue?> propIgnoreMissingComponentTemplates = default; + LocalJsonValue> propIndexPatterns = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propModifiedDate = default; + LocalJsonValue propModifiedDateMillis = default; + LocalJsonValue propPriority = default; + LocalJsonValue propTemplate = default; + LocalJsonValue propVersion = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowAutoCreate.TryReadProperty(ref reader, options, PropAllowAutoCreate, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propComposedOf.TryReadProperty(ref reader, options, PropComposedOf, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propCreatedDate.TryReadProperty(ref reader, options, PropCreatedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propCreatedDateMillis.TryReadProperty(ref reader, options, PropCreatedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propDataStream.TryReadProperty(ref reader, options, PropDataStream, null)) + { + continue; + } + + if (propDeprecated.TryReadProperty(ref reader, options, PropDeprecated, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propIgnoreMissingComponentTemplates.TryReadProperty(ref reader, options, PropIgnoreMissingComponentTemplates, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null))) + { + continue; + } + + if (propIndexPatterns.TryReadProperty(ref reader, options, PropIndexPatterns, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propMeta.TryReadProperty(ref reader, options, PropMeta, 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 (propModifiedDate.TryReadProperty(ref reader, options, PropModifiedDate, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker)))) + { + continue; + } + + if (propModifiedDateMillis.TryReadProperty(ref reader, options, PropModifiedDateMillis, static System.DateTimeOffset? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) + { + continue; + } + + if (propPriority.TryReadProperty(ref reader, options, PropPriority, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, null)) + { + continue; + } + + if (propVersion.TryReadProperty(ref reader, options, PropVersion, static long? (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(); + 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.IndexTemplateWithRollover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowAutoCreate = propAllowAutoCreate.Value, + ComposedOf = propComposedOf.Value, + CreatedDate = propCreatedDate.Value, + CreatedDateMillis = propCreatedDateMillis.Value, + DataStream = propDataStream.Value, + Deprecated = propDeprecated.Value, + IgnoreMissingComponentTemplates = propIgnoreMissingComponentTemplates.Value, + IndexPatterns = propIndexPatterns.Value, + Meta = propMeta.Value, + ModifiedDate = propModifiedDate.Value, + ModifiedDateMillis = propModifiedDateMillis.Value, + Priority = propPriority.Value, + Template = propTemplate.Value, + Version = propVersion.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateWithRollover value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowAutoCreate, value.AllowAutoCreate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropComposedOf, value.ComposedOf, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropCreatedDate, value.CreatedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropCreatedDateMillis, value.CreatedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropDataStream, value.DataStream, null, null); + writer.WriteProperty(options, PropDeprecated, value.Deprecated, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropIgnoreMissingComponentTemplates, value.IgnoreMissingComponentTemplates, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropIndexPatterns, value.IndexPatterns, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropMeta, value.Meta, 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, PropModifiedDate, value.ModifiedDate, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMarker))); + writer.WriteProperty(options, PropModifiedDateMillis, value.ModifiedDateMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset? v) => w.WriteNullableValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); + writer.WriteProperty(options, PropPriority, value.Priority, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteProperty(options, PropVersion, value.Version, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateWithRollover.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateWithRollover.g.cs new file mode 100644 index 00000000000..6b2b4522b6e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/IndexTemplateWithRollover.g.cs @@ -0,0 +1,149 @@ +// 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.IndexTemplateWithRolloverConverter))] +public sealed partial class IndexTemplateWithRollover +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public IndexTemplateWithRollover(System.Collections.Generic.IReadOnlyCollection composedOf, System.Collections.Generic.ICollection indexPatterns) + { + ComposedOf = composedOf; + IndexPatterns = indexPatterns; + } + + public IndexTemplateWithRollover() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal IndexTemplateWithRollover(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public bool? AllowAutoCreate { get; set; } + + /// + /// + /// An ordered list of component template names. + /// Component templates are merged in the order specified, meaning that the last component template specified has the highest precedence. + /// + /// + public required System.Collections.Generic.IReadOnlyCollection ComposedOf { get; set; } + + /// + /// + /// Date and time when the index template was created. Only returned if the human query parameter is true. + /// + /// + public System.DateTimeOffset? CreatedDate { get; set; } + + /// + /// + /// Date and time when the index template was created, in milliseconds since the epoch. + /// + /// + public System.DateTimeOffset? CreatedDateMillis { get; set; } + + /// + /// + /// If this object is included, the template is used to create data streams and their backing indices. + /// Supports an empty object. + /// Data streams require a matching index template with a data_stream object. + /// + /// + public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateDataStreamConfiguration? DataStream { get; set; } + + /// + /// + /// Marks this index template as deprecated. + /// When creating or updating a non-deprecated index template that uses deprecated components, + /// Elasticsearch will emit a deprecation warning. + /// + /// + public bool? Deprecated { get; set; } + + /// + /// + /// A list of component template names that are allowed to be absent. + /// + /// + public System.Collections.Generic.ICollection? IgnoreMissingComponentTemplates { get; set; } + + /// + /// + /// Array of wildcard (*) expressions used to match the names of data streams and indices during creation. + /// + /// + public required System.Collections.Generic.ICollection IndexPatterns { get; set; } + + /// + /// + /// Optional user metadata about the index template. May have any contents. + /// This map is not automatically generated by Elasticsearch. + /// + /// + public System.Collections.Generic.IReadOnlyDictionary? Meta { get; set; } + + /// + /// + /// Date and time when the index template was last modified. Only returned if the human query parameter is true. + /// + /// + public System.DateTimeOffset? ModifiedDate { get; set; } + + /// + /// + /// Date and time when the index template was last modified, in milliseconds since the epoch. + /// + /// + public System.DateTimeOffset? ModifiedDateMillis { get; set; } + + /// + /// + /// Priority to determine index template precedence when a new data stream or index is created. + /// The index template with the highest priority is chosen. + /// If no priority is specified the template is treated as though it is of priority 0 (lowest priority). + /// This number is not automatically generated by Elasticsearch. + /// + /// + public long? Priority { get; set; } + + /// + /// + /// Template to be applied. + /// It may optionally include an aliases, mappings, or settings configuration. + /// + /// + public Elastic.Clients.Elasticsearch.IndexManagement.IndexTemplateSummaryWithRollover? Template { get; set; } + + /// + /// + /// Version number used to manage index templates externally. + /// This number is not automatically generated by Elasticsearch. + /// + /// + public long? Version { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.Converters.g.cs index 59ffe997cf7..d546fabed43 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.Converters.g.cs @@ -25,14 +25,21 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class AzureOpenAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"u8); private static readonly System.Text.Json.JsonEncodedText PropUser = System.Text.Json.JsonEncodedText.Encode("user"u8); public override Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskSettings 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 System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + if (propUser.TryReadProperty(ref reader, options, PropUser, null)) { continue; @@ -50,6 +57,7 @@ public override Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskSettings reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { + Headers = propHeaders.Value, User = propUser.Value }; } @@ -57,6 +65,7 @@ public override Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskSettings public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.AzureOpenAITaskSettings 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, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); writer.WriteProperty(options, PropUser, value.User, null, null); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.g.cs index 9ffe30ae27c..f62acdeddb7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/AzureOpenAITaskSettings.g.cs @@ -38,7 +38,21 @@ internal AzureOpenAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// - /// For a completion, chat_completion or text_embedding task, specify the user issuing the request. + /// Specifies custom HTTP header parameters. + /// For example: + /// + /// + /// "headers": { + /// "Custom-Header": "Some-Value", + /// "Another-Custom-Header": "Another-Value" + /// } + /// + /// + public System.Collections.Generic.IDictionary? Headers { get; set; } + + /// + /// + /// Specifies the user issuing the request. /// This information can be used for abuse detection. /// /// @@ -66,7 +80,68 @@ public AzureOpenAiTaskSettingsDescriptor() /// /// - /// For a completion, chat_completion or text_embedding task, specify the user issuing the request. + /// Specifies custom HTTP header parameters. + /// For example: + /// + /// + /// "headers": { + /// "Custom-Header": "Some-Value", + /// "Another-Custom-Header": "Another-Value" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.AzureOpenAiTaskSettingsDescriptor Headers(System.Collections.Generic.IDictionary? value) + { + Instance.Headers = value; + return this; + } + + /// + /// + /// Specifies custom HTTP header parameters. + /// For example: + /// + /// + /// "headers": { + /// "Custom-Header": "Some-Value", + /// "Another-Custom-Header": "Another-Value" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.AzureOpenAiTaskSettingsDescriptor Headers() + { + Instance.Headers = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(null); + return this; + } + + /// + /// + /// Specifies custom HTTP header parameters. + /// For example: + /// + /// + /// "headers": { + /// "Custom-Header": "Some-Value", + /// "Another-Custom-Header": "Another-Value" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.AzureOpenAiTaskSettingsDescriptor Headers(System.Action? action) + { + Instance.Headers = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.AzureOpenAiTaskSettingsDescriptor AddHeader(string key, string value) + { + Instance.Headers ??= new System.Collections.Generic.Dictionary(); + Instance.Headers.Add(key, value); + return this; + } + + /// + /// + /// Specifies the user issuing the request. /// This information can be used for abuse detection. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.Converters.g.cs index b5470ee525a..f9fc7583c1c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.Converters.g.cs @@ -25,16 +25,30 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class ContentObjectConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropFile = System.Text.Json.JsonEncodedText.Encode("file"u8); + private static readonly System.Text.Json.JsonEncodedText PropImageUrl = System.Text.Json.JsonEncodedText.Encode("image_url"u8); private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"u8); private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"u8); public override Elastic.Clients.Elasticsearch.Inference.ContentObject Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFile = default; + LocalJsonValue propImageUrl = default; LocalJsonValue propText = default; - LocalJsonValue propType = default; + LocalJsonValue propType = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { + if (propFile.TryReadProperty(ref reader, options, PropFile, null)) + { + continue; + } + + if (propImageUrl.TryReadProperty(ref reader, options, PropImageUrl, null)) + { + continue; + } + if (propText.TryReadProperty(ref reader, options, PropText, null)) { continue; @@ -57,6 +71,8 @@ public override Elastic.Clients.Elasticsearch.Inference.ContentObject Read(ref S reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Inference.ContentObject(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { + File = propFile.Value, + ImageUrl = propImageUrl.Value, Text = propText.Value, Type = propType.Value }; @@ -65,6 +81,8 @@ public override Elastic.Clients.Elasticsearch.Inference.ContentObject Read(ref S public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ContentObject value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); + writer.WriteProperty(options, PropFile, value.File, null, null); + writer.WriteProperty(options, PropImageUrl, value.ImageUrl, null, null); writer.WriteProperty(options, PropText, value.Text, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.g.cs index 47bd02eeb41..75d14db0ec9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentObject.g.cs @@ -32,8 +32,10 @@ namespace Elastic.Clients.Elasticsearch.Inference; public sealed partial class ContentObject { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public ContentObject(string text, string type) + public ContentObject(Elastic.Clients.Elasticsearch.Inference.FileContent file, Elastic.Clients.Elasticsearch.Inference.ImageUrl imageUrl, string text, Elastic.Clients.Elasticsearch.Inference.ContentType type) { + File = file; + ImageUrl = imageUrl; Text = text; Type = type; } @@ -50,15 +52,30 @@ internal ContentObject(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// /// - /// The text content. + /// The file content. Only applicable for the file type + /// + /// + public required Elastic.Clients.Elasticsearch.Inference.FileContent File { get; set; } + + /// + /// + /// The image content. Only applicable for the image_url type + /// + /// + public required Elastic.Clients.Elasticsearch.Inference.ImageUrl ImageUrl { get; set; } + + /// + /// + /// The text content. Only applicable for the text type /// /// public required string Text { get; set; } /// /// - /// The type of content. + /// The type of content. Must be one of text, image_url or file. Not all services/models support content + /// types other than "text" /// /// - public required string Type { get; set; } + public required Elastic.Clients.Elasticsearch.Inference.ContentType Type { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentType.Converters.g.cs new file mode 100644 index 00000000000..3d7b7b551db --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentType.Converters.g.cs @@ -0,0 +1,95 @@ +// 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 ContentTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberFile = System.Text.Json.JsonEncodedText.Encode("file"u8); + private static readonly System.Text.Json.JsonEncodedText MemberImageUrl = System.Text.Json.JsonEncodedText.Encode("image_url"u8); + private static readonly System.Text.Json.JsonEncodedText MemberText = System.Text.Json.JsonEncodedText.Encode("text"u8); + + public override Elastic.Clients.Elasticsearch.Inference.ContentType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberFile)) + { + return Elastic.Clients.Elasticsearch.Inference.ContentType.File; + } + + if (reader.ValueTextEquals(MemberImageUrl)) + { + return Elastic.Clients.Elasticsearch.Inference.ContentType.ImageUrl; + } + + if (reader.ValueTextEquals(MemberText)) + { + return Elastic.Clients.Elasticsearch.Inference.ContentType.Text; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberFile.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ContentType.File; + } + + if (string.Equals(value, MemberImageUrl.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ContentType.ImageUrl; + } + + if (string.Equals(value, MemberText.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ContentType.Text; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ContentType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ContentType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.ContentType.File: + writer.WriteStringValue(MemberFile); + break; + case Elastic.Clients.Elasticsearch.Inference.ContentType.ImageUrl: + writer.WriteStringValue(MemberImageUrl); + break; + case Elastic.Clients.Elasticsearch.Inference.ContentType.Text: + writer.WriteStringValue(MemberText); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ContentType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.ContentType 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.ContentType 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/ContentType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentType.g.cs new file mode 100644 index 00000000000..4b68825d4b3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContentType.g.cs @@ -0,0 +1,35 @@ +// 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.ContentTypeConverter))] +public enum ContentType +{ + [System.Runtime.Serialization.EnumMember(Value = "file")] + File, + [System.Runtime.Serialization.EnumMember(Value = "image_url")] + ImageUrl, + [System.Runtime.Serialization.EnumMember(Value = "text")] + Text +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.Converters.g.cs index 3cbba0bcb07..0a625618dbf 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.Converters.g.cs @@ -30,10 +30,10 @@ public sealed partial class CustomResponseParamsConverter : System.Text.Json.Ser public override Elastic.Clients.Elasticsearch.Inference.CustomResponseParams Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propJsonParser = default; + LocalJsonValue> propJsonParser = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propJsonParser.TryReadProperty(ref reader, options, PropJsonParser, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + if (propJsonParser.TryReadProperty(ref reader, options, PropJsonParser, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) { continue; } @@ -57,7 +57,7 @@ public override Elastic.Clients.Elasticsearch.Inference.CustomResponseParams Rea public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomResponseParams value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropJsonParser, value.JsonParser, 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, PropJsonParser, value.JsonParser, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); writer.WriteEndObject(); } } \ 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 bfe7b8c3d52..f33a2a15b8e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomResponseParams.g.cs @@ -27,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; public sealed partial class CustomResponseParams { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public CustomResponseParams(object jsonParser) + public CustomResponseParams(System.Collections.Generic.IDictionary jsonParser) { JsonParser = jsonParser; } @@ -197,7 +197,7 @@ internal CustomResponseParams(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// } /// /// - public required object JsonParser { get; set; } + public required System.Collections.Generic.IDictionary JsonParser { get; set; } } public readonly partial struct CustomResponseParamsDescriptor @@ -374,12 +374,341 @@ public CustomResponseParamsDescriptor() /// } /// /// - public Elastic.Clients.Elasticsearch.Inference.CustomResponseParamsDescriptor JsonParser(object value) + public Elastic.Clients.Elasticsearch.Inference.CustomResponseParamsDescriptor JsonParser(System.Collections.Generic.IDictionary value) { Instance.JsonParser = value; return this; } + /// + /// + /// Specifies the JSON parser that is used to parse the response from the custom service. + /// Different task types require different json_parser parameters. + /// For example: + /// + /// + /// # text_embedding + /// # For a response like this: + /// + /// { + /// "object": "list", + /// "data": [ + /// { + /// "object": "embedding", + /// "index": 0, + /// "embedding": [ + /// 0.014539449, + /// -0.015288644 + /// ] + /// } + /// ], + /// "model": "text-embedding-ada-002-v2", + /// "usage": { + /// "prompt_tokens": 8, + /// "total_tokens": 8 + /// } + /// } + /// + /// # the json_parser definition should look like this: + /// + /// "response":{ + /// "json_parser":{ + /// "text_embeddings":"$.data[*].embedding[*]" + /// } + /// } + /// + /// # 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: + /// + /// { + /// "request_id": "75C50B5B-E79E-4930-****-F48DBB392231", + /// "latency": 22, + /// "usage": { + /// "token_count": 11 + /// }, + /// "result": { + /// "sparse_embeddings": [ + /// { + /// "index": 0, + /// "embedding": [ + /// { + /// "token_id": 6, + /// "weight": 0.101 + /// }, + /// { + /// "token_id": 163040, + /// "weight": 0.28417 + /// } + /// ] + /// } + /// ] + /// } + /// } + /// + /// # the json_parser definition should look like this: + /// + /// "response":{ + /// "json_parser":{ + /// "token_path":"$.result.sparse_embeddings[*].embedding[*].token_id", + /// "weight_path":"$.result.sparse_embeddings[*].embedding[*].weight" + /// } + /// } + /// + /// # rerank + /// # For a response like this: + /// + /// { + /// "results": [ + /// { + /// "index": 3, + /// "relevance_score": 0.999071, + /// "document": "abc" + /// }, + /// { + /// "index": 4, + /// "relevance_score": 0.7867867, + /// "document": "123" + /// }, + /// { + /// "index": 0, + /// "relevance_score": 0.32713068, + /// "document": "super" + /// } + /// ], + /// } + /// + /// # the json_parser definition should look like this: + /// + /// "response":{ + /// "json_parser":{ + /// "reranked_index":"$.result.scores[*].index", // optional + /// "relevance_score":"$.result.scores[*].score", + /// "document_text":"xxx" // optional + /// } + /// } + /// + /// # completion + /// # For a response like this: + /// + /// { + /// "id": "chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT", + /// "object": "chat.completion", + /// "created": 1741569952, + /// "model": "gpt-4.1-2025-04-14", + /// "choices": [ + /// { + /// "index": 0, + /// "message": { + /// "role": "assistant", + /// "content": "Hello! How can I assist you today?", + /// "refusal": null, + /// "annotations": [] + /// }, + /// "logprobs": null, + /// "finish_reason": "stop" + /// } + /// ] + /// } + /// + /// # the json_parser definition should look like this: + /// + /// "response":{ + /// "json_parser":{ + /// "completion_result":"$.choices[*].message.content" + /// } + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.CustomResponseParamsDescriptor JsonParser() + { + Instance.JsonParser = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(null); + return this; + } + + /// + /// + /// Specifies the JSON parser that is used to parse the response from the custom service. + /// Different task types require different json_parser parameters. + /// For example: + /// + /// + /// # text_embedding + /// # For a response like this: + /// + /// { + /// "object": "list", + /// "data": [ + /// { + /// "object": "embedding", + /// "index": 0, + /// "embedding": [ + /// 0.014539449, + /// -0.015288644 + /// ] + /// } + /// ], + /// "model": "text-embedding-ada-002-v2", + /// "usage": { + /// "prompt_tokens": 8, + /// "total_tokens": 8 + /// } + /// } + /// + /// # the json_parser definition should look like this: + /// + /// "response":{ + /// "json_parser":{ + /// "text_embeddings":"$.data[*].embedding[*]" + /// } + /// } + /// + /// # 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: + /// + /// { + /// "request_id": "75C50B5B-E79E-4930-****-F48DBB392231", + /// "latency": 22, + /// "usage": { + /// "token_count": 11 + /// }, + /// "result": { + /// "sparse_embeddings": [ + /// { + /// "index": 0, + /// "embedding": [ + /// { + /// "token_id": 6, + /// "weight": 0.101 + /// }, + /// { + /// "token_id": 163040, + /// "weight": 0.28417 + /// } + /// ] + /// } + /// ] + /// } + /// } + /// + /// # the json_parser definition should look like this: + /// + /// "response":{ + /// "json_parser":{ + /// "token_path":"$.result.sparse_embeddings[*].embedding[*].token_id", + /// "weight_path":"$.result.sparse_embeddings[*].embedding[*].weight" + /// } + /// } + /// + /// # rerank + /// # For a response like this: + /// + /// { + /// "results": [ + /// { + /// "index": 3, + /// "relevance_score": 0.999071, + /// "document": "abc" + /// }, + /// { + /// "index": 4, + /// "relevance_score": 0.7867867, + /// "document": "123" + /// }, + /// { + /// "index": 0, + /// "relevance_score": 0.32713068, + /// "document": "super" + /// } + /// ], + /// } + /// + /// # the json_parser definition should look like this: + /// + /// "response":{ + /// "json_parser":{ + /// "reranked_index":"$.result.scores[*].index", // optional + /// "relevance_score":"$.result.scores[*].score", + /// "document_text":"xxx" // optional + /// } + /// } + /// + /// # completion + /// # For a response like this: + /// + /// { + /// "id": "chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT", + /// "object": "chat.completion", + /// "created": 1741569952, + /// "model": "gpt-4.1-2025-04-14", + /// "choices": [ + /// { + /// "index": 0, + /// "message": { + /// "role": "assistant", + /// "content": "Hello! How can I assist you today?", + /// "refusal": null, + /// "annotations": [] + /// }, + /// "logprobs": null, + /// "finish_reason": "stop" + /// } + /// ] + /// } + /// + /// # the json_parser definition should look like this: + /// + /// "response":{ + /// "json_parser":{ + /// "completion_result":"$.choices[*].message.content" + /// } + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.CustomResponseParamsDescriptor JsonParser(System.Action? action) + { + Instance.JsonParser = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.CustomResponseParamsDescriptor AddJsonParser(string key, string value) + { + Instance.JsonParser ??= new System.Collections.Generic.Dictionary(); + Instance.JsonParser.Add(key, value); + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.Inference.CustomResponseParams Build(System.Action action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceInputType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceInputType.Converters.g.cs new file mode 100644 index 00000000000..385b034bffb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceInputType.Converters.g.cs @@ -0,0 +1,109 @@ +// 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 CustomServiceInputTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberClassification = System.Text.Json.JsonEncodedText.Encode("classification"u8); + private static readonly System.Text.Json.JsonEncodedText MemberClustering = System.Text.Json.JsonEncodedText.Encode("clustering"u8); + private static readonly System.Text.Json.JsonEncodedText MemberIngest = System.Text.Json.JsonEncodedText.Encode("ingest"u8); + private static readonly System.Text.Json.JsonEncodedText MemberSearch = System.Text.Json.JsonEncodedText.Encode("search"u8); + + public override Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberClassification)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType.Classification; + } + + if (reader.ValueTextEquals(MemberClustering)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType.Clustering; + } + + if (reader.ValueTextEquals(MemberIngest)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType.Ingest; + } + + if (reader.ValueTextEquals(MemberSearch)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType.Search; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberClassification.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType.Classification; + } + + if (string.Equals(value, MemberClustering.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType.Clustering; + } + + if (string.Equals(value, MemberIngest.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType.Ingest; + } + + if (string.Equals(value, MemberSearch.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType.Search; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType.Classification: + writer.WriteStringValue(MemberClassification); + break; + case Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType.Clustering: + writer.WriteStringValue(MemberClustering); + break; + case Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType.Ingest: + writer.WriteStringValue(MemberIngest); + break; + case Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType.Search: + writer.WriteStringValue(MemberSearch); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType 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.CustomServiceInputType 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/CustomServiceInputType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceInputType.g.cs new file mode 100644 index 00000000000..2edcba16b77 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceInputType.g.cs @@ -0,0 +1,37 @@ +// 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.CustomServiceInputTypeConverter))] +public enum CustomServiceInputType +{ + [System.Runtime.Serialization.EnumMember(Value = "classification")] + Classification, + [System.Runtime.Serialization.EnumMember(Value = "clustering")] + Clustering, + [System.Runtime.Serialization.EnumMember(Value = "ingest")] + Ingest, + [System.Runtime.Serialization.EnumMember(Value = "search")] + Search +} \ No newline at end of file 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 94aaee918b3..716e97921f8 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 @@ -38,12 +38,12 @@ public override Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings Re { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propBatchSize = default; - LocalJsonValue propHeaders = default; - LocalJsonValue propInputType = default; - LocalJsonValue propQueryParameters = default; + LocalJsonValue?> propHeaders = default; + LocalJsonValue?> propInputType = default; + LocalJsonValue>?> propQueryParameters = default; LocalJsonValue propRequest = default; LocalJsonValue propResponse = default; - LocalJsonValue propSecretParameters = default; + LocalJsonValue> propSecretParameters = default; LocalJsonValue propUrl = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -52,17 +52,17 @@ public override Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings Re 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)))) + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) { continue; } - if (propInputType.TryReadProperty(ref reader, options, PropInputType, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + if (propInputType.TryReadProperty(ref reader, options, PropInputType, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) { continue; } - if (propQueryParameters.TryReadProperty(ref reader, options, PropQueryParameters, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + if (propQueryParameters.TryReadProperty(ref reader, options, PropQueryParameters, static System.Collections.Generic.ICollection>? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue>(o, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!))) { continue; } @@ -77,7 +77,7 @@ public override Elastic.Clients.Elasticsearch.Inference.CustomServiceSettings Re continue; } - if (propSecretParameters.TryReadProperty(ref reader, options, PropSecretParameters, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + if (propSecretParameters.TryReadProperty(ref reader, options, PropSecretParameters, static System.Collections.Generic.IDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) { continue; } @@ -114,12 +114,12 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { 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))); + writer.WriteProperty(options, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropInputType, value.InputType, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropQueryParameters, value.QueryParameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection>? v) => w.WriteCollectionValue>(o, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); writer.WriteProperty(options, PropRequest, value.Request, null, null); writer.WriteProperty(options, PropResponse, value.Response, null, null); - writer.WriteProperty(options, PropSecretParameters, value.SecretParameters, 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, PropSecretParameters, value.SecretParameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary v) => w.WriteDictionaryValue(o, v, null, null)); writer.WriteProperty(options, PropUrl, value.Url, null, null); writer.WriteEndObject(); } 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 f19f126f9bd..0301d2a7e5d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomServiceSettings.g.cs @@ -27,7 +27,7 @@ namespace Elastic.Clients.Elasticsearch.Inference; public sealed partial class CustomServiceSettings { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public CustomServiceSettings(Elastic.Clients.Elasticsearch.Inference.CustomRequestParams request, Elastic.Clients.Elasticsearch.Inference.CustomResponseParams response, object secretParameters) + public CustomServiceSettings(Elastic.Clients.Elasticsearch.Inference.CustomRequestParams request, Elastic.Clients.Elasticsearch.Inference.CustomResponseParams response, System.Collections.Generic.IDictionary secretParameters) { Request = request; Response = response; @@ -59,13 +59,13 @@ internal CustomServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonC /// For example: /// /// - /// "headers":{ + /// "headers": { /// "Authorization": "Bearer ${api_key}", /// "Content-Type": "application/json;charset=utf-8" /// } /// /// - public object? Headers { get; set; } + public System.Collections.Generic.IDictionary? Headers { get; set; } /// /// @@ -109,7 +109,7 @@ internal CustomServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonC /// /// /// - public object? InputType { get; set; } + public System.Collections.Generic.IDictionary? InputType { get; set; } /// /// @@ -127,7 +127,7 @@ internal CustomServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonC /// If the base url is https://www.elastic.co it results in: https://www.elastic.co?param_key=some_value&param_key=another_value&other_key=other_value. /// /// - public object? QueryParameters { get; set; } + public System.Collections.Generic.ICollection>? QueryParameters { get; set; } /// /// @@ -154,7 +154,7 @@ internal CustomServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonC /// } /// /// - public required object SecretParameters { get; set; } + public required System.Collections.Generic.IDictionary SecretParameters { get; set; } /// /// @@ -202,18 +202,61 @@ public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor B /// For example: /// /// - /// "headers":{ + /// "headers": { /// "Authorization": "Bearer ${api_key}", /// "Content-Type": "application/json;charset=utf-8" /// } /// /// - public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor Headers(object? value) + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor Headers(System.Collections.Generic.IDictionary? value) { Instance.Headers = value; return this; } + /// + /// + /// Specifies the HTTP header parameters – such as Authentication or Content-Type – that are required to access the custom service. + /// For example: + /// + /// + /// "headers": { + /// "Authorization": "Bearer ${api_key}", + /// "Content-Type": "application/json;charset=utf-8" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor Headers() + { + Instance.Headers = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(null); + return this; + } + + /// + /// + /// Specifies the HTTP header parameters – such as Authentication or Content-Type – that are required to access the custom service. + /// For example: + /// + /// + /// "headers": { + /// "Authorization": "Bearer ${api_key}", + /// "Content-Type": "application/json;charset=utf-8" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor Headers(System.Action? action) + { + Instance.Headers = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor AddHeader(string key, string value) + { + Instance.Headers ??= new System.Collections.Generic.Dictionary(); + Instance.Headers.Add(key, value); + return this; + } + /// /// /// Specifies the input type translation values that are used to replace the ${input_type} template in the request body. @@ -256,12 +299,115 @@ public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor H /// /// /// - public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor InputType(object? value) + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor InputType(System.Collections.Generic.IDictionary? value) { Instance.InputType = value; return this; } + /// + /// + /// Specifies the input type translation values that are used to replace the ${input_type} template in the request body. + /// For example: + /// + /// + /// "input_type": { + /// "translation": { + /// "ingest": "do_ingest", + /// "search": "do_search" + /// }, + /// "default": "a_default" + /// }, + /// + /// + /// If the subsequent inference requests come from a search context, the search key will be used and the template will be replaced with do_search. + /// If it comes from the ingest context do_ingest is used. If it's a different context that is not specified, the default value will be used. If no default is specified an empty string is used. + /// translation can be: + /// + /// + /// + /// + /// classification + /// + /// + /// + /// + /// clustering + /// + /// + /// + /// + /// ingest + /// + /// + /// + /// + /// search + /// + /// + /// + /// + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor InputType() + { + Instance.InputType = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfCustomServiceInputTypeString.Build(null); + return this; + } + + /// + /// + /// Specifies the input type translation values that are used to replace the ${input_type} template in the request body. + /// For example: + /// + /// + /// "input_type": { + /// "translation": { + /// "ingest": "do_ingest", + /// "search": "do_search" + /// }, + /// "default": "a_default" + /// }, + /// + /// + /// If the subsequent inference requests come from a search context, the search key will be used and the template will be replaced with do_search. + /// If it comes from the ingest context do_ingest is used. If it's a different context that is not specified, the default value will be used. If no default is specified an empty string is used. + /// translation can be: + /// + /// + /// + /// + /// classification + /// + /// + /// + /// + /// clustering + /// + /// + /// + /// + /// ingest + /// + /// + /// + /// + /// search + /// + /// + /// + /// + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor InputType(System.Action? action) + { + Instance.InputType = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfCustomServiceInputTypeString.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor AddInputType(Elastic.Clients.Elasticsearch.Inference.CustomServiceInputType key, string value) + { + Instance.InputType ??= new System.Collections.Generic.Dictionary(); + Instance.InputType.Add(key, value); + return this; + } + /// /// /// Specifies the query parameters as a list of tuples. The arrays inside the query_parameters must have two items, a key and a value. @@ -278,12 +424,34 @@ public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor I /// If the base url is https://www.elastic.co it results in: https://www.elastic.co?param_key=some_value&param_key=another_value&other_key=other_value. /// /// - public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor QueryParameters(object? value) + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor QueryParameters(System.Collections.Generic.ICollection>? value) { Instance.QueryParameters = value; return this; } + /// + /// + /// Specifies the query parameters as a list of tuples. The arrays inside the query_parameters must have two items, a key and a value. + /// For example: + /// + /// + /// "query_parameters":[ + /// ["param_key", "some_value"], + /// ["param_key", "another_value"], + /// ["other_key", "other_value"] + /// ] + /// + /// + /// If the base url is https://www.elastic.co it results in: https://www.elastic.co?param_key=some_value&param_key=another_value&other_key=other_value. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor QueryParameters(params System.Collections.Generic.ICollection[] values) + { + Instance.QueryParameters = [.. values]; + return this; + } + /// /// /// The request configuration object. @@ -339,12 +507,53 @@ public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor R /// } /// /// - public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor SecretParameters(object value) + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor SecretParameters(System.Collections.Generic.IDictionary value) { Instance.SecretParameters = value; return this; } + /// + /// + /// Specifies secret parameters, like api_key or api_token, that are required to access the custom service. + /// For example: + /// + /// + /// "secret_parameters":{ + /// "api_key":"<api_key>" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor SecretParameters() + { + Instance.SecretParameters = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(null); + return this; + } + + /// + /// + /// Specifies secret parameters, like api_key or api_token, that are required to access the custom service. + /// For example: + /// + /// + /// "secret_parameters":{ + /// "api_key":"<api_key>" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor SecretParameters(System.Action? action) + { + Instance.SecretParameters = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.CustomServiceSettingsDescriptor AddSecretParameter(string key, string value) + { + Instance.SecretParameters ??= new System.Collections.Generic.Dictionary(); + Instance.SecretParameters.Add(key, value); + return this; + } + /// /// /// The URL endpoint to use for the requests. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.Converters.g.cs index 727ecd96413..b6350613b84 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.Converters.g.cs @@ -30,10 +30,10 @@ public sealed partial class CustomTaskSettingsConverter : System.Text.Json.Seria public override Elastic.Clients.Elasticsearch.Inference.CustomTaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propParameters = default; + LocalJsonValue?> propParameters = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propParameters.TryReadProperty(ref reader, options, PropParameters, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + if (propParameters.TryReadProperty(ref reader, options, PropParameters, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) { continue; } @@ -57,7 +57,7 @@ public override Elastic.Clients.Elasticsearch.Inference.CustomTaskSettings Read( public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.CustomTaskSettings value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropParameters, value.Parameters, 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, PropParameters, value.Parameters, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.g.cs index 86a529787a6..4b25d88f36a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/CustomTaskSettings.g.cs @@ -50,7 +50,7 @@ internal CustomTaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// } /// /// - public object? Parameters { get; set; } + public System.Collections.Generic.IDictionary? Parameters { get; set; } } public readonly partial struct CustomTaskSettingsDescriptor @@ -86,12 +86,59 @@ public CustomTaskSettingsDescriptor() /// } /// /// - public Elastic.Clients.Elasticsearch.Inference.CustomTaskSettingsDescriptor Parameters(object? value) + public Elastic.Clients.Elasticsearch.Inference.CustomTaskSettingsDescriptor Parameters(System.Collections.Generic.IDictionary? value) { Instance.Parameters = value; return this; } + /// + /// + /// Specifies parameters that are required to run the custom service. The parameters depend on the model your custom service uses. + /// For example: + /// + /// + /// "task_settings":{ + /// "parameters":{ + /// "input_type":"query", + /// "return_token":true + /// } + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.CustomTaskSettingsDescriptor Parameters() + { + Instance.Parameters = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringObject.Build(null); + return this; + } + + /// + /// + /// Specifies parameters that are required to run the custom service. The parameters depend on the model your custom service uses. + /// For example: + /// + /// + /// "task_settings":{ + /// "parameters":{ + /// "input_type":"query", + /// "return_token":true + /// } + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.CustomTaskSettingsDescriptor Parameters(System.Action? action) + { + Instance.Parameters = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringObject.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.CustomTaskSettingsDescriptor AddParameter(string key, object value) + { + Instance.Parameters ??= new System.Collections.Generic.Dictionary(); + Instance.Parameters.Add(key, value); + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.Inference.CustomTaskSettings Build(System.Action? action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EncryptedReasoningDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EncryptedReasoningDetail.Converters.g.cs new file mode 100644 index 00000000000..7f775b60bde --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EncryptedReasoningDetail.Converters.g.cs @@ -0,0 +1,98 @@ +// 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 EncryptedReasoningDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropData = System.Text.Json.JsonEncodedText.Encode("data"u8); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"u8); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"u8); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"u8); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"u8); + + public override Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propData = default; + LocalJsonValue propFormat = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propData.TryReadProperty(ref reader, options, PropData, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.SafeSkip(); + 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.Inference.EncryptedReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Data = propData.Value, + Format = propFormat.Value, + Id = propId.Value, + Index = propIndex.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetail value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropData, value.Data, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EncryptedReasoningDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EncryptedReasoningDetail.g.cs new file mode 100644 index 00000000000..71fd78a02a3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/EncryptedReasoningDetail.g.cs @@ -0,0 +1,160 @@ +// 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; + +/// +/// +/// The reasoning detail with encrypted reasoning data that may be redacted or protected. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.EncryptedReasoningDetailConverter))] +public sealed partial class EncryptedReasoningDetail : Elastic.Clients.Elasticsearch.Inference.IReasoningDetail +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public EncryptedReasoningDetail(string data) + { + Data = data; + } + + public EncryptedReasoningDetail() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal EncryptedReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The encrypted reasoning data generated by the model, + /// which may be redacted or protected based on the model's configuration and the nature of the reasoning information. + /// + /// + public required string Data { get; set; } + + /// + /// + /// The format of the reasoning detail. + /// + /// + public string? Format { get; set; } + + /// + /// + /// The identifier of the reasoning detail. + /// + /// + public string? Id { get; set; } + + /// + /// + /// The index of the reasoning detail, + /// which indicates its position in the sequence of reasoning details generated by the model. + /// + /// + public int? Index { get; set; } + + public string Type => "reasoning.encrypted"; +} + +/// +/// +/// The reasoning detail with encrypted reasoning data that may be redacted or protected. +/// +/// +public readonly partial struct EncryptedReasoningDetailDescriptor +{ + internal Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetail Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public EncryptedReasoningDetailDescriptor(Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetail instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public EncryptedReasoningDetailDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetailDescriptor(Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetail instance) => new Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetailDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetail(Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetailDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The encrypted reasoning data generated by the model, + /// which may be redacted or protected based on the model's configuration and the nature of the reasoning information. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetailDescriptor Data(string value) + { + Instance.Data = value; + return this; + } + + /// + /// + /// The format of the reasoning detail. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetailDescriptor Format(string? value) + { + Instance.Format = value; + return this; + } + + /// + /// + /// The identifier of the reasoning detail. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetailDescriptor Id(string? value) + { + Instance.Id = value; + return this; + } + + /// + /// + /// The index of the reasoning detail, + /// which indicates its position in the sequence of reasoning details generated by the model. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetailDescriptor Index(int? value) + { + Instance.Index = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetail Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetailDescriptor(new Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FileContent.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FileContent.Converters.g.cs new file mode 100644 index 00000000000..de8813adadf --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FileContent.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.Inference.Json; + +public sealed partial class FileContentConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFileData = System.Text.Json.JsonEncodedText.Encode("file_data"u8); + private static readonly System.Text.Json.JsonEncodedText PropFilename = System.Text.Json.JsonEncodedText.Encode("filename"u8); + + public override Elastic.Clients.Elasticsearch.Inference.FileContent Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFileData = default; + LocalJsonValue propFilename = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFileData.TryReadProperty(ref reader, options, PropFileData, null)) + { + continue; + } + + if (propFilename.TryReadProperty(ref reader, options, PropFilename, 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.Inference.FileContent(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + FileData = propFileData.Value, + Filename = propFilename.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.FileContent value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFileData, value.FileData, null, null); + writer.WriteProperty(options, PropFilename, value.Filename, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FileContent.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FileContent.g.cs new file mode 100644 index 00000000000..9e736ee673a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FileContent.g.cs @@ -0,0 +1,59 @@ +// 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.FileContentConverter))] +public sealed partial class FileContent +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public FileContent(string fileData, string filename) + { + FileData = fileData; + Filename = filename; + } + + public FileContent() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal FileContent(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The base64 encoded file data + /// + /// + public required string FileData { get; set; } + + /// + /// + /// The name of the file + /// + /// + public required string Filename { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.Converters.g.cs index 66291f5201d..ef172969a03 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.Converters.g.cs @@ -31,11 +31,11 @@ public sealed partial class FireworksAITaskSettingsConverter : System.Text.Json. public override Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings 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?> 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)))) + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) { continue; } @@ -65,7 +65,7 @@ public override Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.FireworksAITaskSettings 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, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); writer.WriteProperty(options, PropUser, value.User, null, null); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.g.cs index 37a2cad3c24..380ed4991c6 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/FireworksAITaskSettings.g.cs @@ -42,13 +42,13 @@ internal FireworksAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.Jso /// For example: /// /// - /// "headers":{ + /// "headers": { /// "Custom-Header": "Some-Value", /// "Another-Custom-Header": "Another-Value" /// } /// /// - public object? Headers { get; set; } + public System.Collections.Generic.IDictionary? Headers { get; set; } /// /// @@ -84,18 +84,61 @@ public FireworksAiTaskSettingsDescriptor() /// For example: /// /// - /// "headers":{ + /// "headers": { /// "Custom-Header": "Some-Value", /// "Another-Custom-Header": "Another-Value" /// } /// /// - public Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor Headers(object? value) + public Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor Headers(System.Collections.Generic.IDictionary? value) { Instance.Headers = value; return this; } + /// + /// + /// For a completion orchat_completion task. Specifies custom HTTP header parameters. + /// For example: + /// + /// + /// "headers": { + /// "Custom-Header": "Some-Value", + /// "Another-Custom-Header": "Another-Value" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor Headers() + { + Instance.Headers = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(null); + return this; + } + + /// + /// + /// For a completion orchat_completion task. Specifies custom HTTP header parameters. + /// For example: + /// + /// + /// "headers": { + /// "Custom-Header": "Some-Value", + /// "Another-Custom-Header": "Another-Value" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor Headers(System.Action? action) + { + Instance.Headers = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.FireworksAiTaskSettingsDescriptor AddHeader(string key, string value) + { + Instance.Headers ??= new System.Collections.Generic.Dictionary(); + Instance.Headers.Add(key, value); + return this; + } + /// /// /// For a completion orchat_completion task, specify the user issuing the request. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ImageUrl.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ImageUrl.Converters.g.cs new file mode 100644 index 00000000000..1d68aa9ec62 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ImageUrl.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.Inference.Json; + +public sealed partial class ImageUrlConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDetail = System.Text.Json.JsonEncodedText.Encode("detail"u8); + private static readonly System.Text.Json.JsonEncodedText PropUrl = System.Text.Json.JsonEncodedText.Encode("url"u8); + + public override Elastic.Clients.Elasticsearch.Inference.ImageUrl Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDetail = default; + LocalJsonValue propUrl = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDetail.TryReadProperty(ref reader, options, PropDetail, static Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propUrl.TryReadProperty(ref reader, options, PropUrl, 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.Inference.ImageUrl(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Detail = propDetail.Value, + Url = propUrl.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ImageUrl value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDetail, value.Detail, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail? v) => w.WriteNullableValue(o, v)); + 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/ImageUrl.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ImageUrl.g.cs new file mode 100644 index 00000000000..d40f4c169e8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ImageUrl.g.cs @@ -0,0 +1,58 @@ +// 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.ImageUrlConverter))] +public sealed partial class ImageUrl +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ImageUrl(string url) + { + Url = url; + } + + public ImageUrl() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ImageUrl(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Specifies the detail level of the image + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail? Detail { get; set; } + + /// + /// + /// The base64 encoded image data as a data URI + /// + /// + public required string Url { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ImageUrlDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ImageUrlDetail.Converters.g.cs new file mode 100644 index 00000000000..b34abff8474 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ImageUrlDetail.Converters.g.cs @@ -0,0 +1,95 @@ +// 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 ImageUrlDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAuto = System.Text.Json.JsonEncodedText.Encode("auto"u8); + private static readonly System.Text.Json.JsonEncodedText MemberHigh = System.Text.Json.JsonEncodedText.Encode("high"u8); + private static readonly System.Text.Json.JsonEncodedText MemberLow = System.Text.Json.JsonEncodedText.Encode("low"u8); + + public override Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAuto)) + { + return Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail.Auto; + } + + if (reader.ValueTextEquals(MemberHigh)) + { + return Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail.High; + } + + if (reader.ValueTextEquals(MemberLow)) + { + return Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail.Low; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAuto.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail.Auto; + } + + if (string.Equals(value, MemberHigh.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail.High; + } + + if (string.Equals(value, MemberLow.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail.Low; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail.Auto: + writer.WriteStringValue(MemberAuto); + break; + case Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail.High: + writer.WriteStringValue(MemberHigh); + break; + case Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail.Low: + writer.WriteStringValue(MemberLow); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.ImageUrlDetail 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.ImageUrlDetail 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/ImageUrlDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ImageUrlDetail.g.cs new file mode 100644 index 00000000000..84c135b1df5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ImageUrlDetail.g.cs @@ -0,0 +1,35 @@ +// 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.ImageUrlDetailConverter))] +public enum ImageUrlDetail +{ + [System.Runtime.Serialization.EnumMember(Value = "auto")] + Auto, + [System.Runtime.Serialization.EnumMember(Value = "high")] + High, + [System.Runtime.Serialization.EnumMember(Value = "low")] + Low +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.Converters.g.cs index 6fedc1018f9..fe26313e7c8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.Converters.g.cs @@ -26,6 +26,8 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class MessageConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropContent = System.Text.Json.JsonEncodedText.Encode("content"u8); + private static readonly System.Text.Json.JsonEncodedText PropReasoning = System.Text.Json.JsonEncodedText.Encode("reasoning"u8); + private static readonly System.Text.Json.JsonEncodedText PropReasoningDetails = System.Text.Json.JsonEncodedText.Encode("reasoning_details"u8); private static readonly System.Text.Json.JsonEncodedText PropRole = System.Text.Json.JsonEncodedText.Encode("role"u8); private static readonly System.Text.Json.JsonEncodedText PropToolCallId = System.Text.Json.JsonEncodedText.Encode("tool_call_id"u8); private static readonly System.Text.Json.JsonEncodedText PropToolCalls = System.Text.Json.JsonEncodedText.Encode("tool_calls"u8); @@ -34,6 +36,8 @@ public override Elastic.Clients.Elasticsearch.Inference.Message Read(ref System. { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue>?> propContent = default; + LocalJsonValue propReasoning = default; + LocalJsonValue?> propReasoningDetails = default; LocalJsonValue propRole = default; LocalJsonValue propToolCallId = default; LocalJsonValue?> propToolCalls = default; @@ -44,6 +48,16 @@ public override Elastic.Clients.Elasticsearch.Inference.Message Read(ref System. continue; } + if (propReasoning.TryReadProperty(ref reader, options, PropReasoning, null)) + { + continue; + } + + if (propReasoningDetails.TryReadProperty(ref reader, options, PropReasoningDetails, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + if (propRole.TryReadProperty(ref reader, options, PropRole, null)) { continue; @@ -72,6 +86,8 @@ public override Elastic.Clients.Elasticsearch.Inference.Message Read(ref System. return new Elastic.Clients.Elasticsearch.Inference.Message(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Content = propContent.Value, + Reasoning = propReasoning.Value, + ReasoningDetails = propReasoningDetails.Value, Role = propRole.Value, ToolCallId = propToolCallId.Value, ToolCalls = propToolCalls.Value @@ -82,6 +98,8 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropContent, value.Content, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union>? v) => w.WriteUnionValue>(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null))); + writer.WriteProperty(options, PropReasoning, value.Reasoning, null, null); + writer.WriteProperty(options, PropReasoningDetails, value.ReasoningDetails, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropRole, value.Role, null, null); writer.WriteProperty(options, PropToolCallId, value.ToolCallId, null, null); writer.WriteProperty(options, PropToolCalls, value.ToolCalls, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.g.cs index 50be22e7862..0f9f6e71eef 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Message.g.cs @@ -60,7 +60,7 @@ internal Message(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSent /// } /// /// - /// Object example: + /// Text example: /// /// /// { @@ -72,9 +72,56 @@ internal Message(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSent /// ] /// } /// + /// + /// Image example: + /// + /// + /// { + /// "content": [ + /// { + /// "image_url": { + /// "url": "data:image/jpg;base64,..." + /// }, + /// "type": "image_url" + /// } + /// ] + /// } + /// + /// + /// File example: + /// + /// + /// { + /// "content": [ + /// { + /// "file": { + /// "file_data": "data:application/pdf;base64,...", + /// "filename": "somePDF" + /// }, + /// "type": "file" + /// } + /// ] + /// } + /// /// public Elastic.Clients.Elasticsearch.Union>? Content { get; set; } + /// + /// + /// Only for assistant role messages. The reasoning details generated by the model as plaintext. + /// Currently supported only for elastic provider. + /// + /// + public string? Reasoning { get; set; } + + /// + /// + /// Only for assistant role messages. The reasoning details generated by the model as structured data. + /// Currently supported only for elastic provider. + /// + /// + public System.Collections.Generic.ICollection? ReasoningDetails { get; set; } + /// /// /// The role of the message author. Valid values are user, assistant, system, and tool. @@ -149,7 +196,7 @@ public MessageDescriptor() /// } /// /// - /// Object example: + /// Text example: /// /// /// { @@ -161,6 +208,37 @@ public MessageDescriptor() /// ] /// } /// + /// + /// Image example: + /// + /// + /// { + /// "content": [ + /// { + /// "image_url": { + /// "url": "data:image/jpg;base64,..." + /// }, + /// "type": "image_url" + /// } + /// ] + /// } + /// + /// + /// File example: + /// + /// + /// { + /// "content": [ + /// { + /// "file": { + /// "file_data": "data:application/pdf;base64,...", + /// "filename": "somePDF" + /// }, + /// "type": "file" + /// } + /// ] + /// } + /// /// public Elastic.Clients.Elasticsearch.Inference.MessageDescriptor Content(Elastic.Clients.Elasticsearch.Union>? value) { @@ -168,6 +246,60 @@ public Elastic.Clients.Elasticsearch.Inference.MessageDescriptor Content(Elastic return this; } + /// + /// + /// Only for assistant role messages. The reasoning details generated by the model as plaintext. + /// Currently supported only for elastic provider. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.MessageDescriptor Reasoning(string? value) + { + Instance.Reasoning = value; + return this; + } + + /// + /// + /// Only for assistant role messages. The reasoning details generated by the model as structured data. + /// Currently supported only for elastic provider. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.MessageDescriptor ReasoningDetails(System.Collections.Generic.ICollection? value) + { + Instance.ReasoningDetails = value; + return this; + } + + /// + /// + /// Only for assistant role messages. The reasoning details generated by the model as structured data. + /// Currently supported only for elastic provider. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.MessageDescriptor ReasoningDetails(params Elastic.Clients.Elasticsearch.Inference.IReasoningDetail[] values) + { + Instance.ReasoningDetails = [.. values]; + return this; + } + + /// + /// + /// Only for assistant role messages. The reasoning details generated by the model as structured data. + /// Currently supported only for elastic provider. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.MessageDescriptor ReasoningDetails(params System.Func[] actions) + { + var items = new System.Collections.Generic.List(); + foreach (var action in actions) + { + items.Add(Elastic.Clients.Elasticsearch.Inference.ReasoningDetailFactory.Build(action)); + } + + Instance.ReasoningDetails = items; + return this; + } + /// /// /// The role of the message author. Valid values are user, assistant, system, and tool. 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 978321cd7fb..683db06bfc2 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 @@ -31,11 +31,11 @@ public sealed partial class OpenAITaskSettingsConverter : System.Text.Json.Seria 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?> 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)))) + if (propHeaders.TryReadProperty(ref reader, options, PropHeaders, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) { continue; } @@ -65,7 +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, PropHeaders, value.Headers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); 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 4a1e663bdb8..629f037af61 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/OpenAITaskSettings.g.cs @@ -42,17 +42,17 @@ internal OpenAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// For example: /// /// - /// "headers":{ + /// "headers": { /// "Custom-Header": "Some-Value", /// "Another-Custom-Header": "Another-Value" /// } /// /// - public object? Headers { get; set; } + public System.Collections.Generic.IDictionary? Headers { get; set; } /// /// - /// For a completion, chat_completion, or text_embedding task, specify the user issuing the request. + /// Specifies the user issuing the request. /// This information can be used for abuse detection. /// /// @@ -84,13 +84,13 @@ public OpenAiTaskSettingsDescriptor() /// For example: /// /// - /// "headers":{ + /// "headers": { /// "Custom-Header": "Some-Value", /// "Another-Custom-Header": "Another-Value" /// } /// /// - public Elastic.Clients.Elasticsearch.Inference.OpenAiTaskSettingsDescriptor Headers(object? value) + public Elastic.Clients.Elasticsearch.Inference.OpenAiTaskSettingsDescriptor Headers(System.Collections.Generic.IDictionary? value) { Instance.Headers = value; return this; @@ -98,7 +98,50 @@ public Elastic.Clients.Elasticsearch.Inference.OpenAiTaskSettingsDescriptor Head /// /// - /// For a completion, chat_completion, or text_embedding task, specify the user issuing the request. + /// Specifies custom HTTP header parameters. + /// For example: + /// + /// + /// "headers": { + /// "Custom-Header": "Some-Value", + /// "Another-Custom-Header": "Another-Value" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.OpenAiTaskSettingsDescriptor Headers() + { + Instance.Headers = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(null); + return this; + } + + /// + /// + /// Specifies custom HTTP header parameters. + /// For example: + /// + /// + /// "headers": { + /// "Custom-Header": "Some-Value", + /// "Another-Custom-Header": "Another-Value" + /// } + /// + /// + public Elastic.Clients.Elasticsearch.Inference.OpenAiTaskSettingsDescriptor Headers(System.Action? action) + { + Instance.Headers = Elastic.Clients.Elasticsearch.Fluent.FluentDictionaryOfStringString.Build(action); + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.OpenAiTaskSettingsDescriptor AddHeader(string key, string value) + { + Instance.Headers ??= new System.Collections.Generic.Dictionary(); + Instance.Headers.Add(key, value); + return this; + } + + /// + /// + /// Specifies the user issuing the request. /// This information can be used for abuse detection. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Reasoning.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Reasoning.Converters.g.cs new file mode 100644 index 00000000000..5424cf79353 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Reasoning.Converters.g.cs @@ -0,0 +1,90 @@ +// 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 ReasoningConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropEffort = System.Text.Json.JsonEncodedText.Encode("effort"u8); + private static readonly System.Text.Json.JsonEncodedText PropEnabled = System.Text.Json.JsonEncodedText.Encode("enabled"u8); + private static readonly System.Text.Json.JsonEncodedText PropExclude = System.Text.Json.JsonEncodedText.Encode("exclude"u8); + private static readonly System.Text.Json.JsonEncodedText PropSummary = System.Text.Json.JsonEncodedText.Encode("summary"u8); + + public override Elastic.Clients.Elasticsearch.Inference.Reasoning Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propEffort = default; + LocalJsonValue propEnabled = default; + LocalJsonValue propExclude = default; + LocalJsonValue propSummary = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propEffort.TryReadProperty(ref reader, options, PropEffort, static Elastic.Clients.Elasticsearch.Inference.ReasoningEffort? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propEnabled.TryReadProperty(ref reader, options, PropEnabled, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propExclude.TryReadProperty(ref reader, options, PropExclude, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSummary.TryReadProperty(ref reader, options, PropSummary, static Elastic.Clients.Elasticsearch.Inference.ReasoningSummary? (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(); + 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.Inference.Reasoning(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Effort = propEffort.Value, + Enabled = propEnabled.Value, + Exclude = propExclude.Value, + Summary = propSummary.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.Reasoning value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropEffort, value.Effort, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.ReasoningEffort? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropEnabled, value.Enabled, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropExclude, value.Exclude, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSummary, value.Summary, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Inference.ReasoningSummary? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Reasoning.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Reasoning.g.cs new file mode 100644 index 00000000000..e3726daee35 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/Reasoning.g.cs @@ -0,0 +1,173 @@ +// 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; + +/// +/// +/// The reasoning configuration to use for the completion request. +/// Currently supported only for elastic provider. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.ReasoningConverter))] +public sealed partial class Reasoning +{ + public Reasoning() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal Reasoning(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The level of effort the model should put into reasoning. + /// This is a hint that guides the model in how much effort to put into reasoning, + /// with xhigh being the most effort and none being no effort. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ReasoningEffort? Effort { get; set; } + + /// + /// + /// Whether to enable reasoning with default settings. + /// This is a shortcut for enabling reasoning without having to specify the other parameters. + /// If enabled is set to true, then reasoning at the medium effort level is enabled. + /// Ignored if effort is specified, + /// in which case that parameter will control the reasoning process instead. + /// + /// + public bool? Enabled { get; set; } + + /// + /// + /// Whether to exclude reasoning information from the response. + /// If true, the response will not include any reasoning details. + /// + /// + public bool? Exclude { get; set; } + + /// + /// + /// The level of detail included in the reasoning summary returned in the response. + /// This is a hint on how much detail to include in the summary of the reasoning that is returned in the response, + /// with auto being the default level of detail, concise being less detail, and detailed being more detail. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ReasoningSummary? Summary { get; set; } +} + +/// +/// +/// The reasoning configuration to use for the completion request. +/// Currently supported only for elastic provider. +/// +/// +public readonly partial struct ReasoningDescriptor +{ + internal Elastic.Clients.Elasticsearch.Inference.Reasoning Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ReasoningDescriptor(Elastic.Clients.Elasticsearch.Inference.Reasoning instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ReasoningDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Inference.Reasoning(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Inference.ReasoningDescriptor(Elastic.Clients.Elasticsearch.Inference.Reasoning instance) => new Elastic.Clients.Elasticsearch.Inference.ReasoningDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Inference.Reasoning(Elastic.Clients.Elasticsearch.Inference.ReasoningDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The level of effort the model should put into reasoning. + /// This is a hint that guides the model in how much effort to put into reasoning, + /// with xhigh being the most effort and none being no effort. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ReasoningDescriptor Effort(Elastic.Clients.Elasticsearch.Inference.ReasoningEffort? value) + { + Instance.Effort = value; + return this; + } + + /// + /// + /// Whether to enable reasoning with default settings. + /// This is a shortcut for enabling reasoning without having to specify the other parameters. + /// If enabled is set to true, then reasoning at the medium effort level is enabled. + /// Ignored if effort is specified, + /// in which case that parameter will control the reasoning process instead. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ReasoningDescriptor Enabled(bool? value = true) + { + Instance.Enabled = value; + return this; + } + + /// + /// + /// Whether to exclude reasoning information from the response. + /// If true, the response will not include any reasoning details. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ReasoningDescriptor Exclude(bool? value = true) + { + Instance.Exclude = value; + return this; + } + + /// + /// + /// The level of detail included in the reasoning summary returned in the response. + /// This is a hint on how much detail to include in the summary of the reasoning that is returned in the response, + /// with auto being the default level of detail, concise being less detail, and detailed being more detail. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ReasoningDescriptor Summary(Elastic.Clients.Elasticsearch.Inference.ReasoningSummary? value) + { + Instance.Summary = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.Reasoning Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Inference.Reasoning(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Inference.ReasoningDescriptor(new Elastic.Clients.Elasticsearch.Inference.Reasoning(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningDetail.Converters.g.cs new file mode 100644 index 00000000000..0a0798093cb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningDetail.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.Inference.Json; + +public sealed partial class IReasoningDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDiscriminator = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Inference.IReasoningDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + var readerSnapshot = reader; + string? discriminator = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.TryReadProperty(options, PropDiscriminator, ref discriminator, null)) + { + break; + } + + reader.SafeSkip(); + } + + reader = readerSnapshot; + return discriminator switch + { + "reasoning.encrypted" => reader.ReadValue(options, null), + "reasoning.summary" => reader.ReadValue(options, null), + "reasoning.text" => reader.ReadValue(options, null), + _ => throw new System.Text.Json.JsonException($"Variant '{discriminator}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Inference.IReasoningDetail)}'.") + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.IReasoningDetail value, System.Text.Json.JsonSerializerOptions options) + { + switch (value.Type) + { + case "reasoning.encrypted": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetail)value, null); + break; + case "reasoning.summary": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetail)value, null); + break; + case "reasoning.text": + writer.WriteValue(options, (Elastic.Clients.Elasticsearch.Inference.TextReasoningDetail)value, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.Type}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Inference.IReasoningDetail)}'."); + } + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningDetail.g.cs new file mode 100644 index 00000000000..a5b1a09b6df --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningDetail.g.cs @@ -0,0 +1,75 @@ +// 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.IReasoningDetailConverter))] +public partial interface IReasoningDetail +{ + public string Type { get; } +} + +public readonly partial struct ReasoningDetailFactory +{ + public Elastic.Clients.Elasticsearch.Inference.IReasoningDetail Encrypted(Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetail value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Inference.IReasoningDetail Encrypted(System.Action action) + { + return Elastic.Clients.Elasticsearch.Inference.EncryptedReasoningDetailDescriptor.Build(action); + } + + public Elastic.Clients.Elasticsearch.Inference.IReasoningDetail Summary(Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetail value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Inference.IReasoningDetail Summary(System.Action action) + { + return Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetailDescriptor.Build(action); + } + + public Elastic.Clients.Elasticsearch.Inference.IReasoningDetail Text(Elastic.Clients.Elasticsearch.Inference.TextReasoningDetail value) + { + return value; + } + + public Elastic.Clients.Elasticsearch.Inference.IReasoningDetail Text() + { + return Elastic.Clients.Elasticsearch.Inference.TextReasoningDetailDescriptor.Build(null); + } + + public Elastic.Clients.Elasticsearch.Inference.IReasoningDetail Text(System.Action? action) + { + return Elastic.Clients.Elasticsearch.Inference.TextReasoningDetailDescriptor.Build(action); + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.IReasoningDetail Build(System.Func action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.ReasoningDetailFactory(); + return action.Invoke(builder); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningDetails.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningDetails.Converters.g.cs new file mode 100644 index 00000000000..38c0f6ee6f9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningDetails.Converters.g.cs @@ -0,0 +1,37 @@ +// 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 ReasoningDetailsConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Inference.ReasoningDetails Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + return new Elastic.Clients.Elasticsearch.Inference.ReasoningDetails(reader.ReadValue?>(options, static System.Collections.Generic.Dictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ReasoningDetails value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteValue(options, value.BackingDictionary, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.Dictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningDetails.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningDetails.g.cs new file mode 100644 index 00000000000..61c1a89d097 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningDetails.g.cs @@ -0,0 +1,51 @@ +// 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.ReasoningDetailsConverter))] +public sealed partial class ReasoningDetails : Elastic.Clients.Elasticsearch.IsADictionary +{ + public ReasoningDetails() + { + } + + public ReasoningDetails(System.Collections.Generic.IDictionary backingDictionary) : base(backingDictionary) + { + } + + public void Add(string key, Elastic.Clients.Elasticsearch.Inference.IReasoningDetail value) => BackingDictionary.Add(Sanitize(key), value); + public bool TryGetReasoningDetail(string key, [System.Diagnostics.CodeAnalysis.NotNullWhen(returnValue: true)] out Elastic.Clients.Elasticsearch.Inference.IReasoningDetail value) => BackingDictionary.TryGetValue(Sanitize(key), out value); + + public bool TryGetReasoningDetail(string key, [System.Diagnostics.CodeAnalysis.NotNullWhen(returnValue: true)] out T? value) where T : class, IReasoningDetail + { + if (BackingDictionary.TryGetValue(Sanitize(key), out var matchedValue) && matchedValue is T finalValue) + { + value = finalValue; + return true; + } + + value = null; + return false; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningEffort.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningEffort.Converters.g.cs new file mode 100644 index 00000000000..0920df5843f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningEffort.Converters.g.cs @@ -0,0 +1,137 @@ +// 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 ReasoningEffortConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberHigh = System.Text.Json.JsonEncodedText.Encode("high"u8); + private static readonly System.Text.Json.JsonEncodedText MemberLow = System.Text.Json.JsonEncodedText.Encode("low"u8); + private static readonly System.Text.Json.JsonEncodedText MemberMedium = System.Text.Json.JsonEncodedText.Encode("medium"u8); + private static readonly System.Text.Json.JsonEncodedText MemberMinimal = System.Text.Json.JsonEncodedText.Encode("minimal"u8); + private static readonly System.Text.Json.JsonEncodedText MemberNone = System.Text.Json.JsonEncodedText.Encode("none"u8); + private static readonly System.Text.Json.JsonEncodedText MemberXhigh = System.Text.Json.JsonEncodedText.Encode("xhigh"u8); + + public override Elastic.Clients.Elasticsearch.Inference.ReasoningEffort Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberHigh)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.High; + } + + if (reader.ValueTextEquals(MemberLow)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.Low; + } + + if (reader.ValueTextEquals(MemberMedium)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.Medium; + } + + if (reader.ValueTextEquals(MemberMinimal)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.Minimal; + } + + if (reader.ValueTextEquals(MemberNone)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.None; + } + + if (reader.ValueTextEquals(MemberXhigh)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.Xhigh; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberHigh.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.High; + } + + if (string.Equals(value, MemberLow.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.Low; + } + + if (string.Equals(value, MemberMedium.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.Medium; + } + + if (string.Equals(value, MemberMinimal.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.Minimal; + } + + if (string.Equals(value, MemberNone.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.None; + } + + if (string.Equals(value, MemberXhigh.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.Xhigh; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ReasoningEffort)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ReasoningEffort value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.High: + writer.WriteStringValue(MemberHigh); + break; + case Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.Low: + writer.WriteStringValue(MemberLow); + break; + case Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.Medium: + writer.WriteStringValue(MemberMedium); + break; + case Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.Minimal: + writer.WriteStringValue(MemberMinimal); + break; + case Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.None: + writer.WriteStringValue(MemberNone); + break; + case Elastic.Clients.Elasticsearch.Inference.ReasoningEffort.Xhigh: + writer.WriteStringValue(MemberXhigh); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ReasoningEffort)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.ReasoningEffort 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.ReasoningEffort 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/ReasoningEffort.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningEffort.g.cs new file mode 100644 index 00000000000..99f12c0b528 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningEffort.g.cs @@ -0,0 +1,41 @@ +// 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.ReasoningEffortConverter))] +public enum ReasoningEffort +{ + [System.Runtime.Serialization.EnumMember(Value = "high")] + High, + [System.Runtime.Serialization.EnumMember(Value = "low")] + Low, + [System.Runtime.Serialization.EnumMember(Value = "medium")] + Medium, + [System.Runtime.Serialization.EnumMember(Value = "minimal")] + Minimal, + [System.Runtime.Serialization.EnumMember(Value = "none")] + None, + [System.Runtime.Serialization.EnumMember(Value = "xhigh")] + Xhigh +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningSummary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningSummary.Converters.g.cs new file mode 100644 index 00000000000..c882dc1fa62 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningSummary.Converters.g.cs @@ -0,0 +1,95 @@ +// 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 ReasoningSummaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberAuto = System.Text.Json.JsonEncodedText.Encode("auto"u8); + private static readonly System.Text.Json.JsonEncodedText MemberConcise = System.Text.Json.JsonEncodedText.Encode("concise"u8); + private static readonly System.Text.Json.JsonEncodedText MemberDetailed = System.Text.Json.JsonEncodedText.Encode("detailed"u8); + + public override Elastic.Clients.Elasticsearch.Inference.ReasoningSummary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberAuto)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningSummary.Auto; + } + + if (reader.ValueTextEquals(MemberConcise)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningSummary.Concise; + } + + if (reader.ValueTextEquals(MemberDetailed)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningSummary.Detailed; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberAuto.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningSummary.Auto; + } + + if (string.Equals(value, MemberConcise.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningSummary.Concise; + } + + if (string.Equals(value, MemberDetailed.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.ReasoningSummary.Detailed; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ReasoningSummary)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ReasoningSummary value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.ReasoningSummary.Auto: + writer.WriteStringValue(MemberAuto); + break; + case Elastic.Clients.Elasticsearch.Inference.ReasoningSummary.Concise: + writer.WriteStringValue(MemberConcise); + break; + case Elastic.Clients.Elasticsearch.Inference.ReasoningSummary.Detailed: + writer.WriteStringValue(MemberDetailed); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.ReasoningSummary)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.ReasoningSummary 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.ReasoningSummary 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/ReasoningSummary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningSummary.g.cs new file mode 100644 index 00000000000..178f54a4dcb --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ReasoningSummary.g.cs @@ -0,0 +1,35 @@ +// 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.ReasoningSummaryConverter))] +public enum ReasoningSummary +{ + [System.Runtime.Serialization.EnumMember(Value = "auto")] + Auto, + [System.Runtime.Serialization.EnumMember(Value = "concise")] + Concise, + [System.Runtime.Serialization.EnumMember(Value = "detailed")] + Detailed +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.Converters.g.cs index 8b4f69b2461..7782286cc6a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.Converters.g.cs @@ -28,6 +28,7 @@ public sealed partial class RequestChatCompletionConverter : System.Text.Json.Se private static readonly System.Text.Json.JsonEncodedText PropMaxCompletionTokens = System.Text.Json.JsonEncodedText.Encode("max_completion_tokens"u8); private static readonly System.Text.Json.JsonEncodedText PropMessages = System.Text.Json.JsonEncodedText.Encode("messages"u8); private static readonly System.Text.Json.JsonEncodedText PropModel = System.Text.Json.JsonEncodedText.Encode("model"u8); + private static readonly System.Text.Json.JsonEncodedText PropReasoning = System.Text.Json.JsonEncodedText.Encode("reasoning"u8); private static readonly System.Text.Json.JsonEncodedText PropStop = System.Text.Json.JsonEncodedText.Encode("stop"u8); private static readonly System.Text.Json.JsonEncodedText PropTemperature = System.Text.Json.JsonEncodedText.Encode("temperature"u8); private static readonly System.Text.Json.JsonEncodedText PropToolChoice = System.Text.Json.JsonEncodedText.Encode("tool_choice"u8); @@ -40,6 +41,7 @@ public override Elastic.Clients.Elasticsearch.Inference.RequestChatCompletion Re LocalJsonValue propMaxCompletionTokens = default; LocalJsonValue> propMessages = default; LocalJsonValue propModel = default; + LocalJsonValue propReasoning = default; LocalJsonValue?> propStop = default; LocalJsonValue propTemperature = default; LocalJsonValue?> propToolChoice = default; @@ -62,6 +64,11 @@ public override Elastic.Clients.Elasticsearch.Inference.RequestChatCompletion Re continue; } + if (propReasoning.TryReadProperty(ref reader, options, PropReasoning, null)) + { + continue; + } + if (propStop.TryReadProperty(ref reader, options, PropStop, static System.Collections.Generic.ICollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) { continue; @@ -102,6 +109,7 @@ public override Elastic.Clients.Elasticsearch.Inference.RequestChatCompletion Re MaxCompletionTokens = propMaxCompletionTokens.Value, Messages = propMessages.Value, Model = propModel.Value, + Reasoning = propReasoning.Value, Stop = propStop.Value, Temperature = propTemperature.Value, ToolChoice = propToolChoice.Value, @@ -116,6 +124,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropMaxCompletionTokens, value.MaxCompletionTokens, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropMessages, value.Messages, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropModel, value.Model, null, null); + writer.WriteProperty(options, PropReasoning, value.Reasoning, null, null); writer.WriteProperty(options, PropStop, value.Stop, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection? v) => w.WriteCollectionValue(o, v, null)); writer.WriteProperty(options, PropTemperature, value.Temperature, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropToolChoice, value.ToolChoice, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.g.cs index b4d85e21f60..aaf4d8c90f7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RequestChatCompletion.g.cs @@ -65,6 +65,68 @@ internal RequestChatCompletion(Elastic.Clients.Elasticsearch.Serialization.JsonC /// public string? Model { get; set; } + /// + /// + /// The reasoning configuration for the completion request. + /// This controls the model's reasoning process in one of two ways: + /// + /// + /// + /// + /// By specifying the model’s reasoning effort level with the effort field. + /// + /// + /// + /// + /// By enabling reasoning with default settings by setting enabled field to true. + /// + /// + /// + /// + /// It also includes optional settings to control: + /// + /// + /// + /// + /// The level of detail in the summary returned in the response with the summary field. + /// + /// + /// + /// + /// Whether reasoning details are included in the response at all with the exclude field. + /// + /// + /// + /// + /// Example (effort): + /// + /// + /// { + /// "reasoning": { + /// "effort": "high", + /// "summary": "concise", + /// "exclude": false + /// } + /// } + /// + /// + /// Example (enabled): + /// + /// + /// { + /// "reasoning": { + /// "enabled": true, + /// "summary": "concise", + /// "exclude": false + /// } + /// } + /// + /// + /// Currently supported only for elastic provider. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.Reasoning? Reasoning { get; set; } + /// /// /// A sequence of strings to control when the model should stop generating additional tokens. @@ -224,6 +286,204 @@ public Elastic.Clients.Elasticsearch.Inference.RequestChatCompletionDescriptor M return this; } + /// + /// + /// The reasoning configuration for the completion request. + /// This controls the model's reasoning process in one of two ways: + /// + /// + /// + /// + /// By specifying the model’s reasoning effort level with the effort field. + /// + /// + /// + /// + /// By enabling reasoning with default settings by setting enabled field to true. + /// + /// + /// + /// + /// It also includes optional settings to control: + /// + /// + /// + /// + /// The level of detail in the summary returned in the response with the summary field. + /// + /// + /// + /// + /// Whether reasoning details are included in the response at all with the exclude field. + /// + /// + /// + /// + /// Example (effort): + /// + /// + /// { + /// "reasoning": { + /// "effort": "high", + /// "summary": "concise", + /// "exclude": false + /// } + /// } + /// + /// + /// Example (enabled): + /// + /// + /// { + /// "reasoning": { + /// "enabled": true, + /// "summary": "concise", + /// "exclude": false + /// } + /// } + /// + /// + /// Currently supported only for elastic provider. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.RequestChatCompletionDescriptor Reasoning(Elastic.Clients.Elasticsearch.Inference.Reasoning? value) + { + Instance.Reasoning = value; + return this; + } + + /// + /// + /// The reasoning configuration for the completion request. + /// This controls the model's reasoning process in one of two ways: + /// + /// + /// + /// + /// By specifying the model’s reasoning effort level with the effort field. + /// + /// + /// + /// + /// By enabling reasoning with default settings by setting enabled field to true. + /// + /// + /// + /// + /// It also includes optional settings to control: + /// + /// + /// + /// + /// The level of detail in the summary returned in the response with the summary field. + /// + /// + /// + /// + /// Whether reasoning details are included in the response at all with the exclude field. + /// + /// + /// + /// + /// Example (effort): + /// + /// + /// { + /// "reasoning": { + /// "effort": "high", + /// "summary": "concise", + /// "exclude": false + /// } + /// } + /// + /// + /// Example (enabled): + /// + /// + /// { + /// "reasoning": { + /// "enabled": true, + /// "summary": "concise", + /// "exclude": false + /// } + /// } + /// + /// + /// Currently supported only for elastic provider. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.RequestChatCompletionDescriptor Reasoning() + { + Instance.Reasoning = Elastic.Clients.Elasticsearch.Inference.ReasoningDescriptor.Build(null); + return this; + } + + /// + /// + /// The reasoning configuration for the completion request. + /// This controls the model's reasoning process in one of two ways: + /// + /// + /// + /// + /// By specifying the model’s reasoning effort level with the effort field. + /// + /// + /// + /// + /// By enabling reasoning with default settings by setting enabled field to true. + /// + /// + /// + /// + /// It also includes optional settings to control: + /// + /// + /// + /// + /// The level of detail in the summary returned in the response with the summary field. + /// + /// + /// + /// + /// Whether reasoning details are included in the response at all with the exclude field. + /// + /// + /// + /// + /// Example (effort): + /// + /// + /// { + /// "reasoning": { + /// "effort": "high", + /// "summary": "concise", + /// "exclude": false + /// } + /// } + /// + /// + /// Example (enabled): + /// + /// + /// { + /// "reasoning": { + /// "enabled": true, + /// "summary": "concise", + /// "exclude": false + /// } + /// } + /// + /// + /// Currently supported only for elastic provider. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.RequestChatCompletionDescriptor Reasoning(System.Action? action) + { + Instance.Reasoning = Elastic.Clients.Elasticsearch.Inference.ReasoningDescriptor.Build(action); + return this; + } + /// /// /// A sequence of strings to control when the model should stop generating additional tokens. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SummaryReasoningDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SummaryReasoningDetail.Converters.g.cs new file mode 100644 index 00000000000..8352e521164 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SummaryReasoningDetail.Converters.g.cs @@ -0,0 +1,98 @@ +// 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 SummaryReasoningDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"u8); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"u8); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"u8); + private static readonly System.Text.Json.JsonEncodedText PropSummary = System.Text.Json.JsonEncodedText.Encode("summary"u8); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"u8); + + public override Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFormat = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propSummary = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSummary.TryReadProperty(ref reader, options, PropSummary, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.SafeSkip(); + 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.Inference.SummaryReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Format = propFormat.Value, + Id = propId.Value, + Index = propIndex.Value, + Summary = propSummary.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetail value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSummary, value.Summary, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SummaryReasoningDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SummaryReasoningDetail.g.cs new file mode 100644 index 00000000000..90e92401b90 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/SummaryReasoningDetail.g.cs @@ -0,0 +1,160 @@ +// 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; + +/// +/// +/// The reasoning summary detail includes a high-level summary of the model's reasoning process. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.SummaryReasoningDetailConverter))] +public sealed partial class SummaryReasoningDetail : Elastic.Clients.Elasticsearch.Inference.IReasoningDetail +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SummaryReasoningDetail(string summary) + { + Summary = summary; + } + + public SummaryReasoningDetail() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal SummaryReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The format of the reasoning detail. + /// + /// + public string? Format { get; set; } + + /// + /// + /// The identifier of the reasoning detail. + /// + /// + public string? Id { get; set; } + + /// + /// + /// The index of the reasoning detail, + /// which indicates its position in the sequence of reasoning details generated by the model. + /// + /// + public int? Index { get; set; } + + /// + /// + /// The summary of the reasoning process generated by the model, + /// which provides an overview of the key points and conclusions reached during the reasoning process. + /// + /// + public required string Summary { get; set; } + + public string Type => "reasoning.summary"; +} + +/// +/// +/// The reasoning summary detail includes a high-level summary of the model's reasoning process. +/// +/// +public readonly partial struct SummaryReasoningDetailDescriptor +{ + internal Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetail Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SummaryReasoningDetailDescriptor(Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetail instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public SummaryReasoningDetailDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetailDescriptor(Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetail instance) => new Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetailDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetail(Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetailDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The format of the reasoning detail. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetailDescriptor Format(string? value) + { + Instance.Format = value; + return this; + } + + /// + /// + /// The identifier of the reasoning detail. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetailDescriptor Id(string? value) + { + Instance.Id = value; + return this; + } + + /// + /// + /// The index of the reasoning detail, + /// which indicates its position in the sequence of reasoning details generated by the model. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetailDescriptor Index(int? value) + { + Instance.Index = value; + return this; + } + + /// + /// + /// The summary of the reasoning process generated by the model, + /// which provides an overview of the key points and conclusions reached during the reasoning process. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetailDescriptor Summary(string value) + { + Instance.Summary = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetail Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetailDescriptor(new Elastic.Clients.Elasticsearch.Inference.SummaryReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextReasoningDetail.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextReasoningDetail.Converters.g.cs new file mode 100644 index 00000000000..c9c624dce92 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextReasoningDetail.Converters.g.cs @@ -0,0 +1,107 @@ +// 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 TextReasoningDetailConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"u8); + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"u8); + private static readonly System.Text.Json.JsonEncodedText PropIndex = System.Text.Json.JsonEncodedText.Encode("index"u8); + private static readonly System.Text.Json.JsonEncodedText PropSignature = System.Text.Json.JsonEncodedText.Encode("signature"u8); + private static readonly System.Text.Json.JsonEncodedText PropText = System.Text.Json.JsonEncodedText.Encode("text"u8); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"u8); + + public override Elastic.Clients.Elasticsearch.Inference.TextReasoningDetail Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propFormat = default; + LocalJsonValue propId = default; + LocalJsonValue propIndex = default; + LocalJsonValue propSignature = default; + LocalJsonValue propText = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propIndex.TryReadProperty(ref reader, options, PropIndex, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propSignature.TryReadProperty(ref reader, options, PropSignature, null)) + { + continue; + } + + if (propText.TryReadProperty(ref reader, options, PropText, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropType)) + { + reader.SafeSkip(); + 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.Inference.TextReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Format = propFormat.Value, + Id = propId.Value, + Index = propIndex.Value, + Signature = propSignature.Value, + Text = propText.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TextReasoningDetail value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropIndex, value.Index, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropSignature, value.Signature, null, null); + writer.WriteProperty(options, PropText, value.Text, null, null); + writer.WriteProperty(options, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextReasoningDetail.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextReasoningDetail.g.cs new file mode 100644 index 00000000000..9dea98dd0a4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TextReasoningDetail.g.cs @@ -0,0 +1,179 @@ +// 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; + +/// +/// +/// The reasoning text detail includes plaintext reasoning with optional signature verification. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.TextReasoningDetailConverter))] +public sealed partial class TextReasoningDetail : Elastic.Clients.Elasticsearch.Inference.IReasoningDetail +{ + public TextReasoningDetail() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal TextReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The format of the reasoning detail. + /// + /// + public string? Format { get; set; } + + /// + /// + /// The identifier of the reasoning detail. + /// + /// + public string? Id { get; set; } + + /// + /// + /// The index of the reasoning detail, + /// which indicates its position in the sequence of reasoning details generated by the model. + /// + /// + public int? Index { get; set; } + + /// + /// + /// The signature of the reasoning text, + /// which can be used to verify the authenticity and integrity of the reasoning information provided by the model. + /// + /// + public string? Signature { get; set; } + + /// + /// + /// The plaintext reasoning generated by the model, + /// which provides a detailed explanation of the model's reasoning process in human-readable form. + /// + /// + public string? Text { get; set; } + + public string Type => "reasoning.text"; +} + +/// +/// +/// The reasoning text detail includes plaintext reasoning with optional signature verification. +/// +/// +public readonly partial struct TextReasoningDetailDescriptor +{ + internal Elastic.Clients.Elasticsearch.Inference.TextReasoningDetail Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public TextReasoningDetailDescriptor(Elastic.Clients.Elasticsearch.Inference.TextReasoningDetail instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public TextReasoningDetailDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Inference.TextReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Inference.TextReasoningDetailDescriptor(Elastic.Clients.Elasticsearch.Inference.TextReasoningDetail instance) => new Elastic.Clients.Elasticsearch.Inference.TextReasoningDetailDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Inference.TextReasoningDetail(Elastic.Clients.Elasticsearch.Inference.TextReasoningDetailDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The format of the reasoning detail. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.TextReasoningDetailDescriptor Format(string? value) + { + Instance.Format = value; + return this; + } + + /// + /// + /// The identifier of the reasoning detail. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.TextReasoningDetailDescriptor Id(string? value) + { + Instance.Id = value; + return this; + } + + /// + /// + /// The index of the reasoning detail, + /// which indicates its position in the sequence of reasoning details generated by the model. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.TextReasoningDetailDescriptor Index(int? value) + { + Instance.Index = value; + return this; + } + + /// + /// + /// The signature of the reasoning text, + /// which can be used to verify the authenticity and integrity of the reasoning information provided by the model. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.TextReasoningDetailDescriptor Signature(string? value) + { + Instance.Signature = value; + return this; + } + + /// + /// + /// The plaintext reasoning generated by the model, + /// which provides a detailed explanation of the model's reasoning process in human-readable form. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.TextReasoningDetailDescriptor Text(string? value) + { + Instance.Text = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.TextReasoningDetail Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Inference.TextReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Inference.TextReasoningDetailDescriptor(new Elastic.Clients.Elasticsearch.Inference.TextReasoningDetail(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.g.cs index 5866e150867..2e7d670fa3d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/LicenseManagement/LicenseInformation.g.cs @@ -50,16 +50,87 @@ internal LicenseInformation(Elastic.Clients.Elasticsearch.Serialization.JsonCons _ = sentinel; } + /// + /// + /// The date and time the license expires in ISO 8601 format. + /// + /// public System.DateTimeOffset? ExpiryDate { get; set; } + + /// + /// + /// The date and time the license expires in milliseconds since the Unix epoch. + /// + /// public System.DateTimeOffset? ExpiryDateInMillis { get; set; } + + /// + /// + /// The date and time the license was issued in ISO 8601 format. + /// + /// public required System.DateTimeOffset IssueDate { get; set; } + + /// + /// + /// The date and time the license was issued in milliseconds since the Unix epoch. + /// + /// public required System.DateTimeOffset IssueDateInMillis { get; set; } + + /// + /// + /// The name of the customer or organization that received the license. + /// + /// public required string IssuedTo { get; set; } + + /// + /// + /// The name of the organization that issued the license. + /// + /// public required string Issuer { get; set; } + + /// + /// + /// The maximum number of nodes the license allows. + /// + /// public required long? MaxNodes { get; set; } + + /// + /// + /// The maximum number of resource units the license allows (for enterprise licenses only). + /// + /// public int? MaxResourceUnits { get; set; } + + /// + /// + /// The date and time the license was started in milliseconds since the Unix epoch. + /// + /// public required System.DateTimeOffset StartDateInMillis { get; set; } + + /// + /// + /// The status of the license. For example,active, valid, invalid, or expired. + /// + /// public required Elastic.Clients.Elasticsearch.LicenseManagement.LicenseStatus Status { get; set; } + + /// + /// + /// The type of the license. For example, trial, basic, gold, platinum, or enterprise. + /// + /// public required Elastic.Clients.Elasticsearch.LicenseManagement.LicenseType Type { get; set; } + + /// + /// + /// The unique identifier of the license. + /// + /// public required string Uid { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs index b5ad1db3a1d..9c1f1a869cd 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/AnalysisConfigRead.g.cs @@ -46,84 +46,64 @@ internal AnalysisConfigRead(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// - /// The size of the interval that the analysis is aggregated into, typically between 5m and 1h. + /// The size of the interval that the analysis is aggregated into, typically between 5m and 1h. This value should be either a whole number of days or equate to a + /// whole number of buckets in one day. If the anomaly detection job uses a datafeed with aggregations, this value must also be divisible by the interval of the date histogram aggregation. /// /// public required Elastic.Clients.Elasticsearch.Duration BucketSpan { get; set; } /// /// - /// If categorization_field_name is specified, you can also define the analyzer that is used to interpret the categorization field. - /// This property cannot be used at the same time as categorization_filters. - /// The categorization analyzer specifies how the categorization_field is interpreted by the categorization process. + /// If categorization_field_name is specified, you can also define the analyzer that is used to interpret the categorization field. This property cannot be used at the same time as categorization_filters. The categorization analyzer specifies how the categorization_field is interpreted by the categorization process. The categorization_analyzer field can be specified either as a string or as an object. If it is a string, it must refer to a built-in analyzer or one added by another plugin. /// /// public Elastic.Clients.Elasticsearch.MachineLearning.CategorizationAnalyzer? CategorizationAnalyzer { get; set; } /// /// - /// If this property is specified, the values of the specified field will be categorized. - /// The resulting categories must be used in a detector by setting by_field_name, over_field_name, or partition_field_name to the keyword mlcategory. + /// If this property is specified, the values of the specified field will be categorized. The resulting categories must be used in a detector by setting by_field_name, over_field_name, or partition_field_name to the keyword mlcategory. /// /// public string? CategorizationFieldName { get; set; } /// /// - /// If categorization_field_name is specified, you can also define optional filters. - /// This property expects an array of regular expressions. - /// The expressions are used to filter out matching sequences from the categorization field values. + /// If categorization_field_name is specified, you can also define optional filters. This property expects an array of regular expressions. The expressions are used to filter out matching sequences from the categorization field values. You can use this functionality to fine tune the categorization by excluding sequences from consideration when categories are defined. For example, you can exclude SQL statements that appear in your log files. This property cannot be used at the same time as categorization_analyzer. If you only want to define simple regular expression filters that are applied prior to tokenization, setting this property is the easiest method. If you also want to customize the tokenizer or post-tokenization filtering, use the categorization_analyzer property instead and include the filters as pattern_replace character filters. The effect is exactly the same. /// /// public System.Collections.Generic.IReadOnlyCollection? CategorizationFilters { get; set; } /// /// - /// An array of detector configuration objects. - /// Detector configuration objects specify which data fields a job analyzes. - /// They also specify which analytical functions are used. - /// You can specify multiple detectors for a job. + /// Detector configuration objects specify which data fields a job analyzes. They also specify which analytical functions are used. You can specify multiple detectors for a job. If the detectors array does not contain at least one detector, no analysis can occur and an error is returned. /// /// public required System.Collections.Generic.IReadOnlyCollection Detectors { get; set; } /// /// - /// A comma separated list of influencer field names. - /// Typically these can be the by, over, or partition fields that are used in the detector configuration. - /// You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. - /// When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity. + /// A comma separated list of influencer field names. Typically these can be the by, over, or partition fields that are used in the detector configuration. You might also want to use a field name that is not specifically named in a detector, but is available as part of the input data. When you use multiple detectors, the use of influencers is recommended as it aggregates results for each influencer entity. /// /// public required Elastic.Clients.Elasticsearch.Fields Influencers { get; set; } /// /// - /// The size of the window in which to expect data that is out of time order. - /// Defaults to no latency. - /// If you specify a non-zero value, it must be greater than or equal to one second. + /// The size of the window in which to expect data that is out of time order. If you specify a non-zero value, it must be greater than or equal to one second. NOTE: Latency is applicable only when you send data by using the post data API. /// /// public Elastic.Clients.Elasticsearch.Duration? Latency { get; set; } /// /// - /// Advanced configuration option. - /// Affects the pruning of models that have not been updated for the given time duration. - /// The value must be set to a multiple of the bucket_span. - /// If set too low, important information may be removed from the model. - /// Typically, set to 30d or longer. - /// If not set, model pruning only occurs if the model memory status reaches the soft limit or the hard limit. - /// For jobs created in 8.1 and later, the default value is the greater of 30d or 20 times bucket_span. + /// Advanced configuration option. Affects the pruning of models that have not been updated for the given time duration. The value must be set to a multiple of the bucket_span. If set too low, important information may be removed from the model. For jobs created in 8.1 and later, the default value is the greater of 30d or 20 times bucket_span. /// /// public Elastic.Clients.Elasticsearch.Duration? ModelPruneWindow { get; set; } /// /// - /// This functionality is reserved for internal use. - /// It is not supported for use in customer environments and is not subject to the support SLA of official GA features. - /// If set to true, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. + /// This functionality is reserved for internal use. It is not supported for use in customer environments and is not subject to the support SLA of official GA features. If set to true, the analysis will automatically find correlations between metrics for a given by field value and report anomalies when those correlations cease to hold. For example, suppose CPU and memory usage on host A is usually highly correlated with the same metrics on host B. Perhaps this correlation occurs because they are running a load-balanced application. If you enable this property, anomalies will be reported when, for example, CPU usage on host A is high and the value of CPU usage on host B is low. That is to say, you’ll see an anomaly when the CPU of host A is unusual given the CPU of host B. To use the multivariate_by_fields property, you must also specify by_field_name in your detector. /// /// public bool? MultivariateByFields { get; set; } @@ -137,9 +117,7 @@ internal AnalysisConfigRead(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// - /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. - /// This property value is the name of the field that contains the count of raw data points that have been summarized. - /// The same summary_count_field_name applies to all detectors in the job. + /// If this property is specified, the data that is fed to the job is expected to be pre-summarized. This property value is the name of the field that contains the count of raw data points that have been summarized. The same summary_count_field_name applies to all detectors in the job. NOTE: The summary_count_field_name property cannot be used with the metric function. /// /// public string? SummaryCountFieldName { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.g.cs index 913bc4acab7..04a771c3f5e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/MachineLearning/DetectorRead.g.cs @@ -44,18 +44,14 @@ internal DetectorRead(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo /// /// - /// The field used to split the data. - /// In particular, this property is used for analyzing the splits with respect to their own history. - /// It is used for finding unusual values in the context of the split. + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. /// /// public string? ByFieldName { get; set; } /// /// - /// An array of custom rule objects, which enable you to customize the way detectors operate. - /// For example, a rule may dictate to the detector conditions under which results should be skipped. - /// Kibana refers to custom rules as job rules. + /// Custom rules enable you to customize the way detectors operate. For example, a rule may dictate conditions under which results should be skipped. Kibana refers to custom rules as job rules. /// /// public System.Collections.Generic.IReadOnlyCollection? CustomRules { get; set; } @@ -69,51 +65,42 @@ internal DetectorRead(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo /// /// - /// A unique identifier for the detector. - /// This identifier is based on the order of the detectors in the analysis_config, starting at zero. + /// A unique identifier for the detector. This identifier is based on the order of the detectors in the analysis_config, starting at zero. If you specify a value for this property, it is ignored. /// /// public int? DetectorIndex { get; set; } /// /// - /// Contains one of the following values: all, none, by, or over. - /// If set, frequent entities are excluded from influencing the anomaly results. - /// Entities can be considered frequent over time or frequent in a population. - /// If you are working with both over and by fields, then you can set exclude_frequent to all for both fields, or to by or over for those specific fields. + /// If set, frequent entities are excluded from influencing the anomaly results. Entities can be considered frequent over time or frequent in a population. If you are working with both over and by fields, you can set exclude_frequent to all for both fields, or to by or over for those specific fields. /// /// public Elastic.Clients.Elasticsearch.MachineLearning.ExcludeFrequent? ExcludeFrequent { get; set; } /// /// - /// The field that the detector uses in the function. - /// If you use an event rate function such as count or rare, do not specify this field. + /// The field that the detector uses in the function. If you use an event rate function such as count or rare, do not specify this field. The field_name cannot contain double quotes or backslashes. /// /// public string? FieldName { get; set; } /// /// - /// The analysis function that is used. - /// For example, count, rare, mean, min, max, and sum. + /// The analysis function that is used. For example, count, rare, mean, min, max, or sum. /// /// public required string Function { get; set; } /// /// - /// The field used to split the data. - /// In particular, this property is used for analyzing the splits with respect to the history of all splits. - /// It is used for finding unusual values in the population of all splits. + /// The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. /// /// public string? OverFieldName { get; set; } /// /// - /// The field used to segment the analysis. - /// When you use this property, you have completely independent baselines for each value of this field. + /// The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. /// /// public string? PartitionFieldName { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilege.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilege.g.cs index e52fbd5946b..2ee5443b70c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilege.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndexPrivilege.g.cs @@ -38,10 +38,12 @@ namespace Elastic.Clients.Elasticsearch.Security; public static IndexPrivilege Create { get; } = new IndexPrivilege("create"); public static IndexPrivilege CreateDoc { get; } = new IndexPrivilege("create_doc"); public static IndexPrivilege CreateIndex { get; } = new IndexPrivilege("create_index"); + public static IndexPrivilege CreateView { get; } = new IndexPrivilege("create_view"); public static IndexPrivilege CrossClusterReplication { get; } = new IndexPrivilege("cross_cluster_replication"); public static IndexPrivilege CrossClusterReplicationInternal { get; } = new IndexPrivilege("cross_cluster_replication_internal"); public static IndexPrivilege Delete { get; } = new IndexPrivilege("delete"); public static IndexPrivilege DeleteIndex { get; } = new IndexPrivilege("delete_index"); + public static IndexPrivilege DeleteView { get; } = new IndexPrivilege("delete_view"); public static IndexPrivilege Index { get; } = new IndexPrivilege("index"); public static IndexPrivilege Maintenance { get; } = new IndexPrivilege("maintenance"); public static IndexPrivilege Manage { get; } = new IndexPrivilege("manage"); @@ -49,10 +51,12 @@ namespace Elastic.Clients.Elasticsearch.Security; public static IndexPrivilege ManageFollowIndex { get; } = new IndexPrivilege("manage_follow_index"); public static IndexPrivilege ManageIlm { get; } = new IndexPrivilege("manage_ilm"); public static IndexPrivilege ManageLeaderIndex { get; } = new IndexPrivilege("manage_leader_index"); + public static IndexPrivilege ManageView { get; } = new IndexPrivilege("manage_view"); public static IndexPrivilege Monitor { get; } = new IndexPrivilege("monitor"); public static IndexPrivilege None { get; } = new IndexPrivilege("none"); public static IndexPrivilege Read { get; } = new IndexPrivilege("read"); public static IndexPrivilege ReadCrossCluster { get; } = new IndexPrivilege("read_cross_cluster"); + public static IndexPrivilege ReadViewMetadata { get; } = new IndexPrivilege("read_view_metadata"); public static IndexPrivilege ViewIndexMetadata { get; } = new IndexPrivilege("view_index_metadata"); public static IndexPrivilege Write { get; } = new IndexPrivilege("write"); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivilegesBase.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivilegesBase.Converters.g.cs new file mode 100644 index 00000000000..45303d3e880 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivilegesBase.Converters.g.cs @@ -0,0 +1,99 @@ +// 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.Security.Json; + +public sealed partial class IndicesPrivilegesBaseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"u8); + private static readonly System.Text.Json.JsonEncodedText PropFieldSecurity = System.Text.Json.JsonEncodedText.Encode("field_security"u8); + private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"u8); + private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"u8); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"u8); + + public override Elastic.Clients.Elasticsearch.Security.IndicesPrivilegesBase Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowRestrictedIndices = default; + LocalJsonValue propFieldSecurity = default; + LocalJsonValue> propNames = default; + LocalJsonValue> propPrivileges = default; + LocalJsonValue propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propFieldSecurity.TryReadProperty(ref reader, options, PropFieldSecurity, null)) + { + continue; + } + + if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, 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.Security.IndicesPrivilegesBase(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowRestrictedIndices = propAllowRestrictedIndices.Value, + FieldSecurity = propFieldSecurity.Value, + Names = propNames.Value, + Privileges = propPrivileges.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.IndicesPrivilegesBase value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, null); + writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQuery, value.Query, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivilegesBase.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivilegesBase.g.cs new file mode 100644 index 00000000000..360549af911 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/IndicesPrivilegesBase.g.cs @@ -0,0 +1,80 @@ +// 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.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.IndicesPrivilegesBaseConverter))] +public sealed partial class IndicesPrivilegesBase +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public IndicesPrivilegesBase(System.Collections.Generic.ICollection names, System.Collections.Generic.ICollection privileges) + { + Names = names; + Privileges = privileges; + } + + public IndicesPrivilegesBase() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal IndicesPrivilegesBase(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Set to true if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the names list, Elasticsearch checks privileges against these indices regardless of the value set for allow_restricted_indices. + /// + /// + public bool? AllowRestrictedIndices { get; set; } + + /// + /// + /// The document fields that the owners of the role have read access to. + /// + /// + public Elastic.Clients.Elasticsearch.Security.FieldSecurity? FieldSecurity { get; set; } + + /// + /// + /// A list of indices (or index name patterns) to which the permissions in this entry apply. + /// + /// + public required System.Collections.Generic.ICollection Names { get; set; } + + /// + /// + /// The index level privileges that owners of the role have on the specified indices. + /// + /// + public required System.Collections.Generic.ICollection Privileges { get; set; } + + /// + /// + /// A search query that defines the documents the owners of the role have access to. A document within the specified indices must match this query for it to be accessible by the owners of the role. + /// + /// + public object? Query { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorRead.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorRead.g.cs index dbf9445306d..b31275ff8a0 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorRead.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleDescriptorRead.g.cs @@ -59,7 +59,7 @@ internal RoleDescriptorRead(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// - /// An optional description of the role descriptor. + /// Optional description of the role descriptor /// /// public string? Description { get; set; } @@ -102,7 +102,7 @@ internal RoleDescriptorRead(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// - /// A restriction for when the role descriptor is allowed to be effective. + /// Restriction for when the role descriptor is allowed to be effective. /// /// public Elastic.Clients.Elasticsearch.Security.Restriction? Restriction { get; set; } @@ -110,6 +110,8 @@ internal RoleDescriptorRead(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// /// /// A list of users that the API keys can impersonate. + /// NOTE: In Elastic Cloud Serverless, the run-as feature is disabled. + /// For API compatibility, you can still specify an empty run_as field, but a non-empty list will be rejected. /// /// public System.Collections.Generic.IReadOnlyCollection? RunAs { get; set; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplateQuery.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplateQuery.Converters.g.cs new file mode 100644 index 00000000000..a84b070cd27 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplateQuery.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.Security.Json; + +public sealed partial class RoleTemplateQueryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropTemplate = System.Text.Json.JsonEncodedText.Encode("template"u8); + + public override Elastic.Clients.Elasticsearch.Security.RoleTemplateQuery Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propTemplate = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propTemplate.TryReadProperty(ref reader, options, PropTemplate, 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.Security.RoleTemplateQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Template = propTemplate.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleTemplateQuery value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropTemplate, value.Template, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplateQuery.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplateQuery.g.cs new file mode 100644 index 00000000000..e75e2e17ada --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplateQuery.g.cs @@ -0,0 +1,48 @@ +// 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.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RoleTemplateQueryConverter))] +public sealed partial class RoleTemplateQuery +{ + public RoleTemplateQuery() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal RoleTemplateQuery(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// When you create a role, you can specify a query that defines the document level security permissions. You can optionally + /// use Mustache templates in the role query to insert the username of the current authenticated user into the role. + /// Like other places in Elasticsearch that support templating or scripting, you can specify inline, stored, or file-based + /// templates and define custom parameters. You access the details for the current authenticated user through the _user parameter. + /// + /// + public Elastic.Clients.Elasticsearch.Security.RoleTemplateScript? Template { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplateScript.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplateScript.Converters.g.cs new file mode 100644 index 00000000000..055744c4ff4 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplateScript.Converters.g.cs @@ -0,0 +1,106 @@ +// 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.Security.Json; + +public sealed partial class RoleTemplateScriptConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"u8); + private static readonly System.Text.Json.JsonEncodedText PropLang = System.Text.Json.JsonEncodedText.Encode("lang"u8); + private static readonly System.Text.Json.JsonEncodedText PropOptions = System.Text.Json.JsonEncodedText.Encode("options"u8); + private static readonly System.Text.Json.JsonEncodedText PropParams = System.Text.Json.JsonEncodedText.Encode("params"u8); + private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"u8); + + public override Elastic.Clients.Elasticsearch.Security.RoleTemplateScript Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + var readerSnapshot = reader; + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propId = default; + LocalJsonValue propLang = default; + LocalJsonValue?> propOptions = default; + LocalJsonValue?> propParams = default; + LocalJsonValue?> propSource = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propId.TryReadProperty(ref reader, options, PropId, null)) + { + continue; + } + + if (propLang.TryReadProperty(ref reader, options, PropLang, static Elastic.Clients.Elasticsearch.ScriptLanguage? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propOptions.TryReadProperty(ref reader, options, PropOptions, static System.Collections.Generic.IDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) + { + continue; + } + + if (propParams.TryReadProperty(ref reader, options, PropParams, 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 (propSource.TryReadProperty(ref reader, options, PropSource, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject), null, null))) + { + continue; + } + + try + { + reader = readerSnapshot; + var result = reader.ReadValue?>(options, static Elastic.Clients.Elasticsearch.Union? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadUnionValue(o, static (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => JsonUnionSelector.ByTokenType(ref r, o, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.String, Elastic.Clients.Elasticsearch.Serialization.JsonTokenTypes.StartObject), null, null)); + return new Elastic.Clients.Elasticsearch.Security.RoleTemplateScript(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Source = result + }; + } + catch (System.Text.Json.JsonException) + { + throw; + } + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.RoleTemplateScript(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Id = propId.Value, + Lang = propLang.Value, + Options = propOptions.Value, + Params = propParams.Value, + Source = propSource.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RoleTemplateScript value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropId, value.Id, null, null); + writer.WriteProperty(options, PropLang, value.Lang, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.ScriptLanguage? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOptions, value.Options, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteProperty(options, PropParams, value.Params, 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, PropSource, value.Source, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Union? v) => w.WriteUnionValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplateScript.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplateScript.g.cs new file mode 100644 index 00000000000..1b983dcda9c --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RoleTemplateScript.g.cs @@ -0,0 +1,62 @@ +// 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.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.RoleTemplateScriptConverter))] +public sealed partial class RoleTemplateScript +{ + public RoleTemplateScript() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal RoleTemplateScript(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The id for a stored script. + /// + /// + public Elastic.Clients.Elasticsearch.Id? Id { get; set; } + + /// + /// + /// Specifies the language the script is written in. + /// + /// + public Elastic.Clients.Elasticsearch.ScriptLanguage? Lang { get; set; } + public System.Collections.Generic.IDictionary? Options { get; set; } + + /// + /// + /// Specifies any named parameters that are passed into the script as variables. + /// Use parameters instead of hard-coded values to decrease compile time. + /// + /// + public System.Collections.Generic.IDictionary? Params { get; set; } + public Elastic.Clients.Elasticsearch.Union? Source { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivilegesBase.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivilegesBase.Converters.g.cs new file mode 100644 index 00000000000..4335ca7407f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivilegesBase.Converters.g.cs @@ -0,0 +1,99 @@ +// 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.Security.Json; + +public sealed partial class UserIndicesPrivilegesBaseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropAllowRestrictedIndices = System.Text.Json.JsonEncodedText.Encode("allow_restricted_indices"u8); + private static readonly System.Text.Json.JsonEncodedText PropFieldSecurity = System.Text.Json.JsonEncodedText.Encode("field_security"u8); + private static readonly System.Text.Json.JsonEncodedText PropNames = System.Text.Json.JsonEncodedText.Encode("names"u8); + private static readonly System.Text.Json.JsonEncodedText PropPrivileges = System.Text.Json.JsonEncodedText.Encode("privileges"u8); + private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"u8); + + public override Elastic.Clients.Elasticsearch.Security.UserIndicesPrivilegesBase Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propAllowRestrictedIndices = default; + LocalJsonValue?> propFieldSecurity = default; + LocalJsonValue> propNames = default; + LocalJsonValue> propPrivileges = default; + LocalJsonValue?> propQuery = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propAllowRestrictedIndices.TryReadProperty(ref reader, options, PropAllowRestrictedIndices, null)) + { + continue; + } + + if (propFieldSecurity.TryReadProperty(ref reader, options, PropFieldSecurity, static System.Collections.Generic.IReadOnlyCollection? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null))) + { + continue; + } + + if (propNames.TryReadProperty(ref reader, options, PropNames, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + { + continue; + } + + if (propPrivileges.TryReadProperty(ref reader, options, PropPrivileges, static System.Collections.Generic.IReadOnlyCollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) + { + continue; + } + + if (propQuery.TryReadProperty(ref reader, options, PropQuery, 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.Security.UserIndicesPrivilegesBase(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + AllowRestrictedIndices = propAllowRestrictedIndices.Value, + FieldSecurity = propFieldSecurity.Value, + Names = propNames.Value, + Privileges = propPrivileges.Value, + Query = propQuery.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.UserIndicesPrivilegesBase value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropAllowRestrictedIndices, value.AllowRestrictedIndices, null, null); + writer.WriteProperty(options, PropFieldSecurity, value.FieldSecurity, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection? v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropNames, value.Names, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.ICollection v) => w.WriteSingleOrManyCollectionValue(o, v, null)); + writer.WriteProperty(options, PropPrivileges, value.Privileges, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyCollection v) => w.WriteCollectionValue(o, v, null)); + writer.WriteProperty(options, PropQuery, value.Query, 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/Types/Security/UserIndicesPrivilegesBase.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivilegesBase.g.cs new file mode 100644 index 00000000000..81fefd51250 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/UserIndicesPrivilegesBase.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.Security; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.UserIndicesPrivilegesBaseConverter))] +public sealed partial class UserIndicesPrivilegesBase +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public UserIndicesPrivilegesBase(bool allowRestrictedIndices, System.Collections.Generic.ICollection names, System.Collections.Generic.IReadOnlyCollection privileges) + { + AllowRestrictedIndices = allowRestrictedIndices; + Names = names; + Privileges = privileges; + } + + public UserIndicesPrivilegesBase() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal UserIndicesPrivilegesBase(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Set to true if using wildcard or regular expressions for patterns that cover restricted indices. Implicitly, restricted indices have limited privileges that can cause pattern tests to fail. If restricted indices are explicitly included in the names list, Elasticsearch checks privileges against these indices regardless of the value set for allow_restricted_indices. + /// + /// + public required bool AllowRestrictedIndices { get; set; } + + /// + /// + /// The document fields that the owners of the role have read access to. + /// + /// + public System.Collections.Generic.IReadOnlyCollection? FieldSecurity { get; set; } + + /// + /// + /// A list of indices (or index name patterns) to which the permissions in this entry apply. + /// + /// + public required System.Collections.Generic.ICollection Names { get; set; } + + /// + /// + /// The index level privileges that owners of the role have on the specified indices. + /// + /// + public required System.Collections.Generic.IReadOnlyCollection Privileges { get; set; } + + /// + /// + /// Search queries that define the documents the user has access to. A document within the specified indices must match these queries for it to be accessible by the owners of the role. + /// + /// + public System.Collections.Generic.IReadOnlyCollection? Query { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.g.cs index f2ed1df768d..74932441a15 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Synonyms/SynonymRuleRead.g.cs @@ -45,14 +45,15 @@ internal SynonymRuleRead(Elastic.Clients.Elasticsearch.Serialization.JsonConstru /// /// - /// Synonym Rule identifier + /// The identifier for the synonym rule. + /// If you do not specify a synonym rule ID when you create a rule, an identifier is created automatically by Elasticsearch. /// /// public required string Id { get; set; } /// /// - /// Synonyms, in Solr format, that conform the synonym rule. + /// The synonyms that conform the synonym rule in Solr format. /// /// public required string Synonyms { get; set; }