diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs index 6df833bb384..e3470fbd147 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ApiUrlLookup.g.cs @@ -168,6 +168,7 @@ internal static class ApiUrlLookup internal static ApiUrls InferencePutAzureaistudio = new ApiUrls(new[] { "_inference/{task_type}/{azureaistudio_inference_id}" }); internal static ApiUrls InferencePutAzureopenai = new ApiUrls(new[] { "_inference/{task_type}/{azureopenai_inference_id}" }); internal static ApiUrls InferencePutCohere = new ApiUrls(new[] { "_inference/{task_type}/{cohere_inference_id}" }); + internal static ApiUrls InferencePutContextualai = new ApiUrls(new[] { "_inference/{task_type}/{contextualai_inference_id}" }); internal static ApiUrls InferencePutCustom = new ApiUrls(new[] { "_inference/{task_type}/{custom_inference_id}" }); internal static ApiUrls InferencePutDeepseek = new ApiUrls(new[] { "_inference/{task_type}/{deepseek_inference_id}" }); internal static ApiUrls InferencePutElasticsearch = new ApiUrls(new[] { "_inference/{task_type}/{elasticsearch_inference_id}" }); @@ -326,7 +327,6 @@ internal static class ApiUrlLookup internal static ApiUrls NoNamespaceUpdate = new ApiUrls(new[] { "{index}/_update/{id}" }); internal static ApiUrls NoNamespaceUpdateByQuery = new ApiUrls(new[] { "{index}/_update_by_query" }); internal static ApiUrls NoNamespaceUpdateByQueryRethrottle = new ApiUrls(new[] { "_update_by_query/{task_id}/_rethrottle" }); - internal static ApiUrls ProjectTags = new ApiUrls(new[] { "_project/tags" }); internal static ApiUrls QueryRulesDeleteRule = new ApiUrls(new[] { "_query_rules/{ruleset_id}/_rule/{rule_id}" }); internal static ApiUrls QueryRulesDeleteRuleset = new ApiUrls(new[] { "_query_rules/{ruleset_id}" }); internal static ApiUrls QueryRulesGetRule = new ApiUrls(new[] { "_query_rules/{ruleset_id}/_rule/{rule_id}" }); @@ -391,6 +391,7 @@ internal static class ApiUrlLookup internal static ApiUrls SecurityGetServiceAccounts = new ApiUrls(new[] { "_security/service/{namespace}/{service}", "_security/service/{namespace}", "_security/service" }); internal static ApiUrls SecurityGetServiceCredentials = new ApiUrls(new[] { "_security/service/{namespace}/{service}/credential" }); internal static ApiUrls SecurityGetSettings = new ApiUrls(new[] { "_security/settings" }); + internal static ApiUrls SecurityGetStats = new ApiUrls(new[] { "_security/stats" }); internal static ApiUrls SecurityGetToken = new ApiUrls(new[] { "_security/oauth2/token" }); internal static ApiUrls SecurityGetUser = new ApiUrls(new[] { "_security/user/{username}", "_security/user" }); internal static ApiUrls SecurityGetUserPrivileges = new ApiUrls(new[] { "_security/user/_privileges" }); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.g.cs index 9bf9e3aef7f..99181f041b5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/CountRequest.g.cs @@ -52,7 +52,7 @@ public sealed partial class CountRequestParameters : Elastic.Transport.RequestPa /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -227,7 +227,7 @@ internal CountRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -419,7 +419,7 @@ public Elastic.Clients.Elasticsearch.CountRequestDescriptor AnalyzeWildcard(bool /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -751,7 +751,7 @@ public Elastic.Clients.Elasticsearch.CountRequestDescriptor AnalyzeWi /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.g.cs index 5a951967d07..21f2b25432a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/DeleteByQueryRequest.g.cs @@ -59,7 +59,7 @@ public sealed partial class DeleteByQueryRequestParameters : Elastic.Transport.R /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -466,7 +466,7 @@ internal DeleteByQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -915,7 +915,7 @@ public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor Conflicts(El /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -1645,7 +1645,7 @@ public Elastic.Clients.Elasticsearch.DeleteByQueryRequestDescriptor C /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs index f57d8ed8657..811c45e11fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ExplainRequest.g.cs @@ -43,7 +43,7 @@ public sealed partial class ExplainRequestParameters : Elastic.Transport.Request /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -195,7 +195,7 @@ internal ExplainRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -360,7 +360,7 @@ public Elastic.Clients.Elasticsearch.ExplainRequestDescriptor AnalyzeWildcard(bo /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -721,7 +721,7 @@ public Elastic.Clients.Elasticsearch.ExplainRequestDescriptor Analyze /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs index 49ab77f4a81..9667b47d0db 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/IndicesStatsRequest.g.cs @@ -85,7 +85,7 @@ public sealed partial class IndicesStatsRequestParameters : Elastic.Transport.Re /// /// - /// Indicates whether statistics are aggregated at the cluster, index, or shard level. + /// Indicates whether statistics are aggregated at the cluster, indices, or shards level. /// /// public Elastic.Clients.Elasticsearch.Level? Level { get => Q("level"); set => Q("level", value); } @@ -221,7 +221,7 @@ internal IndicesStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCon /// /// - /// Indicates whether statistics are aggregated at the cluster, index, or shard level. + /// Indicates whether statistics are aggregated at the cluster, indices, or shards level. /// /// public Elastic.Clients.Elasticsearch.Level? Level { get => Q("level"); set => Q("level", value); } @@ -449,7 +449,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsRequestDescript /// /// - /// Indicates whether statistics are aggregated at the cluster, index, or shard level. + /// Indicates whether statistics are aggregated at the cluster, indices, or shards level. /// /// public Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.Level? value) @@ -736,7 +736,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsRequestDescript /// /// - /// Indicates whether statistics are aggregated at the cluster, index, or shard level. + /// Indicates whether statistics are aggregated at the cluster, indices, or shards level. /// /// public Elastic.Clients.Elasticsearch.IndexManagement.IndicesStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.Level? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs index b80d1f74e53..3a7a9af5709 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/IndexManagement/ValidateQueryRequest.g.cs @@ -57,7 +57,7 @@ public sealed partial class ValidateQueryRequestParameters : Elastic.Transport.R /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// /// public Elastic.Clients.Elasticsearch.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); } @@ -192,7 +192,7 @@ internal ValidateQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// /// public Elastic.Clients.Elasticsearch.QueryDsl.Operator? DefaultOperator { get => Q("default_operator"); set => Q("default_operator", value); } @@ -347,7 +347,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryRequestDescrip /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// /// public Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? value) @@ -628,7 +628,7 @@ public Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryRequestDescrip /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// /// public Elastic.Clients.Elasticsearch.IndexManagement.ValidateQueryRequestDescriptor DefaultOperator(Elastic.Clients.Elasticsearch.QueryDsl.Operator? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.g.cs index 544b6077124..cc688829a40 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/ChatCompletionUnifiedRequest.g.cs @@ -35,7 +35,7 @@ public sealed partial class ChatCompletionUnifiedRequestParameters : Elastic.Tra /// /// -/// Perform chat completion inference +/// Perform chat completion inference on the service /// /// /// The chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation. @@ -107,7 +107,7 @@ internal ChatCompletionUnifiedRequest(Elastic.Clients.Elasticsearch.Serializatio /// /// -/// Perform chat completion inference +/// Perform chat completion inference on the service /// /// /// The chat completion inference API enables real-time responses for chat completion tasks by delivering answers incrementally, reducing response times during computation. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionRequest.g.cs index d8c094dce23..2ee3c2219c7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/CompletionRequest.g.cs @@ -36,6 +36,14 @@ public sealed partial class CompletionRequestParameters : Elastic.Transport.Requ /// /// /// Perform completion inference on the service +/// Get responses for completion tasks. +/// This API works only with the completion task type. +/// +/// +/// IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs. +/// +/// +/// This API requires the monitor_inference cluster privilege (the built-in inference_admin and inference_user roles grant this privilege). /// /// [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.CompletionRequestConverter))] @@ -112,6 +120,14 @@ internal CompletionRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// /// Perform completion inference on the service +/// Get responses for completion tasks. +/// This API works only with the completion task type. +/// +/// +/// IMPORTANT: The inference APIs enable you to use certain services, such as built-in machine learning models (ELSER, E5), models uploaded through Eland, Cohere, OpenAI, Azure, Google AI Studio, Google Vertex AI, Anthropic, Watsonx.ai, or Hugging Face. For built-in models and models uploaded through Eland, the inference APIs offer an alternative way to use and manage trained models. However, if you do not plan to use the inference APIs to use these models or if you want to use non-NLP models, use the machine learning trained model APIs. +/// +/// +/// This API requires the monitor_inference cluster privilege (the built-in inference_admin and inference_user roles grant this privilege). /// /// public readonly partial struct CompletionRequestDescriptor diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiRequest.Converters.g.cs new file mode 100644 index 00000000000..bfb420b3408 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiRequest.Converters.g.cs @@ -0,0 +1,89 @@ +// 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 PutContextualaiRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + + public override Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (reader.ValueTextEquals(PropService)) + { + reader.SafeSkip(); + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, null)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, 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.PutContextualaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, null, null); + writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiRequest.g.cs new file mode 100644 index 00000000000..052f5bd67ce --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiRequest.g.cs @@ -0,0 +1,353 @@ +// 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; + +public sealed partial class PutContextualaiRequestParameters : Elastic.Transport.RequestParameters +{ + /// + /// + /// Specifies the amount of time to wait for the inference endpoint to be created. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } +} + +/// +/// +/// Create an Contextual AI inference endpoint. +/// +/// +/// Create an inference endpoint to perform an inference task with the contexualai service. +/// +/// +/// To review the available rerank models, refer to https://docs.contextual.ai/api-reference/rerank/rerank#body-model. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Inference.Json.PutContextualaiRequestConverter))] +public sealed partial class PutContextualaiRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ + [System.Obsolete("The request contains additional required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PutContextualaiRequest(Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI taskType, Elastic.Clients.Elasticsearch.Id contextualaiInferenceId) : base(r => r.Required("task_type", taskType).Required("contextualai_inference_id", contextualaiInferenceId)) + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PutContextualaiRequest(Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI taskType, Elastic.Clients.Elasticsearch.Id contextualaiInferenceId, Elastic.Clients.Elasticsearch.Inference.ContextualAIServiceSettings serviceSettings) : base(r => r.Required("task_type", taskType).Required("contextualai_inference_id", contextualaiInferenceId)) + { + ServiceSettings = serviceSettings; + } +#if NET7_0_OR_GREATER + public PutContextualaiRequest() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal PutContextualaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.InferencePutContextualai; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.PUT; + + internal override bool SupportsBody => true; + + internal override string OperationName => "inference.put_contextualai"; + + /// + /// + /// The unique identifier of the inference endpoint. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Id ContextualaiInferenceId { get => P("contextualai_inference_id"); set => PR("contextualai_inference_id", value); } + + /// + /// + /// The type of the inference task that the model will perform. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI TaskType { get => P("task_type"); set => PR("task_type", value); } + + /// + /// + /// Specifies the amount of time to wait for the inference endpoint to be created. + /// + /// + public Elastic.Clients.Elasticsearch.Duration? Timeout { get => Q("timeout"); set => Q("timeout", value); } + + /// + /// + /// The chunking configuration object. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } + + /// + /// + /// The type of service supported for the specified task type. In this case, contextualai. + /// + /// + public string Service => "contextualai"; + + /// + /// + /// Settings used to install the inference model. These settings are specific to the contextualai service. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Inference.ContextualAIServiceSettings ServiceSettings { get; set; } + + /// + /// + /// Settings to configure the inference task. + /// These settings are specific to the task type you specified. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ContextualAITaskSettings? TaskSettings { get; set; } +} + +/// +/// +/// Create an Contextual AI inference endpoint. +/// +/// +/// Create an inference endpoint to perform an inference task with the contexualai service. +/// +/// +/// To review the available rerank models, refer to https://docs.contextual.ai/api-reference/rerank/rerank#body-model. +/// +/// +public readonly partial struct PutContextualaiRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PutContextualaiRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequest instance) + { + Instance = instance; + } + + public PutContextualaiRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI taskType, Elastic.Clients.Elasticsearch.Id contextualaiInferenceId) + { +#pragma warning disable CS0618 + Instance = new Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequest(taskType, contextualaiInferenceId); +#pragma warning restore CS0618 + } + + [System.Obsolete("The use of the parameterless constructor is not permitted for this type.")] + public PutContextualaiRequestDescriptor() + { + throw new System.InvalidOperationException("The use of the parameterless constructor is not permitted for this type."); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor(Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequest instance) => new Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequest(Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The unique identifier of the inference endpoint. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor ContextualaiInferenceId(Elastic.Clients.Elasticsearch.Id value) + { + Instance.ContextualaiInferenceId = value; + return this; + } + + /// + /// + /// The type of the inference task that the model will perform. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor TaskType(Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI value) + { + Instance.TaskType = value; + return this; + } + + /// + /// + /// Specifies the amount of time to wait for the inference endpoint to be created. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor Timeout(Elastic.Clients.Elasticsearch.Duration? value) + { + Instance.Timeout = value; + return this; + } + + /// + /// + /// The chunking configuration object. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor ChunkingSettings(Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? value) + { + Instance.ChunkingSettings = value; + return this; + } + + /// + /// + /// The chunking configuration object. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor ChunkingSettings() + { + Instance.ChunkingSettings = Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettingsDescriptor.Build(null); + return this; + } + + /// + /// + /// The chunking configuration object. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor ChunkingSettings(System.Action? action) + { + Instance.ChunkingSettings = Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettingsDescriptor.Build(action); + return this; + } + + /// + /// + /// Settings used to install the inference model. These settings are specific to the contextualai service. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor ServiceSettings(Elastic.Clients.Elasticsearch.Inference.ContextualAIServiceSettings value) + { + Instance.ServiceSettings = value; + return this; + } + + /// + /// + /// Settings used to install the inference model. These settings are specific to the contextualai service. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor ServiceSettings(System.Action action) + { + Instance.ServiceSettings = Elastic.Clients.Elasticsearch.Inference.ContextualAiServiceSettingsDescriptor.Build(action); + return this; + } + + /// + /// + /// Settings to configure the inference task. + /// These settings are specific to the task type you specified. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor TaskSettings(Elastic.Clients.Elasticsearch.Inference.ContextualAITaskSettings? value) + { + Instance.TaskSettings = value; + return this; + } + + /// + /// + /// Settings to configure the inference task. + /// These settings are specific to the task type you specified. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor TaskSettings() + { + Instance.TaskSettings = Elastic.Clients.Elasticsearch.Inference.ContextualAiTaskSettingsDescriptor.Build(null); + return this; + } + + /// + /// + /// Settings to configure the inference task. + /// These settings are specific to the task type you specified. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor TaskSettings(System.Action? action) + { + Instance.TaskSettings = Elastic.Clients.Elasticsearch.Inference.ContextualAiTaskSettingsDescriptor.Build(action); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequest Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor(new Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.Converters.g.cs new file mode 100644 index 00000000000..b654de13264 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.Converters.g.cs @@ -0,0 +1,108 @@ +// 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 PutContextualaiResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); + private static readonly System.Text.Json.JsonEncodedText PropService = System.Text.Json.JsonEncodedText.Encode("service"); + private static readonly System.Text.Json.JsonEncodedText PropServiceSettings = System.Text.Json.JsonEncodedText.Encode("service_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTaskType = System.Text.Json.JsonEncodedText.Encode("task_type"); + + public override Elastic.Clients.Elasticsearch.Inference.PutContextualaiResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkingSettings = default; + LocalJsonValue propInferenceId = default; + LocalJsonValue propService = default; + LocalJsonValue propServiceSettings = default; + LocalJsonValue propTaskSettings = default; + LocalJsonValue propTaskType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkingSettings.TryReadProperty(ref reader, options, PropChunkingSettings, null)) + { + continue; + } + + if (propInferenceId.TryReadProperty(ref reader, options, PropInferenceId, null)) + { + continue; + } + + if (propService.TryReadProperty(ref reader, options, PropService, null)) + { + continue; + } + + if (propServiceSettings.TryReadProperty(ref reader, options, PropServiceSettings, static object (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker))!)) + { + continue; + } + + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) + { + continue; + } + + if (propTaskType.TryReadProperty(ref reader, options, PropTaskType, 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.PutContextualaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkingSettings = propChunkingSettings.Value, + InferenceId = propInferenceId.Value, + Service = propService.Value, + ServiceSettings = propServiceSettings.Value, + TaskSettings = propTaskSettings.Value, + TaskType = propTaskType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.PutContextualaiResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); + writer.WriteProperty(options, PropService, value.Service, null, null); + writer.WriteProperty(options, PropServiceSettings, value.ServiceSettings, 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, PropTaskSettings, value.TaskSettings, 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, PropTaskType, value.TaskType, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.g.cs new file mode 100644 index 00000000000..1a32738e990 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/PutContextualaiResponse.g.cs @@ -0,0 +1,97 @@ +// 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.PutContextualaiResponseConverter))] +public sealed partial class PutContextualaiResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public PutContextualaiResponse() + { + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal PutContextualaiResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Chunking configuration object + /// + /// + public Elastic.Clients.Elasticsearch.Inference.InferenceChunkingSettings? ChunkingSettings { get; set; } + + /// + /// + /// The inference Id + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + string InferenceId { get; set; } + + /// + /// + /// The service type + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + string Service { get; set; } + + /// + /// + /// Settings specific to the service + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + object ServiceSettings { get; set; } + + /// + /// + /// Task settings specific to the service and task type + /// + /// + public object? TaskSettings { get; set; } + + /// + /// + /// The task type + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI TaskType { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.Converters.g.cs index 15bab6f8532..e0534579965 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.Converters.g.cs @@ -27,17 +27,21 @@ public sealed partial class RerankRequestConverter : System.Text.Json.Serializat { private static readonly System.Text.Json.JsonEncodedText PropInput = System.Text.Json.JsonEncodedText.Encode("input"); private static readonly System.Text.Json.JsonEncodedText PropQuery = System.Text.Json.JsonEncodedText.Encode("query"); + private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); private static readonly System.Text.Json.JsonEncodedText PropTaskSettings = System.Text.Json.JsonEncodedText.Encode("task_settings"); + private static readonly System.Text.Json.JsonEncodedText PropTopN = System.Text.Json.JsonEncodedText.Encode("top_n"); public override Elastic.Clients.Elasticsearch.Inference.RerankRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue> propInput = default; LocalJsonValue propQuery = default; + LocalJsonValue propReturnDocuments = default; LocalJsonValue propTaskSettings = default; + LocalJsonValue propTopN = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { - if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadSingleOrManyCollectionValue(o, null)!)) + if (propInput.TryReadProperty(ref reader, options, PropInput, static System.Collections.Generic.ICollection (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadCollectionValue(o, null)!)) { continue; } @@ -47,11 +51,21 @@ public override Elastic.Clients.Elasticsearch.Inference.RerankRequest Read(ref S continue; } + if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propTaskSettings.TryReadProperty(ref reader, options, PropTaskSettings, static object? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))) { continue; } + if (propTopN.TryReadProperty(ref reader, options, PropTopN, static int? (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(); @@ -66,16 +80,20 @@ public override Elastic.Clients.Elasticsearch.Inference.RerankRequest Read(ref S { Input = propInput.Value, Query = propQuery.Value, - TaskSettings = propTaskSettings.Value + ReturnDocuments = propReturnDocuments.Value, + TaskSettings = propTaskSettings.Value, + TopN = propTopN.Value }; } public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.RerankRequest value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); - writer.WriteProperty(options, PropInput, value.Input, 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, PropInput, value.Input, 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.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropTaskSettings, value.TaskSettings, 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, PropTopN, value.TopN, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.g.cs index edbf89430f9..801b5dd3186 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/RerankRequest.g.cs @@ -92,12 +92,7 @@ internal RerankRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// /// - /// The text on which you want to perform the inference task. - /// It can be a single string or an array. - /// - /// - /// info - /// Inference endpoints for the completion task type currently only support a single string as input. + /// The documents to rank. /// /// public @@ -117,6 +112,13 @@ internal RerankRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct #endif string Query { get; set; } + /// + /// + /// Include the document text in the response. + /// + /// + public bool? ReturnDocuments { get; set; } + /// /// /// Task settings for the individual inference request. @@ -124,6 +126,13 @@ internal RerankRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// /// public object? TaskSettings { get; set; } + + /// + /// + /// Limit the response to the top N documents. + /// + /// + public int? TopN { get; set; } } /// @@ -181,12 +190,7 @@ public Elastic.Clients.Elasticsearch.Inference.RerankRequestDescriptor Timeout(E /// /// - /// The text on which you want to perform the inference task. - /// It can be a single string or an array. - /// - /// - /// info - /// Inference endpoints for the completion task type currently only support a single string as input. + /// The documents to rank. /// /// public Elastic.Clients.Elasticsearch.Inference.RerankRequestDescriptor Input(System.Collections.Generic.ICollection value) @@ -197,12 +201,7 @@ public Elastic.Clients.Elasticsearch.Inference.RerankRequestDescriptor Input(Sys /// /// - /// The text on which you want to perform the inference task. - /// It can be a single string or an array. - /// - /// - /// info - /// Inference endpoints for the completion task type currently only support a single string as input. + /// The documents to rank. /// /// public Elastic.Clients.Elasticsearch.Inference.RerankRequestDescriptor Input(params string[] values) @@ -222,6 +221,17 @@ public Elastic.Clients.Elasticsearch.Inference.RerankRequestDescriptor Query(str return this; } + /// + /// + /// Include the document text in the response. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.RerankRequestDescriptor ReturnDocuments(bool? value = true) + { + Instance.ReturnDocuments = value; + return this; + } + /// /// /// Task settings for the individual inference request. @@ -234,6 +244,17 @@ public Elastic.Clients.Elasticsearch.Inference.RerankRequestDescriptor TaskSetti return this; } + /// + /// + /// Limit the response to the top N documents. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.RerankRequestDescriptor TopN(int? value) + { + Instance.TopN = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.Inference.RerankRequest Build(System.Action action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/StreamCompletionRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/StreamCompletionRequest.g.cs index 277404841e9..ee3061b3c53 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/StreamCompletionRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Inference/StreamCompletionRequest.g.cs @@ -35,7 +35,7 @@ public sealed partial class StreamCompletionRequestParameters : Elastic.Transpor /// /// -/// Perform streaming inference. +/// Perform streaming completion inference on the service /// Get real-time responses for completion tasks by delivering answers incrementally, reducing response times during computation. /// This API works only with the completion task type. /// @@ -122,7 +122,7 @@ internal StreamCompletionRequest(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// -/// Perform streaming inference. +/// Perform streaming completion inference on the service /// Get real-time responses for completion tasks by delivering answers incrementally, reducing response times during computation. /// This API works only with the completion task type. /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.g.cs index 7938e5270e3..c227d18b1b4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Nodes/NodesStatsRequest.g.cs @@ -69,7 +69,7 @@ public sealed partial class NodesStatsRequestParameters : Elastic.Transport.Requ /// /// - /// Indicates whether statistics are aggregated at the cluster, index, or shard level. + /// Indicates whether statistics are aggregated at the node, indices, or shards level. /// /// public Elastic.Clients.Elasticsearch.NodeStatsLevel? Level { get => Q("level"); set => Q("level", value); } @@ -207,7 +207,7 @@ internal NodesStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConst /// /// - /// Indicates whether statistics are aggregated at the cluster, index, or shard level. + /// Indicates whether statistics are aggregated at the node, indices, or shards level. /// /// public Elastic.Clients.Elasticsearch.NodeStatsLevel? Level { get => Q("level"); set => Q("level", value); } @@ -411,7 +411,7 @@ public Elastic.Clients.Elasticsearch.Nodes.NodesStatsRequestDescriptor IncludeUn /// /// - /// Indicates whether statistics are aggregated at the cluster, index, or shard level. + /// Indicates whether statistics are aggregated at the node, indices, or shards level. /// /// public Elastic.Clients.Elasticsearch.Nodes.NodesStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.NodeStatsLevel? value) @@ -693,7 +693,7 @@ public Elastic.Clients.Elasticsearch.Nodes.NodesStatsRequestDescriptor /// - /// Indicates whether statistics are aggregated at the cluster, index, or shard level. + /// Indicates whether statistics are aggregated at the node, indices, or shards level. /// /// public Elastic.Clients.Elasticsearch.Nodes.NodesStatsRequestDescriptor Level(Elastic.Clients.Elasticsearch.NodeStatsLevel? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.g.cs deleted file mode 100644 index ce03970d628..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.g.cs +++ /dev/null @@ -1,140 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Project; - -public sealed partial class TagsRequestParameters : Elastic.Transport.RequestParameters -{ -} - -/// -/// -/// Return tags defined for the project -/// -/// -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.TagsRequestConverter))] -public sealed partial class TagsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest -{ -#if NET7_0_OR_GREATER - public TagsRequest() - { - } -#endif -#if !NET7_0_OR_GREATER - public TagsRequest() - { - } -#endif - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal TagsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) - { - _ = sentinel; - } - - internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.ProjectTags; - - protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET; - - internal override bool SupportsBody => false; - - internal override string OperationName => "project.tags"; -} - -/// -/// -/// Return tags defined for the project -/// -/// -public readonly partial struct TagsRequestDescriptor -{ - internal Elastic.Clients.Elasticsearch.Project.TagsRequest Instance { get; init; } - - [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public TagsRequestDescriptor(Elastic.Clients.Elasticsearch.Project.TagsRequest instance) - { - Instance = instance; - } - - public TagsRequestDescriptor() - { - Instance = new Elastic.Clients.Elasticsearch.Project.TagsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); - } - - public static explicit operator Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor(Elastic.Clients.Elasticsearch.Project.TagsRequest instance) => new Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor(instance); - public static implicit operator Elastic.Clients.Elasticsearch.Project.TagsRequest(Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor descriptor) => descriptor.Instance; - - [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.Project.TagsRequest Build(System.Action? action) - { - if (action is null) - { - return new Elastic.Clients.Elasticsearch.Project.TagsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); - } - - var builder = new Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor(new Elastic.Clients.Elasticsearch.Project.TagsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); - action.Invoke(builder); - return builder.Instance; - } - - public Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor ErrorTrace(bool? value) - { - Instance.ErrorTrace = value; - return this; - } - - public Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor FilterPath(params string[]? value) - { - Instance.FilterPath = value; - return this; - } - - public Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor Human(bool? value) - { - Instance.Human = value; - return this; - } - - public Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor Pretty(bool? value) - { - Instance.Pretty = value; - return this; - } - - public Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor SourceQueryString(string? value) - { - Instance.SourceQueryString = value; - return this; - } - - public Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) - { - Instance.RequestConfiguration = value; - return this; - } - - public Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor RequestConfiguration(System.Func? configurationSelector) - { - Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; - return this; - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsResponse.Converters.g.cs deleted file mode 100644 index 07cab4a39b2..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsResponse.Converters.g.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Project.Json; - -public sealed partial class TagsResponseConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropLinkedProjects = System.Text.Json.JsonEncodedText.Encode("linked_projects"); - private static readonly System.Text.Json.JsonEncodedText PropOrigin = System.Text.Json.JsonEncodedText.Encode("origin"); - - public override Elastic.Clients.Elasticsearch.Project.TagsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue?> propLinkedProjects = default; - LocalJsonValue> propOrigin = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propLinkedProjects.TryReadProperty(ref reader, options, PropLinkedProjects, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) - { - continue; - } - - if (propOrigin.TryReadProperty(ref reader, options, PropOrigin, static System.Collections.Generic.KeyValuePair (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadKeyValuePairValue(o, null, 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.Project.TagsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - LinkedProjects = propLinkedProjects.Value, - Origin = propOrigin.Value - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.TagsResponse value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropLinkedProjects, value.LinkedProjects, 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, PropOrigin, value.Origin, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.KeyValuePair v) => w.WriteKeyValuePairValue(o, v, null, null)); - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.Converters.g.cs index af8a58f4051..d51bbea7176 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.Converters.g.cs @@ -29,7 +29,6 @@ public sealed partial class ReindexRequestConverter : System.Text.Json.Serializa private static readonly System.Text.Json.JsonEncodedText PropDest = System.Text.Json.JsonEncodedText.Encode("dest"); private static readonly System.Text.Json.JsonEncodedText PropMaxDocs = System.Text.Json.JsonEncodedText.Encode("max_docs"); private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); - private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("source"); public override Elastic.Clients.Elasticsearch.ReindexRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) @@ -39,7 +38,6 @@ public override Elastic.Clients.Elasticsearch.ReindexRequest Read(ref System.Tex LocalJsonValue propDest = default; LocalJsonValue propMaxDocs = default; LocalJsonValue propScript = default; - LocalJsonValue propSize = default; LocalJsonValue propSource = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { @@ -63,11 +61,6 @@ public override Elastic.Clients.Elasticsearch.ReindexRequest Read(ref System.Tex continue; } - if (propSize.TryReadProperty(ref reader, options, PropSize, static long? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) - { - continue; - } - if (propSource.TryReadProperty(ref reader, options, PropSource, null)) { continue; @@ -89,7 +82,6 @@ public override Elastic.Clients.Elasticsearch.ReindexRequest Read(ref System.Tex Dest = propDest.Value, MaxDocs = propMaxDocs.Value, Script = propScript.Value, - Size = propSize.Value, Source = propSource.Value }; } @@ -101,7 +93,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropDest, value.Dest, null, null); writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropScript, value.Script, null, null); - writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropSource, value.Source, null, null); writer.WriteEndObject(); } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.g.cs index b45729811e8..0128a7b5bbb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/ReindexRequest.g.cs @@ -334,7 +334,6 @@ internal ReindexRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc /// /// public Elastic.Clients.Elasticsearch.Script? Script { get; set; } - public long? Size { get; set; } /// /// @@ -668,12 +667,6 @@ public Elastic.Clients.Elasticsearch.ReindexRequestDescriptor Script(System.Acti return this; } - public Elastic.Clients.Elasticsearch.ReindexRequestDescriptor Size(long? value) - { - Instance.Size = value; - return this; - } - /// /// /// The source you are copying from. @@ -1078,12 +1071,6 @@ public Elastic.Clients.Elasticsearch.ReindexRequestDescriptor Script( return this; } - public Elastic.Clients.Elasticsearch.ReindexRequestDescriptor Size(long? value) - { - Instance.Size = value; - return this; - } - /// /// /// The source you are copying from. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs index 7c221d5b0ef..b94e3ae9746 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/SearchRequest.g.cs @@ -78,7 +78,7 @@ public sealed partial class SearchRequestParameters : Elastic.Transport.RequestP /// /// - /// The default operator for the query string query: AND or OR. + /// The default operator for the query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -457,7 +457,7 @@ internal SearchRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct /// /// - /// The default operator for the query string query: AND or OR. + /// The default operator for the query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -1134,7 +1134,7 @@ public Elastic.Clients.Elasticsearch.SearchRequestDescriptor CcsMinimizeRoundtri /// /// - /// The default operator for the query string query: AND or OR. + /// The default operator for the query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -2889,7 +2889,7 @@ public Elastic.Clients.Elasticsearch.SearchRequestDescriptor CcsMinim /// /// - /// The default operator for the query string query: AND or OR. + /// The default operator for the query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.Converters.g.cs index 91f91898dbd..f59b1a2e805 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.Converters.g.cs @@ -26,6 +26,7 @@ namespace Elastic.Clients.Elasticsearch.Security.Json; public sealed partial class CreateCrossClusterApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropAccess = System.Text.Json.JsonEncodedText.Encode("access"); + private static readonly System.Text.Json.JsonEncodedText PropCertificateIdentity = System.Text.Json.JsonEncodedText.Encode("certificate_identity"); private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); private static readonly System.Text.Json.JsonEncodedText PropName = System.Text.Json.JsonEncodedText.Encode("name"); @@ -34,6 +35,7 @@ public override Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyR { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propAccess = default; + LocalJsonValue propCertificateIdentity = default; LocalJsonValue propExpiration = default; LocalJsonValue?> propMetadata = default; LocalJsonValue propName = default; @@ -44,6 +46,11 @@ public override Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyR continue; } + if (propCertificateIdentity.TryReadProperty(ref reader, options, PropCertificateIdentity, null)) + { + continue; + } + if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) { continue; @@ -72,6 +79,7 @@ public override Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyR return new Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Access = propAccess.Value, + CertificateIdentity = propCertificateIdentity.Value, Expiration = propExpiration.Value, Metadata = propMetadata.Value, Name = propName.Value @@ -82,6 +90,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropAccess, value.Access, null, null); + writer.WriteProperty(options, PropCertificateIdentity, value.CertificateIdentity, null, null); writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); writer.WriteProperty(options, PropMetadata, value.Metadata, 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, PropName, value.Name, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.g.cs index 28cf2e516af..f4c81b3c4b1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/CreateCrossClusterApiKeyRequest.g.cs @@ -106,6 +106,15 @@ internal CreateCrossClusterApiKeyRequest(Elastic.Clients.Elasticsearch.Serializa #endif Elastic.Clients.Elasticsearch.Security.Access Access { get; set; } + /// + /// + /// The certificate identity to associate with this API key. + /// This field is used to restrict the API key to connections authenticated by a specific TLS certificate. + /// The value should match the certificate's distinguished name (DN) pattern. + /// + /// + public string? CertificateIdentity { get; set; } + /// /// /// Expiration time for the API key. @@ -249,6 +258,19 @@ public Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyRequestDes return this; } + /// + /// + /// The certificate identity to associate with this API key. + /// This field is used to restrict the API key to connections authenticated by a specific TLS certificate. + /// The value should match the certificate's distinguished name (DN) pattern. + /// + /// + public Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyRequestDescriptor CertificateIdentity(string? value) + { + Instance.CertificateIdentity = value; + return this; + } + /// /// /// Expiration time for the API key. @@ -466,6 +488,19 @@ public Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyRequestDes return this; } + /// + /// + /// The certificate identity to associate with this API key. + /// This field is used to restrict the API key to connections authenticated by a specific TLS certificate. + /// The value should match the certificate's distinguished name (DN) pattern. + /// + /// + public Elastic.Clients.Elasticsearch.Security.CreateCrossClusterApiKeyRequestDescriptor CertificateIdentity(string? value) + { + Instance.CertificateIdentity = value; + return this; + } + /// /// /// Expiration time for the API key. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetStatsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetStatsRequest.Converters.g.cs new file mode 100644 index 00000000000..943c0850312 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetStatsRequest.Converters.g.cs @@ -0,0 +1,53 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Security.Json; + +public sealed partial class GetStatsRequestConverter : System.Text.Json.Serialization.JsonConverter +{ + public override Elastic.Clients.Elasticsearch.Security.GetStatsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) + { + reader.SafeSkip(); + continue; + } + + throw new System.Text.Json.JsonException($"Unknown JSON property '{reader.GetString()}' for type '{typeToConvert.Name}'."); + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Security.GetStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetStatsRequest value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetStatsRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetStatsRequest.g.cs new file mode 100644 index 00000000000..caabbeef7ab --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetStatsRequest.g.cs @@ -0,0 +1,146 @@ +// 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; + +public sealed partial class GetStatsRequestParameters : Elastic.Transport.RequestParameters +{ +} + +/// +/// +/// Get security stats. +/// +/// +/// Gather security usage statistics from all node(s) within the cluster. +/// +/// +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetStatsRequestConverter))] +public sealed partial class GetStatsRequest : Elastic.Clients.Elasticsearch.Requests.PlainRequest +{ +#if NET7_0_OR_GREATER + public GetStatsRequest() + { + } +#endif +#if !NET7_0_OR_GREATER + public GetStatsRequest() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal GetStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + internal override Elastic.Clients.Elasticsearch.Requests.ApiUrls ApiUrls => Elastic.Clients.Elasticsearch.Requests.ApiUrlLookup.SecurityGetStats; + + protected override Elastic.Transport.HttpMethod StaticHttpMethod => Elastic.Transport.HttpMethod.GET; + + internal override bool SupportsBody => false; + + internal override string OperationName => "security.get_stats"; +} + +/// +/// +/// Get security stats. +/// +/// +/// Gather security usage statistics from all node(s) within the cluster. +/// +/// +public readonly partial struct GetStatsRequestDescriptor +{ + internal Elastic.Clients.Elasticsearch.Security.GetStatsRequest Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public GetStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Security.GetStatsRequest instance) + { + Instance = instance; + } + + public GetStatsRequestDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Security.GetStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor(Elastic.Clients.Elasticsearch.Security.GetStatsRequest instance) => new Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Security.GetStatsRequest(Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor descriptor) => descriptor.Instance; + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Security.GetStatsRequest Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Security.GetStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor(new Elastic.Clients.Elasticsearch.Security.GetStatsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } + + public Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor ErrorTrace(bool? value) + { + Instance.ErrorTrace = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor FilterPath(params string[]? value) + { + Instance.FilterPath = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor Human(bool? value) + { + Instance.Human = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor Pretty(bool? value) + { + Instance.Pretty = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor SourceQueryString(string? value) + { + Instance.SourceQueryString = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor RequestConfiguration(Elastic.Transport.IRequestConfiguration? value) + { + Instance.RequestConfiguration = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor RequestConfiguration(System.Func? configurationSelector) + { + Instance.RequestConfiguration = configurationSelector.Invoke(Instance.RequestConfiguration is null ? new Elastic.Transport.RequestConfigurationDescriptor() : new Elastic.Transport.RequestConfigurationDescriptor(Instance.RequestConfiguration)) ?? Instance.RequestConfiguration; + return this; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetStatsResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetStatsResponse.Converters.g.cs new file mode 100644 index 00000000000..f5df85a6d8b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetStatsResponse.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 GetStatsResponseConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropNodes = System.Text.Json.JsonEncodedText.Encode("nodes"); + + public override Elastic.Clients.Elasticsearch.Security.GetStatsResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue> propNodes = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propNodes.TryReadProperty(ref reader, options, PropNodes, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, 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.GetStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Nodes = propNodes.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.GetStatsResponse value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropNodes, value.Nodes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetStatsResponse.g.cs similarity index 70% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsResponse.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetStatsResponse.g.cs index 07c91d64d20..099cfc9904c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/GetStatsResponse.g.cs @@ -21,26 +21,30 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Project; +namespace Elastic.Clients.Elasticsearch.Security; -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.TagsResponseConverter))] -public sealed partial class TagsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Security.Json.GetStatsResponseConverter))] +public sealed partial class GetStatsResponse : Elastic.Transport.Products.Elasticsearch.ElasticsearchResponse { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public TagsResponse() + public GetStatsResponse() { } [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal TagsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal GetStatsResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } - public System.Collections.Generic.IReadOnlyDictionary? LinkedProjects { get; set; } + /// + /// + /// A map of node IDs to security statistics for that node. + /// + /// public #if NET7_0_OR_GREATER -required + required #endif -System.Collections.Generic.KeyValuePair Origin { get; set; } + System.Collections.Generic.IReadOnlyDictionary Nodes { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.Converters.g.cs index 5ee34ab4f35..2b49cb6d701 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.Converters.g.cs @@ -26,6 +26,7 @@ namespace Elastic.Clients.Elasticsearch.Security.Json; public sealed partial class UpdateCrossClusterApiKeyRequestConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropAccess = System.Text.Json.JsonEncodedText.Encode("access"); + private static readonly System.Text.Json.JsonEncodedText PropCertificateIdentity = System.Text.Json.JsonEncodedText.Encode("certificate_identity"); private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); private static readonly System.Text.Json.JsonEncodedText PropMetadata = System.Text.Json.JsonEncodedText.Encode("metadata"); @@ -33,6 +34,7 @@ public override Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyR { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propAccess = default; + LocalJsonValue propCertificateIdentity = default; LocalJsonValue propExpiration = default; LocalJsonValue?> propMetadata = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -42,6 +44,11 @@ public override Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyR continue; } + if (propCertificateIdentity.TryReadProperty(ref reader, options, PropCertificateIdentity, null)) + { + continue; + } + if (propExpiration.TryReadProperty(ref reader, options, PropExpiration, null)) { continue; @@ -65,6 +72,7 @@ public override Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyR return new Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Access = propAccess.Value, + CertificateIdentity = propCertificateIdentity.Value, Expiration = propExpiration.Value, Metadata = propMetadata.Value }; @@ -74,6 +82,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropAccess, value.Access, null, null); + writer.WriteProperty(options, PropCertificateIdentity, value.CertificateIdentity, null, null); writer.WriteProperty(options, PropExpiration, value.Expiration, null, null); writer.WriteProperty(options, PropMetadata, value.Metadata, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, object v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SourceMarker)))); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.g.cs index cf7beab0e33..54609d87f83 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Security/UpdateCrossClusterApiKeyRequest.g.cs @@ -115,6 +115,18 @@ internal UpdateCrossClusterApiKeyRequest(Elastic.Clients.Elasticsearch.Serializa #endif Elastic.Clients.Elasticsearch.Security.Access Access { get; set; } + /// + /// + /// The certificate identity to associate with this API key. + /// This field is used to restrict the API key to connections authenticated by a specific TLS certificate. + /// The value should match the certificate's distinguished name (DN) pattern. + /// When specified, this fully replaces any previously assigned certificate identity. + /// To clear an existing certificate identity, explicitly set this field to null. + /// When omitted, the existing certificate identity remains unchanged. + /// + /// + public string? CertificateIdentity { get; set; } + /// /// /// The expiration time for the API key. @@ -257,6 +269,22 @@ public Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyRequestDes return this; } + /// + /// + /// The certificate identity to associate with this API key. + /// This field is used to restrict the API key to connections authenticated by a specific TLS certificate. + /// The value should match the certificate's distinguished name (DN) pattern. + /// When specified, this fully replaces any previously assigned certificate identity. + /// To clear an existing certificate identity, explicitly set this field to null. + /// When omitted, the existing certificate identity remains unchanged. + /// + /// + public Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyRequestDescriptor CertificateIdentity(string? value) + { + Instance.CertificateIdentity = value; + return this; + } + /// /// /// The expiration time for the API key. @@ -478,6 +506,22 @@ public Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyRequestDes return this; } + /// + /// + /// The certificate identity to associate with this API key. + /// This field is used to restrict the API key to connections authenticated by a specific TLS certificate. + /// The value should match the certificate's distinguished name (DN) pattern. + /// When specified, this fully replaces any previously assigned certificate identity. + /// To clear an existing certificate identity, explicitly set this field to null. + /// When omitted, the existing certificate identity remains unchanged. + /// + /// + public Elastic.Clients.Elasticsearch.Security.UpdateCrossClusterApiKeyRequestDescriptor CertificateIdentity(string? value) + { + Instance.CertificateIdentity = value; + return this; + } + /// /// /// The expiration time for the API key. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.Converters.g.cs index 91f44975881..c611d813c1a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.Converters.g.cs @@ -31,6 +31,7 @@ public sealed partial class TranslateResponseConverter : System.Text.Json.Serial private static readonly System.Text.Json.JsonEncodedText PropSize = System.Text.Json.JsonEncodedText.Encode("size"); private static readonly System.Text.Json.JsonEncodedText PropSort = System.Text.Json.JsonEncodedText.Encode("sort"); private static readonly System.Text.Json.JsonEncodedText PropSource = System.Text.Json.JsonEncodedText.Encode("_source"); + private static readonly System.Text.Json.JsonEncodedText PropTrackTotalHits = System.Text.Json.JsonEncodedText.Encode("track_total_hits"); public override Elastic.Clients.Elasticsearch.Sql.TranslateResponse Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -41,6 +42,7 @@ public override Elastic.Clients.Elasticsearch.Sql.TranslateResponse Read(ref Sys LocalJsonValue propSize = default; LocalJsonValue?> propSort = default; LocalJsonValue propSource = default; + LocalJsonValue propTrackTotalHits = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propAggregations.TryReadProperty(ref reader, options, PropAggregations, static System.Collections.Generic.IReadOnlyDictionary? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null))) @@ -73,6 +75,11 @@ public override Elastic.Clients.Elasticsearch.Sql.TranslateResponse Read(ref Sys continue; } + if (propTrackTotalHits.TryReadProperty(ref reader, options, PropTrackTotalHits, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -90,7 +97,8 @@ public override Elastic.Clients.Elasticsearch.Sql.TranslateResponse Read(ref Sys Query = propQuery.Value, Size = propSize.Value, Sort = propSort.Value, - Source = propSource.Value + Source = propSource.Value, + TrackTotalHits = propTrackTotalHits.Value }; } @@ -103,6 +111,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropSize, value.Size, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropSort, value.Sort, 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, PropSource, value.Source, null, null); + writer.WriteProperty(options, PropTrackTotalHits, value.TrackTotalHits, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs index 2da5d5dfafd..0e0c13697b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Sql/TranslateResponse.g.cs @@ -43,4 +43,5 @@ internal TranslateResponse(Elastic.Clients.Elasticsearch.Serialization.JsonConst public long? Size { get; set; } public System.Collections.Generic.ICollection? Sort { get; set; } public Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? Source { get; set; } + public Elastic.Clients.Elasticsearch.Core.Search.TrackHits? TrackTotalHits { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/StreamsStatusRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/StreamsStatusRequest.g.cs index 04826b15969..b300cb146cb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/StreamsStatusRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/Streams/StreamsStatusRequest.g.cs @@ -30,7 +30,7 @@ public sealed partial class StreamsStatusRequestParameters : Elastic.Transport.R /// Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. /// /// - public Elastic.Clients.Elasticsearch.TimeUnit? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } /// @@ -73,7 +73,7 @@ internal StreamsStatusRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. /// /// - public Elastic.Clients.Elasticsearch.TimeUnit? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } + public Elastic.Clients.Elasticsearch.Duration? MasterTimeout { get => Q("master_timeout"); set => Q("master_timeout", value); } } /// @@ -107,7 +107,7 @@ public StreamsStatusRequestDescriptor() /// Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. /// /// - public Elastic.Clients.Elasticsearch.Streams.StreamsStatusRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.TimeUnit? value) + public Elastic.Clients.Elasticsearch.Streams.StreamsStatusRequestDescriptor MasterTimeout(Elastic.Clients.Elasticsearch.Duration? value) { Instance.MasterTimeout = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.g.cs index 56223c61a21..90fe7a349de 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Api/UpdateByQueryRequest.g.cs @@ -52,7 +52,7 @@ public sealed partial class UpdateByQueryRequestParameters : Elastic.Transport.R /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -494,7 +494,7 @@ internal UpdateByQueryRequest(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -981,7 +981,7 @@ public Elastic.Clients.Elasticsearch.UpdateByQueryRequestDescriptor AnalyzeWildc /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// @@ -1753,7 +1753,7 @@ public Elastic.Clients.Elasticsearch.UpdateByQueryRequestDescriptor A /// /// - /// The default operator for query string query: AND or OR. + /// The default operator for query string query: and or or. /// This parameter can be used only when the q query string parameter is specified. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs index fb9f50d89f6..2856496bf39 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Inference.g.cs @@ -852,6 +852,52 @@ public virtual Elastic.Clients.Elasticsearch.Inference.PutCohereResponse PutCohe return DoRequestAsync(request, cancellationToken); } + public virtual Elastic.Clients.Elasticsearch.Inference.PutContextualaiResponse PutContextualai(Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Inference.PutContextualaiResponse PutContextualai(Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI taskType, Elastic.Clients.Elasticsearch.Id contextualaiInferenceId) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor(taskType, contextualaiInferenceId); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Inference.PutContextualaiResponse PutContextualai(Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI taskType, Elastic.Clients.Elasticsearch.Id contextualaiInferenceId, System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor(taskType, contextualaiInferenceId); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task PutContextualaiAsync(Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task PutContextualaiAsync(Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI taskType, Elastic.Clients.Elasticsearch.Id contextualaiInferenceId, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor(taskType, contextualaiInferenceId); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task PutContextualaiAsync(Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI taskType, Elastic.Clients.Elasticsearch.Id contextualaiInferenceId, System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.PutContextualaiRequestDescriptor(taskType, contextualaiInferenceId); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual Elastic.Clients.Elasticsearch.Inference.PutCustomResponse PutCustom(Elastic.Clients.Elasticsearch.Inference.PutCustomRequest request) { request.BeforeRequest(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Project.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Project.g.cs deleted file mode 100644 index 6ff5cf2367f..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Project.g.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Project; - -public partial class ProjectNamespacedClient : Elastic.Clients.Elasticsearch.NamespacedClientProxy -{ - /// - /// - /// Initializes a new instance of the class for mocking. - /// - /// - protected ProjectNamespacedClient() : base() - { - } - - internal ProjectNamespacedClient(Elastic.Clients.Elasticsearch.ElasticsearchClient client) : base(client) - { - } - - public virtual Elastic.Clients.Elasticsearch.Project.TagsResponse Tags(Elastic.Clients.Elasticsearch.Project.TagsRequest request) - { - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.Project.TagsResponse Tags() - { - var builder = new Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual Elastic.Clients.Elasticsearch.Project.TagsResponse Tags(System.Action action) - { - var builder = new Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequest(request); - } - - public virtual System.Threading.Tasks.Task TagsAsync(Elastic.Clients.Elasticsearch.Project.TagsRequest request, System.Threading.CancellationToken cancellationToken = default) - { - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task TagsAsync(System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor(); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } - - public virtual System.Threading.Tasks.Task TagsAsync(System.Action action, System.Threading.CancellationToken cancellationToken = default) - { - var builder = new Elastic.Clients.Elasticsearch.Project.TagsRequestDescriptor(); - action.Invoke(builder); - var request = builder.Instance; - request.BeforeRequest(); - return DoRequestAsync(request, cancellationToken); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Security.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Security.g.cs index 1b093b831a1..18b45fa2f1d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Security.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.Security.g.cs @@ -1866,6 +1866,52 @@ public virtual Elastic.Clients.Elasticsearch.Security.GetSecuritySettingsRespons return DoRequestAsync(request, cancellationToken); } + public virtual Elastic.Clients.Elasticsearch.Security.GetStatsResponse GetStats(Elastic.Clients.Elasticsearch.Security.GetStatsRequest request) + { + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Security.GetStatsResponse GetStats() + { + var builder = new Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor(); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual Elastic.Clients.Elasticsearch.Security.GetStatsResponse GetStats(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequest(request); + } + + public virtual System.Threading.Tasks.Task GetStatsAsync(Elastic.Clients.Elasticsearch.Security.GetStatsRequest request, System.Threading.CancellationToken cancellationToken = default) + { + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetStatsAsync(System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor(); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + + public virtual System.Threading.Tasks.Task GetStatsAsync(System.Action action, System.Threading.CancellationToken cancellationToken = default) + { + var builder = new Elastic.Clients.Elasticsearch.Security.GetStatsRequestDescriptor(); + action.Invoke(builder); + var request = builder.Instance; + request.BeforeRequest(); + return DoRequestAsync(request, cancellationToken); + } + public virtual Elastic.Clients.Elasticsearch.Security.GetTokenResponse GetToken(Elastic.Clients.Elasticsearch.Security.GetTokenRequest request) { request.BeforeRequest(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs index cd960045240..89cb5e09f45 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Client/ElasticsearchClient.g.cs @@ -41,7 +41,6 @@ public partial class ElasticsearchClient public virtual Elastic.Clients.Elasticsearch.LicenseManagement.LicenseManagementNamespacedClient LicenseManagement { get; private set; } public virtual Elastic.Clients.Elasticsearch.MachineLearning.MachineLearningNamespacedClient MachineLearning { get; private set; } public virtual Elastic.Clients.Elasticsearch.Nodes.NodesNamespacedClient Nodes { get; private set; } - public virtual Elastic.Clients.Elasticsearch.Project.ProjectNamespacedClient Project { get; private set; } public virtual Elastic.Clients.Elasticsearch.QueryRules.QueryRulesNamespacedClient QueryRules { get; private set; } public virtual Elastic.Clients.Elasticsearch.Rollup.RollupNamespacedClient Rollup { get; private set; } public virtual Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsNamespacedClient SearchableSnapshots { get; private set; } @@ -76,7 +75,6 @@ private partial void SetupNamespaces() LicenseManagement = new Elastic.Clients.Elasticsearch.LicenseManagement.LicenseManagementNamespacedClient(this); MachineLearning = new Elastic.Clients.Elasticsearch.MachineLearning.MachineLearningNamespacedClient(this); Nodes = new Elastic.Clients.Elasticsearch.Nodes.NodesNamespacedClient(this); - Project = new Elastic.Clients.Elasticsearch.Project.ProjectNamespacedClient(this); QueryRules = new Elastic.Clients.Elasticsearch.QueryRules.QueryRulesNamespacedClient(this); Rollup = new Elastic.Clients.Elasticsearch.Rollup.RollupNamespacedClient(this); SearchableSnapshots = new Elastic.Clients.Elasticsearch.SearchableSnapshots.SearchableSnapshotsNamespacedClient(this); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.Converters.g.cs index f993d2a12c8..8b4298d3fdb 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.Converters.g.cs @@ -70,6 +70,9 @@ internal static void ReadItem(ref System.Text.Json.Utf8JsonReader reader, System "boxplot" => reader.ReadValue(options, null), "bucket_metric_value" => reader.ReadValue(options, null), "cardinality" => reader.ReadValue(options, null), + "cartesian_bounds" => reader.ReadValue(options, null), + "cartesian_centroid" => reader.ReadValue(options, null), + "change_point" => reader.ReadValue(options, null), "children" => reader.ReadValue(options, null), "composite" => reader.ReadValue(options, null), "date_histogram" => reader.ReadValue(options, null), @@ -161,6 +164,15 @@ internal static void WriteItem(System.Text.Json.Utf8JsonWriter writer, System.Te case Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate v: writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate v) => w.WritePropertyName(o, v)); break; + case Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregate v) => w.WritePropertyName(o, v)); + break; + case Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregate v: + writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregate v) => w.WritePropertyName(o, v)); + break; case Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate v: writer.WriteProperty(options, key, v, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate v) => w.WritePropertyName(o, v)); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs index 2f4cb92fa5b..aad88904b48 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/AggregateDictionary.g.cs @@ -50,6 +50,9 @@ public bool TryGetAggregate(string key, [System.Diagnostics.CodeAnalysis.NotN public Elastic.Clients.Elasticsearch.Aggregations.BoxplotAggregate? GetBoxplot(string key) => TryGet(key); public Elastic.Clients.Elasticsearch.Aggregations.BucketMetricValueAggregate? GetBucketMetricValue(string key) => TryGet(key); public Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregate? GetCardinality(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregate? GetCartesianBounds(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregate? GetCartesianCentroid(string key) => TryGet(key); + public Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregate? GetChangePoint(string key) => TryGet(key); public Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregate? GetChildren(string key) => TryGet(key); public Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregate? GetComposite(string key) => TryGet(key); public Elastic.Clients.Elasticsearch.Aggregations.DateHistogramAggregate? GetDateHistogram(string key) => TryGet(key); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.Converters.g.cs index c93b97e433e..3c74354eb5d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.Converters.g.cs @@ -39,7 +39,10 @@ public sealed partial class AggregationConverter : System.Text.Json.Serializatio private static readonly System.Text.Json.JsonEncodedText VariantBucketSelector = System.Text.Json.JsonEncodedText.Encode("bucket_selector"); private static readonly System.Text.Json.JsonEncodedText VariantBucketSort = System.Text.Json.JsonEncodedText.Encode("bucket_sort"); private static readonly System.Text.Json.JsonEncodedText VariantCardinality = System.Text.Json.JsonEncodedText.Encode("cardinality"); + private static readonly System.Text.Json.JsonEncodedText VariantCartesianBounds = System.Text.Json.JsonEncodedText.Encode("cartesian_bounds"); + private static readonly System.Text.Json.JsonEncodedText VariantCartesianCentroid = System.Text.Json.JsonEncodedText.Encode("cartesian_centroid"); private static readonly System.Text.Json.JsonEncodedText VariantCategorizeText = System.Text.Json.JsonEncodedText.Encode("categorize_text"); + private static readonly System.Text.Json.JsonEncodedText VariantChangePoint = System.Text.Json.JsonEncodedText.Encode("change_point"); private static readonly System.Text.Json.JsonEncodedText VariantChildren = System.Text.Json.JsonEncodedText.Encode("children"); private static readonly System.Text.Json.JsonEncodedText VariantComposite = System.Text.Json.JsonEncodedText.Encode("composite"); private static readonly System.Text.Json.JsonEncodedText VariantCumulativeCardinality = System.Text.Json.JsonEncodedText.Encode("cumulative_cardinality"); @@ -53,6 +56,7 @@ public sealed partial class AggregationConverter : System.Text.Json.Serializatio private static readonly System.Text.Json.JsonEncodedText VariantFilter = System.Text.Json.JsonEncodedText.Encode("filter"); private static readonly System.Text.Json.JsonEncodedText VariantFilters = System.Text.Json.JsonEncodedText.Encode("filters"); private static readonly System.Text.Json.JsonEncodedText VariantFrequentItemSets = System.Text.Json.JsonEncodedText.Encode("frequent_item_sets"); + private static readonly System.Text.Json.JsonEncodedText VariantFrequentItemSets1 = System.Text.Json.JsonEncodedText.Encode("frequent_items"); private static readonly System.Text.Json.JsonEncodedText VariantGeoBounds = System.Text.Json.JsonEncodedText.Encode("geo_bounds"); private static readonly System.Text.Json.JsonEncodedText VariantGeoCentroid = System.Text.Json.JsonEncodedText.Encode("geo_centroid"); private static readonly System.Text.Json.JsonEncodedText VariantGeoDistance = System.Text.Json.JsonEncodedText.Encode("geo_distance"); @@ -213,6 +217,22 @@ public override Elastic.Clients.Elasticsearch.Aggregations.Aggregation Read(ref continue; } + if (reader.ValueTextEquals(VariantCartesianBounds)) + { + variantType = VariantCartesianBounds.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantCartesianCentroid)) + { + variantType = VariantCartesianCentroid.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + if (reader.ValueTextEquals(VariantCategorizeText)) { variantType = VariantCategorizeText.Value; @@ -221,6 +241,14 @@ public override Elastic.Clients.Elasticsearch.Aggregations.Aggregation Read(ref continue; } + if (reader.ValueTextEquals(VariantChangePoint)) + { + variantType = VariantChangePoint.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + if (reader.ValueTextEquals(VariantChildren)) { variantType = VariantChildren.Value; @@ -317,7 +345,7 @@ public override Elastic.Clients.Elasticsearch.Aggregations.Aggregation Read(ref continue; } - if (reader.ValueTextEquals(VariantFrequentItemSets)) + if (reader.ValueTextEquals(VariantFrequentItemSets) || reader.ValueTextEquals(VariantFrequentItemSets1)) { variantType = VariantFrequentItemSets.Value; reader.Read(); @@ -800,9 +828,18 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case "cardinality": writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation)value.Variant, null, null); break; + case "cartesian_bounds": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation)value.Variant, null, null); + break; + case "cartesian_centroid": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation)value.Variant, null, null); + break; case "categorize_text": writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation)value.Variant, null, null); break; + case "change_point": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation)value.Variant, null, null); + break; case "children": writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation)value.Variant, null, null); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs index 97fc65d1d6b..c08f0024d75 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Aggregation.g.cs @@ -124,6 +124,20 @@ internal Aggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor /// public Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation? Cardinality { get => GetVariant("cardinality"); set => SetVariant("cardinality", value); } + /// + /// + /// A metric aggregation that computes the spatial bounding box containing all values for a Point or Shape field. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation? CartesianBounds { get => GetVariant("cartesian_bounds"); set => SetVariant("cartesian_bounds", value); } + + /// + /// + /// A metric aggregation that computes the weighted centroid from all coordinate values for point and shape fields. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation? CartesianCentroid { get => GetVariant("cartesian_centroid"); set => SetVariant("cartesian_centroid", value); } + /// /// /// A multi-bucket aggregation that groups semi-structured text into buckets. @@ -131,6 +145,17 @@ internal Aggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor /// public Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation? CategorizeText { get => GetVariant("categorize_text"); set => SetVariant("categorize_text", value); } + /// + /// + /// A sibling pipeline that detects, spikes, dips, and change points in a metric. + /// Given a distribution of values provided by the sibling multi-bucket aggregation, + /// this aggregation indicates the bucket of any spike or dip and/or the bucket at which + /// the largest change in the distribution of values, if they are statistically significant. + /// There must be at least 22 bucketed values. Fewer than 1,000 is preferred. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation? ChangePoint { get => GetVariant("change_point"); set => SetVariant("change_point", value); } + /// /// /// A single bucket aggregation that selects child documents that have the specified type, as defined in a join field. @@ -223,7 +248,7 @@ internal Aggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor /// A bucket aggregation which finds frequent item sets, a form of association rules mining that identifies items that often occur together. /// /// - public Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation? FrequentItemSets { get => GetVariant("frequent_item_sets"); set => SetVariant("frequent_item_sets", value); } + public Elastic.Clients.Elasticsearch.Aggregations.FrequentItemSetsAggregation? FrequentItemSets { get => GetVariant(""); set => SetVariant("", value); } /// /// @@ -614,7 +639,10 @@ internal Aggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructor public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(Elastic.Clients.Elasticsearch.Aggregations.BucketSelectorAggregation value) => new Elastic.Clients.Elasticsearch.Aggregations.Aggregation { BucketSelector = value }; public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(Elastic.Clients.Elasticsearch.Aggregations.BucketSortAggregation value) => new Elastic.Clients.Elasticsearch.Aggregations.Aggregation { BucketSort = value }; public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(Elastic.Clients.Elasticsearch.Aggregations.CardinalityAggregation value) => new Elastic.Clients.Elasticsearch.Aggregations.Aggregation { Cardinality = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation value) => new Elastic.Clients.Elasticsearch.Aggregations.Aggregation { CartesianBounds = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation value) => new Elastic.Clients.Elasticsearch.Aggregations.Aggregation { CartesianCentroid = value }; public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(Elastic.Clients.Elasticsearch.Aggregations.CategorizeTextAggregation value) => new Elastic.Clients.Elasticsearch.Aggregations.Aggregation { CategorizeText = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation value) => new Elastic.Clients.Elasticsearch.Aggregations.Aggregation { ChangePoint = value }; public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(Elastic.Clients.Elasticsearch.Aggregations.ChildrenAggregation value) => new Elastic.Clients.Elasticsearch.Aggregations.Aggregation { Children = value }; public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(Elastic.Clients.Elasticsearch.Aggregations.CompositeAggregation value) => new Elastic.Clients.Elasticsearch.Aggregations.Aggregation { Composite = value }; public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.Aggregation(Elastic.Clients.Elasticsearch.Aggregations.CumulativeCardinalityAggregation value) => new Elastic.Clients.Elasticsearch.Aggregations.Aggregation { CumulativeCardinality = value }; @@ -1078,6 +1106,72 @@ public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor + /// + /// A metric aggregation that computes the spatial bounding box containing all values for a Point or Shape field. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianBounds(Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation? value) + { + Instance.CartesianBounds = value; + return this; + } + + /// + /// + /// A metric aggregation that computes the spatial bounding box containing all values for a Point or Shape field. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianBounds() + { + Instance.CartesianBounds = Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor.Build(null); + return this; + } + + /// + /// + /// A metric aggregation that computes the spatial bounding box containing all values for a Point or Shape field. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianBounds(System.Action>? action) + { + Instance.CartesianBounds = Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor.Build(action); + return this; + } + + /// + /// + /// A metric aggregation that computes the weighted centroid from all coordinate values for point and shape fields. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianCentroid(Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation? value) + { + Instance.CartesianCentroid = value; + return this; + } + + /// + /// + /// A metric aggregation that computes the weighted centroid from all coordinate values for point and shape fields. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianCentroid() + { + Instance.CartesianCentroid = Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor.Build(null); + return this; + } + + /// + /// + /// A metric aggregation that computes the weighted centroid from all coordinate values for point and shape fields. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianCentroid(System.Action>? action) + { + Instance.CartesianCentroid = Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor.Build(action); + return this; + } + /// /// /// A multi-bucket aggregation that groups semi-structured text into buckets. @@ -1100,6 +1194,51 @@ public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor + /// + /// A sibling pipeline that detects, spikes, dips, and change points in a metric. + /// Given a distribution of values provided by the sibling multi-bucket aggregation, + /// this aggregation indicates the bucket of any spike or dip and/or the bucket at which + /// the largest change in the distribution of values, if they are statistically significant. + /// There must be at least 22 bucketed values. Fewer than 1,000 is preferred. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor ChangePoint(Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation? value) + { + Instance.ChangePoint = value; + return this; + } + + /// + /// + /// A sibling pipeline that detects, spikes, dips, and change points in a metric. + /// Given a distribution of values provided by the sibling multi-bucket aggregation, + /// this aggregation indicates the bucket of any spike or dip and/or the bucket at which + /// the largest change in the distribution of values, if they are statistically significant. + /// There must be at least 22 bucketed values. Fewer than 1,000 is preferred. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor ChangePoint() + { + Instance.ChangePoint = Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregationDescriptor.Build(null); + return this; + } + + /// + /// + /// A sibling pipeline that detects, spikes, dips, and change points in a metric. + /// Given a distribution of values provided by the sibling multi-bucket aggregation, + /// this aggregation indicates the bucket of any spike or dip and/or the bucket at which + /// the largest change in the distribution of values, if they are statistically significant. + /// There must be at least 22 bucketed values. Fewer than 1,000 is preferred. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor ChangePoint(System.Action? action) + { + Instance.ChangePoint = Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregationDescriptor.Build(action); + return this; + } + /// /// /// A single bucket aggregation that selects child documents that have the specified type, as defined in a join field. @@ -3708,6 +3847,94 @@ public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor Cardinal return this; } + /// + /// + /// A metric aggregation that computes the spatial bounding box containing all values for a Point or Shape field. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianBounds(Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation? value) + { + Instance.CartesianBounds = value; + return this; + } + + /// + /// + /// A metric aggregation that computes the spatial bounding box containing all values for a Point or Shape field. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianBounds() + { + Instance.CartesianBounds = Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor.Build(null); + return this; + } + + /// + /// + /// A metric aggregation that computes the spatial bounding box containing all values for a Point or Shape field. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianBounds(System.Action? action) + { + Instance.CartesianBounds = Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor.Build(action); + return this; + } + + /// + /// + /// A metric aggregation that computes the spatial bounding box containing all values for a Point or Shape field. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianBounds(System.Action>? action) + { + Instance.CartesianBounds = Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor.Build(action); + return this; + } + + /// + /// + /// A metric aggregation that computes the weighted centroid from all coordinate values for point and shape fields. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianCentroid(Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation? value) + { + Instance.CartesianCentroid = value; + return this; + } + + /// + /// + /// A metric aggregation that computes the weighted centroid from all coordinate values for point and shape fields. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianCentroid() + { + Instance.CartesianCentroid = Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor.Build(null); + return this; + } + + /// + /// + /// A metric aggregation that computes the weighted centroid from all coordinate values for point and shape fields. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianCentroid(System.Action? action) + { + Instance.CartesianCentroid = Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor.Build(action); + return this; + } + + /// + /// + /// A metric aggregation that computes the weighted centroid from all coordinate values for point and shape fields. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor CartesianCentroid(System.Action>? action) + { + Instance.CartesianCentroid = Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor.Build(action); + return this; + } + /// /// /// A multi-bucket aggregation that groups semi-structured text into buckets. @@ -3741,6 +3968,51 @@ public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor Categori return this; } + /// + /// + /// A sibling pipeline that detects, spikes, dips, and change points in a metric. + /// Given a distribution of values provided by the sibling multi-bucket aggregation, + /// this aggregation indicates the bucket of any spike or dip and/or the bucket at which + /// the largest change in the distribution of values, if they are statistically significant. + /// There must be at least 22 bucketed values. Fewer than 1,000 is preferred. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor ChangePoint(Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation? value) + { + Instance.ChangePoint = value; + return this; + } + + /// + /// + /// A sibling pipeline that detects, spikes, dips, and change points in a metric. + /// Given a distribution of values provided by the sibling multi-bucket aggregation, + /// this aggregation indicates the bucket of any spike or dip and/or the bucket at which + /// the largest change in the distribution of values, if they are statistically significant. + /// There must be at least 22 bucketed values. Fewer than 1,000 is preferred. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor ChangePoint() + { + Instance.ChangePoint = Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregationDescriptor.Build(null); + return this; + } + + /// + /// + /// A sibling pipeline that detects, spikes, dips, and change points in a metric. + /// Given a distribution of values provided by the sibling multi-bucket aggregation, + /// this aggregation indicates the bucket of any spike or dip and/or the bucket at which + /// the largest change in the distribution of values, if they are statistically significant. + /// There must be at least 22 bucketed values. Fewer than 1,000 is preferred. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregationDescriptor ChangePoint(System.Action? action) + { + Instance.ChangePoint = Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregationDescriptor.Build(action); + return this; + } + /// /// /// A single bucket aggregation that selects child documents that have the specified type, as defined in a join field. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregate.Converters.g.cs new file mode 100644 index 00000000000..fc32cbdc6a1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregate.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.Aggregations.Json; + +public sealed partial class CartesianBoundsAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBounds = System.Text.Json.JsonEncodedText.Encode("bounds"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBounds = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBounds.TryReadProperty(ref reader, options, PropBounds, 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 (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.Aggregations.CartesianBoundsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Bounds = propBounds.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBounds, value.Bounds, 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.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregate.g.cs new file mode 100644 index 00000000000..fe87022d404 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregate.g.cs @@ -0,0 +1,49 @@ +// 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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CartesianBoundsAggregateConverter))] +public sealed partial class CartesianBoundsAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate +{ +#if NET7_0_OR_GREATER + public CartesianBoundsAggregate() + { + } +#endif +#if !NET7_0_OR_GREATER + public CartesianBoundsAggregate() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CartesianBoundsAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public Elastic.Clients.Elasticsearch.TopLeftBottomRightGeoBounds? Bounds { get; set; } + public System.Collections.Generic.IReadOnlyDictionary? Meta { get; set; } + + string Elastic.Clients.Elasticsearch.Aggregations.IAggregate.Type => "cartesian_bounds"; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregation.Converters.g.cs new file mode 100644 index 00000000000..b396ebdf21f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CartesianBoundsAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, 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.Aggregations.CartesianBoundsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Missing = propMissing.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregation.g.cs new file mode 100644 index 00000000000..8f5de3facc0 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianBoundsAggregation.g.cs @@ -0,0 +1,230 @@ +// 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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CartesianBoundsAggregationConverter))] +public sealed partial class CartesianBoundsAggregation +{ +#if NET7_0_OR_GREATER + public CartesianBoundsAggregation() + { + } +#endif +#if !NET7_0_OR_GREATER + public CartesianBoundsAggregation() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CartesianBoundsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The field on which to run the aggregation. + /// + /// + public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + + /// + /// + /// The value to apply to documents that do not have a value. + /// By default, documents without a value are ignored. + /// + /// + public object? Missing { get; set; } + public Elastic.Clients.Elasticsearch.Script? Script { get; set; } +} + +public readonly partial struct CartesianBoundsAggregationDescriptor +{ + internal Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CartesianBoundsAggregationDescriptor(Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CartesianBoundsAggregationDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor(Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation instance) => new Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation(Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The field on which to run the aggregation. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? value) + { + Instance.Field = value; + return this; + } + + /// + /// + /// The field on which to run the aggregation. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor Field(System.Linq.Expressions.Expression> value) + { + Instance.Field = value; + return this; + } + + /// + /// + /// The value to apply to documents that do not have a value. + /// By default, documents without a value are ignored. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor Missing(object? value) + { + Instance.Missing = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? value) + { + Instance.Script = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor Script() + { + Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(null); + return this; + } + + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor Script(System.Action? action) + { + Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(action); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation Build(System.Action>? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor(new Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} + +public readonly partial struct CartesianBoundsAggregationDescriptor +{ + internal Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CartesianBoundsAggregationDescriptor(Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CartesianBoundsAggregationDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor(Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation instance) => new Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation(Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The field on which to run the aggregation. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? value) + { + Instance.Field = value; + return this; + } + + /// + /// + /// The field on which to run the aggregation. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor Field(System.Linq.Expressions.Expression> value) + { + Instance.Field = value; + return this; + } + + /// + /// + /// The value to apply to documents that do not have a value. + /// By default, documents without a value are ignored. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor Missing(object? value) + { + Instance.Missing = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? value) + { + Instance.Script = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor Script() + { + Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(null); + return this; + } + + public Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor Script(System.Action? action) + { + Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(action); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregationDescriptor(new Elastic.Clients.Elasticsearch.Aggregations.CartesianBoundsAggregation(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/Aggregations/CartesianCentroidAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregate.Converters.g.cs new file mode 100644 index 00000000000..b913241c750 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CartesianCentroidAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propCount = default; + LocalJsonValue propLocation = default; + LocalJsonValue?> propMeta = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propCount.TryReadProperty(ref reader, options, PropCount, null)) + { + continue; + } + + if (propLocation.TryReadProperty(ref reader, options, PropLocation, 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 (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.Aggregations.CartesianCentroidAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Count = propCount.Value, + Location = propLocation.Value, + Meta = propMeta.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropLocation, value.Location, 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.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregate.g.cs new file mode 100644 index 00000000000..f4c45a8595b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregate.g.cs @@ -0,0 +1,60 @@ +// 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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CartesianCentroidAggregateConverter))] +public sealed partial class CartesianCentroidAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CartesianCentroidAggregate(long count) + { + Count = count; + } +#if NET7_0_OR_GREATER + public CartesianCentroidAggregate() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public CartesianCentroidAggregate() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CartesianCentroidAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public +#if NET7_0_OR_GREATER + required +#endif + long Count { get; set; } + public Elastic.Clients.Elasticsearch.CartesianPoint? Location { get; set; } + public System.Collections.Generic.IReadOnlyDictionary? Meta { get; set; } + + string Elastic.Clients.Elasticsearch.Aggregations.IAggregate.Type => "cartesian_centroid"; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregation.Converters.g.cs new file mode 100644 index 00000000000..d08659b58a2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class CartesianCentroidAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropField = System.Text.Json.JsonEncodedText.Encode("field"); + private static readonly System.Text.Json.JsonEncodedText PropMissing = System.Text.Json.JsonEncodedText.Encode("missing"); + private static readonly System.Text.Json.JsonEncodedText PropScript = System.Text.Json.JsonEncodedText.Encode("script"); + + public override Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propField = default; + LocalJsonValue propMissing = default; + LocalJsonValue propScript = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propField.TryReadProperty(ref reader, options, PropField, null)) + { + continue; + } + + if (propMissing.TryReadProperty(ref reader, options, PropMissing, null)) + { + continue; + } + + if (propScript.TryReadProperty(ref reader, options, PropScript, 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.Aggregations.CartesianCentroidAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Field = propField.Value, + Missing = propMissing.Value, + Script = propScript.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropField, value.Field, null, null); + writer.WriteProperty(options, PropMissing, value.Missing, null, null); + writer.WriteProperty(options, PropScript, value.Script, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregation.g.cs new file mode 100644 index 00000000000..85e634139b8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/CartesianCentroidAggregation.g.cs @@ -0,0 +1,230 @@ +// 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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.CartesianCentroidAggregationConverter))] +public sealed partial class CartesianCentroidAggregation +{ +#if NET7_0_OR_GREATER + public CartesianCentroidAggregation() + { + } +#endif +#if !NET7_0_OR_GREATER + public CartesianCentroidAggregation() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CartesianCentroidAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// The field on which to run the aggregation. + /// + /// + public Elastic.Clients.Elasticsearch.Field? Field { get; set; } + + /// + /// + /// The value to apply to documents that do not have a value. + /// By default, documents without a value are ignored. + /// + /// + public object? Missing { get; set; } + public Elastic.Clients.Elasticsearch.Script? Script { get; set; } +} + +public readonly partial struct CartesianCentroidAggregationDescriptor +{ + internal Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CartesianCentroidAggregationDescriptor(Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CartesianCentroidAggregationDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor(Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation instance) => new Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation(Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The field on which to run the aggregation. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? value) + { + Instance.Field = value; + return this; + } + + /// + /// + /// The field on which to run the aggregation. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor Field(System.Linq.Expressions.Expression> value) + { + Instance.Field = value; + return this; + } + + /// + /// + /// The value to apply to documents that do not have a value. + /// By default, documents without a value are ignored. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor Missing(object? value) + { + Instance.Missing = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? value) + { + Instance.Script = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor Script() + { + Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(null); + return this; + } + + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor Script(System.Action? action) + { + Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(action); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation Build(System.Action>? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor(new Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); + action.Invoke(builder); + return builder.Instance; + } +} + +public readonly partial struct CartesianCentroidAggregationDescriptor +{ + internal Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CartesianCentroidAggregationDescriptor(Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CartesianCentroidAggregationDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor(Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation instance) => new Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation(Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// The field on which to run the aggregation. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor Field(Elastic.Clients.Elasticsearch.Field? value) + { + Instance.Field = value; + return this; + } + + /// + /// + /// The field on which to run the aggregation. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor Field(System.Linq.Expressions.Expression> value) + { + Instance.Field = value; + return this; + } + + /// + /// + /// The value to apply to documents that do not have a value. + /// By default, documents without a value are ignored. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor Missing(object? value) + { + Instance.Missing = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor Script(Elastic.Clients.Elasticsearch.Script? value) + { + Instance.Script = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor Script() + { + Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(null); + return this; + } + + public Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor Script(System.Action? action) + { + Instance.Script = Elastic.Clients.Elasticsearch.ScriptDescriptor.Build(action); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregationDescriptor(new Elastic.Clients.Elasticsearch.Aggregations.CartesianCentroidAggregation(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/Aggregations/ChangePointAggregate.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointAggregate.Converters.g.cs new file mode 100644 index 00000000000..6eef86a2e1f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointAggregate.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ChangePointAggregateConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucket = System.Text.Json.JsonEncodedText.Encode("bucket"); + private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); + private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregate Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucket = default; + LocalJsonValue?> propMeta = default; + LocalJsonValue propType = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucket.TryReadProperty(ref reader, options, PropBucket, 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 (propType.TryReadProperty(ref reader, options, PropType, 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.Aggregations.ChangePointAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Bucket = propBucket.Value, + Meta = propMeta.Value, + Type = propType.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregate value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucket, value.Bucket, 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, PropType, value.Type, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointAggregate.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointAggregate.g.cs new file mode 100644 index 00000000000..4f657e0ac0e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointAggregate.g.cs @@ -0,0 +1,60 @@ +// 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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ChangePointAggregateConverter))] +public sealed partial class ChangePointAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChangePointAggregate(Elastic.Clients.Elasticsearch.Aggregations.ChangeType type) + { + Type = type; + } +#if NET7_0_OR_GREATER + public ChangePointAggregate() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public ChangePointAggregate() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ChangePointAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public Elastic.Clients.Elasticsearch.Aggregations.ChangePointBucket? Bucket { get; set; } + public System.Collections.Generic.IReadOnlyDictionary? Meta { get; set; } + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Aggregations.ChangeType Type { get; set; } + + string Elastic.Clients.Elasticsearch.Aggregations.IAggregate.Type => "change_point"; +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointAggregation.Converters.g.cs new file mode 100644 index 00000000000..c0bd0d6a099 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointAggregation.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class ChangePointAggregationConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropBucketsPath = System.Text.Json.JsonEncodedText.Encode("buckets_path"); + private static readonly System.Text.Json.JsonEncodedText PropFormat = System.Text.Json.JsonEncodedText.Encode("format"); + private static readonly System.Text.Json.JsonEncodedText PropGapPolicy = System.Text.Json.JsonEncodedText.Encode("gap_policy"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propBucketsPath = default; + LocalJsonValue propFormat = default; + LocalJsonValue propGapPolicy = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propBucketsPath.TryReadProperty(ref reader, options, PropBucketsPath, null)) + { + continue; + } + + if (propFormat.TryReadProperty(ref reader, options, PropFormat, null)) + { + continue; + } + + if (propGapPolicy.TryReadProperty(ref reader, options, PropGapPolicy, static Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? (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.Aggregations.ChangePointAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + BucketsPath = propBucketsPath.Value, + Format = propFormat.Value, + GapPolicy = propGapPolicy.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropBucketsPath, value.BucketsPath, null, null); + writer.WriteProperty(options, PropFormat, value.Format, null, null); + writer.WriteProperty(options, PropGapPolicy, value.GapPolicy, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointAggregation.g.cs new file mode 100644 index 00000000000..85516127794 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointAggregation.g.cs @@ -0,0 +1,133 @@ +// 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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ChangePointAggregationConverter))] +public sealed partial class ChangePointAggregation +{ +#if NET7_0_OR_GREATER + public ChangePointAggregation() + { + } +#endif +#if !NET7_0_OR_GREATER + public ChangePointAggregation() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ChangePointAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Path to the buckets that contain one set of values to correlate. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? BucketsPath { get; set; } + + /// + /// + /// DecimalFormat pattern for the output value. + /// If specified, the formatted value is returned in the aggregation’s value_as_string property. + /// + /// + public string? Format { get; set; } + + /// + /// + /// Policy to apply when gaps are found in the data. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? GapPolicy { get; set; } +} + +public readonly partial struct ChangePointAggregationDescriptor +{ + internal Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChangePointAggregationDescriptor(Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ChangePointAggregationDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregationDescriptor(Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation instance) => new Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregationDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation(Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregationDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// Path to the buckets that contain one set of values to correlate. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregationDescriptor BucketsPath(Elastic.Clients.Elasticsearch.Aggregations.BucketsPath? value) + { + Instance.BucketsPath = value; + return this; + } + + /// + /// + /// DecimalFormat pattern for the output value. + /// If specified, the formatted value is returned in the aggregation’s value_as_string property. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregationDescriptor Format(string? value) + { + Instance.Format = value; + return this; + } + + /// + /// + /// Policy to apply when gaps are found in the data. + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregationDescriptor GapPolicy(Elastic.Clients.Elasticsearch.Aggregations.GapPolicy? value) + { + Instance.GapPolicy = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregationDescriptor(new Elastic.Clients.Elasticsearch.Aggregations.ChangePointAggregation(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/Aggregations/ChangePointBucket.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointBucket.Converters.g.cs new file mode 100644 index 00000000000..f0658b3d285 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointBucket.Converters.g.cs @@ -0,0 +1,78 @@ +// 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.Aggregations.Json; + +public sealed partial class ChangePointBucketConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDocCount = System.Text.Json.JsonEncodedText.Encode("doc_count"); + private static readonly System.Text.Json.JsonEncodedText PropKey = System.Text.Json.JsonEncodedText.Encode("key"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ChangePointBucket Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + System.Collections.Generic.Dictionary? propAggregations = default; + LocalJsonValue propDocCount = default; + LocalJsonValue propKey = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDocCount.TryReadProperty(ref reader, options, PropDocCount, null)) + { + continue; + } + + if (propKey.TryReadProperty(ref reader, options, PropKey, null)) + { + continue; + } + + propAggregations ??= new System.Collections.Generic.Dictionary(); + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.ReadItem(ref reader, options, out string key, out Elastic.Clients.Elasticsearch.Aggregations.IAggregate value); + propAggregations[key] = value; + } + + reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); + return new Elastic.Clients.Elasticsearch.Aggregations.ChangePointBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Aggregations = new Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary(propAggregations), + DocCount = propDocCount.Value, + Key = propKey.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ChangePointBucket value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDocCount, value.DocCount, null, null); + writer.WriteProperty(options, PropKey, value.Key, null, null); + if (value.Aggregations is not null) + { + foreach (var item in value.Aggregations) + { + Elastic.Clients.Elasticsearch.Aggregations.Json.AggregateDictionaryConverter.WriteItem(writer, options, item.Key, item.Value); + } + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Project/Tags.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointBucket.g.cs similarity index 71% rename from src/Elastic.Clients.Elasticsearch/_Generated/Types/Project/Tags.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointBucket.g.cs index 10a563973af..a402968ceac 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Project/Tags.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangePointBucket.g.cs @@ -21,61 +21,48 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Project; +namespace Elastic.Clients.Elasticsearch.Aggregations; -[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Project.Json.TagsConverter))] -public sealed partial class Tags +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ChangePointBucketConverter))] +public sealed partial class ChangePointBucket { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public Tags(string alias, string id, string organisation, string type) + public ChangePointBucket(long docCount, Elastic.Clients.Elasticsearch.FieldValue key) { - Alias = alias; - Id = id; - Organisation = organisation; - Type = type; + DocCount = docCount; + Key = key; } #if NET7_0_OR_GREATER - public Tags() + public ChangePointBucket() { } #endif #if !NET7_0_OR_GREATER [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] - public Tags() + public ChangePointBucket() { } #endif [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - internal Tags(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + internal ChangePointBucket(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) { _ = sentinel; } + /// + /// + /// Nested aggregations + /// + /// + public Elastic.Clients.Elasticsearch.Aggregations.AggregateDictionary? Aggregations { get; set; } public #if NET7_0_OR_GREATER required #endif - string Alias { get; set; } - public -#if NET7_0_OR_GREATER - required -#endif - string Id { get; set; } - public -#if NET7_0_OR_GREATER - required -#endif - string Organisation { get; set; } + long DocCount { get; set; } public #if NET7_0_OR_GREATER required #endif - string Type { get; set; } - - /// - /// - /// Additional tags defined by user. - /// - /// - public System.Collections.Generic.IReadOnlyDictionary? UserDefinedTags { get; set; } + Elastic.Clients.Elasticsearch.FieldValue Key { get; set; } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangeType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangeType.Converters.g.cs new file mode 100644 index 00000000000..d3782282a96 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangeType.Converters.g.cs @@ -0,0 +1,162 @@ +// 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.Aggregations.Json; + +public sealed partial class ChangeTypeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText VariantDip = System.Text.Json.JsonEncodedText.Encode("dip"); + private static readonly System.Text.Json.JsonEncodedText VariantDistributionChange = System.Text.Json.JsonEncodedText.Encode("distribution_change"); + private static readonly System.Text.Json.JsonEncodedText VariantIndeterminable = System.Text.Json.JsonEncodedText.Encode("indeterminable"); + private static readonly System.Text.Json.JsonEncodedText VariantNonStationary = System.Text.Json.JsonEncodedText.Encode("non_stationary"); + private static readonly System.Text.Json.JsonEncodedText VariantSpike = System.Text.Json.JsonEncodedText.Encode("spike"); + private static readonly System.Text.Json.JsonEncodedText VariantStationary = System.Text.Json.JsonEncodedText.Encode("stationary"); + private static readonly System.Text.Json.JsonEncodedText VariantStepChange = System.Text.Json.JsonEncodedText.Encode("step_change"); + private static readonly System.Text.Json.JsonEncodedText VariantTrendChange = System.Text.Json.JsonEncodedText.Encode("trend_change"); + + public override Elastic.Clients.Elasticsearch.Aggregations.ChangeType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + string? variantType = null; + object? variant = null; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (reader.ValueTextEquals(VariantDip)) + { + variantType = VariantDip.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantDistributionChange)) + { + variantType = VariantDistributionChange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantIndeterminable)) + { + variantType = VariantIndeterminable.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantNonStationary)) + { + variantType = VariantNonStationary.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantSpike)) + { + variantType = VariantSpike.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantStationary)) + { + variantType = VariantStationary.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantStepChange)) + { + variantType = VariantStepChange.Value; + reader.Read(); + variant = reader.ReadValue(options, null); + continue; + } + + if (reader.ValueTextEquals(VariantTrendChange)) + { + variantType = VariantTrendChange.Value; + reader.Read(); + variant = reader.ReadValue(options, 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.Aggregations.ChangeType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + VariantType = variantType, + Variant = variant + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.ChangeType value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + switch (value.VariantType) + { + case null: + break; + case "dip": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.Dip)value.Variant, null, null); + break; + case "distribution_change": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.DistributionChange)value.Variant, null, null); + break; + case "indeterminable": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.Indeterminable)value.Variant, null, null); + break; + case "non_stationary": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.NonStationary)value.Variant, null, null); + break; + case "spike": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.Spike)value.Variant, null, null); + break; + case "stationary": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.Stationary)value.Variant, null, null); + break; + case "step_change": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.StepChange)value.Variant, null, null); + break; + case "trend_change": + writer.WriteProperty(options, value.VariantType, (Elastic.Clients.Elasticsearch.Aggregations.TrendChange)value.Variant, null, null); + break; + default: + throw new System.Text.Json.JsonException($"Variant '{value.VariantType}' is not supported for type '{nameof(Elastic.Clients.Elasticsearch.Aggregations.ChangeType)}'."); + } + + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangeType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangeType.g.cs new file mode 100644 index 00000000000..40e31dcefe9 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/ChangeType.g.cs @@ -0,0 +1,82 @@ +// 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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.ChangeTypeConverter))] +public sealed partial class ChangeType +{ + internal string? VariantType { get; set; } + internal object? Variant { get; set; } +#if NET7_0_OR_GREATER + public ChangeType() + { + } +#endif +#if !NET7_0_OR_GREATER + public ChangeType() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ChangeType(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public Elastic.Clients.Elasticsearch.Aggregations.Dip? Dip { get => GetVariant("dip"); set => SetVariant("dip", value); } + public Elastic.Clients.Elasticsearch.Aggregations.DistributionChange? DistributionChange { get => GetVariant("distribution_change"); set => SetVariant("distribution_change", value); } + public Elastic.Clients.Elasticsearch.Aggregations.Indeterminable? Indeterminable { get => GetVariant("indeterminable"); set => SetVariant("indeterminable", value); } + public Elastic.Clients.Elasticsearch.Aggregations.NonStationary? NonStationary { get => GetVariant("non_stationary"); set => SetVariant("non_stationary", value); } + public Elastic.Clients.Elasticsearch.Aggregations.Spike? Spike { get => GetVariant("spike"); set => SetVariant("spike", value); } + public Elastic.Clients.Elasticsearch.Aggregations.Stationary? Stationary { get => GetVariant("stationary"); set => SetVariant("stationary", value); } + public Elastic.Clients.Elasticsearch.Aggregations.StepChange? StepChange { get => GetVariant("step_change"); set => SetVariant("step_change", value); } + public Elastic.Clients.Elasticsearch.Aggregations.TrendChange? TrendChange { get => GetVariant("trend_change"); set => SetVariant("trend_change", value); } + + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.ChangeType(Elastic.Clients.Elasticsearch.Aggregations.Dip value) => new Elastic.Clients.Elasticsearch.Aggregations.ChangeType { Dip = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.ChangeType(Elastic.Clients.Elasticsearch.Aggregations.DistributionChange value) => new Elastic.Clients.Elasticsearch.Aggregations.ChangeType { DistributionChange = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.ChangeType(Elastic.Clients.Elasticsearch.Aggregations.Indeterminable value) => new Elastic.Clients.Elasticsearch.Aggregations.ChangeType { Indeterminable = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.ChangeType(Elastic.Clients.Elasticsearch.Aggregations.NonStationary value) => new Elastic.Clients.Elasticsearch.Aggregations.ChangeType { NonStationary = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.ChangeType(Elastic.Clients.Elasticsearch.Aggregations.Spike value) => new Elastic.Clients.Elasticsearch.Aggregations.ChangeType { Spike = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.ChangeType(Elastic.Clients.Elasticsearch.Aggregations.Stationary value) => new Elastic.Clients.Elasticsearch.Aggregations.ChangeType { Stationary = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.ChangeType(Elastic.Clients.Elasticsearch.Aggregations.StepChange value) => new Elastic.Clients.Elasticsearch.Aggregations.ChangeType { StepChange = value }; + public static implicit operator Elastic.Clients.Elasticsearch.Aggregations.ChangeType(Elastic.Clients.Elasticsearch.Aggregations.TrendChange value) => new Elastic.Clients.Elasticsearch.Aggregations.ChangeType { TrendChange = value }; + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private T? GetVariant(string type) + { + if (string.Equals(VariantType, type, System.StringComparison.Ordinal) && Variant is T result) + { + return result; + } + + return default; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private void SetVariant(string type, T? value) + { + VariantType = type; + Variant = value; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Dip.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Dip.Converters.g.cs new file mode 100644 index 00000000000..64c548e64d1 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Dip.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.Aggregations.Json; + +public sealed partial class DipConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChangePoint = System.Text.Json.JsonEncodedText.Encode("change_point"); + private static readonly System.Text.Json.JsonEncodedText PropPValue = System.Text.Json.JsonEncodedText.Encode("p_value"); + + public override Elastic.Clients.Elasticsearch.Aggregations.Dip Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChangePoint = default; + LocalJsonValue propPValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChangePoint.TryReadProperty(ref reader, options, PropChangePoint, null)) + { + continue; + } + + if (propPValue.TryReadProperty(ref reader, options, PropPValue, 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.Aggregations.Dip(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChangePoint = propChangePoint.Value, + PValue = propPValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.Dip value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChangePoint, value.ChangePoint, null, null); + writer.WriteProperty(options, PropPValue, value.PValue, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Dip.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Dip.g.cs new file mode 100644 index 00000000000..e561efcb89b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Dip.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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DipConverter))] +public sealed partial class Dip +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public Dip(int changePoint, double pValue) + { + ChangePoint = changePoint; + PValue = pValue; + } +#if NET7_0_OR_GREATER + public Dip() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public Dip() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal Dip(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public +#if NET7_0_OR_GREATER + required +#endif + int ChangePoint { get; set; } + public +#if NET7_0_OR_GREATER + required +#endif + double PValue { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DistributionChange.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DistributionChange.Converters.g.cs new file mode 100644 index 00000000000..1098a5610f3 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DistributionChange.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.Aggregations.Json; + +public sealed partial class DistributionChangeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChangePoint = System.Text.Json.JsonEncodedText.Encode("change_point"); + private static readonly System.Text.Json.JsonEncodedText PropPValue = System.Text.Json.JsonEncodedText.Encode("p_value"); + + public override Elastic.Clients.Elasticsearch.Aggregations.DistributionChange Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChangePoint = default; + LocalJsonValue propPValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChangePoint.TryReadProperty(ref reader, options, PropChangePoint, null)) + { + continue; + } + + if (propPValue.TryReadProperty(ref reader, options, PropPValue, 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.Aggregations.DistributionChange(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChangePoint = propChangePoint.Value, + PValue = propPValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.DistributionChange value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChangePoint, value.ChangePoint, null, null); + writer.WriteProperty(options, PropPValue, value.PValue, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DistributionChange.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DistributionChange.g.cs new file mode 100644 index 00000000000..9fb6eaf51ec --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/DistributionChange.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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.DistributionChangeConverter))] +public sealed partial class DistributionChange +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public DistributionChange(int changePoint, double pValue) + { + ChangePoint = changePoint; + PValue = pValue; + } +#if NET7_0_OR_GREATER + public DistributionChange() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public DistributionChange() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal DistributionChange(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public +#if NET7_0_OR_GREATER + required +#endif + int ChangePoint { get; set; } + public +#if NET7_0_OR_GREATER + required +#endif + double PValue { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.Converters.g.cs index 60e0831e34c..150c621f437 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.Converters.g.cs @@ -26,6 +26,7 @@ namespace Elastic.Clients.Elasticsearch.Aggregations.Json; public sealed partial class FiltersAggregationConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropFilters = System.Text.Json.JsonEncodedText.Encode("filters"); + private static readonly System.Text.Json.JsonEncodedText PropKeyed = System.Text.Json.JsonEncodedText.Encode("keyed"); private static readonly System.Text.Json.JsonEncodedText PropOtherBucket = System.Text.Json.JsonEncodedText.Encode("other_bucket"); private static readonly System.Text.Json.JsonEncodedText PropOtherBucketKey = System.Text.Json.JsonEncodedText.Encode("other_bucket_key"); @@ -42,6 +43,12 @@ public override Elastic.Clients.Elasticsearch.Aggregations.FiltersAggregation Re continue; } + if (reader.ValueTextEquals(PropKeyed)) + { + reader.SafeSkip(); + continue; + } + if (propOtherBucket.TryReadProperty(ref reader, options, PropOtherBucket, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; @@ -74,6 +81,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropFilters, value.Filters, null, null); + writer.WriteProperty(options, PropKeyed, value.Keyed, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropOtherBucket, value.OtherBucket, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropOtherBucketKey, value.OtherBucketKey, null, null); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.g.cs index 8b14feb8a90..2b71542af1a 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/FiltersAggregation.g.cs @@ -49,6 +49,14 @@ internal FiltersAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonCons /// public Elastic.Clients.Elasticsearch.Aggregations.Buckets? Filters { get; set; } + /// + /// + /// By default, the named filters aggregation returns the buckets as an object. + /// Set to false to return the buckets as an array of objects. + /// + /// + public bool? Keyed => false; + /// /// /// Set to true to add a bucket to the response which will contain all documents that do not match any of the given filters. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Indeterminable.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Indeterminable.Converters.g.cs new file mode 100644 index 00000000000..0a43a0ca80e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Indeterminable.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.Aggregations.Json; + +public sealed partial class IndeterminableConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropReason = System.Text.Json.JsonEncodedText.Encode("reason"); + + public override Elastic.Clients.Elasticsearch.Aggregations.Indeterminable Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propReason = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propReason.TryReadProperty(ref reader, options, PropReason, 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.Aggregations.Indeterminable(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Reason = propReason.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.Indeterminable value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropReason, value.Reason, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Indeterminable.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Indeterminable.g.cs new file mode 100644 index 00000000000..5dc54027a5d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Indeterminable.g.cs @@ -0,0 +1,56 @@ +// 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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.IndeterminableConverter))] +public sealed partial class Indeterminable +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public Indeterminable(string reason) + { + Reason = reason; + } +#if NET7_0_OR_GREATER + public Indeterminable() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public Indeterminable() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal Indeterminable(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public +#if NET7_0_OR_GREATER + required +#endif + string Reason { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NonStationary.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NonStationary.Converters.g.cs new file mode 100644 index 00000000000..a01dcffe169 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NonStationary.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class NonStationaryConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropPValue = System.Text.Json.JsonEncodedText.Encode("p_value"); + private static readonly System.Text.Json.JsonEncodedText PropRValue = System.Text.Json.JsonEncodedText.Encode("r_value"); + private static readonly System.Text.Json.JsonEncodedText PropTrend = System.Text.Json.JsonEncodedText.Encode("trend"); + + public override Elastic.Clients.Elasticsearch.Aggregations.NonStationary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propPValue = default; + LocalJsonValue propRValue = default; + LocalJsonValue propTrend = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propPValue.TryReadProperty(ref reader, options, PropPValue, null)) + { + continue; + } + + if (propRValue.TryReadProperty(ref reader, options, PropRValue, null)) + { + continue; + } + + if (propTrend.TryReadProperty(ref reader, options, PropTrend, 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.Aggregations.NonStationary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + PValue = propPValue.Value, + RValue = propRValue.Value, + Trend = propTrend.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.NonStationary value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropPValue, value.PValue, null, null); + writer.WriteProperty(options, PropRValue, value.RValue, null, null); + writer.WriteProperty(options, PropTrend, value.Trend, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NonStationary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NonStationary.g.cs new file mode 100644 index 00000000000..34d6c85c0c2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/NonStationary.g.cs @@ -0,0 +1,68 @@ +// 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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.NonStationaryConverter))] +public sealed partial class NonStationary +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public NonStationary(double pValue, double rValue, string trend) + { + PValue = pValue; + RValue = rValue; + Trend = trend; + } +#if NET7_0_OR_GREATER + public NonStationary() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public NonStationary() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal NonStationary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public +#if NET7_0_OR_GREATER + required +#endif + double PValue { get; set; } + public +#if NET7_0_OR_GREATER + required +#endif + double RValue { get; set; } + public +#if NET7_0_OR_GREATER + required +#endif + string Trend { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Spike.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Spike.Converters.g.cs new file mode 100644 index 00000000000..10a37a65d54 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Spike.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.Aggregations.Json; + +public sealed partial class SpikeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChangePoint = System.Text.Json.JsonEncodedText.Encode("change_point"); + private static readonly System.Text.Json.JsonEncodedText PropPValue = System.Text.Json.JsonEncodedText.Encode("p_value"); + + public override Elastic.Clients.Elasticsearch.Aggregations.Spike Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChangePoint = default; + LocalJsonValue propPValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChangePoint.TryReadProperty(ref reader, options, PropChangePoint, null)) + { + continue; + } + + if (propPValue.TryReadProperty(ref reader, options, PropPValue, 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.Aggregations.Spike(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChangePoint = propChangePoint.Value, + PValue = propPValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.Spike value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChangePoint, value.ChangePoint, null, null); + writer.WriteProperty(options, PropPValue, value.PValue, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Spike.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Spike.g.cs new file mode 100644 index 00000000000..7221ea4cba5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Spike.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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.SpikeConverter))] +public sealed partial class Spike +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public Spike(int changePoint, double pValue) + { + ChangePoint = changePoint; + PValue = pValue; + } +#if NET7_0_OR_GREATER + public Spike() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public Spike() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal Spike(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public +#if NET7_0_OR_GREATER + required +#endif + int ChangePoint { get; set; } + public +#if NET7_0_OR_GREATER + required +#endif + double PValue { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Stationary.Converters.g.cs similarity index 74% rename from src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.Converters.g.cs rename to src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Stationary.Converters.g.cs index 7fe21141180..dd056824135 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Api/Project/TagsRequest.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Stationary.Converters.g.cs @@ -21,11 +21,11 @@ using System.Linq; using Elastic.Clients.Elasticsearch.Serialization; -namespace Elastic.Clients.Elasticsearch.Project.Json; +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; -public sealed partial class TagsRequestConverter : System.Text.Json.Serialization.JsonConverter +public sealed partial class StationaryConverter : System.Text.Json.Serialization.JsonConverter { - public override Elastic.Clients.Elasticsearch.Project.TagsRequest Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + public override Elastic.Clients.Elasticsearch.Aggregations.Stationary Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -40,12 +40,12 @@ public override Elastic.Clients.Elasticsearch.Project.TagsRequest Read(ref Syste } reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Project.TagsRequest(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + return new Elastic.Clients.Elasticsearch.Aggregations.Stationary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { }; } - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.TagsRequest value, System.Text.Json.JsonSerializerOptions options) + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.Stationary value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Stationary.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Stationary.g.cs new file mode 100644 index 00000000000..f8b81da6d16 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/Stationary.g.cs @@ -0,0 +1,44 @@ +// 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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StationaryConverter))] +public sealed partial class Stationary +{ +#if NET7_0_OR_GREATER + public Stationary() + { + } +#endif +#if !NET7_0_OR_GREATER + public Stationary() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal Stationary(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StepChange.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StepChange.Converters.g.cs new file mode 100644 index 00000000000..79e6cb6a345 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StepChange.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.Aggregations.Json; + +public sealed partial class StepChangeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChangePoint = System.Text.Json.JsonEncodedText.Encode("change_point"); + private static readonly System.Text.Json.JsonEncodedText PropPValue = System.Text.Json.JsonEncodedText.Encode("p_value"); + + public override Elastic.Clients.Elasticsearch.Aggregations.StepChange Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChangePoint = default; + LocalJsonValue propPValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChangePoint.TryReadProperty(ref reader, options, PropChangePoint, null)) + { + continue; + } + + if (propPValue.TryReadProperty(ref reader, options, PropPValue, 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.Aggregations.StepChange(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChangePoint = propChangePoint.Value, + PValue = propPValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.StepChange value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChangePoint, value.ChangePoint, null, null); + writer.WriteProperty(options, PropPValue, value.PValue, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StepChange.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StepChange.g.cs new file mode 100644 index 00000000000..ccf06b62e18 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/StepChange.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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StepChangeConverter))] +public sealed partial class StepChange +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public StepChange(int changePoint, double pValue) + { + ChangePoint = changePoint; + PValue = pValue; + } +#if NET7_0_OR_GREATER + public StepChange() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public StepChange() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal StepChange(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public +#if NET7_0_OR_GREATER + required +#endif + int ChangePoint { get; set; } + public +#if NET7_0_OR_GREATER + required +#endif + double PValue { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TrendChange.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TrendChange.Converters.g.cs new file mode 100644 index 00000000000..c04d62785ed --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TrendChange.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Aggregations.Json; + +public sealed partial class TrendChangeConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChangePoint = System.Text.Json.JsonEncodedText.Encode("change_point"); + private static readonly System.Text.Json.JsonEncodedText PropPValue = System.Text.Json.JsonEncodedText.Encode("p_value"); + private static readonly System.Text.Json.JsonEncodedText PropRValue = System.Text.Json.JsonEncodedText.Encode("r_value"); + + public override Elastic.Clients.Elasticsearch.Aggregations.TrendChange Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChangePoint = default; + LocalJsonValue propPValue = default; + LocalJsonValue propRValue = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChangePoint.TryReadProperty(ref reader, options, PropChangePoint, null)) + { + continue; + } + + if (propPValue.TryReadProperty(ref reader, options, PropPValue, null)) + { + continue; + } + + if (propRValue.TryReadProperty(ref reader, options, PropRValue, 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.Aggregations.TrendChange(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChangePoint = propChangePoint.Value, + PValue = propPValue.Value, + RValue = propRValue.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Aggregations.TrendChange value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChangePoint, value.ChangePoint, null, null); + writer.WriteProperty(options, PropPValue, value.PValue, null, null); + writer.WriteProperty(options, PropRValue, value.RValue, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TrendChange.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TrendChange.g.cs new file mode 100644 index 00000000000..0af67ccfdc8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Aggregations/TrendChange.g.cs @@ -0,0 +1,68 @@ +// 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.Aggregations; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.TrendChangeConverter))] +public sealed partial class TrendChange +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public TrendChange(int changePoint, double pValue, double rValue) + { + ChangePoint = changePoint; + PValue = pValue; + RValue = rValue; + } +#if NET7_0_OR_GREATER + public TrendChange() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public TrendChange() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal TrendChange(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public +#if NET7_0_OR_GREATER + required +#endif + int ChangePoint { get; set; } + public +#if NET7_0_OR_GREATER + required +#endif + double PValue { get; set; } + public +#if NET7_0_OR_GREATER + required +#endif + double RValue { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CartesianPoint.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CartesianPoint.Converters.g.cs new file mode 100644 index 00000000000..83070f8d98a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CartesianPoint.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.Json; + +public sealed partial class CartesianPointConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropX = System.Text.Json.JsonEncodedText.Encode("x"); + private static readonly System.Text.Json.JsonEncodedText PropY = System.Text.Json.JsonEncodedText.Encode("y"); + + public override Elastic.Clients.Elasticsearch.CartesianPoint Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propX = default; + LocalJsonValue propY = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propX.TryReadProperty(ref reader, options, PropX, null)) + { + continue; + } + + if (propY.TryReadProperty(ref reader, options, PropY, 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.CartesianPoint(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + X = propX.Value, + Y = propY.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.CartesianPoint value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropX, value.X, null, null); + writer.WriteProperty(options, PropY, value.Y, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/CartesianPoint.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CartesianPoint.g.cs new file mode 100644 index 00000000000..dfb8cd5e00e --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/CartesianPoint.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; + +[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Json.CartesianPointConverter))] +public sealed partial class CartesianPoint +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public CartesianPoint(double x, double y) + { + X = x; + Y = y; + } +#if NET7_0_OR_GREATER + public CartesianPoint() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public CartesianPoint() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal CartesianPoint(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public +#if NET7_0_OR_GREATER + required +#endif + double X { get; set; } + public +#if NET7_0_OR_GREATER + required +#endif + double Y { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedRetrieversSearchUsage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedRetrieversSearchUsage.Converters.g.cs new file mode 100644 index 00000000000..666fd9bc3fa --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedRetrieversSearchUsage.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.Cluster.Json; + +public sealed partial class ExtendedRetrieversSearchUsageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropTextSimilarityReranker = System.Text.Json.JsonEncodedText.Encode("text_similarity_reranker"); + + public override Elastic.Clients.Elasticsearch.Cluster.ExtendedRetrieversSearchUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propTextSimilarityReranker = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propTextSimilarityReranker.TryReadProperty(ref reader, options, PropTextSimilarityReranker, 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.Cluster.ExtendedRetrieversSearchUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + TextSimilarityReranker = propTextSimilarityReranker.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ExtendedRetrieversSearchUsage value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropTextSimilarityReranker, value.TextSimilarityReranker, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedRetrieversSearchUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedRetrieversSearchUsage.g.cs new file mode 100644 index 00000000000..6ac7e07c753 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedRetrieversSearchUsage.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.ExtendedRetrieversSearchUsageConverter))] +public sealed partial class ExtendedRetrieversSearchUsage +{ +#if NET7_0_OR_GREATER + public ExtendedRetrieversSearchUsage() + { + } +#endif +#if !NET7_0_OR_GREATER + public ExtendedRetrieversSearchUsage() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ExtendedRetrieversSearchUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public Elastic.Clients.Elasticsearch.Cluster.ExtendedTextSimilarityRetrieverUsage? TextSimilarityReranker { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.Converters.g.cs new file mode 100644 index 00000000000..666ddc921ac --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.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.Cluster.Json; + +public sealed partial class ExtendedSearchUsageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRetrievers = System.Text.Json.JsonEncodedText.Encode("retrievers"); + + public override Elastic.Clients.Elasticsearch.Cluster.ExtendedSearchUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRetrievers = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRetrievers.TryReadProperty(ref reader, options, PropRetrievers, 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.Cluster.ExtendedSearchUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Retrievers = propRetrievers.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ExtendedSearchUsage value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRetrievers, value.Retrievers, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.g.cs new file mode 100644 index 00000000000..790673d3965 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedSearchUsage.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.ExtendedSearchUsageConverter))] +public sealed partial class ExtendedSearchUsage +{ +#if NET7_0_OR_GREATER + public ExtendedSearchUsage() + { + } +#endif +#if !NET7_0_OR_GREATER + public ExtendedSearchUsage() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ExtendedSearchUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public Elastic.Clients.Elasticsearch.Cluster.ExtendedRetrieversSearchUsage? Retrievers { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedTextSimilarityRetrieverUsage.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedTextSimilarityRetrieverUsage.Converters.g.cs new file mode 100644 index 00000000000..55324332b32 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedTextSimilarityRetrieverUsage.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.Cluster.Json; + +public sealed partial class ExtendedTextSimilarityRetrieverUsageConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropChunkRescorer = System.Text.Json.JsonEncodedText.Encode("chunk_rescorer"); + + public override Elastic.Clients.Elasticsearch.Cluster.ExtendedTextSimilarityRetrieverUsage Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propChunkRescorer = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propChunkRescorer.TryReadProperty(ref reader, options, PropChunkRescorer, 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.ExtendedTextSimilarityRetrieverUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ChunkRescorer = propChunkRescorer.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.ExtendedTextSimilarityRetrieverUsage value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropChunkRescorer, value.ChunkRescorer, 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/ExtendedTextSimilarityRetrieverUsage.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedTextSimilarityRetrieverUsage.g.cs new file mode 100644 index 00000000000..a996a90dc99 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/ExtendedTextSimilarityRetrieverUsage.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.ExtendedTextSimilarityRetrieverUsageConverter))] +public sealed partial class ExtendedTextSimilarityRetrieverUsage +{ +#if NET7_0_OR_GREATER + public ExtendedTextSimilarityRetrieverUsage() + { + } +#endif +#if !NET7_0_OR_GREATER + public ExtendedTextSimilarityRetrieverUsage() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ExtendedTextSimilarityRetrieverUsage(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + public long? ChunkRescorer { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.Converters.g.cs index 736a0e19136..7c61981974e 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.Converters.g.cs @@ -25,6 +25,7 @@ namespace Elastic.Clients.Elasticsearch.Cluster.Json; public sealed partial class SearchUsageStatsConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropExtended = System.Text.Json.JsonEncodedText.Encode("extended"); private static readonly System.Text.Json.JsonEncodedText PropQueries = System.Text.Json.JsonEncodedText.Encode("queries"); private static readonly System.Text.Json.JsonEncodedText PropRescorers = System.Text.Json.JsonEncodedText.Encode("rescorers"); private static readonly System.Text.Json.JsonEncodedText PropRetrievers = System.Text.Json.JsonEncodedText.Encode("retrievers"); @@ -34,6 +35,7 @@ public sealed partial class SearchUsageStatsConverter : System.Text.Json.Seriali public override Elastic.Clients.Elasticsearch.Cluster.SearchUsageStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propExtended = default; LocalJsonValue> propQueries = default; LocalJsonValue> propRescorers = default; LocalJsonValue> propRetrievers = default; @@ -41,6 +43,11 @@ public override Elastic.Clients.Elasticsearch.Cluster.SearchUsageStats Read(ref LocalJsonValue propTotal = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { + if (propExtended.TryReadProperty(ref reader, options, PropExtended, null)) + { + continue; + } + if (propQueries.TryReadProperty(ref reader, options, PropQueries, static System.Collections.Generic.IReadOnlyDictionary (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadDictionaryValue(o, null, null)!)) { continue; @@ -78,6 +85,7 @@ public override Elastic.Clients.Elasticsearch.Cluster.SearchUsageStats Read(ref reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Cluster.SearchUsageStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { + Extended = propExtended.Value, Queries = propQueries.Value, Rescorers = propRescorers.Value, Retrievers = propRetrievers.Value, @@ -89,6 +97,7 @@ public override Elastic.Clients.Elasticsearch.Cluster.SearchUsageStats Read(ref public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Cluster.SearchUsageStats value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); + writer.WriteProperty(options, PropExtended, value.Extended, null, null); writer.WriteProperty(options, PropQueries, value.Queries, 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, PropRescorers, value.Rescorers, 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, PropRetrievers, value.Retrievers, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IReadOnlyDictionary v) => w.WriteDictionaryValue(o, v, null, null)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.g.cs index 7423b0fa304..42f68be5a81 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Cluster/SearchUsageStats.g.cs @@ -27,8 +27,9 @@ namespace Elastic.Clients.Elasticsearch.Cluster; public sealed partial class SearchUsageStats { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public SearchUsageStats(System.Collections.Generic.IReadOnlyDictionary queries, System.Collections.Generic.IReadOnlyDictionary rescorers, System.Collections.Generic.IReadOnlyDictionary retrievers, System.Collections.Generic.IReadOnlyDictionary sections, long total) + public SearchUsageStats(Elastic.Clients.Elasticsearch.Cluster.ExtendedSearchUsage extended, System.Collections.Generic.IReadOnlyDictionary queries, System.Collections.Generic.IReadOnlyDictionary rescorers, System.Collections.Generic.IReadOnlyDictionary retrievers, System.Collections.Generic.IReadOnlyDictionary sections, long total) { + Extended = extended; Queries = queries; Rescorers = rescorers; Retrievers = retrievers; @@ -52,6 +53,11 @@ internal SearchUsageStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstr _ = sentinel; } + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Cluster.ExtendedSearchUsage Extended { get; set; } public #if NET7_0_OR_GREATER required diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.Converters.g.cs index 4b2c60c5d05..ca9abb8dcb2 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.Converters.g.cs @@ -25,6 +25,7 @@ namespace Elastic.Clients.Elasticsearch.Core.Reindex.Json; public sealed partial class RemoteSourceConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); private static readonly System.Text.Json.JsonEncodedText PropConnectTimeout = System.Text.Json.JsonEncodedText.Encode("connect_timeout"); private static readonly System.Text.Json.JsonEncodedText PropHeaders = System.Text.Json.JsonEncodedText.Encode("headers"); private static readonly System.Text.Json.JsonEncodedText PropHost = System.Text.Json.JsonEncodedText.Encode("host"); @@ -35,6 +36,7 @@ public sealed partial class RemoteSourceConverter : System.Text.Json.Serializati public override Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; LocalJsonValue propConnectTimeout = default; LocalJsonValue?> propHeaders = default; LocalJsonValue propHost = default; @@ -43,6 +45,11 @@ public override Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource Read(ref LocalJsonValue propUsername = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + if (propConnectTimeout.TryReadProperty(ref reader, options, PropConnectTimeout, null)) { continue; @@ -85,6 +92,7 @@ public override Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource Read(ref reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { + ApiKey = propApiKey.Value, ConnectTimeout = propConnectTimeout.Value, Headers = propHeaders.Value, Host = propHost.Value, @@ -97,6 +105,7 @@ public override Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource Read(ref public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); writer.WriteProperty(options, PropConnectTimeout, value.ConnectTimeout, null, null); 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, PropHost, value.Host, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.g.cs index 374eee32d51..cd2fa9724b3 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/RemoteSource.g.cs @@ -48,6 +48,14 @@ internal RemoteSource(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo _ = sentinel; } + /// + /// + /// The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud). + /// (It is not permitted to set this and also to set an Authorization header via headers.) + /// + /// + public string? ApiKey { get; set; } + /// /// /// The remote connection timeout. @@ -76,7 +84,7 @@ internal RemoteSource(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo /// /// - /// The password to use for authentication with the remote host. + /// The password to use for authentication with the remote host (required when using basic auth). /// /// public string? Password { get; set; } @@ -90,7 +98,7 @@ internal RemoteSource(Elastic.Clients.Elasticsearch.Serialization.JsonConstructo /// /// - /// The username to use for authentication with the remote host. + /// The username to use for authentication with the remote host (required when using basic auth). /// /// public Elastic.Clients.Elasticsearch.Username? Username { get; set; } @@ -115,6 +123,18 @@ public RemoteSourceDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor(Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource instance) => new Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSource(Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor descriptor) => descriptor.Instance; + /// + /// + /// The API key to use for authentication with the remote host (as an alternative to basic auth when the remote cluster is in Elastic Cloud). + /// (It is not permitted to set this and also to set an Authorization header via headers.) + /// + /// + public Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor ApiKey(string? value) + { + Instance.ApiKey = value; + return this; + } + /// /// /// The remote connection timeout. @@ -180,7 +200,7 @@ public Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor Host(st /// /// - /// The password to use for authentication with the remote host. + /// The password to use for authentication with the remote host (required when using basic auth). /// /// public Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor Password(string? value) @@ -202,7 +222,7 @@ public Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor SocketT /// /// - /// The username to use for authentication with the remote host. + /// The username to use for authentication with the remote host (required when using basic auth). /// /// public Elastic.Clients.Elasticsearch.Core.Reindex.RemoteSourceDescriptor Username(Elastic.Clients.Elasticsearch.Username? value) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.Converters.g.cs index 0d691c26d84..b1d46092f1f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.Converters.g.cs @@ -44,7 +44,7 @@ public override Elastic.Clients.Elasticsearch.Core.Reindex.Source Read(ref Syste LocalJsonValue propSize = default; LocalJsonValue propSlice = default; LocalJsonValue?> propSort = default; - LocalJsonValue propSourceFields = default; + LocalJsonValue propSourceFields = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propIndices.TryReadProperty(ref reader, options, PropIndices, null)) @@ -82,7 +82,7 @@ public override Elastic.Clients.Elasticsearch.Core.Reindex.Source Read(ref Syste continue; } - if (propSourceFields.TryReadProperty(ref reader, options, PropSourceFields, static Elastic.Clients.Elasticsearch.Fields? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker)))) + if (propSourceFields.TryReadProperty(ref reader, options, PropSourceFields, null)) { continue; } @@ -126,7 +126,7 @@ 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, System.Collections.Generic.ICollection? v) => w.WriteSingleOrManyCollectionValue(o, v, null)) #pragma warning restore CS0618 ; - writer.WriteProperty(options, PropSourceFields, value.SourceFields, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, Elastic.Clients.Elasticsearch.Fields? v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.SingleOrManyFieldsMarker))); + writer.WriteProperty(options, PropSourceFields, value.SourceFields, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.g.cs index a747b1fb165..c824d31fc29 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Core/Reindex/Source.g.cs @@ -110,7 +110,7 @@ internal Source(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSenti /// Set it to a list to reindex select fields. /// /// - public Elastic.Clients.Elasticsearch.Fields? SourceFields { get; set; } + public Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? SourceFields { get; set; } } public readonly partial struct SourceDescriptor @@ -334,7 +334,7 @@ public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor So /// Set it to a list to reindex select fields. /// /// - public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor SourceFields(Elastic.Clients.Elasticsearch.Fields? value) + public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor SourceFields(Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? value) { Instance.SourceFields = value; return this; @@ -346,9 +346,9 @@ public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor So /// Set it to a list to reindex select fields. /// /// - public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor SourceFields(params System.Linq.Expressions.Expression>[] value) + public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor SourceFields(System.Func, Elastic.Clients.Elasticsearch.Core.Search.SourceConfig> action) { - Instance.SourceFields = value; + Instance.SourceFields = Elastic.Clients.Elasticsearch.Core.Search.SourceConfigFactory.Build(action); return this; } @@ -648,7 +648,7 @@ public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor Sort(param /// Set it to a list to reindex select fields. /// /// - public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor SourceFields(Elastic.Clients.Elasticsearch.Fields? value) + public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor SourceFields(Elastic.Clients.Elasticsearch.Core.Search.SourceConfig? value) { Instance.SourceFields = value; return this; @@ -660,9 +660,21 @@ public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor SourceFields( /// Set it to a list to reindex select fields. /// /// - public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor SourceFields(params System.Linq.Expressions.Expression>[] value) + public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor SourceFields(System.Func action) { - Instance.SourceFields = value; + Instance.SourceFields = Elastic.Clients.Elasticsearch.Core.Search.SourceConfigFactory.Build(action); + return this; + } + + /// + /// + /// If true, reindex all source fields. + /// Set it to a list to reindex select fields. + /// + /// + public Elastic.Clients.Elasticsearch.Core.Reindex.SourceDescriptor SourceFields(System.Func, Elastic.Clients.Elasticsearch.Core.Search.SourceConfig> action) + { + Instance.SourceFields = Elastic.Clients.Elasticsearch.Core.Search.SourceConfigFactory.Build(action); return this; } diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.Converters.g.cs index d18514ff748..6a244eac0fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.Converters.g.cs @@ -117,7 +117,10 @@ public override Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverA MaxDocs = propMaxDocs.Value, MaxPrimaryShardDocs = propMaxPrimaryShardDocs.Value, MaxPrimaryShardSize = propMaxPrimaryShardSize.Value, - MaxSize = propMaxSize.Value, +#pragma warning disable CS0618 + MaxSize = propMaxSize.Value +#pragma warning restore CS0618 +, MinAge = propMinAge.Value, MinDocs = propMinDocs.Value, MinPrimaryShardDocs = propMinPrimaryShardDocs.Value, @@ -133,7 +136,10 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropMaxDocs, value.MaxDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropMaxPrimaryShardDocs, value.MaxPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropMaxPrimaryShardSize, value.MaxPrimaryShardSize, null, null); - writer.WriteProperty(options, PropMaxSize, value.MaxSize, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropMaxSize, value.MaxSize, null, null) +#pragma warning restore CS0618 + ; writer.WriteProperty(options, PropMinAge, value.MinAge, null, null); writer.WriteProperty(options, PropMinDocs, value.MinDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropMinPrimaryShardDocs, value.MinPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.g.cs index cccbd91a65e..0ef2a6f0e2f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexLifecycleManagement/RolloverAction.g.cs @@ -46,6 +46,13 @@ internal RolloverAction(Elastic.Clients.Elasticsearch.Serialization.JsonConstruc public long? MaxDocs { get; set; } public long? MaxPrimaryShardDocs { get; set; } public Elastic.Clients.Elasticsearch.ByteSize? MaxPrimaryShardSize { get; set; } + + /// + /// + /// The max_size condition has been deprecated in 9.3.0 and max_primary_shard_size should be used instead + /// + /// + [System.Obsolete("Deprecated in '9.3.0'.")] public Elastic.Clients.Elasticsearch.ByteSize? MaxSize { get; set; } public Elastic.Clients.Elasticsearch.Duration? MinAge { get; set; } public long? MinDocs { get; set; } @@ -103,12 +110,24 @@ public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverActionDesc return this; } + [System.Obsolete("Deprecated in '9.3.0'.")] + /// + /// + /// The max_size condition has been deprecated in 9.3.0 and max_primary_shard_size should be used instead + /// + /// public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverActionDescriptor MaxSize(Elastic.Clients.Elasticsearch.ByteSize? value) { Instance.MaxSize = value; return this; } + [System.Obsolete("Deprecated in '9.3.0'.")] + /// + /// + /// The max_size condition has been deprecated in 9.3.0 and max_primary_shard_size should be used instead + /// + /// public Elastic.Clients.Elasticsearch.IndexLifecycleManagement.RolloverActionDescriptor MaxSize(System.Func action) { Instance.MaxSize = Elastic.Clients.Elasticsearch.ByteSizeFactory.Build(action); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.Converters.g.cs index 724616460aa..c037f3f79e5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.Converters.g.cs @@ -154,7 +154,10 @@ public override Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditions MaxPrimaryShardDocs = propMaxPrimaryShardDocs.Value, MaxPrimaryShardSize = propMaxPrimaryShardSize.Value, MaxPrimaryShardSizeBytes = propMaxPrimaryShardSizeBytes.Value, - MaxSize = propMaxSize.Value, +#pragma warning disable CS0618 + MaxSize = propMaxSize.Value +#pragma warning restore CS0618 +, MaxSizeBytes = propMaxSizeBytes.Value, MinAge = propMinAge.Value, MinDocs = propMinDocs.Value, @@ -175,7 +178,10 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropMaxPrimaryShardDocs, value.MaxPrimaryShardDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropMaxPrimaryShardSize, value.MaxPrimaryShardSize, null, null); writer.WriteProperty(options, PropMaxPrimaryShardSizeBytes, value.MaxPrimaryShardSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); - writer.WriteProperty(options, PropMaxSize, value.MaxSize, null, null); +#pragma warning disable CS0618 + writer.WriteProperty(options, PropMaxSize, value.MaxSize, null, null) +#pragma warning restore CS0618 + ; writer.WriteProperty(options, PropMaxSizeBytes, value.MaxSizeBytes, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropMinAge, value.MinAge, null, null); writer.WriteProperty(options, PropMinDocs, value.MinDocs, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, long? v) => w.WriteNullableValue(o, v)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs index 88ccb61c937..2687c4b6be5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/IndexManagement/RolloverConditions.g.cs @@ -48,6 +48,13 @@ internal RolloverConditions(Elastic.Clients.Elasticsearch.Serialization.JsonCons public long? MaxPrimaryShardDocs { get; set; } public Elastic.Clients.Elasticsearch.ByteSize? MaxPrimaryShardSize { get; set; } public long? MaxPrimaryShardSizeBytes { get; set; } + + /// + /// + /// The max_size condition has been deprecated in 9.3.0 and max_primary_shard_size should be used instead + /// + /// + [System.Obsolete("Deprecated in '9.3.0'.")] public Elastic.Clients.Elasticsearch.ByteSize? MaxSize { get; set; } public long? MaxSizeBytes { get; set; } public Elastic.Clients.Elasticsearch.Duration? MinAge { get; set; } @@ -120,12 +127,24 @@ public Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditionsDescripto return this; } + [System.Obsolete("Deprecated in '9.3.0'.")] + /// + /// + /// The max_size condition has been deprecated in 9.3.0 and max_primary_shard_size should be used instead + /// + /// public Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditionsDescriptor MaxSize(Elastic.Clients.Elasticsearch.ByteSize? value) { Instance.MaxSize = value; return this; } + [System.Obsolete("Deprecated in '9.3.0'.")] + /// + /// + /// The max_size condition has been deprecated in 9.3.0 and max_primary_shard_size should be used instead + /// + /// public Elastic.Clients.Elasticsearch.IndexManagement.RolloverConditionsDescriptor MaxSize(System.Func action) { Instance.MaxSize = Elastic.Clients.Elasticsearch.ByteSizeFactory.Build(action); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAIServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAIServiceSettings.Converters.g.cs new file mode 100644 index 00000000000..ee3f876ead5 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAIServiceSettings.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class ContextualAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropApiKey = System.Text.Json.JsonEncodedText.Encode("api_key"); + private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); + private static readonly System.Text.Json.JsonEncodedText PropRateLimit = System.Text.Json.JsonEncodedText.Encode("rate_limit"); + + public override Elastic.Clients.Elasticsearch.Inference.ContextualAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propApiKey = default; + LocalJsonValue propModelId = default; + LocalJsonValue propRateLimit = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propApiKey.TryReadProperty(ref reader, options, PropApiKey, null)) + { + continue; + } + + if (propModelId.TryReadProperty(ref reader, options, PropModelId, null)) + { + continue; + } + + if (propRateLimit.TryReadProperty(ref reader, options, PropRateLimit, 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.ContextualAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + ApiKey = propApiKey.Value, + ModelId = propModelId.Value, + RateLimit = propRateLimit.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ContextualAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropApiKey, value.ApiKey, null, null); + writer.WriteProperty(options, PropModelId, value.ModelId, null, null); + writer.WriteProperty(options, PropRateLimit, value.RateLimit, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAIServiceSettings.g.cs new file mode 100644 index 00000000000..18c895e75a7 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAIServiceSettings.g.cs @@ -0,0 +1,185 @@ +// 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.ContextualAIServiceSettingsConverter))] +public sealed partial class ContextualAIServiceSettings +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ContextualAIServiceSettings(string apiKey, string modelId) + { + ApiKey = apiKey; + ModelId = modelId; + } +#if NET7_0_OR_GREATER + public ContextualAIServiceSettings() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public ContextualAIServiceSettings() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ContextualAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// A valid API key for your Contexutual AI account. + /// + /// + /// IMPORTANT: You need to provide the API key only once, during the inference model creation. + /// The get inference endpoint API does not retrieve your API key. + /// After creating the inference model, you cannot change the associated API key. + /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + string ApiKey { get; set; } + + /// + /// + /// The name of the model to use for the inference task. + /// Refer to the Contextual AI documentation for the list of available rerank models. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + string ModelId { get; set; } + + /// + /// + /// This setting helps to minimize the number of rate limit errors returned from Contextual AI. + /// The contextualai service sets a default number of requests allowed per minute depending on the task type. + /// For rerank, it is set to 1000. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.RateLimitSetting? RateLimit { get; set; } +} + +public readonly partial struct ContextualAiServiceSettingsDescriptor +{ + internal Elastic.Clients.Elasticsearch.Inference.ContextualAIServiceSettings Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ContextualAiServiceSettingsDescriptor(Elastic.Clients.Elasticsearch.Inference.ContextualAIServiceSettings instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ContextualAiServiceSettingsDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Inference.ContextualAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Inference.ContextualAiServiceSettingsDescriptor(Elastic.Clients.Elasticsearch.Inference.ContextualAIServiceSettings instance) => new Elastic.Clients.Elasticsearch.Inference.ContextualAiServiceSettingsDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Inference.ContextualAIServiceSettings(Elastic.Clients.Elasticsearch.Inference.ContextualAiServiceSettingsDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// A valid API key for your Contexutual AI account. + /// + /// + /// IMPORTANT: You need to provide the API key only once, during the inference model creation. + /// The get inference endpoint API does not retrieve your API key. + /// After creating the inference model, you cannot change the associated API key. + /// If you want to use a different API key, delete the inference model and recreate it with the same name and the updated API key. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ContextualAiServiceSettingsDescriptor ApiKey(string value) + { + Instance.ApiKey = value; + return this; + } + + /// + /// + /// The name of the model to use for the inference task. + /// Refer to the Contextual AI documentation for the list of available rerank models. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ContextualAiServiceSettingsDescriptor ModelId(string value) + { + Instance.ModelId = value; + return this; + } + + /// + /// + /// This setting helps to minimize the number of rate limit errors returned from Contextual AI. + /// The contextualai service sets a default number of requests allowed per minute depending on the task type. + /// For rerank, it is set to 1000. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ContextualAiServiceSettingsDescriptor RateLimit(Elastic.Clients.Elasticsearch.Inference.RateLimitSetting? value) + { + Instance.RateLimit = value; + return this; + } + + /// + /// + /// This setting helps to minimize the number of rate limit errors returned from Contextual AI. + /// The contextualai service sets a default number of requests allowed per minute depending on the task type. + /// For rerank, it is set to 1000. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ContextualAiServiceSettingsDescriptor RateLimit() + { + Instance.RateLimit = Elastic.Clients.Elasticsearch.Inference.RateLimitSettingDescriptor.Build(null); + return this; + } + + /// + /// + /// This setting helps to minimize the number of rate limit errors returned from Contextual AI. + /// The contextualai service sets a default number of requests allowed per minute depending on the task type. + /// For rerank, it is set to 1000. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ContextualAiServiceSettingsDescriptor RateLimit(System.Action? action) + { + Instance.RateLimit = Elastic.Clients.Elasticsearch.Inference.RateLimitSettingDescriptor.Build(action); + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.ContextualAIServiceSettings Build(System.Action action) + { + var builder = new Elastic.Clients.Elasticsearch.Inference.ContextualAiServiceSettingsDescriptor(new Elastic.Clients.Elasticsearch.Inference.ContextualAIServiceSettings(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/ContextualAITaskSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAITaskSettings.Converters.g.cs new file mode 100644 index 00000000000..33cfc7fc77b --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAITaskSettings.Converters.g.cs @@ -0,0 +1,81 @@ +// Licensed to Elasticsearch B.V under one or more agreements. +// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. +// See the LICENSE file in the project root for more information. +// +// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ +// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ +// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ +// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ +// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ +// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ +// ------------------------------------------------ +// +// This file is automatically generated. +// Please do not edit these files manually. +// +// ------------------------------------------------ + +#nullable restore + +using System; +using System.Linq; +using Elastic.Clients.Elasticsearch.Serialization; + +namespace Elastic.Clients.Elasticsearch.Inference.Json; + +public sealed partial class ContextualAITaskSettingsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropInstruction = System.Text.Json.JsonEncodedText.Encode("instruction"); + private static readonly System.Text.Json.JsonEncodedText PropReturnDocuments = System.Text.Json.JsonEncodedText.Encode("return_documents"); + private static readonly System.Text.Json.JsonEncodedText PropTopK = System.Text.Json.JsonEncodedText.Encode("top_k"); + + public override Elastic.Clients.Elasticsearch.Inference.ContextualAITaskSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propInstruction = default; + LocalJsonValue propReturnDocuments = default; + LocalJsonValue propTopK = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propInstruction.TryReadProperty(ref reader, options, PropInstruction, null)) + { + continue; + } + + if (propReturnDocuments.TryReadProperty(ref reader, options, PropReturnDocuments, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + + if (propTopK.TryReadProperty(ref reader, options, PropTopK, static int? (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.ContextualAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Instruction = propInstruction.Value, + ReturnDocuments = propReturnDocuments.Value, + TopK = propTopK.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.ContextualAITaskSettings value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropInstruction, value.Instruction, null, null); + writer.WriteProperty(options, PropReturnDocuments, value.ReturnDocuments, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropTopK, value.TopK, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAITaskSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAITaskSettings.g.cs new file mode 100644 index 00000000000..bffc0ce6d8d --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/ContextualAITaskSettings.g.cs @@ -0,0 +1,139 @@ +// 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.ContextualAITaskSettingsConverter))] +public sealed partial class ContextualAITaskSettings +{ +#if NET7_0_OR_GREATER + public ContextualAITaskSettings() + { + } +#endif +#if !NET7_0_OR_GREATER + public ContextualAITaskSettings() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal ContextualAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Instructions for the reranking model. Refer to https://docs.contextual.ai/api-reference/rerank/rerank#body-instruction + /// Only for the rerank task type. + /// + /// + public string? Instruction { get; set; } + + /// + /// + /// Whether to return the source documents in the response. + /// Only for the rerank task type. + /// + /// + public bool? ReturnDocuments { get; set; } + + /// + /// + /// The number of most relevant documents to return. + /// If not specified, the reranking results of all documents will be returned. + /// Only for the rerank task type. + /// + /// + public int? TopK { get; set; } +} + +public readonly partial struct ContextualAiTaskSettingsDescriptor +{ + internal Elastic.Clients.Elasticsearch.Inference.ContextualAITaskSettings Instance { get; init; } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ContextualAiTaskSettingsDescriptor(Elastic.Clients.Elasticsearch.Inference.ContextualAITaskSettings instance) + { + Instance = instance; + } + + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public ContextualAiTaskSettingsDescriptor() + { + Instance = new Elastic.Clients.Elasticsearch.Inference.ContextualAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + public static explicit operator Elastic.Clients.Elasticsearch.Inference.ContextualAiTaskSettingsDescriptor(Elastic.Clients.Elasticsearch.Inference.ContextualAITaskSettings instance) => new Elastic.Clients.Elasticsearch.Inference.ContextualAiTaskSettingsDescriptor(instance); + public static implicit operator Elastic.Clients.Elasticsearch.Inference.ContextualAITaskSettings(Elastic.Clients.Elasticsearch.Inference.ContextualAiTaskSettingsDescriptor descriptor) => descriptor.Instance; + + /// + /// + /// Instructions for the reranking model. Refer to https://docs.contextual.ai/api-reference/rerank/rerank#body-instruction + /// Only for the rerank task type. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ContextualAiTaskSettingsDescriptor Instruction(string? value) + { + Instance.Instruction = value; + return this; + } + + /// + /// + /// Whether to return the source documents in the response. + /// Only for the rerank task type. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ContextualAiTaskSettingsDescriptor ReturnDocuments(bool? value = true) + { + Instance.ReturnDocuments = value; + return this; + } + + /// + /// + /// The number of most relevant documents to return. + /// If not specified, the reranking results of all documents will be returned. + /// Only for the rerank task type. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.ContextualAiTaskSettingsDescriptor TopK(int? value) + { + Instance.TopK = value; + return this; + } + + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + internal static Elastic.Clients.Elasticsearch.Inference.ContextualAITaskSettings Build(System.Action? action) + { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Inference.ContextualAITaskSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + + var builder = new Elastic.Clients.Elasticsearch.Inference.ContextualAiTaskSettingsDescriptor(new Elastic.Clients.Elasticsearch.Inference.ContextualAITaskSettings(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/GoogleVertexAIServiceSettings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs index 6b92ffa8d4c..03f64fb3d1c 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.Converters.g.cs @@ -25,6 +25,7 @@ namespace Elastic.Clients.Elasticsearch.Inference.Json; public sealed partial class GoogleVertexAIServiceSettingsConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText PropDimensions = System.Text.Json.JsonEncodedText.Encode("dimensions"); private static readonly System.Text.Json.JsonEncodedText PropLocation = System.Text.Json.JsonEncodedText.Encode("location"); private static readonly System.Text.Json.JsonEncodedText PropModelId = System.Text.Json.JsonEncodedText.Encode("model_id"); private static readonly System.Text.Json.JsonEncodedText PropProjectId = System.Text.Json.JsonEncodedText.Encode("project_id"); @@ -34,6 +35,7 @@ public sealed partial class GoogleVertexAIServiceSettingsConverter : System.Text public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDimensions = default; LocalJsonValue propLocation = default; LocalJsonValue propModelId = default; LocalJsonValue propProjectId = default; @@ -41,6 +43,11 @@ public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSet LocalJsonValue propServiceAccountJson = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { + if (propDimensions.TryReadProperty(ref reader, options, PropDimensions, static int? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propLocation.TryReadProperty(ref reader, options, PropLocation, null)) { continue; @@ -78,6 +85,7 @@ public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSet reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { + Dimensions = propDimensions.Value, Location = propLocation.Value, ModelId = propModelId.Value, ProjectId = propProjectId.Value, @@ -89,6 +97,7 @@ public override Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSet public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings value, System.Text.Json.JsonSerializerOptions options) { writer.WriteStartObject(); + writer.WriteProperty(options, PropDimensions, value.Dimensions, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropLocation, value.Location, null, null); writer.WriteProperty(options, PropModelId, value.ModelId, null, null); writer.WriteProperty(options, PropProjectId, value.ProjectId, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs index be605af4909..32b6a5a9b5d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/GoogleVertexAIServiceSettings.g.cs @@ -51,6 +51,15 @@ internal GoogleVertexAIServiceSettings(Elastic.Clients.Elasticsearch.Serializati _ = sentinel; } + /// + /// + /// For a text_embedding task, the number of dimensions the resulting output embeddings should have. + /// By default, the model's standard output dimension is used. + /// Refer to the Google documentation for more information. + /// + /// + public int? Dimensions { get; set; } + /// /// /// The name of the location to use for the inference task. @@ -125,6 +134,19 @@ public GoogleVertexAiServiceSettingsDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor(Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings instance) => new Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.Inference.GoogleVertexAIServiceSettings(Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor descriptor) => descriptor.Instance; + /// + /// + /// For a text_embedding task, the number of dimensions the resulting output embeddings should have. + /// By default, the model's standard output dimension is used. + /// Refer to the Google documentation for more information. + /// + /// + public Elastic.Clients.Elasticsearch.Inference.GoogleVertexAiServiceSettingsDescriptor Dimensions(int? value) + { + Instance.Dimensions = value; + return this; + } + /// /// /// The name of the location to use for the inference task. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.g.cs index 5f9460697c9..8fb48fa0060 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/RateLimitSetting.g.cs @@ -85,6 +85,11 @@ internal RateLimitSetting(Elastic.Clients.Elasticsearch.Serialization.JsonConstr /// /// /// + /// contextualai service: 1000 + /// + /// + /// + /// /// elastic service and task type chat_completion: 240 /// /// @@ -205,6 +210,11 @@ public RateLimitSettingDescriptor() /// /// /// + /// contextualai service: 1000 + /// + /// + /// + /// /// elastic service and task type chat_completion: 240 /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeContextualAI.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeContextualAI.Converters.g.cs new file mode 100644 index 00000000000..bbff6df2c4f --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeContextualAI.Converters.g.cs @@ -0,0 +1,67 @@ +// 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 TaskTypeContextualAIConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText MemberRerank = System.Text.Json.JsonEncodedText.Encode("rerank"); + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + if (reader.ValueTextEquals(MemberRerank)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI.Rerank; + } + + var value = reader.GetString()!; + if (string.Equals(value, MemberRerank.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI.Rerank; + } + + throw new System.Text.Json.JsonException($"Unknown member '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI)}'."); + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI value, System.Text.Json.JsonSerializerOptions options) + { + switch (value) + { + case Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI.Rerank: + writer.WriteStringValue(MemberRerank); + break; + default: + throw new System.Text.Json.JsonException($"Invalid value '{value}' for enum '{nameof(Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI)}'."); + } + } + + public override Elastic.Clients.Elasticsearch.Inference.TaskTypeContextualAI 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.TaskTypeContextualAI 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/TaskTypeContextualAI.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeContextualAI.g.cs new file mode 100644 index 00000000000..a4c9c6c36f8 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Inference/TaskTypeContextualAI.g.cs @@ -0,0 +1,31 @@ +// 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.TaskTypeContextualAIConverter))] +public enum TaskTypeContextualAI +{ + [System.Runtime.Serialization.EnumMember(Value = "rerank")] + Rerank +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ChunkingSettings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ChunkingSettings.g.cs index 0b9120849da..6d796a13c88 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ChunkingSettings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/ChunkingSettings.g.cs @@ -300,8 +300,13 @@ public Elastic.Clients.Elasticsearch.Mapping.ChunkingSettingsDescriptor Strategy } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - internal static Elastic.Clients.Elasticsearch.Mapping.ChunkingSettings Build(System.Action action) + internal static Elastic.Clients.Elasticsearch.Mapping.ChunkingSettings Build(System.Action? action) { + if (action is null) + { + return new Elastic.Clients.Elasticsearch.Mapping.ChunkingSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance); + } + var builder = new Elastic.Clients.Elasticsearch.Mapping.ChunkingSettingsDescriptor(new Elastic.Clients.Elasticsearch.Mapping.ChunkingSettings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance)); action.Invoke(builder); return builder.Instance; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.Converters.g.cs index 1a56ba98a28..4bf7d2d5fc7 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.Converters.g.cs @@ -28,6 +28,7 @@ public sealed partial class DenseVectorIndexOptionsConverter : System.Text.Json. private static readonly System.Text.Json.JsonEncodedText PropConfidenceInterval = System.Text.Json.JsonEncodedText.Encode("confidence_interval"); private static readonly System.Text.Json.JsonEncodedText PropEfConstruction = System.Text.Json.JsonEncodedText.Encode("ef_construction"); private static readonly System.Text.Json.JsonEncodedText PropM = System.Text.Json.JsonEncodedText.Encode("m"); + private static readonly System.Text.Json.JsonEncodedText PropOnDiskRescore = System.Text.Json.JsonEncodedText.Encode("on_disk_rescore"); private static readonly System.Text.Json.JsonEncodedText PropRescoreVector = System.Text.Json.JsonEncodedText.Encode("rescore_vector"); private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("type"); @@ -37,6 +38,7 @@ public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions Re LocalJsonValue propConfidenceInterval = default; LocalJsonValue propEfConstruction = default; LocalJsonValue propM = default; + LocalJsonValue propOnDiskRescore = default; LocalJsonValue propRescoreVector = default; LocalJsonValue propType = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -56,6 +58,11 @@ public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions Re continue; } + if (propOnDiskRescore.TryReadProperty(ref reader, options, PropOnDiskRescore, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + { + continue; + } + if (propRescoreVector.TryReadProperty(ref reader, options, PropRescoreVector, null)) { continue; @@ -81,6 +88,7 @@ public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions Re ConfidenceInterval = propConfidenceInterval.Value, EfConstruction = propEfConstruction.Value, M = propM.Value, + OnDiskRescore = propOnDiskRescore.Value, RescoreVector = propRescoreVector.Value, Type = propType.Value }; @@ -92,6 +100,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropConfidenceInterval, value.ConfidenceInterval, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropEfConstruction, value.EfConstruction, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropM, value.M, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropOnDiskRescore, value.OnDiskRescore, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropRescoreVector, value.RescoreVector, null, null); writer.WriteProperty(options, PropType, value.Type, null, null); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs index 58ac8f8e2c0..c58287c8e18 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptions.g.cs @@ -90,7 +90,17 @@ internal DenseVectorIndexOptions(Elastic.Clients.Elasticsearch.Serialization.Jso /// /// - /// The rescore vector options. This is only applicable to bbq_hnsw, int4_hnsw, int8_hnsw, bbq_flat, int4_flat, and int8_flat index types. + /// true if vector rescoring should be done on-disk + /// + /// + /// Only applicable to bbq_hnsw + /// + /// + public bool? OnDiskRescore { get; set; } + + /// + /// + /// The rescore vector options. This is only applicable to bbq_disk, bbq_hnsw, int4_hnsw, int8_hnsw, bbq_flat, int4_flat, and int8_flat index types. /// /// public Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsRescoreVector? RescoreVector { get; set; } @@ -180,7 +190,21 @@ public Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor M /// /// - /// The rescore vector options. This is only applicable to bbq_hnsw, int4_hnsw, int8_hnsw, bbq_flat, int4_flat, and int8_flat index types. + /// true if vector rescoring should be done on-disk + /// + /// + /// Only applicable to bbq_hnsw + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor OnDiskRescore(bool? value = true) + { + Instance.OnDiskRescore = value; + return this; + } + + /// + /// + /// The rescore vector options. This is only applicable to bbq_disk, bbq_hnsw, int4_hnsw, int8_hnsw, bbq_flat, int4_flat, and int8_flat index types. /// /// public Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor RescoreVector(Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsRescoreVector? value) @@ -191,7 +215,7 @@ public Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor R /// /// - /// The rescore vector options. This is only applicable to bbq_hnsw, int4_hnsw, int8_hnsw, bbq_flat, int4_flat, and int8_flat index types. + /// The rescore vector options. This is only applicable to bbq_disk, bbq_hnsw, int4_hnsw, int8_hnsw, bbq_flat, int4_flat, and int8_flat index types. /// /// public Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsDescriptor RescoreVector(System.Action action) diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.Converters.g.cs index 70763f2ea20..f11128aa18d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.Converters.g.cs @@ -25,6 +25,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping.Json; public sealed partial class DenseVectorIndexOptionsTypeConverter : System.Text.Json.Serialization.JsonConverter { + private static readonly System.Text.Json.JsonEncodedText MemberBbqDisk = System.Text.Json.JsonEncodedText.Encode("bbq_disk"); private static readonly System.Text.Json.JsonEncodedText MemberBbqFlat = System.Text.Json.JsonEncodedText.Encode("bbq_flat"); private static readonly System.Text.Json.JsonEncodedText MemberBbqHnsw = System.Text.Json.JsonEncodedText.Encode("bbq_hnsw"); private static readonly System.Text.Json.JsonEncodedText MemberFlat = System.Text.Json.JsonEncodedText.Encode("flat"); @@ -36,6 +37,11 @@ public sealed partial class DenseVectorIndexOptionsTypeConverter : System.Text.J public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { + if (reader.ValueTextEquals(MemberBbqDisk)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqDisk; + } + if (reader.ValueTextEquals(MemberBbqFlat)) { return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqFlat; @@ -77,6 +83,11 @@ public override Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsTyp } var value = reader.GetString()!; + if (string.Equals(value, MemberBbqDisk.Value, System.StringComparison.OrdinalIgnoreCase)) + { + return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqDisk; + } + if (string.Equals(value, MemberBbqFlat.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqFlat; @@ -124,6 +135,9 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { switch (value) { + case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqDisk: + writer.WriteStringValue(MemberBbqDisk); + break; case Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptionsType.BbqFlat: writer.WriteStringValue(MemberBbqFlat); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.g.cs index 682f6daa44c..1be0174cb37 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/DenseVectorIndexOptionsType.g.cs @@ -26,6 +26,18 @@ namespace Elastic.Clients.Elasticsearch.Mapping; [System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Mapping.Json.DenseVectorIndexOptionsTypeConverter))] public enum DenseVectorIndexOptionsType { + /// + /// + /// This utilizes the DiskBBQ algorithm, a version of Inverted Vector File (IVF) that uses BBQ to quantize vectors. + /// Only supports element_type of float. + /// + /// + /// This not only significantly reduces memory usage, but also allows for indexing and searching of very large datasets that do not fit in memory. + /// Unlike HNSW, this index type loses performance gracefully as the index grows larger than memory. + /// + /// + [System.Runtime.Serialization.EnumMember(Value = "bbq_disk")] + BbqDisk, /// /// /// This utilizes a brute-force search algorithm in addition to automatically quantizing to binary vectors. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.Converters.g.cs index b765486de9e..76d455ed27f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.Converters.g.cs @@ -26,11 +26,13 @@ namespace Elastic.Clients.Elasticsearch.Mapping.Json; public sealed partial class SemanticTextIndexOptionsConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropDenseVector = System.Text.Json.JsonEncodedText.Encode("dense_vector"); + private static readonly System.Text.Json.JsonEncodedText PropSparseVector = System.Text.Json.JsonEncodedText.Encode("sparse_vector"); public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptions Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propDenseVector = default; + LocalJsonValue propSparseVector = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propDenseVector.TryReadProperty(ref reader, options, PropDenseVector, null)) @@ -38,6 +40,11 @@ public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptions R continue; } + if (propSparseVector.TryReadProperty(ref reader, options, PropSparseVector, null)) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -50,7 +57,8 @@ public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptions R reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); return new Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptions(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { - DenseVector = propDenseVector.Value + DenseVector = propDenseVector.Value, + SparseVector = propSparseVector.Value }; } @@ -58,6 +66,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropDenseVector, value.DenseVector, null, null); + writer.WriteProperty(options, PropSparseVector, value.SparseVector, null, null); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.g.cs index b09d5346c47..d5060575a71 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextIndexOptions.g.cs @@ -43,6 +43,7 @@ internal SemanticTextIndexOptions(Elastic.Clients.Elasticsearch.Serialization.Js } public Elastic.Clients.Elasticsearch.Mapping.DenseVectorIndexOptions? DenseVector { get; set; } + public Elastic.Clients.Elasticsearch.Mapping.SparseVectorIndexOptions? SparseVector { get; set; } } public readonly partial struct SemanticTextIndexOptionsDescriptor @@ -76,6 +77,24 @@ public Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptionsDescriptor return this; } + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptionsDescriptor SparseVector(Elastic.Clients.Elasticsearch.Mapping.SparseVectorIndexOptions? value) + { + Instance.SparseVector = value; + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptionsDescriptor SparseVector() + { + Instance.SparseVector = Elastic.Clients.Elasticsearch.Mapping.SparseVectorIndexOptionsDescriptor.Build(null); + return this; + } + + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptionsDescriptor SparseVector(System.Action? action) + { + Instance.SparseVector = Elastic.Clients.Elasticsearch.Mapping.SparseVectorIndexOptionsDescriptor.Build(action); + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.Mapping.SemanticTextIndexOptions Build(System.Action? action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.Converters.g.cs index e35d5722f90..6b84904cae4 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.Converters.g.cs @@ -26,6 +26,7 @@ namespace Elastic.Clients.Elasticsearch.Mapping.Json; public sealed partial class SemanticTextPropertyConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropChunkingSettings = System.Text.Json.JsonEncodedText.Encode("chunking_settings"); + private static readonly System.Text.Json.JsonEncodedText PropFields = System.Text.Json.JsonEncodedText.Encode("fields"); private static readonly System.Text.Json.JsonEncodedText PropIndexOptions = System.Text.Json.JsonEncodedText.Encode("index_options"); private static readonly System.Text.Json.JsonEncodedText PropInferenceId = System.Text.Json.JsonEncodedText.Encode("inference_id"); private static readonly System.Text.Json.JsonEncodedText PropMeta = System.Text.Json.JsonEncodedText.Encode("meta"); @@ -36,6 +37,7 @@ public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty Read( { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propChunkingSettings = default; + LocalJsonValue propFields = default; LocalJsonValue propIndexOptions = default; LocalJsonValue propInferenceId = default; LocalJsonValue?> propMeta = default; @@ -47,6 +49,11 @@ public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty Read( continue; } + if (propFields.TryReadProperty(ref reader, options, PropFields, null)) + { + continue; + } + if (propIndexOptions.TryReadProperty(ref reader, options, PropIndexOptions, null)) { continue; @@ -86,6 +93,7 @@ public override Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty Read( return new Elastic.Clients.Elasticsearch.Mapping.SemanticTextProperty(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { ChunkingSettings = propChunkingSettings.Value, + Fields = propFields.Value, IndexOptions = propIndexOptions.Value, InferenceId = propInferenceId.Value, Meta = propMeta.Value, @@ -97,6 +105,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropChunkingSettings, value.ChunkingSettings, null, null); + writer.WriteProperty(options, PropFields, value.Fields, null, null); writer.WriteProperty(options, PropIndexOptions, value.IndexOptions, null, null); writer.WriteProperty(options, PropInferenceId, value.InferenceId, null, null); writer.WriteProperty(options, PropMeta, value.Meta, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.Collections.Generic.IDictionary? v) => w.WriteDictionaryValue(o, v, null, null)); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.g.cs index da57911ed4d..6e55748dd85 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Mapping/SemanticTextProperty.g.cs @@ -51,6 +51,14 @@ internal SemanticTextProperty(Elastic.Clients.Elasticsearch.Serialization.JsonCo /// public Elastic.Clients.Elasticsearch.Mapping.ChunkingSettings? ChunkingSettings { get; set; } + /// + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + /// field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.Properties? Fields { get; set; } + /// /// /// Settings for index_options that override any defaults used by semantic_text, for example @@ -120,12 +128,49 @@ public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor /// - public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor ChunkingSettings(System.Action action) + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor ChunkingSettings() + { + Instance.ChunkingSettings = Elastic.Clients.Elasticsearch.Mapping.ChunkingSettingsDescriptor.Build(null); + return this; + } + + /// + /// + /// Settings for chunking text into smaller passages. If specified, these will override the + /// chunking settings sent in the inference endpoint associated with inference_id. If chunking settings are updated, + /// they will not be applied to existing documents until they are reindexed. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor ChunkingSettings(System.Action? action) { Instance.ChunkingSettings = Elastic.Clients.Elasticsearch.Mapping.ChunkingSettingsDescriptor.Build(action); return this; } + /// + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + /// field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Properties? value) + { + Instance.Fields = value; + return this; + } + + /// + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + /// field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor Fields(System.Action> action) + { + Instance.Fields = Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor.Build(action); + return this; + } + /// /// /// Settings for index_options that override any defaults used by semantic_text, for example @@ -266,12 +311,61 @@ public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor Chun /// they will not be applied to existing documents until they are reindexed. /// /// - public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor ChunkingSettings(System.Action action) + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor ChunkingSettings() + { + Instance.ChunkingSettings = Elastic.Clients.Elasticsearch.Mapping.ChunkingSettingsDescriptor.Build(null); + return this; + } + + /// + /// + /// Settings for chunking text into smaller passages. If specified, these will override the + /// chunking settings sent in the inference endpoint associated with inference_id. If chunking settings are updated, + /// they will not be applied to existing documents until they are reindexed. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor ChunkingSettings(System.Action? action) { Instance.ChunkingSettings = Elastic.Clients.Elasticsearch.Mapping.ChunkingSettingsDescriptor.Build(action); return this; } + /// + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + /// field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor Fields(Elastic.Clients.Elasticsearch.Mapping.Properties? value) + { + Instance.Fields = value; + return this; + } + + /// + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + /// field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor Fields(System.Action action) + { + Instance.Fields = Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor.Build(action); + return this; + } + + /// + /// + /// Multi-fields allow the same string value to be indexed in multiple ways for different purposes, such as one + /// field for search and a multi-field for sorting and aggregations, or the same string value analyzed by different analyzers. + /// + /// + public Elastic.Clients.Elasticsearch.Mapping.SemanticTextPropertyDescriptor Fields(System.Action> action) + { + Instance.Fields = Elastic.Clients.Elasticsearch.Mapping.PropertiesDescriptor.Build(action); + return this; + } + /// /// /// Settings for index_options that override any defaults used by semantic_text, for example diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Project/Tags.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Project/Tags.Converters.g.cs deleted file mode 100644 index b04938afa90..00000000000 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Project/Tags.Converters.g.cs +++ /dev/null @@ -1,96 +0,0 @@ -// Licensed to Elasticsearch B.V under one or more agreements. -// Elasticsearch B.V licenses this file to you under the Apache 2.0 License. -// See the LICENSE file in the project root for more information. -// -// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ -// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ -// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ -// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ -// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ -// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ -// ------------------------------------------------ -// -// This file is automatically generated. -// Please do not edit these files manually. -// -// ------------------------------------------------ - -#nullable restore - -using System; -using System.Linq; -using Elastic.Clients.Elasticsearch.Serialization; - -namespace Elastic.Clients.Elasticsearch.Project.Json; - -public sealed partial class TagsConverter : System.Text.Json.Serialization.JsonConverter -{ - private static readonly System.Text.Json.JsonEncodedText PropAlias = System.Text.Json.JsonEncodedText.Encode("_alias"); - private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("_id"); - private static readonly System.Text.Json.JsonEncodedText PropOrganisation = System.Text.Json.JsonEncodedText.Encode("_organisation"); - private static readonly System.Text.Json.JsonEncodedText PropType = System.Text.Json.JsonEncodedText.Encode("_type"); - - public override Elastic.Clients.Elasticsearch.Project.Tags Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) - { - reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propAlias = default; - LocalJsonValue propId = default; - LocalJsonValue propOrganisation = default; - LocalJsonValue propType = default; - System.Collections.Generic.Dictionary? propUserDefinedTags = default; - while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) - { - if (propAlias.TryReadProperty(ref reader, options, PropAlias, null)) - { - continue; - } - - if (propId.TryReadProperty(ref reader, options, PropId, null)) - { - continue; - } - - if (propOrganisation.TryReadProperty(ref reader, options, PropOrganisation, null)) - { - continue; - } - - if (propType.TryReadProperty(ref reader, options, PropType, null)) - { - continue; - } - - propUserDefinedTags ??= new System.Collections.Generic.Dictionary(); - reader.ReadProperty(options, out string key, out string value, static string (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadPropertyName(o)!, null); - propUserDefinedTags[key] = value; - } - - reader.ValidateToken(System.Text.Json.JsonTokenType.EndObject); - return new Elastic.Clients.Elasticsearch.Project.Tags(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) - { - Alias = propAlias.Value, - Id = propId.Value, - Organisation = propOrganisation.Value, - Type = propType.Value, - UserDefinedTags = propUserDefinedTags - }; - } - - public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Project.Tags value, System.Text.Json.JsonSerializerOptions options) - { - writer.WriteStartObject(); - writer.WriteProperty(options, PropAlias, value.Alias, null, null); - writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropOrganisation, value.Organisation, null, null); - writer.WriteProperty(options, PropType, value.Type, null, null); - if (value.UserDefinedTags is not null) - { - foreach (var item in value.UserDefinedTags) - { - writer.WriteProperty(options, item.Key, item.Value, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, string v) => w.WritePropertyName(o, v), null); - } - } - - writer.WriteEndObject(); - } -} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.Converters.g.cs index 03be64df323..c5d0365cd4f 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.Converters.g.cs @@ -26,6 +26,7 @@ namespace Elastic.Clients.Elasticsearch.Security.Json; public sealed partial class ApiKeyConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropAccess = System.Text.Json.JsonEncodedText.Encode("access"); + private static readonly System.Text.Json.JsonEncodedText PropCertificateIdentity = System.Text.Json.JsonEncodedText.Encode("certificate_identity"); private static readonly System.Text.Json.JsonEncodedText PropCreation = System.Text.Json.JsonEncodedText.Encode("creation"); private static readonly System.Text.Json.JsonEncodedText PropExpiration = System.Text.Json.JsonEncodedText.Encode("expiration"); private static readonly System.Text.Json.JsonEncodedText PropId = System.Text.Json.JsonEncodedText.Encode("id"); @@ -46,6 +47,7 @@ public override Elastic.Clients.Elasticsearch.Security.ApiKey Read(ref System.Te { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propAccess = default; + LocalJsonValue propCertificateIdentity = default; LocalJsonValue propCreation = default; LocalJsonValue propExpiration = default; LocalJsonValue propId = default; @@ -68,6 +70,11 @@ public override Elastic.Clients.Elasticsearch.Security.ApiKey Read(ref System.Te continue; } + if (propCertificateIdentity.TryReadProperty(ref reader, options, PropCertificateIdentity, null)) + { + continue; + } + if (propCreation.TryReadProperty(ref reader, options, PropCreation, static System.DateTimeOffset (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker)))) { continue; @@ -156,6 +163,7 @@ public override Elastic.Clients.Elasticsearch.Security.ApiKey Read(ref System.Te return new Elastic.Clients.Elasticsearch.Security.ApiKey(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Access = propAccess.Value, + CertificateIdentity = propCertificateIdentity.Value, Creation = propCreation.Value, Expiration = propExpiration.Value, Id = propId.Value, @@ -178,6 +186,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropAccess, value.Access, null, null); + writer.WriteProperty(options, PropCertificateIdentity, value.CertificateIdentity, null, null); writer.WriteProperty(options, PropCreation, value.Creation, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.DateTimeOffset v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.DateTimeMillisMarker))); writer.WriteProperty(options, PropExpiration, value.Expiration, 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, PropId, value.Id, null, null); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.g.cs index 84c94412c42..61891a058fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKey.g.cs @@ -65,6 +65,15 @@ internal ApiKey(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSenti /// public Elastic.Clients.Elasticsearch.Security.Access? Access { get; set; } + /// + /// + /// The certificate identity associated with a cross-cluster API key. + /// Restricts the API key to connections authenticated by a specific TLS certificate. + /// Only applicable to cross-cluster API keys. + /// + /// + public string? CertificateIdentity { get; set; } + /// /// /// Creation time for the API key in milliseconds. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.Converters.g.cs index da2f3af3fbe..dfd1ffc2d09 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.Converters.g.cs @@ -34,7 +34,6 @@ public override Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregation { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue?> propFilters = default; - LocalJsonValue propKeyed = default; LocalJsonValue propOtherBucket = default; LocalJsonValue propOtherBucketKey = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -44,8 +43,9 @@ public override Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregation continue; } - if (propKeyed.TryReadProperty(ref reader, options, PropKeyed, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) + if (reader.ValueTextEquals(PropKeyed)) { + reader.SafeSkip(); continue; } @@ -72,7 +72,6 @@ public override Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregation return new Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregation(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Filters = propFilters.Value, - Keyed = propKeyed.Value, OtherBucket = propOtherBucket.Value, OtherBucketKey = propOtherBucketKey.Value }; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.g.cs index be7cbe4cf3b..efb8bbdc8f1 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/ApiKeyFiltersAggregation.g.cs @@ -55,7 +55,7 @@ internal ApiKeyFiltersAggregation(Elastic.Clients.Elasticsearch.Serialization.Js /// Set to false to return the buckets as an array of objects. /// /// - public bool? Keyed { get; set; } + public bool? Keyed => false; /// /// @@ -113,18 +113,6 @@ public Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregationDescriptor return this; } - /// - /// - /// By default, the named filters aggregation returns the buckets as an object. - /// Set to false to return the buckets as an array of objects. - /// - /// - public Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregationDescriptor Keyed(bool? value = true) - { - Instance.Keyed = value; - return this; - } - /// /// /// Set to true to add a bucket to the response which will contain all documents that do not match any of the given filters. @@ -213,18 +201,6 @@ public Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregationDescriptor return this; } - /// - /// - /// By default, the named filters aggregation returns the buckets as an object. - /// Set to false to return the buckets as an array of objects. - /// - /// - public Elastic.Clients.Elasticsearch.Security.ApiKeyFiltersAggregationDescriptor Keyed(bool? value = true) - { - Instance.Keyed = value; - return this; - } - /// /// /// Set to true to add a bucket to the response which will contain all documents that do not match any of the given filters. diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.Converters.g.cs index 0a310e1b51b..e5634271189 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.Converters.g.cs @@ -34,7 +34,7 @@ public override Elastic.Clients.Elasticsearch.Security.AuthenticateApiKey Read(r { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propId = default; - LocalJsonValue propInternal = default; + LocalJsonValue propInternal = default; LocalJsonValue propManagedBy = default; LocalJsonValue propName = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) @@ -44,7 +44,7 @@ public override Elastic.Clients.Elasticsearch.Security.AuthenticateApiKey Read(r continue; } - if (propInternal.TryReadProperty(ref reader, options, PropInternal, null)) + if (propInternal.TryReadProperty(ref reader, options, PropInternal, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) { continue; } @@ -82,7 +82,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropId, value.Id, null, null); - writer.WriteProperty(options, PropInternal, value.Internal, null, null); + writer.WriteProperty(options, PropInternal, value.Internal, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropManagedBy, value.ManagedBy, null, null); writer.WriteProperty(options, PropName, value.Name, null, null); writer.WriteEndObject(); diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.g.cs index 560adde33ac..78be9a31fdc 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/AuthenticateApiKey.g.cs @@ -27,10 +27,9 @@ namespace Elastic.Clients.Elasticsearch.Security; public sealed partial class AuthenticateApiKey { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public AuthenticateApiKey(string id, bool @internal, Elastic.Clients.Elasticsearch.Security.ApiKeyManagedBy managedBy) + public AuthenticateApiKey(string id, Elastic.Clients.Elasticsearch.Security.ApiKeyManagedBy managedBy) { Id = id; - Internal = @internal; ManagedBy = managedBy; } #if NET7_0_OR_GREATER @@ -55,11 +54,7 @@ internal AuthenticateApiKey(Elastic.Clients.Elasticsearch.Serialization.JsonCons required #endif string Id { get; set; } - public -#if NET7_0_OR_GREATER - required -#endif - bool Internal { get; set; } + public bool? Internal { get; set; } public #if NET7_0_OR_GREATER required diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodeSecurityStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodeSecurityStats.Converters.g.cs new file mode 100644 index 00000000000..dd10e1893bd --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodeSecurityStats.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 NodeSecurityStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropRoles = System.Text.Json.JsonEncodedText.Encode("roles"); + + public override Elastic.Clients.Elasticsearch.Security.NodeSecurityStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propRoles = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propRoles.TryReadProperty(ref reader, options, PropRoles, 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.NodeSecurityStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Roles = propRoles.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.NodeSecurityStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropRoles, value.Roles, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodeSecurityStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodeSecurityStats.g.cs new file mode 100644 index 00000000000..674480527b2 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/NodeSecurityStats.g.cs @@ -0,0 +1,61 @@ +// 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.NodeSecurityStatsConverter))] +public sealed partial class NodeSecurityStats +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public NodeSecurityStats(Elastic.Clients.Elasticsearch.Security.RolesStats roles) + { + Roles = roles; + } +#if NET7_0_OR_GREATER + public NodeSecurityStats() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public NodeSecurityStats() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal NodeSecurityStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Role statistics. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Security.RolesStats Roles { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RolesStats.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RolesStats.Converters.g.cs new file mode 100644 index 00000000000..0f72920fae6 --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RolesStats.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 RolesStatsConverter : System.Text.Json.Serialization.JsonConverter +{ + private static readonly System.Text.Json.JsonEncodedText PropDls = System.Text.Json.JsonEncodedText.Encode("dls"); + + public override Elastic.Clients.Elasticsearch.Security.RolesStats Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) + { + reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); + LocalJsonValue propDls = default; + while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) + { + if (propDls.TryReadProperty(ref reader, options, PropDls, 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.RolesStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) + { + Dls = propDls.Value + }; + } + + public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clients.Elasticsearch.Security.RolesStats value, System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStartObject(); + writer.WriteProperty(options, PropDls, value.Dls, null, null); + writer.WriteEndObject(); + } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RolesStats.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RolesStats.g.cs new file mode 100644 index 00000000000..4aa5be9f68a --- /dev/null +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Security/RolesStats.g.cs @@ -0,0 +1,61 @@ +// 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.RolesStatsConverter))] +public sealed partial class RolesStats +{ + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + public RolesStats(Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDls dls) + { + Dls = dls; + } +#if NET7_0_OR_GREATER + public RolesStats() + { + } +#endif +#if !NET7_0_OR_GREATER + [System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")] + public RolesStats() + { + } +#endif + [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] + internal RolesStats(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel) + { + _ = sentinel; + } + + /// + /// + /// Document-level security (DLS) statistics. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDls Dls { get; set; } +} \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.Converters.g.cs index a5e6d50c9b7..ae8b597bab5 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.Converters.g.cs @@ -31,7 +31,7 @@ public sealed partial class TextEmbeddingConverter : System.Text.Json.Serializat public override Elastic.Clients.Elasticsearch.TextEmbedding Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); - LocalJsonValue propModelId = default; + LocalJsonValue propModelId = default; LocalJsonValue propModelText = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs index 1bc9cc5ad77..465897084fe 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TextEmbedding.g.cs @@ -27,9 +27,8 @@ namespace Elastic.Clients.Elasticsearch; public sealed partial class TextEmbedding { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public TextEmbedding(string modelId, string modelText) + public TextEmbedding(string modelText) { - ModelId = modelId; ModelText = modelText; } #if NET7_0_OR_GREATER @@ -49,11 +48,13 @@ internal TextEmbedding(Elastic.Clients.Elasticsearch.Serialization.JsonConstruct _ = sentinel; } - public -#if NET7_0_OR_GREATER - required -#endif - string ModelId { get; set; } + /// + /// + /// Model ID is required for all dense_vector fields but + /// may be inferred for semantic_text fields + /// + /// + public string? ModelId { get; set; } public #if NET7_0_OR_GREATER required @@ -80,7 +81,13 @@ public TextEmbeddingDescriptor() public static explicit operator Elastic.Clients.Elasticsearch.TextEmbeddingDescriptor(Elastic.Clients.Elasticsearch.TextEmbedding instance) => new Elastic.Clients.Elasticsearch.TextEmbeddingDescriptor(instance); public static implicit operator Elastic.Clients.Elasticsearch.TextEmbedding(Elastic.Clients.Elasticsearch.TextEmbeddingDescriptor descriptor) => descriptor.Instance; - public Elastic.Clients.Elasticsearch.TextEmbeddingDescriptor ModelId(string value) + /// + /// + /// Model ID is required for all dense_vector fields but + /// may be inferred for semantic_text fields + /// + /// + public Elastic.Clients.Elasticsearch.TextEmbeddingDescriptor ModelId(string? value) { Instance.ModelId = value; return this; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.Converters.g.cs index 95d6d2c5486..ec70600c9d8 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.Converters.g.cs @@ -31,6 +31,7 @@ public sealed partial class SettingsConverter : System.Text.Json.Serialization.J private static readonly System.Text.Json.JsonEncodedText PropDocsPerSecond = System.Text.Json.JsonEncodedText.Encode("docs_per_second"); private static readonly System.Text.Json.JsonEncodedText PropMaxPageSearchSize = System.Text.Json.JsonEncodedText.Encode("max_page_search_size"); private static readonly System.Text.Json.JsonEncodedText PropUnattended = System.Text.Json.JsonEncodedText.Encode("unattended"); + private static readonly System.Text.Json.JsonEncodedText PropUsePointInTime = System.Text.Json.JsonEncodedText.Encode("use_point_in_time"); public override Elastic.Clients.Elasticsearch.TransformManagement.Settings Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { @@ -41,6 +42,7 @@ public override Elastic.Clients.Elasticsearch.TransformManagement.Settings Read( LocalJsonValue propDocsPerSecond = default; LocalJsonValue propMaxPageSearchSize = default; LocalJsonValue propUnattended = default; + LocalJsonValue propUsePointInTime = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propAlignCheckpoints.TryReadProperty(ref reader, options, PropAlignCheckpoints, static bool? (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadNullableValue(o))) @@ -73,6 +75,11 @@ public override Elastic.Clients.Elasticsearch.TransformManagement.Settings Read( continue; } + if (propUsePointInTime.TryReadProperty(ref reader, options, PropUsePointInTime, static bool? (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(); @@ -90,7 +97,8 @@ public override Elastic.Clients.Elasticsearch.TransformManagement.Settings Read( DeduceMappings = propDeduceMappings.Value, DocsPerSecond = propDocsPerSecond.Value, MaxPageSearchSize = propMaxPageSearchSize.Value, - Unattended = propUnattended.Value + Unattended = propUnattended.Value, + UsePointInTime = propUsePointInTime.Value }; } @@ -103,6 +111,7 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien writer.WriteProperty(options, PropDocsPerSecond, value.DocsPerSecond, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, float? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropMaxPageSearchSize, value.MaxPageSearchSize, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, int? v) => w.WriteNullableValue(o, v)); writer.WriteProperty(options, PropUnattended, value.Unattended, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); + writer.WriteProperty(options, PropUsePointInTime, value.UsePointInTime, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, bool? v) => w.WriteNullableValue(o, v)); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.g.cs index 6b85ef89116..072d8080f97 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/TransformManagement/Settings.g.cs @@ -97,6 +97,17 @@ internal Settings(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSen /// /// public bool? Unattended { get; set; } + + /// + /// + /// Specifies whether the transform checkpoint will use the Point In Time API while searching over the source index. + /// In general, Point In Time is an optimization that will reduce pressure on the source index by reducing the amount + /// of refreshes and merges, but it can be expensive if a large number of Point In Times are opened and closed for a + /// given index. The benefits and impact depend on the data being searched, the ingest rate into the source index, and + /// the amount of other consumers searching the same source index. + /// + /// + public bool? UsePointInTime { get; set; } } /// @@ -198,6 +209,21 @@ public Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor Unat return this; } + /// + /// + /// Specifies whether the transform checkpoint will use the Point In Time API while searching over the source index. + /// In general, Point In Time is an optimization that will reduce pressure on the source index by reducing the amount + /// of refreshes and merges, but it can be expensive if a large number of Point In Times are opened and closed for a + /// given index. The benefits and impact depend on the data being searched, the ingest rate into the source index, and + /// the amount of other consumers searching the same source index. + /// + /// + public Elastic.Clients.Elasticsearch.TransformManagement.SettingsDescriptor UsePointInTime(bool? value = true) + { + Instance.UsePointInTime = value; + return this; + } + [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] internal static Elastic.Clients.Elasticsearch.TransformManagement.Settings Build(System.Action? action) { diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.Converters.g.cs index 396a066c3ef..1b43bad6429 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.Converters.g.cs @@ -27,7 +27,6 @@ public sealed partial class VersionTypeConverter : System.Text.Json.Serializatio { private static readonly System.Text.Json.JsonEncodedText MemberExternal = System.Text.Json.JsonEncodedText.Encode("external"); private static readonly System.Text.Json.JsonEncodedText MemberExternalGte = System.Text.Json.JsonEncodedText.Encode("external_gte"); - private static readonly System.Text.Json.JsonEncodedText MemberForce = System.Text.Json.JsonEncodedText.Encode("force"); private static readonly System.Text.Json.JsonEncodedText MemberInternal = System.Text.Json.JsonEncodedText.Encode("internal"); public override Elastic.Clients.Elasticsearch.VersionType Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) @@ -42,11 +41,6 @@ public override Elastic.Clients.Elasticsearch.VersionType Read(ref System.Text.J return Elastic.Clients.Elasticsearch.VersionType.ExternalGte; } - if (reader.ValueTextEquals(MemberForce)) - { - return Elastic.Clients.Elasticsearch.VersionType.Force; - } - if (reader.ValueTextEquals(MemberInternal)) { return Elastic.Clients.Elasticsearch.VersionType.Internal; @@ -63,11 +57,6 @@ public override Elastic.Clients.Elasticsearch.VersionType Read(ref System.Text.J return Elastic.Clients.Elasticsearch.VersionType.ExternalGte; } - if (string.Equals(value, MemberForce.Value, System.StringComparison.OrdinalIgnoreCase)) - { - return Elastic.Clients.Elasticsearch.VersionType.Force; - } - if (string.Equals(value, MemberInternal.Value, System.StringComparison.OrdinalIgnoreCase)) { return Elastic.Clients.Elasticsearch.VersionType.Internal; @@ -86,9 +75,6 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien case Elastic.Clients.Elasticsearch.VersionType.ExternalGte: writer.WriteStringValue(MemberExternalGte); break; - case Elastic.Clients.Elasticsearch.VersionType.Force: - writer.WriteStringValue(MemberForce); - break; case Elastic.Clients.Elasticsearch.VersionType.Internal: writer.WriteStringValue(MemberInternal); break; diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.g.cs index 155de681001..b1cb198ab70 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/VersionType.g.cs @@ -44,13 +44,6 @@ public enum VersionType ExternalGte, /// /// - /// This option is deprecated because it can cause primary and replica shards to diverge. - /// - /// - [System.Runtime.Serialization.EnumMember(Value = "force")] - Force, - /// - /// /// Use internal versioning that starts at 1 and increments with each update or delete. /// /// diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.Converters.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.Converters.g.cs index 108550c6e91..5489ba139c9 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.Converters.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.Converters.g.cs @@ -26,15 +26,25 @@ namespace Elastic.Clients.Elasticsearch.Xpack.Json; public sealed partial class SecurityRolesDlsBitSetCacheConverter : System.Text.Json.Serialization.JsonConverter { private static readonly System.Text.Json.JsonEncodedText PropCount = System.Text.Json.JsonEncodedText.Encode("count"); + private static readonly System.Text.Json.JsonEncodedText PropEvictions = System.Text.Json.JsonEncodedText.Encode("evictions"); + private static readonly System.Text.Json.JsonEncodedText PropHits = System.Text.Json.JsonEncodedText.Encode("hits"); + private static readonly System.Text.Json.JsonEncodedText PropHitsTimeInMillis = System.Text.Json.JsonEncodedText.Encode("hits_time_in_millis"); private static readonly System.Text.Json.JsonEncodedText PropMemory = System.Text.Json.JsonEncodedText.Encode("memory"); private static readonly System.Text.Json.JsonEncodedText PropMemoryInBytes = System.Text.Json.JsonEncodedText.Encode("memory_in_bytes"); + private static readonly System.Text.Json.JsonEncodedText PropMisses = System.Text.Json.JsonEncodedText.Encode("misses"); + private static readonly System.Text.Json.JsonEncodedText PropMissesTimeInMillis = System.Text.Json.JsonEncodedText.Encode("misses_time_in_millis"); public override Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCache Read(ref System.Text.Json.Utf8JsonReader reader, System.Type typeToConvert, System.Text.Json.JsonSerializerOptions options) { reader.ValidateToken(System.Text.Json.JsonTokenType.StartObject); LocalJsonValue propCount = default; + LocalJsonValue propEvictions = default; + LocalJsonValue propHits = default; + LocalJsonValue propHitsTimeInMillis = default; LocalJsonValue propMemory = default; LocalJsonValue propMemoryInBytes = default; + LocalJsonValue propMisses = default; + LocalJsonValue propMissesTimeInMillis = default; while (reader.Read() && reader.TokenType is System.Text.Json.JsonTokenType.PropertyName) { if (propCount.TryReadProperty(ref reader, options, PropCount, null)) @@ -42,6 +52,21 @@ public override Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCache continue; } + if (propEvictions.TryReadProperty(ref reader, options, PropEvictions, null)) + { + continue; + } + + if (propHits.TryReadProperty(ref reader, options, PropHits, null)) + { + continue; + } + + if (propHitsTimeInMillis.TryReadProperty(ref reader, options, PropHitsTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + if (propMemory.TryReadProperty(ref reader, options, PropMemory, null)) { continue; @@ -52,6 +77,16 @@ public override Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCache continue; } + if (propMisses.TryReadProperty(ref reader, options, PropMisses, null)) + { + continue; + } + + if (propMissesTimeInMillis.TryReadProperty(ref reader, options, PropMissesTimeInMillis, static System.TimeSpan (ref System.Text.Json.Utf8JsonReader r, System.Text.Json.JsonSerializerOptions o) => r.ReadValueEx(o, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker)))) + { + continue; + } + if (options.UnmappedMemberHandling is System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip) { reader.SafeSkip(); @@ -65,8 +100,13 @@ public override Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCache return new Elastic.Clients.Elasticsearch.Xpack.SecurityRolesDlsBitSetCache(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel.Instance) { Count = propCount.Value, + Evictions = propEvictions.Value, + Hits = propHits.Value, + HitsTimeInMillis = propHitsTimeInMillis.Value, Memory = propMemory.Value, - MemoryInBytes = propMemoryInBytes.Value + MemoryInBytes = propMemoryInBytes.Value, + Misses = propMisses.Value, + MissesTimeInMillis = propMissesTimeInMillis.Value }; } @@ -74,8 +114,13 @@ public override void Write(System.Text.Json.Utf8JsonWriter writer, Elastic.Clien { writer.WriteStartObject(); writer.WriteProperty(options, PropCount, value.Count, null, null); + writer.WriteProperty(options, PropEvictions, value.Evictions, null, null); + writer.WriteProperty(options, PropHits, value.Hits, null, null); + writer.WriteProperty(options, PropHitsTimeInMillis, value.HitsTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); writer.WriteProperty(options, PropMemory, value.Memory, null, null); writer.WriteProperty(options, PropMemoryInBytes, value.MemoryInBytes, null, null); + writer.WriteProperty(options, PropMisses, value.Misses, null, null); + writer.WriteProperty(options, PropMissesTimeInMillis, value.MissesTimeInMillis, null, static (System.Text.Json.Utf8JsonWriter w, System.Text.Json.JsonSerializerOptions o, System.TimeSpan v) => w.WriteValueEx(o, v, typeof(Elastic.Clients.Elasticsearch.Serialization.TimeSpanMillisMarker))); writer.WriteEndObject(); } } \ No newline at end of file diff --git a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs index eaf3a027d25..596301e929d 100644 --- a/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs +++ b/src/Elastic.Clients.Elasticsearch/_Generated/Types/Xpack/SecurityRolesDlsBitSetCache.g.cs @@ -27,10 +27,15 @@ namespace Elastic.Clients.Elasticsearch.Xpack; public sealed partial class SecurityRolesDlsBitSetCache { [System.Diagnostics.CodeAnalysis.SetsRequiredMembers] - public SecurityRolesDlsBitSetCache(int count, long memoryInBytes) + public SecurityRolesDlsBitSetCache(int count, long evictions, long hits, System.TimeSpan hitsTimeInMillis, long memoryInBytes, long misses, System.TimeSpan missesTimeInMillis) { Count = count; + Evictions = evictions; + Hits = hits; + HitsTimeInMillis = hitsTimeInMillis; MemoryInBytes = memoryInBytes; + Misses = misses; + MissesTimeInMillis = missesTimeInMillis; } #if NET7_0_OR_GREATER public SecurityRolesDlsBitSetCache() @@ -49,15 +54,87 @@ internal SecurityRolesDlsBitSetCache(Elastic.Clients.Elasticsearch.Serialization _ = sentinel; } + /// + /// + /// Number of entries in the cache. + /// + /// public #if NET7_0_OR_GREATER required #endif int Count { get; set; } + + /// + /// + /// Total number of cache evictions. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + long Evictions { get; set; } + + /// + /// + /// Total number of cache hits. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + long Hits { get; set; } + + /// + /// + /// Total combined time spent in cache for hits in milliseconds. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + System.TimeSpan HitsTimeInMillis { get; set; } + + /// + /// + /// Human-readable amount of memory taken up by the cache. + /// + /// public Elastic.Clients.Elasticsearch.ByteSize? Memory { get; set; } + + /// + /// + /// Memory taken up by the cache in bytes. + /// + /// public #if NET7_0_OR_GREATER required #endif long MemoryInBytes { get; set; } + + /// + /// + /// Total number of cache misses. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + long Misses { get; set; } + + /// + /// + /// Total combined time spent in cache for misses in milliseconds. + /// + /// + public +#if NET7_0_OR_GREATER + required +#endif + System.TimeSpan MissesTimeInMillis { get; set; } } \ No newline at end of file